acstack 0.0.0-stage → 0.47.0

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.
Files changed (143) hide show
  1. package/.claude-plugin/plugin.json +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +389 -2
  4. package/THIRD_PARTY_NOTICES +14 -0
  5. package/TROUBLESHOOTING.md +225 -0
  6. package/agents/codex/frontend-verifier.toml +352 -0
  7. package/agents/codex/task-checker.toml +345 -0
  8. package/agents/codex/task-executor.toml +157 -0
  9. package/agents/codex/test-writer.toml +149 -0
  10. package/agents/frontend-verifier.md +351 -0
  11. package/agents/task-checker.md +344 -0
  12. package/agents/task-executor.md +156 -0
  13. package/agents/test-writer.md +148 -0
  14. package/assets/playwriter-bridge/build-launcher.ps1 +32 -0
  15. package/assets/playwriter-bridge/doctor.ps1 +450 -0
  16. package/assets/playwriter-bridge/launcher-src.cs +131 -0
  17. package/assets/playwriter-bridge/opener.js +330 -0
  18. package/assets/playwriter-bridge/opener.ps1 +63 -0
  19. package/assets/playwriter-bridge/register-tasks.ps1 +328 -0
  20. package/assets/playwriter-bridge/relay.ps1 +50 -0
  21. package/assets/playwriter-bridge/stop.ps1 +125 -0
  22. package/assets/playwriter-bridge/sync.ps1 +271 -0
  23. package/assets/playwriter-bridge/tunnel.ps1 +325 -0
  24. package/assets/playwriter-bridge/vm-free-port.sh +166 -0
  25. package/assets/terminal-workspace/client-keybindings.md +87 -0
  26. package/assets/terminal-workspace/config.example.yaml +329 -0
  27. package/assets/terminal-workspace/setup.sh +4317 -0
  28. package/cli/README.md +47 -0
  29. package/cli/bin/acstack.js +3 -0
  30. package/cli/dist/index.js +25984 -0
  31. package/cli/dist/index.js.map +7 -0
  32. package/cli/package.json +59 -0
  33. package/docs/adr/0001-ste-writing-standard.md +16 -0
  34. package/docs/adr/0002-version-gate-not-auto-bump.md +35 -0
  35. package/docs/adr/0003-handoff-ack-command.md +19 -0
  36. package/docs/adr/0004-dev-setup-per-host.md +13 -0
  37. package/docs/adr/0005-two-orchestrators-per-host.md +25 -0
  38. package/docs/adr/0006-document-opener-service.md +89 -0
  39. package/docs/adr/0007-lead-check-reads-the-transcript.md +87 -0
  40. package/docs/adr/0008-cli-audits-skill-interviews.md +37 -0
  41. package/docs/adr/0009-verify-the-write-not-the-writer.md +51 -0
  42. package/docs/adr/0010-promote-dev-to-main-by-fast-forward.md +115 -0
  43. package/docs/adr/0011-node-header-is-the-edge-encoding.md +20 -0
  44. package/docs/adr/0012-node-kind-is-a-closed-set-of-five.md +31 -0
  45. package/docs/adr/0013-the-diagram-renderer-is-pure.md +23 -0
  46. package/docs/adr/0014-reading-a-node-hides-its-generated-diagram.md +29 -0
  47. package/docs/adr/0015-a-node-id-links-to-its-issue-through-an-anchor.md +37 -0
  48. package/docs/adr/0016-the-map-root-carries-no-status-of-its-own.md +21 -0
  49. package/docs/adr/0017-call-impeccable-copy-only-its-questions.md +13 -0
  50. package/docs/adr/index.md +17 -0
  51. package/docs/config-reference.md +572 -0
  52. package/docs/dev-setups.md +164 -0
  53. package/docs/migrate-0.8.md +28 -0
  54. package/docs/playwriter-bridge-windows.md +15 -0
  55. package/docs/terminal-workspace-keys.md +137 -0
  56. package/docs/terminal-workspace.md +1774 -0
  57. package/docs/workflows.md +309 -0
  58. package/hooks/ac-writing-style-reminder.sh +86 -0
  59. package/hooks/context-pressure.sh +583 -0
  60. package/hooks/hooks.json +50 -0
  61. package/hooks/session-start-handoff.sh +165 -0
  62. package/hooks/session-start.sh +214 -0
  63. package/orchestrator/AGENTS.md +532 -0
  64. package/output-styles/ac-writing-style.md +286 -0
  65. package/package.json +50 -4
  66. package/pi/agents/frontend-verifier.md +357 -0
  67. package/pi/agents/task-checker.md +348 -0
  68. package/pi/agents/task-executor.md +160 -0
  69. package/pi/agents/test-writer.md +154 -0
  70. package/pi/extension.ts +723 -0
  71. package/profiles/fullstack-python.yaml +29 -0
  72. package/profiles/node-typescript.yaml +23 -0
  73. package/profiles/python.yaml +24 -0
  74. package/skills/archive/SKILL.md +160 -0
  75. package/skills/bootstrap/SKILL.md +109 -0
  76. package/skills/bridge/HANDOFF.md +93 -0
  77. package/skills/bridge/SKILL-VM.md +292 -0
  78. package/skills/bridge/SKILL-WINDOWS.md +526 -0
  79. package/skills/bridge/SKILL.md +121 -0
  80. package/skills/browser-verify/SKILL.md +229 -0
  81. package/skills/code-review/SKILL.md +44 -0
  82. package/skills/commit/SKILL.md +106 -0
  83. package/skills/compact-and-continue/SKILL.md +241 -0
  84. package/skills/explore/SKILL.md +149 -0
  85. package/skills/grilling/SKILL.md +134 -0
  86. package/skills/handoff/SKILL.md +250 -0
  87. package/skills/handoff/launch-herdr.md +197 -0
  88. package/skills/handoff/launch-without-herdr.md +30 -0
  89. package/skills/handoff/lead-check.md +59 -0
  90. package/skills/handoff/outcomes.md +162 -0
  91. package/skills/handoff/running-agent.md +50 -0
  92. package/skills/handoff/watch.md +115 -0
  93. package/skills/host/SKILL.md +247 -0
  94. package/skills/host/detect-host.sh +297 -0
  95. package/skills/host/herdr.md +79 -0
  96. package/skills/host/install-herdr-block.sh +467 -0
  97. package/skills/host/install-orca.sh +512 -0
  98. package/skills/host/notes.md +97 -0
  99. package/skills/host/orca.md +160 -0
  100. package/skills/host/questions.md +163 -0
  101. package/skills/host/report.md +42 -0
  102. package/skills/implement/SKILL.md +230 -0
  103. package/skills/implement/decision-log.md +62 -0
  104. package/skills/implement/design-pass.md +32 -0
  105. package/skills/implement/relaxed-tdd.md +28 -0
  106. package/skills/map/SKILL.md +250 -0
  107. package/skills/map/frontend.md +227 -0
  108. package/skills/map/trackers/files.md +74 -0
  109. package/skills/map/trackers/github.md +180 -0
  110. package/skills/map/visuals.md +387 -0
  111. package/skills/new-worktree/SKILL.md +155 -0
  112. package/skills/new-worktree/detect-orchestrator.sh +328 -0
  113. package/skills/new-worktree/detect-orchestrator.test.sh +894 -0
  114. package/skills/new-worktree/herdr.md +84 -0
  115. package/skills/new-worktree/orca.md +101 -0
  116. package/skills/pre-commit-review/SKILL.md +242 -0
  117. package/skills/pre-commit-review/auto-fix.md +19 -0
  118. package/skills/pre-commit-review/interactive.md +35 -0
  119. package/skills/quick-fix/SKILL.md +125 -0
  120. package/skills/record-context/SKILL.md +106 -0
  121. package/skills/setup/SKILL.md +250 -0
  122. package/skills/setup/browser.md +123 -0
  123. package/skills/setup/design-review.md +97 -0
  124. package/skills/setup/first-run.md +114 -0
  125. package/skills/setup/report.md +68 -0
  126. package/skills/setup/row-fixes.md +196 -0
  127. package/skills/setup/terminal-workspace.md +153 -0
  128. package/skills/sync/SKILL.md +171 -0
  129. package/skills/teardown-worktree/SKILL.md +245 -0
  130. package/skills/teardown-worktree/detector.md +39 -0
  131. package/skills/teardown-worktree/herdr.md +113 -0
  132. package/skills/teardown-worktree/orca.md +61 -0
  133. package/skills/terminal-workspace/SKILL.md +249 -0
  134. package/skills/terminal-workspace/components.md +36 -0
  135. package/skills/terminal-workspace/config-choices.md +69 -0
  136. package/skills/terminal-workspace/emulator-keys.md +48 -0
  137. package/skills/terminal-workspace/headless-clipboard.md +175 -0
  138. package/skills/terminal-workspace/turn-off-and-update.md +104 -0
  139. package/skills/test-conventions/SKILL.md +59 -0
  140. package/skills/visual-docs/SKILL.md +246 -0
  141. package/skills/writing/SKILL.md +231 -0
  142. package/skills/writing/examples.md +153 -0
  143. package/skills/writing/vocabulary.md +96 -0
