@fuzzle/opencode-accountant 0.8.1-next.1 → 0.8.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 +9 -20
- 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
|
|
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 check after changes
|
|
48
|
+
1. **Always validate** - Run hledger-fmt and 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,32 +60,25 @@ 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 |
|
|
64
63
|
|
|
65
64
|
These tools handle validation, deduplication, error checking, and file organization automatically. Bypassing them risks data corruption, duplicate transactions, and inconsistent state.
|
|
66
65
|
|
|
67
66
|
## Bash Usage Policy
|
|
68
67
|
|
|
69
|
-
Bash is allowed ONLY for
|
|
68
|
+
Bash is allowed ONLY for **read-only operations**:
|
|
70
69
|
|
|
71
|
-
- **Validation**: `hledger check`
|
|
70
|
+
- **Validation**: `hledger check`, `hledger bal`
|
|
71
|
+
- **Formatting check**: `hledger-fmt` (WITHOUT `--fix` - shows diff only)
|
|
72
|
+
- **Queries**: `hledger print`, `hledger reg`, `hledger accounts`
|
|
72
73
|
- **File inspection**: `cat`, `head`, `tail`, `grep`
|
|
73
74
|
|
|
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
|
-
|
|
82
75
|
Bash is **FORBIDDEN** for:
|
|
83
76
|
|
|
77
|
+
- **`hledger-fmt --fix`** - Mass-reformats files, destroys formatting
|
|
84
78
|
- **`hledger import`** - Use `import-pipeline` tool instead
|
|
85
79
|
- **Moving/copying CSV files** - Use `import-pipeline` tool instead
|
|
86
80
|
- **Writing to files** - Use `edit`/`write` tools with user approval only
|
|
87
81
|
- **Fetching prices** - Use `fetch-currency-prices` tool instead
|
|
88
|
-
- **`hledger -f <file>`** - Never specify journal files explicitly; `.hledger.journal` includes all journals automatically
|
|
89
82
|
|
|
90
83
|
## Manual Editing Policy
|
|
91
84
|
|
|
@@ -104,6 +97,7 @@ Bash is **FORBIDDEN** for:
|
|
|
104
97
|
|
|
105
98
|
### Absolutely Forbidden
|
|
106
99
|
|
|
100
|
+
❌ **NEVER run `hledger-fmt --fix`** - mass-reformats entire files
|
|
107
101
|
❌ **NEVER reformat existing transactions** - preserve exact spacing/separators
|
|
108
102
|
❌ **NEVER use `hledger print` to rewrite transactions** - changes formatting
|
|
109
103
|
|
|
@@ -111,7 +105,7 @@ Bash is **FORBIDDEN** for:
|
|
|
111
105
|
|
|
112
106
|
1. **Use edit tool surgically** - change only necessary lines
|
|
113
107
|
2. **Preserve formatting exactly** - match spacing, indentation, separators
|
|
114
|
-
3. **Validate after**: Run `hledger check` to verify no unintended changes
|
|
108
|
+
3. **Validate after**: Run `hledger check`, then `hledger-fmt` (no --fix) to verify no unintended changes
|
|
115
109
|
|
|
116
110
|
## Statement Import Workflow
|
|
117
111
|
|
|
@@ -134,11 +128,6 @@ The `import-pipeline` tool operates directly on the working directory:
|
|
|
134
128
|
- Update rules file with `if` directives to match the transaction
|
|
135
129
|
- Re-run `import-pipeline` (use `--skipClassify true` if files are already classified)
|
|
136
130
|
|
|
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
|
-
|
|
142
131
|
**Logs:**
|
|
143
132
|
|
|
144
133
|
- Every import run generates a detailed log: `.memory/import-<timestamp>.md`
|