Finance Pipeline Refresh
Run the full finance pipeline, extract current numbers from master CSVs, diff them against the Obsidian personal finance note, and update any stale tables in-place.
Phase 0: Pre-flight
- Read
~/.claude/skills/personal-finance-update/config.json. - Validate every value path exists on disk.
- If any path is missing: STOP. Report
MISSING: <key>: <path>to the user and do not proceed. Do not attempt to infer a new location or continue with partial data.
Phase 1: Pipeline
- Run the finance pipeline:
bash the `pipeline_script` path from config.json --quick - Check the exit code:
- Exit 0: Continue silently to Phase 2.
- Exit 1: Warn the user about validation warnings, then continue to Phase 2.
- Exit 2: STOP. Report validation failures to the user and do not proceed.
Phase 2: Extract
- Run the extraction script:
python3 ~/.claude/skills/personal-finance-update/scripts/finance_extract.py - Check the exit code:
- Exit 0: Capture the JSON output from stdout. Save it to
/tmp/finance_extract_output.json. - Non-zero: STOP. Report the stderr output to the user and do not proceed.
- Exit 0: Capture the JSON output from stdout. Save it to
Phase 3: Diff
- Run the diff script against the Obsidian note:
python3 ~/.claude/skills/personal-finance-update/scripts/finance_diff.py /tmp/finance_extract_output.json the `obsidian_note` path from config.json - Capture the JSON output. Also check stderr — if any
Warning: section '...' not foundmessages appear, note the missing sections and report them in Phase 7. - If
cells_changedis 0: report "All tables up to date -- 0 changes" and skip directly to Phase 6.
Phase 4: Update
For each table in tables_changed:
- Use the Edit tool to replace the section in the Obsidian note.
- The
old_stringis everything from theheadingline through the end of thepostscript. - The
new_stringis the regenerated heading + preamble + table + postscript fromnew_markdown_sections. - Only touch tables that actually changed. Leave unchanged tables alone.
Phase 5: Verify
- Run
finance_extract.pyagain:python3 ~/.claude/skills/personal-finance-update/scripts/finance_extract.py - Save to a new temp file and run the diff again:
python3 ~/.claude/skills/personal-finance-update/scripts/finance_diff.py /tmp/finance_extract_verify.json the `obsidian_note` path from config.json - If
cells_changedis 0: good, continue to Phase 6. - If non-zero: warn the user about the discrepancy and flag for manual review, but continue.
Phase 6: Audit
From the extract JSON's validation array, flag:
- Uncategorized transactions from validation notes.
- Large transactions over $5,000 that may need review.
- Category distribution warnings (unusual spikes or missing categories).
- Partial-year status for the current year (note how many months of data exist).
Phase 7: Report
Present a summary to the user:
- Tables updated: count of tables changed.
- Cells changed: total number of cell-level changes.
- Specific changes: list each change from the diff output
changesarray (table name, field, old value, new value). - Audit findings: any flags from Phase 6.
Troubleshooting
- Pipeline script not found: Verify the
pipeline_scriptpath from config.json exists and is executable. - No master CSVs found: Check the
master_dirpath from config.json has*_master.csvfiles. - Obsidian note not found: iCloud sync may be delayed -- check the path exists.
- Table not found in note: The diff script couldn't find the expected
###heading -- check the Obsidian note structure hasn't changed.