[PR #8089] [AI] Consolidate agent tooling and simplify developer guidance #114368

Open
opened 2026-06-05 22:13:44 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/8089
Author: @MatissJanis
Created: 6/4/2026
Status: 🔄 Open

Base: masterHead: claude/agent-hooks-nano-staged-XTx5W


📝 Commits (2)

  • 002e19f [AI] Replace mechanical agent rules with shared agent hooks + nano-staged
  • 600f5c5 [AI] Align PR-title wording in AGENTS.md with canonical rules

📊 Changes

23 files changed (+623 additions, -373 deletions)

View changed files

.claude/settings.json (+50 -0)
📝 .claude/skills/committing-actual-changes/SKILL.md (+4 -4)
.codex/config.toml (+51 -0)
.cursor/hooks.json (+7 -0)
.cursor/hooks/after-file-edit.sh (+38 -0)
.cursor/hooks/guard-shell.sh (+46 -0)
📝 .cursor/rules/pr-and-commit.mdc (+8 -63)
📝 .github/agents/pr-and-commit-rules.md (+12 -55)
📝 .husky/pre-commit (+1 -1)
.nano-staged.json (+8 -0)
📝 .oxlintrc.json (+11 -0)
📝 AGENTS.md (+26 -76)
📝 package.json (+1 -13)
📝 packages/eslint-plugin-actual/lib/index.js (+1 -0)
packages/eslint-plugin-actual/lib/rules/no-enum.js (+31 -0)
scripts/agent-hooks/check-on-stop.sh (+90 -0)
scripts/agent-hooks/common.sh (+15 -0)
scripts/agent-hooks/format-edited-file.sh (+32 -0)
scripts/agent-hooks/git-guard.sh (+101 -0)
scripts/agent-hooks/no-strict-ignore-new-file.sh (+28 -0)

...and 3 more files

📄 Description

Description

Ok, there's quite a few changes here, but the core idea behind all this is: lets add hooks (verification layer) that agents can use to check code validity. And then lets remove the same instructions from AGENTS.md.

Why? Doing reviews I noticed that code with these anti-patterns still slips through. Blocking it in eslint would be too harsh as it would block humans too (sometimes the rules deserve to be broken). But agents should obey the rules 100% of the time (within reason).

Hence.. this PR.

Also: swapping from lint-staged to nano-staged (smaller in size & faster)

N/A

Testing

Manual smoke tests ran locally with:

  • claude code
  • cursor
  • codex (don't have it :()

Checklist

  • No obvious regressions in affected areas
  • Self-review performed — changes consolidate tooling and documentation without altering core functionality

https://claude.ai/code/session_01WY4USd1DAk6YjdA7KdorRW


Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 37 14.05 MB → 14.05 MB (-567 B) -0.00%
loot-core 1 5.28 MB → 5.28 MB (+1.11 kB) +0.02%
api 2 3.86 MB → 3.86 MB (+1.09 kB) +0.03%
cli 1 7.97 MB → 7.97 MB (-52 B) -0.00%
crdt 1 11.12 kB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
37 14.05 MB → 14.05 MB (-567 B) -0.00%
Changeset
File Δ Size
src/accounts/syncStatus.ts 🆕 +230 B 0 B → 230 B
node_modules/eventemitter3/index.mjs 📈 +22 B (+10.78%) 204 B → 226 B
node_modules/eventemitter3/index.js 📈 +22 B (+0.27%) 8.03 kB → 8.05 kB
src/components/accounts/Account.tsx 📉 -156 B (-0.35%) 44.09 kB → 43.94 kB
src/components/accounts/Header.tsx 📉 -109 B (-0.38%) 28 kB ��� 27.89 kB
src/components/mobile/accounts/AccountsPage.tsx 📉 -202 B (-0.97%) 20.42 kB → 20.23 kB
src/components/mobile/accounts/AccountPage.tsx 📉 -107 B (-1.15%) 9.07 kB → 8.96 kB
src/components/sidebar/Accounts.tsx 📉 -267 B (-2.97%) 8.77 kB → 8.51 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/toString.js 705.14 kB → 705.18 kB (+44 B) +0.01%

Smaller

Asset File Size % Changed
static/js/narrow.js 364.5 kB → 364.2 kB (-309 B) -0.08%
static/js/wide.js 299.14 kB → 298.88 kB (-265 B) -0.09%
static/js/ManageRules.js 46.64 kB → 46.6 kB (-35 B) -0.07%
static/js/index.js 1.56 MB → 1.56 MB (-2 B) -0.00%

Unchanged

Asset File Size % Changed
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 962.55 kB 0%
static/js/PayeeRuleCountLabel.js 7.33 kB 0%
static/js/ReportRouter.js 1.26 MB 0%
static/js/ScheduleEditForm.js 146.44 kB 0%
static/js/SchedulesTable.js 202.7 kB 0%
static/js/TransactionEdit.js 90.63 kB 0%
static/js/TransactionList.js 85.81 kB 0%
static/js/Value.js 5.08 MB 0%
static/js/_baseIsEqual.js 98.38 kB 0%
static/js/ca.js 186.63 kB 0%
static/js/client.js 451.37 kB 0%
static/js/da.js 101.02 kB 0%
static/js/de.js 170.87 kB 0%
static/js/en-GB.js 9.25 kB 0%
static/js/en.js 199.45 kB 0%
static/js/es.js 178.57 kB 0%
static/js/extends.js 508.06 kB 0%
static/js/fr.js 178.44 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 164.87 kB 0%
static/js/nb-NO.js 147.94 kB 0%
static/js/nl.js 107 kB 0%
static/js/pt-BR.js 188.32 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 174.31 kB 0%
static/js/theme.js 31.88 kB 0%
static/js/uk.js 209.01 kB 0%
static/js/useFormatList.js 2.52 kB 0%
static/js/useTransactionBatchActions.js 9.71 kB 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 117.01 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 5.28 MB → 5.28 MB (+1.11 kB) +0.02%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📈 +1.08 kB (+4.01%) 26.88 kB → 27.96 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts 📈 +34 B (+0.34%) 9.81 kB → 9.85 kB
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.8g6UP_wl.js 0 B → 5.28 MB (+5.28 MB) -

Removed

Asset File Size % Changed
kcab.worker.CCn_Decu.js 5.28 MB → 0 B (-5.28 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
2 3.86 MB → 3.86 MB (+1.09 kB) +0.03%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts 📈 +1.05 kB (+4.02%) 26.2 kB → 27.26 kB
home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts 📈 +33 B (+0.34%) 9.52 kB → 9.56 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.86 MB → 3.86 MB (+1.09 kB) +0.03%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
models.js 0 B 0%

cli

Total

Files count Total bundle size % Changed
1 7.97 MB → 7.97 MB (-52 B) -0.00%
Changeset
File Δ Size
node_modules/emoji-regex/index.js 📉 -26 B (-0.25%) 10.17 kB → 10.15 kB
node_modules/is-fullwidth-code-point/index.js 📉 -26 B (-2.36%) 1.08 kB → 1.05 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller

Asset File Size % Changed
cli.js 7.97 MB → 7.97 MB (-52 B) -0.00%

Unchanged
No assets were unchanged


crdt

Total

Files count Total bundle size % Changed
1 11.12 kB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
index.js 11.12 kB 0%

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/8089 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 6/4/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `claude/agent-hooks-nano-staged-XTx5W` --- ### 📝 Commits (2) - [`002e19f`](https://github.com/actualbudget/actual/commit/002e19f3d4dcbccb58a83877d151afcf5f8784e3) [AI] Replace mechanical agent rules with shared agent hooks + nano-staged - [`600f5c5`](https://github.com/actualbudget/actual/commit/600f5c5d707531e21f5e29ee5f4b0ac029c1164a) [AI] Align PR-title wording in AGENTS.md with canonical rules ### 📊 Changes **23 files changed** (+623 additions, -373 deletions) <details> <summary>View changed files</summary> ➕ `.claude/settings.json` (+50 -0) 📝 `.claude/skills/committing-actual-changes/SKILL.md` (+4 -4) ➕ `.codex/config.toml` (+51 -0) ➕ `.cursor/hooks.json` (+7 -0) ➕ `.cursor/hooks/after-file-edit.sh` (+38 -0) ➕ `.cursor/hooks/guard-shell.sh` (+46 -0) 📝 `.cursor/rules/pr-and-commit.mdc` (+8 -63) 📝 `.github/agents/pr-and-commit-rules.md` (+12 -55) 📝 `.husky/pre-commit` (+1 -1) ➕ `.nano-staged.json` (+8 -0) 📝 `.oxlintrc.json` (+11 -0) 📝 `AGENTS.md` (+26 -76) 📝 `package.json` (+1 -13) 📝 `packages/eslint-plugin-actual/lib/index.js` (+1 -0) ➕ `packages/eslint-plugin-actual/lib/rules/no-enum.js` (+31 -0) ➕ `scripts/agent-hooks/check-on-stop.sh` (+90 -0) ➕ `scripts/agent-hooks/common.sh` (+15 -0) ➕ `scripts/agent-hooks/format-edited-file.sh` (+32 -0) ➕ `scripts/agent-hooks/git-guard.sh` (+101 -0) ➕ `scripts/agent-hooks/no-strict-ignore-new-file.sh` (+28 -0) _...and 3 more files_ </details> ### 📄 Description ## Description Ok, there's quite a few changes here, but the core idea behind all this is: lets add hooks (verification layer) that agents can use to check code validity. And then lets remove the same instructions from AGENTS.md. Why? Doing reviews I noticed that code with these anti-patterns still slips through. Blocking it in eslint would be too harsh as it would block humans too (sometimes the rules deserve to be broken). But agents should obey the rules 100% of the time (within reason). Hence.. this PR. Also: swapping from `lint-staged` to `nano-staged` (smaller in size & faster) ## Related issue(s) N/A ## Testing Manual smoke tests ran locally with: - [x] claude code - [x] cursor - [ ] codex (don't have it :() ## Checklist - [x] No obvious regressions in affected areas - [x] Self-review performed — changes consolidate tooling and documentation without altering core functionality https://claude.ai/code/session_01WY4USd1DAk6YjdA7KdorRW <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 37 | 14.05 MB → 14.05 MB (-567 B) | -0.00% loot-core | 1 | 5.28 MB → 5.28 MB (+1.11 kB) | +0.02% api | 2 | 3.86 MB → 3.86 MB (+1.09 kB) | +0.03% cli | 1 | 7.97 MB → 7.97 MB (-52 B) | -0.00% crdt | 1 | 11.12 kB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 37 | 14.05 MB → 14.05 MB (-567 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/accounts/syncStatus.ts` | 🆕 +230 B | 0 B → 230 B `node_modules/eventemitter3/index.mjs` | 📈 +22 B (+10.78%) | 204 B → 226 B `node_modules/eventemitter3/index.js` | 📈 +22 B (+0.27%) | 8.03 kB → 8.05 kB `src/components/accounts/Account.tsx` | 📉 -156 B (-0.35%) | 44.09 kB → 43.94 kB `src/components/accounts/Header.tsx` | 📉 -109 B (-0.38%) | 28 kB ��� 27.89 kB `src/components/mobile/accounts/AccountsPage.tsx` | 📉 -202 B (-0.97%) | 20.42 kB → 20.23 kB `src/components/mobile/accounts/AccountPage.tsx` | 📉 -107 B (-1.15%) | 9.07 kB → 8.96 kB `src/components/sidebar/Accounts.tsx` | 📉 -267 B (-2.97%) | 8.77 kB → 8.51 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/toString.js | 705.14 kB → 705.18 kB (+44 B) | +0.01% **Smaller** Asset | File Size | % Changed ----- | --------- | --------- static/js/narrow.js | 364.5 kB → 364.2 kB (-309 B) | -0.08% static/js/wide.js | 299.14 kB → 298.88 kB (-265 B) | -0.09% static/js/ManageRules.js | 46.64 kB → 46.6 kB (-35 B) | -0.07% static/js/index.js | 1.56 MB → 1.56 MB (-2 B) | -0.00% **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 962.55 kB | 0% static/js/PayeeRuleCountLabel.js | 7.33 kB | 0% static/js/ReportRouter.js | 1.26 MB | 0% static/js/ScheduleEditForm.js | 146.44 kB | 0% static/js/SchedulesTable.js | 202.7 kB | 0% static/js/TransactionEdit.js | 90.63 kB | 0% static/js/TransactionList.js | 85.81 kB | 0% static/js/Value.js | 5.08 MB | 0% static/js/_baseIsEqual.js | 98.38 kB | 0% static/js/ca.js | 186.63 kB | 0% static/js/client.js | 451.37 kB | 0% static/js/da.js | 101.02 kB | 0% static/js/de.js | 170.87 kB | 0% static/js/en-GB.js | 9.25 kB | 0% static/js/en.js | 199.45 kB | 0% static/js/es.js | 178.57 kB | 0% static/js/extends.js | 508.06 kB | 0% static/js/fr.js | 178.44 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 164.87 kB | 0% static/js/nb-NO.js | 147.94 kB | 0% static/js/nl.js | 107 kB | 0% static/js/pt-BR.js | 188.32 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 174.31 kB | 0% static/js/theme.js | 31.88 kB | 0% static/js/uk.js | 209.01 kB | 0% static/js/useFormatList.js | 2.52 kB | 0% static/js/useTransactionBatchActions.js | 9.71 kB | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 117.01 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 5.28 MB → 5.28 MB (+1.11 kB) | +0.02% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📈 +1.08 kB (+4.01%) | 26.88 kB → 27.96 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts` | 📈 +34 B (+0.34%) | 9.81 kB → 9.85 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.8g6UP_wl.js | 0 B → 5.28 MB (+5.28 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.CCn_Decu.js | 5.28 MB → 0 B (-5.28 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 2 | 3.86 MB → 3.86 MB (+1.09 kB) | +0.03% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/server/accounts/app.ts` | 📈 +1.05 kB (+4.02%) | 26.2 kB → 27.26 kB `home/runner/work/actual/actual/packages/loot-core/src/server/aql/schema/index.ts` | 📈 +33 B (+0.34%) | 9.52 kB → 9.56 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- index.js | 3.86 MB → 3.86 MB (+1.09 kB) | +0.03% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- models.js | 0 B | 0% </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.97 MB → 7.97 MB (-52 B) | -0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `node_modules/emoji-regex/index.js` | 📉 -26 B (-0.25%) | 10.17 kB → 10.15 kB `node_modules/is-fullwidth-code-point/index.js` | 📉 -26 B (-2.36%) | 1.08 kB → 1.05 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** Asset | File Size | % Changed ----- | --------- | --------- cli.js | 7.97 MB → 7.97 MB (-52 B) | -0.00% **Unchanged** No assets were unchanged </div> </details> --- #### crdt **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 11.12 kB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- index.js | 11.12 kB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-05 22:13:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#114368