@@ -0,0 +1,84 @@
1
+ # New worktree: herdr
2
+
3
+ The `Orchestrator: herdr` branch of `SKILL.md`, for when `active` is `herdr`.
4
+
5
+ When `active` is `herdr`, the session is running in a [herdr](https://herdr.dev) pane. Create the worktree through herdr, then move this pane into the workspace herdr made for it. The session ends up in the sidebar row for the worktree it is actually working in, indented under its parent repo.
6
+
7
+ All four steps are one operation. Stopping after step 2 is the old broken behaviour. The session keeps running in the parent repo's workspace, and the worktree row holds nothing but an idle shell.
8
+
9
+ Check herdr's own markers before issuing any of the commands below. The detector reports `herdr` when either marker holds a value, but these steps need both: if `$HERDR_WORKSPACE_ID` or `$HERDR_PANE_ID` is empty, herdr's markers are incomplete. Say so and stop there, rather than issuing herdr commands against a blank target – `herdr workspace get ""` does not fail usefully, it just acts on nothing.
10
+
11
+ ## 1. Keep the source workspace alive
12
+
13
+ Moving the last pane out of a workspace closes that workspace. If this session is the only pane in a repo-root workspace, the repo row vanishes and the new worktree has no parent to nest under.
14
+
15
+ Read the source workspace first:
16
+
17
+ ```bash
18
+ herdr workspace get "$HERDR_WORKSPACE_ID"
19
+ ```
20
+
21
+ If `pane_count` is 1 and `worktree.is_linked_worktree` is `false`, leave a shell behind before moving:
22
+
23
+ ```bash
24
+ herdr tab create --workspace "$HERDR_WORKSPACE_ID" --cwd <main-root> --no-focus
25
+ ```
26
+
27
+ Skip this when the workspace has other tabs, or when it is already a linked worktree. A spent worktree workspace should close when the session leaves it.
28
+
29
+ ## 2. Create the worktree
30
+
31
+ `<base>` per the base rule in `SKILL.md`.
32
+
33
+ ```bash
34
+ cd <main-root> \
35
+ && git fetch origin --quiet \
36
+ && herdr worktree create \
37
+ --cwd "$(pwd)" \
38
+ --branch <branch> \
39
+ --base <base> \
40
+ --label <slug> \
41
+ --no-focus
42
+ ```
43
+
44
+ `--cwd` must be the MAIN repo root. herdr records it as the workspace's `repo_root`, and the sidebar groups worktree workspaces as indented children under that repo. Pass a nested worktree path and the new workspace groups under the wrong parent.
45
+
46
+ Do not pass `--path`. herdr places the checkout under its configured root (`worktrees.directory`, default `~/.herdr/worktrees`, giving `<root>/<repo>/<branch-slug>`). Letting the config decide keeps worktrees agent-neutral – the same layout whether Claude, Codex, or another CLI agent works in them.
47
+
48
+ Use `--no-focus` here, so herdr does not drop the user into the spare shell. Focus comes in step 3, with this pane.
49
+
50
+ Read three values from the JSON rather than assuming any of them:
51
+
52
+ - `.result.worktree.path` – the checkout, for `git -C <path> log -1 --oneline` to confirm the base commit
53
+ - `.result.workspace.workspace_id` – where this pane is going
54
+ - `.result.root_pane.pane_id` – the spare shell to close in step 4
55
+
56
+ Never hardcode the path. A relative `worktrees.directory` resolves against the herdr session's base directory, not the repo you pass to `--cwd`. Only the output tells you where the checkout landed.
57
+
58
+ ## 3. Move this pane in
59
+
60
+ ```bash
61
+ herdr pane move "$HERDR_PANE_ID" --new-tab --workspace <workspace-id> --focus
62
+ ```
63
+
64
+ Use `--focus` so the user's view follows the session they were watching, instead of staying on whatever remains behind.
65
+
66
+ The pane gets a new workspace-qualified ID. Read it from `.result.move_result.pane.pane_id`. `$HERDR_PANE_ID` still resolves for this process, so it keeps working as a target here. Do not hand the old ID to anything else.
67
+
68
+ ## 4. Close the spare shell
69
+
70
+ herdr's create step always spawns a shell in the new workspace. Close it once the move has landed:
71
+
72
+ ```bash
73
+ herdr pane close <root-pane-id>
74
+ ```
75
+
76
+ Order matters. Close it first and the workspace has no panes left. herdr then closes the workspace, so the move in step 3 has nothing to target.
77
+
78
+ ## If the checkout already exists
79
+
80
+ Attach it instead of recreating, then carry on from step 3:
81
+
82
+ ```bash
83
+ herdr worktree open --path <path-to-existing-checkout>
84
+ ```
@@ -0,0 +1,101 @@
1
+ # New worktree: Orca
2
+
3
+ The `Orchestrator: orca` branch of `SKILL.md`, for when `active` is `orca`.
4
+
5
+ When `active` is `orca`, the session runs in an Orca terminal. Create the worktree through Orca, then change this session's working directory into the checkout Orca reports.
6
+
7
+ There is no pane move here. Orca has no command that moves a running terminal into another worktree, so step 3 is a plain cwd change. That is the one place this branch differs from herdr.
8
+
9
+ Run every step below. Stopping after step 3 leaves an idle Orca shell in the checkout, and `teardown-worktree` then refuses to remove it.
10
+
11
+ There is no marker check either. Orca injects `ORCA_PANE_KEY` and `ORCA_WORKTREE_ID` into the terminals it opens, and the detector already reads them. The commands below target the repo by path, so they need neither marker.
12
+
13
+ Resolve Orca's executable before you call it. The Linux binary is `orca-ide`, and some installs put it on PATH as plain `orca`. Never hard-code either name:
14
+
15
+ ```bash
16
+ ORCA_BIN="$(command -v orca-ide || command -v orca)"
17
+ ```
18
+
19
+ Every Orca command takes `--json` and answers with one object: `{id, ok, result, error, _meta}`. Read `.ok` before you read anything else.
20
+
21
+ ## 1. Create the worktree
22
+
23
+ `<base>` per the base rule in `SKILL.md`.
24
+
25
+ ```bash
26
+ cd <main-root> \
27
+ && git fetch origin --quiet \
28
+ && "$ORCA_BIN" worktree create \
29
+ --repo path:"$(pwd)" \
30
+ --name <slug> \
31
+ --base-branch <base> \
32
+ --no-parent \
33
+ --json
34
+ ```
35
+
36
+ `--repo` must name the MAIN repo root, the same rule herdr's `--cwd` follows. Pass `--no-parent` so Orca records the checkout as independent work. Without it, Orca makes the new worktree a child of whatever this terminal sits in.
37
+
38
+ Read three values from the JSON rather than assuming any of them:
39
+
40
+ - `.result.worktree.path` – the checkout, for `git -C <path> log -1 --oneline` to confirm the base commit
41
+ - `.result.worktree.branch` – the branch Orca made, as a full ref such as `refs/heads/<github-user>/<name>`
42
+ - `.result.worktree.baseRef` – the ref Orca branched from
43
+
44
+ Never compute the path or the branch.
45
+
46
+ Orca places the checkout under `~/orca/workspaces/<repo>/<name>`, and it names the branch `<github-user>/<name>`. So the `<type>/<slug>` branch rule in `SKILL.md` does not survive here. Pass the slug as `--name`, then report the branch Orca actually returned.
47
+
48
+ Strip the `refs/heads/` prefix before you report that branch. `git branch --show-current` in the checkout prints the same short name, so the two agree.
49
+
50
+ ## 2. When Orca refuses
51
+
52
+ `repo_not_found` in `.error` means Orca does not know this repo. Register it once, then retry the create:
53
+
54
+ ```bash
55
+ "$ORCA_BIN" repo add --path <main-root> --json
56
+ ```
57
+
58
+ On any other failure, show the user the exact command and Orca's `error`, then stop. Never fall through to plain git.
59
+
60
+ Orca cannot see a checkout made behind its back, cannot track it, and cannot later remove it. That leaves the user holding a worktree their orchestrator will never account for.
61
+
62
+ ## 3. Move this session in
63
+
64
+ Change cwd into the path Orca returned, the way `Orchestrator: none` does. `Then move into it` in `SKILL.md` covers it.
65
+
66
+ Offer the fresh-session variant too. It opens a new Orca terminal in the checkout, running its own agent. Stop the spare shell first, or the new terminal joins it:
67
+
68
+ ```bash
69
+ "$ORCA_BIN" terminal stop --worktree path:<path> --json
70
+ "$ORCA_BIN" terminal create --worktree path:<path> --title <slug> --command "claude" --json
71
+ ```
72
+
73
+ Take that route only when the user asks for it.
74
+
75
+ This session then stays where it is. Otherwise two agents share one checkout. That ordering also settles step 4, so skip it.
76
+
77
+ ## 4. Stop the spare shell
78
+
79
+ `orca worktree create` always spawns a shell terminal in the new checkout. Stop it once this session has moved in:
80
+
81
+ ```bash
82
+ "$ORCA_BIN" terminal stop --worktree path:<path> --json
83
+ ```
84
+
85
+ The result counts what it stopped, as `{"stopped": N}`. `terminal stop` stops every terminal Orca holds for that worktree, not the spare one alone. So run it before you open anything in the checkout that you want to keep.
86
+
87
+ Leaving that shell running costs the user a worktree later. `teardown-worktree` refuses to remove a checkout whose `liveTerminalCount` is above zero. The idle shell alone holds that count at one. So the worktree never becomes a teardown candidate.
88
+
89
+ ## If the checkout already exists
90
+
91
+ Attach to it instead of creating a second one:
92
+
93
+ ```bash
94
+ "$ORCA_BIN" worktree list --repo path:<main-root> --json
95
+ ```
96
+
97
+ Match `.result.worktrees[].branch`, which holds a full ref such as `refs/heads/<github-user>/roadmap-gantt`, or match `.displayName`. Then take that entry's `.path` and carry on from step 3.
98
+
99
+ Match only a path under `~/orca/workspaces/`. Orca's listing also reports herdr and plain git checkouts when the user turns external visibility on, and those are not Orca's to hand out.
100
+
101
+ `"$ORCA_BIN" worktree current --json` answers the other question: which Orca worktree holds the current directory.
@@ -0,0 +1,242 @@
1
+ ---
2
+ name: pre-commit-review
3
+ description: "Deep code quality review of all changes since last commit. Checks for hardcodes, single-source-of-truth violations, scalability issues, edge cases, and project convention drift using dynamic project awareness (living specs, codebase search, surrounding code). Also flags adjacent code rot worth cleaning up. Auto-invocable in two contexts – (1) when working autonomously through a task list and about to commit (e.g., user said \"implement all tasks and commit\"), use --auto-fix mode; (2) when the user manually invokes /commit and this skill has not already run on the current changes, use INTERACTIVE mode (default). Manual invocation via /pre-commit-review also uses interactive mode by default."
4
+ argument-hint: "[--auto-fix] [scope description]"
5
+ ---
6
+
7
+ # Pre-commit review
8
+
9
+ This skill runs a deep review of code quality in uncommitted changes, using dynamic
10
+ project awareness. It finds issues that linters miss: hardcodes, duplicated logic, missing
11
+ edge cases, convention drift, and adjacent rot.
12
+
13
+ ## User input
14
+
15
+ ```text
16
+ $ARGUMENTS
17
+ ```
18
+
19
+ ## Mode detection
20
+
21
+ Parse `$ARGUMENTS` and invocation context to determine mode:
22
+
23
+ - **Auto-fix mode**: Use when ANY of these are true:
24
+ - Arguments contain `--auto-fix`, `fix everything`, `auto fix`, or `fix automatically`
25
+ - The LLM works autonomously. The user asked it to implement, commit, and push, or work
26
+ through a task list, or said "handle everything". The LLM itself decided to commit.
27
+
28
+ The user is likely not present, so don't block on questions.
29
+
30
+ - **Interactive mode** (default): Use when ANY of these are true:
31
+ - No `--auto-fix` argument, and the user invoked the skill manually via `/pre-commit-review`
32
+ - The user typed `/commit`, which auto-invokes the skill. The user is clearly present,
33
+ so consult them in question-tool waves (AskUserQuestion on Claude Code).
34
+ - When in doubt, use interactive – it's always safe to ask.
35
+
36
+ **Rule of thumb**: Who initiated the commit? User typed `/commit` -> interactive.
37
+ LLM decided to commit during autonomous work -> auto-fix.
38
+
39
+ ## Workflow overview
40
+
41
+ ```
42
+ 1. SNAPSHOT – collect the diff and understand what changed
43
+ 2. DISCOVER – learn project conventions dynamically (parallel subagents)
44
+ 3. REVIEW – analyze changes against conventions + best practices (parallel subagents)
45
+ 4. ADJACENT – check surrounding code for related rot (parallel subagents)
46
+ 5. REPORT – synthesize findings
47
+ 6. FIX – auto-fix or interactive proposal waves
48
+ ```
49
+
50
+ ## Step 1: SNAPSHOT
51
+
52
+ Collect the raw material:
53
+
54
+ ```bash
55
+ # All changes (staged + unstaged + untracked) since last commit
56
+ git diff HEAD
57
+ git diff --cached
58
+ git status --short
59
+ git log --oneline -3 # recent context
60
+ ```
61
+
62
+ Read `acstack/project.yaml` to understand the project's directory layout, commands, and conventions.
63
+
64
+ Categorize changed files into scopes using the project configuration:
65
+
66
+ - **source**: files under `directories.source` from project.yaml
67
+ - **frontend**: files under `frontend.directory` from project.yaml (if configured)
68
+ - **config**: `*.yaml`, `*.toml`, `*.json`, config files, etc.
69
+ - **tests**: files under `directories.tests` from project.yaml
70
+ - **other**: everything else
71
+
72
+ If no meaningful code changes exist (only docs, config, assets), report "No code changes to review" and exit. Run the prose lint from Step 3 before you exit, when Markdown files changed.
73
+
74
+ ## Step 2: DISCOVER – Learn project conventions (parallel)
75
+
76
+ Launch **3 parallel Explore subagents** to build a dynamic understanding of the project's current conventions.
77
+ Do NOT hardcode conventions – discover them fresh each time.
78
+
79
+ **Subagent A – Living Specs & Architecture:**
80
+
81
+ ```
82
+ Read the living specs relevant to this change:
83
+ - Check acstack/specs/ directory listing
84
+ - Read spec.md files for domains touched by the changed files
85
+ (use acstack/domain-map.yaml to map files -> domains)
86
+ - Extract documented conventions, patterns, and requirements (FR-NNN entries)
87
+ Report: list of project conventions and patterns relevant to these changes.
88
+ ```
89
+
90
+ **Subagent B – Codebase Patterns via Search:**
91
+
92
+ ```
93
+ Search the codebase for established patterns related to the changes.
94
+ For each changed function/component, search for similar implementations:
95
+ Search for function signatures, class names, and patterns from the diff
96
+ Find files with similar naming conventions
97
+ Identify: how does the rest of the codebase handle similar things?
98
+ Report: established patterns, common approaches, naming conventions observed.
99
+ ```
100
+
101
+ **Subagent C – Local Context & Config:**
102
+
103
+ ```
104
+ For each changed file, read:
105
+ - The full file (to see surrounding code context)
106
+ - Import targets (what does this file import? read those files' signatures)
107
+ - Config that governs this area (linter rules, compiler config, etc.)
108
+ Report: local conventions, related code patterns, existing abstractions nearby.
109
+ ```
110
+
111
+ Synthesize the three reports into a **convention profile** – the set of expectations
112
+ review subagents measure changes against.
113
+
114
+ ## Step 3: REVIEW – Analyze changes (parallel)
115
+
116
+ Launch **3 parallel review subagents**, each examining a different quality dimension.
117
+ Every subagent receives the diff AND the convention profile from Step 2.
118
+
119
+ **Subagent 1 – Hardcodes & SSOT:**
120
+
121
+ ```
122
+ Examine the diff for:
123
+ - Hardcoded values: URLs, ports, credentials, API keys, magic numbers, string literals
124
+ that should be constants or config
125
+ - Single Source of Truth violations: same logic/value defined in 2+ places,
126
+ copy-pasted code that should be a shared function, config scattered across files
127
+ - Constants that belong in a central config but are inline
128
+ - Duplicated type definitions or interfaces
129
+
130
+ For each finding, report:
131
+ FILE:LINE | SEVERITY (MUST/SHOULD/CONSIDER) | WHAT | WHY | SUGGESTED FIX
132
+ ```
133
+
134
+ **Subagent 2 – Scalability & Readability:**
135
+
136
+ ```
137
+ Examine the diff for:
138
+ - Functions > 40 lines or > 3 levels of nesting
139
+ - God functions doing too many things
140
+ - Unclear variable/function names
141
+ - Missing or premature abstractions
142
+ - Complex conditionals that could be simplified
143
+ - Code that would be hard for a new developer to understand
144
+ - Performance concerns (N+1 queries, unnecessary re-renders, blocking I/O)
145
+
146
+ For each finding, report:
147
+ FILE:LINE | SEVERITY (MUST/SHOULD/CONSIDER) | WHAT | WHY | SUGGESTED FIX
148
+ ```
149
+
150
+ **Subagent 3 – Edge Cases & Robustness:**
151
+
152
+ ```
153
+ Examine the diff for:
154
+ - Unhandled null/undefined/None cases
155
+ - Empty array/object assumptions
156
+ - Missing error handling on I/O, network calls, or DB queries
157
+ - Race conditions in async code
158
+ - Missing input validation at system boundaries
159
+ - Unhappy paths not tested or handled
160
+ - Type narrowing gaps (any casts, missing type hints on public APIs)
161
+
162
+ For each finding, report:
163
+ FILE:LINE | SEVERITY (MUST/SHOULD/CONSIDER) | WHAT | WHY | SUGGESTED FIX
164
+ ```
165
+
166
+ **Prose lint on changed Markdown:**
167
+
168
+ ```bash
169
+ ~/.claude/acstack/bin/acstack lint-prose <changed .md files>
170
+ ```
171
+
172
+ Run the lint on the changed Markdown files, and on nothing else. Skip the command when no Markdown file changed, because it exits 1 with no paths.
173
+
174
+ The lint exits 0 even when it reports findings. It groups findings by file with line numbers, then prints a summary per file. It skips `skills/writing/vocabulary.md` on purpose.
175
+
176
+ Add each finding to the review as `SHOULD | PROSE`, at the `file:line` it names. The writing standard is a project convention, so it sits at the same severity as other convention drift.
177
+
178
+ ## Step 4: ADJACENT – Check surrounding code for rot
179
+
180
+ For each file with findings from Step 3, launch an **Explore subagent** (up to 3 in parallel).
181
+ Each subagent examines the rest of that file and its immediate imports for the same categories of issue.
182
+
183
+ ```
184
+ File [path] has these issues in the changed code: [summary].
185
+ Read the FULL file and its direct imports.
186
+ Find any OTHER instances of the same categories of problem in this file
187
+ or closely related files – even if they weren't part of this commit's changes.
188
+ These are "while we're here" cleanup opportunities.
189
+
190
+ Report as: ADJACENT | FILE:LINE | WHAT | WHY | SUGGESTED FIX
191
+ ```
192
+
193
+ Only flag adjacent issues that are **closely related** to the current changes (same file,
194
+ same module, or same pattern). Stay narrowly scoped.
195
+
196
+ ## Step 5: REPORT – Synthesize findings
197
+
198
+ Merge all subagent findings. Deduplicate. Sort by:
199
+
200
+ 1. MUST FIX (correctness, security, will-break-in-prod)
201
+ 2. SHOULD FIX (convention violations, readability, maintainability)
202
+ 3. CONSIDER (style preferences, minor improvements, adjacent rot)
203
+
204
+ For each finding, make sure it has:
205
+
206
+ - `file:line` reference
207
+ - Category tag (HARDCODE, SSOT, SCALABILITY, READABILITY, EDGE-CASE, PROSE, ADJACENT)
208
+ - Severity (MUST / SHOULD / CONSIDER)
209
+ - Clear 1-sentence description of the problem
210
+ - Why it matters (1 sentence)
211
+ - Suggested fix (concrete, actionable – code snippet or approach)
212
+
213
+ If any finding needs deeper analysis to determine the right fix, launch a **planning subagent**:
214
+
215
+ ```
216
+ This code has [problem]. The file is [path]. Here's the surrounding context: [context].
217
+ Think through 2-3 possible fixes, evaluate trade-offs, and recommend the best approach.
218
+ Consider: does a fix here require changes in other files? What's the minimal change?
219
+ ```
220
+
221
+ ## Step 6: FIX – Auto-fix or interactive waves
222
+
223
+ - **Auto-fix mode**: read `auto-fix.md` and follow it.
224
+ - **Interactive mode** (default): read `interactive.md` and follow it.
225
+
226
+ ## Severity guide
227
+
228
+ | Severity | Meaning | Examples |
229
+ | -------- | ------------------------------------------------------ | ------------------------------------------------------------------ |
230
+ | MUST | Will cause bugs, security issues, or prod failures | Hardcoded secrets, unhandled null on critical path, race condition |
231
+ | SHOULD | Violates conventions, hurts maintainability, tech debt | SSOT violations, unclear naming, missing error handling on I/O |
232
+ | CONSIDER | Improvement opportunity, not urgent | Adjacent rot, minor style, could-be-cleaner patterns |
233
+
234
+ ## What this skill does not check
235
+
236
+ - **Formatting/style** – linters and formatters handle this
237
+ - **Type errors** – typecheckers handle this
238
+ - **Test coverage** – task-checker handles this
239
+ - **UI rendering** – frontend-verify handles this
240
+ - **Security scanning** – dedicated security tools handle credentials in committed code
241
+
242
+ Focus exclusively on the semantic/architectural issues that automated tools miss.
@@ -0,0 +1,19 @@
1
+ # Pre-commit review: auto-fix mode
2
+
3
+ Step 6 of `SKILL.md` in auto-fix mode.
4
+
5
+ For each finding (MUST first, then SHOULD, then CONSIDER):
6
+
7
+ 1. Launch a **task-executor subagent** with the finding + suggested fix
8
+ 2. Verify the fix doesn't break anything (run lint, typecheck, and test commands from project.yaml)
9
+ 3. If fix breaks something, revert and try alternate approach
10
+ 4. Move to next finding
11
+
12
+ After all fixes, run full verification using commands from `acstack/project.yaml`:
13
+
14
+ ```bash
15
+ # Run the project's configured test, lint, and typecheck commands
16
+ # Read these from project.yaml – do not hardcode
17
+ ```
18
+
19
+ Report a summary of the fixes.
@@ -0,0 +1,35 @@
1
+ # Pre-commit review: interactive mode
2
+
3
+ Step 6 of `SKILL.md` in interactive mode, the default.
4
+
5
+ Present findings in **waves of up to 4** using the question tool (AskUserQuestion on Claude Code). On a host without one, use a numbered list in chat. Group related findings together.
6
+
7
+ Format each wave like:
8
+
9
+ ```
10
+ I found these issues in your changes. For each, choose: FIX / SKIP / DISCUSS
11
+
12
+ 1. [MUST | HARDCODE] `path/to/file.py:42`
13
+ Hardcoded timeout value `30` – should use config constant.
14
+ Suggested fix: Move to config, reference from there.
15
+
16
+ 2. [SHOULD | SSOT] `path/to/api/client.ts:15`
17
+ Duplicated error handling pattern – same try/catch in 3 functions.
18
+ Suggested fix: Extract shared wrapper function.
19
+
20
+ 3. [CONSIDER | ADJACENT] `path/to/component.tsx:88`
21
+ Existing code (not your change) has a magic string – should use constant.
22
+ Suggested fix: Add constant, use in both places.
23
+
24
+ 4. [SHOULD | EDGE-CASE] `path/to/manager.py:120`
25
+ No null check on response before accessing `.status`.
26
+ Suggested fix: Add guard clause with appropriate error.
27
+
28
+ Reply with numbers to fix (e.g., "1,2,4") or "all" or "skip all", and any notes on approach.
29
+ ```
30
+
31
+ After user responds:
32
+
33
+ - Fix selected items via task-executor subagents (parallelize independent fixes)
34
+ - Present next wave if more findings remain
35
+ - Continue until all findings addressed or user says "done" / "skip the rest"
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: quick-fix
3
+ description: "Structured workflow for fixing bugs, issues, and broken behavior. Enforces codebase exploration before touching code, root cause analysis, minimal change principle, and full verification. Use when (1) something is broken and needs fixing, (2) behavior is wrong and needs correcting, or (3) user reports a bug. Lighter than a full debug investigation but more disciplined than ad-hoc fixes. Not for new features – use the Implementation Discipline directly."
4
+ argument-hint: "<description of what's broken>"
5
+ ---
6
+
7
+ # Quick fix
8
+
9
+ Structured fix workflow: understand -> locate -> root-cause -> fix -> verify.
10
+
11
+ ## Input
12
+
13
+ ```
14
+ $ARGUMENTS
15
+ ```
16
+
17
+ If `$ARGUMENTS` is empty, ask the user to describe what's broken.
18
+
19
+ ## Before you start
20
+
21
+ Copy the seven step headings below into your todo list word for word. They go ahead of any task-specific items. A step you skip stays in the list, marked `skip: <reason>`.
22
+
23
+ When Step 5 runs, copy its four numbered steps the same way.
24
+
25
+ ## Step 1: Understand the problem
26
+
27
+ Before touching any code:
28
+
29
+ 1. Restate the problem in one sentence. What is the expected behavior vs actual behavior?
30
+ 2. Classify the problem type:
31
+ - **Crash/error**: Stack trace or error message available
32
+ - **Wrong behavior**: Code runs but produces incorrect results
33
+ - **Regression**: Something that used to work stopped working
34
+ - **Performance**: Too slow, too many resources
35
+
36
+ If the user provided an error message or stack trace, note the key details (file, line, error type).
37
+
38
+ ## Step 2: Explore the codebase
39
+
40
+ **Do NOT skip this step.** Delegate exploration to subagents:
41
+
42
+ 1. **Locate the code**: Launch an Explore subagent to find the files involved. Read only a file you can already name.
43
+
44
+ 2. **Read the integration points**: Have the subagent read the broken function's callers and callees, not just the function. Understand:
45
+ - What calls this code? (upstream)
46
+ - What does this code call? (downstream)
47
+ - What data flows through it? (inputs/outputs)
48
+ - Are there tests covering this behavior?
49
+
50
+ 3. **Check recent changes**: If this is a regression, run:
51
+ ```bash
52
+ git log --oneline -20 -- <file>
53
+ ```
54
+ to see if a recent commit introduced the problem.
55
+
56
+ Produce a brief exploration summary:
57
+
58
+ ```
59
+ Files involved: <list>
60
+ Integration points: <upstream -> target -> downstream>
61
+ Existing tests: <list or "none">
62
+ Recent changes: <relevant commits or "none suspicious">
63
+ ```
64
+
65
+ ## Step 3: Root cause analysis
66
+
67
+ Based on the exploration, identify the root cause – not just the symptom.
68
+
69
+ Bad: "The function returns null" (symptom).
70
+ Good: "The function returns null because the query filter uses `org_id`, but the test user's org isn't in the result set" (root cause).
71
+
72
+ If the root cause isn't clear after exploration, escalate to deeper investigation with parallel debug subagents. Don't guess.
73
+
74
+ ## Step 4: Plan the fix
75
+
76
+ Before coding, state:
77
+
78
+ 1. **What** will change (which file(s), which function(s))
79
+ 2. **Why** this fixes the root cause (not just the symptom)
80
+ 3. **What won't change** (confirm the fix is minimal – no drive-by refactors)
81
+
82
+ If the fix touches more than 3 files, pause. Confirm the scope with the user – the fix may be bigger than a quick fix.
83
+
84
+ ## Step 5: Implement via the Implementation discipline
85
+
86
+ Follow the standard pipeline:
87
+
88
+ 1. **test-writer** – Write a failing test that reproduces the problem (if testable behavior exists). Skip for pure config/infra fixes.
89
+ 2. **task-executor** – Implement the minimal fix to make the test pass. Executor CANNOT modify test files.
90
+ 3. **task-checker** – Verify: task tests pass, full suite passes, test count >= baseline, no regressions.
91
+ 4. **frontend-verify** – Only if the fix touches frontend files (check `frontend.directory` in project.yaml).
92
+
93
+ ## Step 6: Verify
94
+
95
+ Run build verification using commands from `acstack/project.yaml`:
96
+
97
+ ```bash
98
+ # Run the project's configured test, lint, and typecheck commands
99
+ # Read these from project.yaml – do not hardcode
100
+ ```
101
+
102
+ **STOP – if the fix touches frontend files, you MUST visually verify before proceeding to Step 7.**
103
+
104
+ If the project has a frontend verification agent or browser verification configured, use them. Otherwise, take a browser screenshot and think through:
105
+
106
+ 1. **Expected vs actual** – What should the change look like? Does the screenshot match?
107
+ 2. **Gaps** – Is anything missing, wrong, or showing the wrong data/labels/formatting?
108
+ 3. **General UX** – Anything weird? Overlapping elements, bad spacing, truncation, unprofessional appearance?
109
+
110
+ If verification finds a problem, fix it. Verify again. Do NOT proceed to Step 7 with unverified frontend changes.
111
+
112
+ ## Step 7: Report
113
+
114
+ ```
115
+ === Quick Fix Complete ===
116
+
117
+ Problem: <one-line description>
118
+ Root cause: <what was actually wrong>
119
+ Fix: <what changed and why>
120
+ Files modified: <list>
121
+ Tests: <added/modified/passing>
122
+ Regressions: none
123
+ ```
124
+
125
+ Remind the user to `/commit` when they're satisfied.