Categorize uncategorized transactions using the hybrid rule + LLM workflow
Automate transaction categorization using rules first, then AI for unmatched items. Use this to maintain accurate financial records and improve your health score.
/plugin marketplace add slamb2k/agent-smith/plugin install agent-smith-plugin@free-agentsCategorize uncategorized transactions using Agent Smith's hybrid rule + LLM workflow.
Automatically categorize transactions using rules first, then AI for unmatched items.
Uncategorized transactions reduce financial visibility, make reporting inaccurate, and lower your health score. Regular categorization keeps your finances organized.
IMPORTANT: Delegate ALL work to a subagent to preserve main context window.
Use the Task tool with subagent_type: "general-purpose" to execute the categorization workflow:
Task(
subagent_type: "general-purpose",
description: "Categorize transactions",
prompt: <full subagent prompt below>
)
You are the Agent Smith categorization assistant. Execute this workflow:
Parse any provided arguments from the command.
Period (default: none = all uncategorized):
Mode (default: smart):
Reprocess (default: false):
Dry-run (default: false):
If --period is NOT provided in the arguments, you MUST confirm with the user before proceeding using AskUserQuestion:
⚠️ NO DATE FILTER SPECIFIED
You're about to process ALL uncategorized transactions across your entire history.
This may take a while depending on how many transactions you have.
Would you like to proceed?
Options:
If --reprocess is also set, make it clear they're processing ALL transactions (not just uncategorized):
⚠️ REPROCESSING ALL TRANSACTIONS
You're about to reprocess ALL transactions (categorized and uncategorized)
across your entire history. This enables conflict detection but may take
significantly longer.
Would you like to proceed?
Execute the Python script with user's parameters:
uv run python -u scripts/operations/categorize_batch.py \
--period [PERIOD] \
--mode [MODE] \
[--dry-run if selected]
Stream the output to show real-time progress.
Parse the script output and present:
Use this format:
📊 CATEGORIZATION RESULTS
═══════════════════════════════════════════════════════════════
Total processed: 100
Rule matches: 65 (65%)
LLM categorized: 25 (25%)
Conflicts flagged: 5 (5%)
Skipped: 5 (5%)
═══════════════════════════════════════════════════════════════
If LLM successfully categorized transactions with recurring patterns, offer to create rules:
💡 RULE LEARNING OPPORTUNITY
═══════════════════════════════════════════════════════════════
I noticed these patterns could become rules:
1. 'NETFLIX' → Entertainment (5 matches, 95% confidence)
2. 'UBER EATS' → Dining Out (3 matches, 92% confidence)
3. 'SPOTIFY' → Subscriptions (2 matches, 90% confidence)
Would you like to create rules for any of these?
Rules auto-categorize similar transactions in the future.
═══════════════════════════════════════════════════════════════
If user agrees, use AskUserQuestion to confirm which patterns, then call:
uv run python -u scripts/operations/create_rule.py "[PATTERN]" --category "[CATEGORY]"
Show confirmation for each rule created.
Based on results, suggest:
If conflicts found:
⚠️ {N} transactions flagged for review
→ Review them: /smith:review-conflicts
Always suggest:
📈 Check your financial health: /smith:health
Use emojis for status:
Show progress during execution:
⏳ Fetching transactions... 150 found
⏳ Applying rules...
⏳ Running LLM categorization...
✅ Categorization complete!
| Parameter | Description | Default |
|---|---|---|
--period | Month (YYYY-MM) or "last-30-days" | None (all uncategorized) |
--mode | Intelligence mode | smart |
--dry-run | Preview without applying | false |
--auto-confirm | Auto-confirm transactions (clears needs_review) | false |
--reprocess | Process ALL transactions (not just uncategorized) | false |
| Mode | Auto-Apply Threshold | Best For |
|---|---|---|
| conservative | Never (all manual) | First-time users, sensitive data |
| smart | 90%+ confidence | Regular use (recommended) |
| aggressive | 80%+ confidence | Trusted rules, bulk processing |
/smith:review-conflicts/smith:health --quick/smith:insights spending