asimons81/x-analytics-import
Use when X Analytics CSV exports must be inspected, validated, normalized, imported, or compared through a repeatable private-by-default workflow.
npx skills add https://github.com/asimons81/hermes-field-kit --skill x-analytics-import
Use this skill to turn X Analytics CSV exports into validated, normalized, private local snapshots. The deterministic engine is scripts/x_analytics_import.py; it uses only the Python standard library and has no network, browser, Git, or publishing side effects.
The operating rule is simple:
first run: inspect -> validate-only -> dry-run -> full-import
later runs: inspect -> validate-only -> dry-run -> incremental-import -> compare
Read references/operations.md only when command detail or recovery guidance is needed.
Use this skill when:
Do not use this skill when:
inspect, validate-only, and dry-run before every write mode.~/.hermes/data/x-analytics-import.--force unless the user explicitly requests an identical re-import.| Mode | Purpose | Writes |
|---|---|---:|
| inspect | Detect export type, schema, hash, rows, and coverage | No |
| validate-only | Run structural and semantic checks | No |
| dry-run | Execute the complete pipeline without artifacts | No |
| full-import | Create the first baseline or deliberate rebuild | Yes |
| incremental-import | Add a new source set only when hashes differ | Yes |
| compare-snapshots | Compare matched dates and post IDs | No |
| rebuild-classification | Reapply lane rules without reparsing CSVs | Yes |
Expected file families:
account_overview_analytics*.csv
account_analytics_content_<start>_<end>.csv
video_overview_analytics*.csv
Video is optional. Confirm the files belong to the intended export run. Chrome suffixes such as (1) are not chronology.
Completion criterion: every selected file has an exact path, plausible coverage, and no stale duplicate has been substituted.
already_imported.Completion criterion: the agent can name the prior import ID or state that no baseline exists.
Run, in order:
inspect
validate-only
dry-run
full-import
Use the same exact file paths for all four stages. Stop before full-import when validation fails, reconciliation fails, or file pairing is doubtful.
After full-import, verify:
incremental-import returns already_imported.Completion criterion: one verified baseline exists and duplicate protection is proven.
Run, in order:
inspect
validate-only
dry-run
incremental-import
compare-snapshots
Use incremental-import for ordinary future runs. If it returns already_imported, do not force a duplicate and do not create a comparison.
Compare the new snapshot against the previous completed snapshot. Use the original baseline only for a separate long-range view.
Comparison rules:
Completion criterion: a new import is either safely rejected as duplicate or written once and compared on matched coverage.
Use medians, p25, p75, p90, sample sizes, and IQR outliers. Separate originals, replies, quotes, reposts, and unknown types. Treat CSV-only post type as heuristic. Preserve Uncertain lane results rather than forcing a winner.
Exclude detected partial dates from default statistics. State confidence and source coverage. Do not claim causation from correlation.
Completion criterion: every recommendation includes evidence, sample size, confidence, and outlier context.
Return operational status first:
Exact metrics, post content, source hashes, revenue, and strategy findings remain local unless the user explicitly requests them.
Completion criterion: the response is useful without exposing sensitive values by default.
python "<skill-dir>/scripts/x_analytics_import.py" <mode> --overview "<overview.csv>" --content "<content.csv>" --video "<video.csv>" --config "<local-config.json>" --output-dir "<private-output-dir>" --json
Omit --video or --config when unused. Copy references/config.example.json to a private local path before customizing lane rules.
Snapshot comparison:
python "<skill-dir>/scripts/x_analytics_import.py" compare-snapshots --snapshot-a "<older.json>" --snapshot-b "<newer.json>" --json
Stop before a write mode when:
Warnings such as an X filename window starting before the first actual content row may be acceptable when actual row coverage and end dates align. Explain the warning rather than silently discarding it.
full-import every time. Use it once for the baseline; use incremental-import afterward.inspect, validate-only, and dry-run completed firstfull-import; later runs use incremental-importalready_importedTake asimons81/x-analytics-import from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.