@fuzzle/opencode-accountant 0.8.0-next.1 → 0.8.1-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent/accountant.md +20 -9
- package/package.json +1 -1
package/agent/accountant.md
CHANGED
|
@@ -8,7 +8,7 @@ tools:
|
|
|
8
8
|
bash: true
|
|
9
9
|
edit: true
|
|
10
10
|
write: true
|
|
11
|
-
# MCP tools available: import-pipeline, fetch-currency-prices
|
|
11
|
+
# MCP tools available: import-pipeline, fetch-currency-prices, hledger-mcp (read-only queries)
|
|
12
12
|
permissions:
|
|
13
13
|
bash: allow
|
|
14
14
|
edit: allow
|
|
@@ -45,7 +45,7 @@ before performing any accounting task.**
|
|
|
45
45
|
When working with accounting tasks:
|
|
46
46
|
|
|
47
47
|
1. **Follow conventions precisely** - Use the exact patterns from `config/conventions/*.md`
|
|
48
|
-
1. **Always validate** - Run hledger
|
|
48
|
+
1. **Always validate** - Run hledger check after changes
|
|
49
49
|
1. **Balance checking** - Ensure all transactions balance with `@ price` notation for conversions
|
|
50
50
|
1. **File organization** - Keep transactions in appropriate year journals
|
|
51
51
|
1. **Duplicate checking** - Take extra care to avoid duplicate transactions
|
|
@@ -60,25 +60,32 @@ You have access to specialized MCP tools that MUST be used for their designated
|
|
|
60
60
|
| ----------------------- | ---------------------------------------------------- | --------------------------------------------------------- |
|
|
61
61
|
| `import-pipeline` | Full import workflow (classify → import → reconcile) | Manual file moves, `hledger import`, manual journal edits |
|
|
62
62
|
| `fetch-currency-prices` | Fetching exchange rates | `curl` to price APIs, manual price entries |
|
|
63
|
+
| hledger MCP tools | Read-only queries (balance, register, accounts, etc.) | `hledger bal`, `hledger reg`, `hledger print` via bash |
|
|
63
64
|
|
|
64
65
|
These tools handle validation, deduplication, error checking, and file organization automatically. Bypassing them risks data corruption, duplicate transactions, and inconsistent state.
|
|
65
66
|
|
|
66
67
|
## Bash Usage Policy
|
|
67
68
|
|
|
68
|
-
Bash is allowed ONLY for
|
|
69
|
+
Bash is allowed ONLY for:
|
|
69
70
|
|
|
70
|
-
- **Validation**: `hledger check
|
|
71
|
-
- **Formatting check**: `hledger-fmt` (WITHOUT `--fix` - shows diff only)
|
|
72
|
-
- **Queries**: `hledger print`, `hledger reg`, `hledger accounts`
|
|
71
|
+
- **Validation**: `hledger check`
|
|
73
72
|
- **File inspection**: `cat`, `head`, `tail`, `grep`
|
|
74
73
|
|
|
74
|
+
For all hledger queries, use the hledger MCP tools instead of bash:
|
|
75
|
+
|
|
76
|
+
- `balance` / `balancesheet` / `incomestatement` / `cashflow` for reports
|
|
77
|
+
- `register` / `aregister` for transaction history
|
|
78
|
+
- `print` for displaying transactions
|
|
79
|
+
- `accounts` for listing accounts
|
|
80
|
+
- `stats` / `activity` / `payees` / `descriptions` for analysis
|
|
81
|
+
|
|
75
82
|
Bash is **FORBIDDEN** for:
|
|
76
83
|
|
|
77
|
-
- **`hledger-fmt --fix`** - Mass-reformats files, destroys formatting
|
|
78
84
|
- **`hledger import`** - Use `import-pipeline` tool instead
|
|
79
85
|
- **Moving/copying CSV files** - Use `import-pipeline` tool instead
|
|
80
86
|
- **Writing to files** - Use `edit`/`write` tools with user approval only
|
|
81
87
|
- **Fetching prices** - Use `fetch-currency-prices` tool instead
|
|
88
|
+
- **`hledger -f <file>`** - Never specify journal files explicitly; `.hledger.journal` includes all journals automatically
|
|
82
89
|
|
|
83
90
|
## Manual Editing Policy
|
|
84
91
|
|
|
@@ -97,7 +104,6 @@ Bash is **FORBIDDEN** for:
|
|
|
97
104
|
|
|
98
105
|
### Absolutely Forbidden
|
|
99
106
|
|
|
100
|
-
❌ **NEVER run `hledger-fmt --fix`** - mass-reformats entire files
|
|
101
107
|
❌ **NEVER reformat existing transactions** - preserve exact spacing/separators
|
|
102
108
|
❌ **NEVER use `hledger print` to rewrite transactions** - changes formatting
|
|
103
109
|
|
|
@@ -105,7 +111,7 @@ Bash is **FORBIDDEN** for:
|
|
|
105
111
|
|
|
106
112
|
1. **Use edit tool surgically** - change only necessary lines
|
|
107
113
|
2. **Preserve formatting exactly** - match spacing, indentation, separators
|
|
108
|
-
3. **Validate after**: Run `hledger check
|
|
114
|
+
3. **Validate after**: Run `hledger check` to verify no unintended changes
|
|
109
115
|
|
|
110
116
|
## Statement Import Workflow
|
|
111
117
|
|
|
@@ -128,6 +134,11 @@ The `import-pipeline` tool operates directly on the working directory:
|
|
|
128
134
|
- Update rules file with `if` directives to match the transaction
|
|
129
135
|
- Re-run `import-pipeline` (use `--skipClassify true` if files are already classified)
|
|
130
136
|
|
|
137
|
+
⚠️ **On import failure, your role is investigator only:**
|
|
138
|
+
- Investigate the error using read-only tools (hledger check, print, reg, file inspection)
|
|
139
|
+
- Present findings and root cause analysis to the user
|
|
140
|
+
- **NEVER manually edit journal files to fix import issues** — suggest the fix, wait for approval
|
|
141
|
+
|
|
131
142
|
**Logs:**
|
|
132
143
|
|
|
133
144
|
- Every import run generates a detailed log: `.memory/import-<timestamp>.md`
|
package/package.json
CHANGED