Skip to main content

Finance CSV Edit Command

Purpose

Make modifications or generate reports on CSV financial files with automatic validation after every file operation.

Arguments

  • $1 - Path to the CSV file
  • $2 - Modification request or report type

Usage

# Add a transaction
/finance-csv-edit checking.csv "add a row for a $100 deposit on 2026-01-15"

# Report on structure
/finance-csv-edit transactions.csv "report on data structure"

# Fix a value
/finance-csv-edit savings.csv "correct the balance on row 12 to $5,432.10"

# Delete a row
/finance-csv-edit expenses.csv "remove duplicate transaction on 2026-01-03"

Self-Validation

This command uses PostToolUse hooks to validate after every Read, Edit, or Write:

  • CSV can be parsed
  • File is not empty
  • For normalized files: required columns present

Workflow

  1. Read the CSV file: $1
  2. Analyze current structure
  3. Perform the modification or analysis: $2
  4. Validate (automatic via hook)
  5. Report results

Self-Correction Example

User: /finance-csv-edit savings.csv "add a row for a $100 deposit"

Agent: [Reads file]
Hook: [Validates CSV structure] ✓

Agent: [Edits file to add row]
Hook: [Validates CSV structure]
✗ Balance mismatch! Expected $1100, got $1000

Agent: [Understands error, fixes balance calculation]
Hook: [Validates CSV structure] ✓

Agent: "Added deposit row with correct balance of $1100."