acstack 0.50.4 → 0.51.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 (111) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +14 -7
  3. package/agents/codex/frontend-verifier.toml +89 -6
  4. package/agents/codex/task-checker.toml +83 -2
  5. package/agents/codex/task-executor.toml +83 -1
  6. package/agents/codex/test-writer.toml +77 -1
  7. package/agents/frontend-verifier.md +13 -6
  8. package/agents/task-checker.md +7 -2
  9. package/agents/task-executor.md +7 -1
  10. package/agents/test-writer.md +1 -1
  11. package/assets/terminal-workspace/config.example.yaml +1 -1
  12. package/assets/terminal-workspace/helpers/acstack-md +12 -4
  13. package/assets/terminal-workspace/helpers/acstack-open +10 -2
  14. package/cli/dist/index.js +10142 -9369
  15. package/cli/dist/index.js.map +4 -4
  16. package/cli/package.json +1 -1
  17. package/docs/config-reference.md +113 -14
  18. package/docs/dev-setups.md +4 -4
  19. package/docs/terminal-workspace.md +1 -1
  20. package/docs/workflows.md +22 -16
  21. package/examples/design-doc/acstack/README.md +273 -0
  22. package/examples/design-doc/acstack/acstack.yaml +4 -0
  23. package/examples/design-doc/acstack/cli.yaml +5 -0
  24. package/examples/design-doc/acstack/design.yaml +39 -0
  25. package/examples/design-doc/acstack/github.yaml +12 -0
  26. package/examples/design-doc/acstack/host.yaml +14 -0
  27. package/examples/design-doc/acstack/journey.md +85 -0
  28. package/examples/design-doc/acstack/publication.md +16 -0
  29. package/examples/design-doc/acstack/review-runtime.yaml +24 -0
  30. package/examples/design-doc/acstack/skills.yaml +22 -0
  31. package/examples/design-doc/acstack/store.yaml +11 -0
  32. package/examples/design-doc/acstack/user.yaml +15 -0
  33. package/examples/design-doc/acstack/viewer.yaml +13 -0
  34. package/hooks/ac-writing-style-reminder.sh +7 -18
  35. package/hooks/communication-standard.mjs +17 -0
  36. package/hooks/communication-standard.sh +6 -0
  37. package/hooks/context-pressure.sh +2 -2
  38. package/hooks/hooks.json +18 -0
  39. package/hooks/lib/communication-standard.mjs +16 -0
  40. package/hooks/project-data.sh +38 -0
  41. package/hooks/session-start-handoff.sh +21 -7
  42. package/hooks/session-start.sh +9 -2
  43. package/orchestrator/AGENTS.md +25 -14
  44. package/output-styles/ac-writing-style.md +75 -276
  45. package/package.json +2 -1
  46. package/pi/agents/frontend-verifier.md +89 -6
  47. package/pi/agents/task-checker.md +83 -2
  48. package/pi/agents/task-executor.md +83 -1
  49. package/pi/agents/test-writer.md +77 -1
  50. package/pi/extension.ts +70 -12
  51. package/profiles/fullstack-python.yaml +1 -1
  52. package/profiles/node-typescript.yaml +1 -1
  53. package/profiles/python.yaml +1 -1
  54. package/skills/archive/SKILL.md +53 -36
  55. package/skills/bootstrap/SKILL.md +6 -6
  56. package/skills/bridge/SKILL-VM.md +11 -2
  57. package/skills/bridge/SKILL-WINDOWS.md +3 -3
  58. package/skills/browser-verify/SKILL.md +14 -5
  59. package/skills/code-review/SKILL.md +8 -2
  60. package/skills/commit/SKILL.md +7 -6
  61. package/skills/compact-and-continue/SKILL.md +9 -8
  62. package/skills/design-doc/SKILL.md +235 -0
  63. package/skills/explore/SKILL.md +1 -1
  64. package/skills/grilling/SKILL.md +4 -4
  65. package/skills/handoff/SKILL.md +4 -4
  66. package/skills/host/SKILL.md +1 -1
  67. package/skills/host/detect-host.sh +2 -2
  68. package/skills/host/notes.md +2 -2
  69. package/skills/host/questions.md +1 -1
  70. package/skills/implement/SKILL.md +20 -13
  71. package/skills/implement/decision-log.md +9 -8
  72. package/skills/implement/design-pass.md +16 -2
  73. package/skills/map/SKILL.md +15 -71
  74. package/skills/map/alignment.md +18 -27
  75. package/skills/map/frontend.md +1 -1
  76. package/skills/map/materialising.md +74 -0
  77. package/skills/map/trackers/files.md +4 -6
  78. package/skills/pre-commit-review/SKILL.md +15 -9
  79. package/skills/pre-commit-review/auto-fix.md +1 -1
  80. package/skills/quick-fix/SKILL.md +1 -1
  81. package/skills/record-context/SKILL.md +6 -6
  82. package/skills/setup/SKILL.md +15 -50
  83. package/skills/setup/browser.md +2 -2
  84. package/skills/setup/first-run.md +19 -8
  85. package/skills/setup/report.md +3 -2
  86. package/skills/setup/row-fixes.md +56 -9
  87. package/skills/sync/SKILL.md +12 -11
  88. package/skills/terminal-workspace/SKILL.md +1 -1
  89. package/skills/test-conventions/SKILL.md +2 -2
  90. package/skills/visual-docs/SKILL.md +69 -235
  91. package/skills/writing/SKILL.md +29 -217
  92. package/skills/writing/examples.md +62 -129
  93. package/docs/adr/0001-ste-writing-standard.md +0 -16
  94. package/docs/adr/0002-version-gate-not-auto-bump.md +0 -35
  95. package/docs/adr/0003-handoff-ack-command.md +0 -19
  96. package/docs/adr/0004-dev-setup-per-host.md +0 -13
  97. package/docs/adr/0005-two-orchestrators-per-host.md +0 -25
  98. package/docs/adr/0006-document-opener-service.md +0 -89
  99. package/docs/adr/0007-lead-check-reads-the-transcript.md +0 -87
  100. package/docs/adr/0008-cli-audits-skill-interviews.md +0 -37
  101. package/docs/adr/0009-verify-the-write-not-the-writer.md +0 -51
  102. package/docs/adr/0010-promote-dev-to-main-by-fast-forward.md +0 -115
  103. package/docs/adr/0011-node-header-is-the-edge-encoding.md +0 -20
  104. package/docs/adr/0012-node-kind-is-a-closed-set-of-five.md +0 -31
  105. package/docs/adr/0013-the-diagram-renderer-is-pure.md +0 -23
  106. package/docs/adr/0014-reading-a-node-hides-its-generated-diagram.md +0 -29
  107. package/docs/adr/0015-a-node-id-links-to-its-issue-through-an-anchor.md +0 -37
  108. package/docs/adr/0016-the-map-root-carries-no-status-of-its-own.md +0 -21
  109. package/docs/adr/0017-call-impeccable-copy-only-its-questions.md +0 -13
  110. package/docs/adr/0018-alignment-packs-use-local-viewers.md +0 -11
  111. package/docs/adr/index.md +0 -18
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: archive
3
- description: Close out a cleared map – one whose frontier is empty with no fog and no claims left – by verifying the durable residue, meaning what the effort leaves behind in living specs, ADRs and the glossary, was extracted, then closing the root and disposing of the nodes per workflow.maps.persist. Invoke when a map has just been cleared, when the last node on a map resolves, or when the user asks to archive or close out a map. Refuses and asks first if anything is still open. Also archives legacy acstack/changes/ directories from the pre-map workflow.
3
+ description: Close out a cleared map – one whose frontier is empty with no fog and no claims left – by verifying the durable residue, meaning what the effort leaves behind in living specs, ADRs and the glossary, was extracted, then closing the root and disposing of the nodes per workflow.maps.persist. Invoke when a map has just been cleared, when the last node on a map resolves, or when the user asks to archive or close out a map. Refuses and asks first if anything is still open. Also archives legacy .acstack/changes/ directories from the pre-map workflow.
4
4
  argument-hint: "[map or legacy change name]"
5
5
  ---
6
6
 
@@ -14,24 +14,16 @@ You **MUST** consider the user input before proceeding (if not empty).
14
14
 
15
15
  ## Purpose
16
16
 
17
- A map is scaffolding. It exists to clear fog – the questions nobody could
18
- state precisely when the effort started.
19
-
20
- Once the fog clears, the answers belong in living specs, ADRs and the
21
- glossary, not in a second copy that drifts. That is the residue – what
22
- survives the map.
23
-
24
- Archive verifies the residue reached those three places. It then closes the
25
- map's root node and disposes of the rest.
17
+ Archive verifies implemented specs, durable decisions, and retained review evidence before closing the root and disposing of temporary map nodes.
26
18
 
27
19
  ## Step 1: Locate the map
28
20
 
29
21
  If `$ARGUMENTS` names a map, use it. Otherwise list maps on the configured
30
- tracker (`workflow.maps.tracker`): `ls acstack/maps/` on the files backend,
22
+ tracker (`workflow.maps.tracker`): `ls .acstack/maps/` on the files backend,
31
23
  `gh label list --search "map:" --json name` on GitHub.
32
24
 
33
25
  If exactly one, use it. If several, ask. If `$ARGUMENTS` names a legacy
34
- `acstack/changes/` directory instead, jump to Legacy below.
26
+ `.acstack/changes/` directory instead, jump to Legacy below.
35
27
 
36
28
  ## Step 2: Verify no open work remains
37
29
 
@@ -64,8 +56,23 @@ frontier only lists nodes with no unresolved blockers. Two nodes that block
64
56
  each other show an empty frontier while both questions stay open. An empty
65
57
  frontier is therefore no proof of a cleared map.
66
58
 
67
- If anything remains, WARN with what it is and ask for confirmation –
68
- archiving an uncleared map throws away open questions.
59
+ If anything remains, stop and list the fog, open questions, or claims.
60
+ Ask the user to resolve them or explicitly mark dropped scope out of scope before retrying.
61
+ Do not dispose of an uncleared map.
62
+
63
+ For a bound design, read the root's `Design entry` reference and run:
64
+
65
+ ```bash
66
+ ~/.claude/acstack/bin/acstack design-review status <entry>
67
+ ```
68
+
69
+ - Require returned `planning.tracker` and `planning.map` to match the map being archived
70
+ - Stop on a missing or different binding; another map's approval does not authorize this archive
71
+ - Require `approval.valid: true` for the current exact revision tuple
72
+ - Require completed reconciliation of saved feedback and current map contributions
73
+ - Return invalid approval or unresolved reconciliation to `/acstack:design-doc`
74
+ - Recheck after source, saved comments, or contribution inputs change
75
+ - Never promote historical approval or migrate legacy data during archive
69
76
 
70
77
  ## Step 3: Extract the residue
71
78
 
@@ -76,16 +83,22 @@ On GitHub, compose the walk per `trackers/github.md`.
76
83
  Check each resolution left what it should have:
77
84
 
78
85
  1. **Living specs** – behaviour the effort built should already be in
79
- `acstack/specs/` via commit-time sync. Spot-check the affected domains.
86
+ `.acstack/specs/` via commit-time sync. Spot-check the affected domains.
87
+
88
+ Verify against source and verification evidence, not proposals copied from map nodes.
80
89
  Fix gaps on sight per the Spec Correction Protocol.
81
90
 
82
- 2. **ADRs and glossary** – invoke `record-context` for any resolved decision
83
- that meets the bar and that nobody recorded. This is the last chance.
91
+ 2. **ADRs and glossary** – apply `record-context`'s existing tests to unrecorded decisions.
92
+ An ADR requires a hard-to-reverse, surprising decision with a real trade-off.
93
+ A glossary entry requires an agreed term; neither is the common outcome.
84
94
 
85
- 3. **Out-of-scope nodes** – report them. A scope boundary is worth the user
86
- hearing once more before the map disappears.
95
+ 3. **Scope and provenance** – record dropped scope, unresolved limits, and reopening conditions before disposal.
96
+ Keep durable node identities and their provenance with the affected specs or decision records.
87
97
 
88
- 4. **The decision log** – read `<main checkout>/acstack/.decisions/<name>.tsv`
98
+ Preserve enough context to trace implemented behavior back to its decisions without retaining proposals as requirements.
99
+ Stop if unresolved scope still needs a decision rather than an explicit out-of-scope resolution.
100
+
101
+ 4. **The decision log** – read `<main checkout>/.acstack/decision-logs/<name>.tsv`
89
102
  if it exists. The main checkout is `dirname` of `git rev-parse
90
103
  --path-format=absolute --git-common-dir`.
91
104
 
@@ -117,47 +130,51 @@ If you reached this skill on your own after a map cleared, name what you
117
130
  will delete or move. Then wait for the user's go-ahead. Deletion is
118
131
  irreversible and they never asked for it.
119
132
 
120
- `workflow.maps.persist` in `acstack/project.yaml` decides (default `false`):
133
+ `workflow.maps.persist` in `.acstack/project.yaml` decides (default `false`):
121
134
 
122
135
  | Value | Action |
123
136
  | ----------------- | ------------------------------------------------------------ |
124
- | `false` (default) | delete `acstack/maps/<name>/` |
125
- | `true` | move the nodes to `acstack/archive/[YYYY-MM-DD]-[name]/nodes/` |
137
+ | `false` (default) | delete `.acstack/maps/<name>/` |
138
+ | `true` | move the nodes to `.acstack/archive/[YYYY-MM-DD]-[name]/nodes/` |
126
139
 
127
140
  Default is delete because keeping the nodes leaves a second copy of every
128
141
  decision, and the two drift. On the GitHub tracker there is nothing to
129
142
  dispose – closed issues are already the archive.
130
143
 
131
- Also dispose of `acstack/handoffs/<name>/` if it exists. Consumed handoffs
132
- hold conversation content and should not outlive the map they served.
144
+ Retain these records independently of `workflow.maps.persist`:
145
+
146
+ - Authored design entries and referenced source files
147
+ - Canonical `review.json` files, posted feedback, reconciliation, and exact-revision approval evidence
148
+ - Imported legacy history and original `.acstack/alignment-packs/` artifacts
149
+ - Main-checkout `.acstack/decision-logs/<name>.tsv` files
150
+ - Handoffs that contain review evidence or provenance not retained elsewhere
133
151
 
134
- Also dispose of `acstack/alignment-packs/<safe-map>/` if it exists. Alignment
135
- packs are local review artifacts. Step 3 already verified the durable residue.
152
+ Never recursively delete alignment, review, decision-log, or handoff directories as archive cleanup.
153
+ Do not invoke a cleanup helper that erases those records.
136
154
 
137
- Delete the map's decision log, `<main checkout>/acstack/.decisions/<name>.tsv`,
138
- on either tracker. Step 3 already extracted what it held. Leave the directory
139
- and its `.gitignore` for the next map.
155
+ If a retained source or review record sits inside the proposed node disposal path, stop and resolve its safe retention first.
156
+ Respect native Git ignore rules; never force-add private records.
140
157
 
141
158
  ## Step 6: Report
142
159
 
143
160
  - Nodes resolved / out-of-scope counts
144
161
  - Residue: domains spot-checked, ADRs and glossary entries written
145
- - Disposal: deleted, or archive path
162
+ - Disposal: node deletion or archive path, plus retained review evidence and provenance
146
163
  - Reminder: commit with `/acstack:commit`
147
164
 
148
- ## Legacy: archiving a `acstack/changes/` directory
165
+ ## Legacy: archiving a `.acstack/changes/` directory
149
166
 
150
167
  The pre-map workflow created changes that hold proposal.md, design.md and
151
168
  tasks.md. They still archive the old way, so an upgrade never strands work:
152
169
 
153
170
  1. Read the change's artifacts. Derive the affected domains from the file
154
- paths in `tasks.md` via `acstack/domain-map.yaml`.
171
+ paths in `tasks.md` via `.acstack/domain-map.yaml`.
155
172
 
156
173
  2. For each domain, merge what the feature ADDED, MODIFIED or REMOVED into
157
- `acstack/specs/[domain]/spec.md`.
174
+ `.acstack/specs/[domain]/spec.md`.
158
175
 
159
176
  3. Write a `delta.md` into the change directory.
160
177
 
161
178
  Then run the CLI's `acstack archive <name>`. It moves the artifacts,
162
- delta included, to `acstack/changes/archive/[YYYY-MM-DD]-[change-name]/`.
163
- It also removes the change from `acstack/changes/`.
179
+ delta included, to `.acstack/changes/archive/[YYYY-MM-DD]-[change-name]/`.
180
+ It also removes the change from `.acstack/changes/`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: bootstrap
3
- description: Multi-pass AI crawl to generate initial living specs from the existing codebase. Use when acstack/specs/ domains need their initial spec.md files bootstrapped from code.
3
+ description: Multi-pass AI crawl to generate initial living specs from the existing codebase. Use when .acstack/specs/ domains need their initial spec.md files bootstrapped from code.
4
4
  argument-hint: "[domain-names (optional)]"
5
5
  disable-model-invocation: true
6
6
  ---
@@ -15,9 +15,9 @@ Consider the user input before you proceed, if it is not empty.
15
15
 
16
16
  ## Purpose
17
17
 
18
- This skill bootstraps cumulative living specs in `acstack/specs/`. It crawls the existing codebase with multiple independent AI passes. It then merges the passes and validates the results.
18
+ This skill bootstraps cumulative living specs in `.acstack/specs/`. It crawls the existing codebase with multiple independent AI passes. It then merges the passes and validates the results.
19
19
 
20
- **IMPORTANT**: This is a one-time bootstrapping operation. Only run when `acstack/specs/` domains have no `spec.md` files yet.
20
+ **IMPORTANT**: This is a one-time bootstrapping operation. Only run when `.acstack/specs/` domains have no `spec.md` files yet.
21
21
 
22
22
  ## Your role: orchestrator only
23
23
 
@@ -33,9 +33,9 @@ Your job is to:
33
33
 
34
34
  ## Pre-flight check
35
35
 
36
- 1. Read `acstack/domain-map.yaml` to get the list of domains and their file path mappings.
36
+ 1. Read `.acstack/domain-map.yaml` to get the list of domains and their file path mappings.
37
37
  2. If `$ARGUMENTS` specifies domain names, filter to only those domains.
38
- 3. Check if any `acstack/specs/*/spec.md` files already exist:
38
+ 3. Check if any `.acstack/specs/*/spec.md` files already exist:
39
39
  - If specs exist, warn the user. Ask for confirmation before overwriting.
40
40
  - If no specs exist, proceed automatically.
41
41
 
@@ -98,7 +98,7 @@ Launch a single subagent to apply validated corrections from Phase 3.
98
98
 
99
99
  ## Phase 5: human review (pass 9)
100
100
 
101
- Present a summary to the user. Ask: "Review the specs in `acstack/specs/`. Want to edit any domain before finalizing?"
101
+ Present a summary to the user. Ask: "Review the specs in `.acstack/specs/`. Want to edit any domain before finalizing?"
102
102
 
103
103
  ## Phase 6: finalization (pass 10)
104
104
 
@@ -10,7 +10,7 @@
10
10
  binds `127.0.0.1:19988` on this host.
11
11
 
12
12
  - `agent-browser` (installed per the `browser-verify` skill) pointed at
13
- that endpoint via `agent-browser.json`.
13
+ that endpoint via `.acstack/agent-browser.json`.
14
14
 
15
15
  - `vm-free-port.sh` for clearing a stuck port 19988 after a dropped
16
16
  session.
@@ -42,12 +42,21 @@ and is driving a real Chrome on the laptop.
42
42
 
43
43
  See the `browser-verify` skill for the install command.
44
44
 
45
- ### 2. Create `agent-browser.json` in each project root
45
+ ### 2. Create `.acstack/agent-browser.json` in each configured project
46
46
 
47
47
  ```json
48
48
  { "cdp": "19988" }
49
49
  ```
50
50
 
51
+ Run `~/.claude/acstack/bin/acstack project-data ensure` after creating `.acstack/`.
52
+ Select the config explicitly from the project root before browser commands:
53
+
54
+ ```bash
55
+ export AGENT_BROWSER_CONFIG="$(pwd)/.acstack/agent-browser.json"
56
+ ```
57
+
58
+ For manual CDP checks without project configuration, use `agent-browser --cdp 19988 ...` instead; do not pass a missing config.
59
+
51
60
  ### 3. Accept the laptop's key
52
61
 
53
62
  Append the laptop's SSH public key to `~/.ssh/authorized_keys`.
@@ -276,9 +276,9 @@ pages.
276
276
  The opener shows a page from a VM in this laptop's default browser. It is a
277
277
  second service, not part of the bridge.
278
278
 
279
- The bridge carries CDP to a Chrome the extension drives. The opener takes a
280
- document and opens a tab. See `docs/adr/0006-document-opener-service.md` for
281
- why these stay apart.
279
+ The bridge carries CDP to a Chrome the extension drives. The opener opens
280
+ documents in the default browser without requiring an automation session.
281
+ Separate services let either function run without the other.
282
282
 
283
283
  Two tasks run it:
284
284
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: browser-verify
3
- description: How to interact with a browser for frontend verification using agent-browser CLI and CDP. ALWAYS use when UI or frontend files are modified and workflow.frontend_verification is true in acstack/project.yaml. Also use before running agent-browser commands, when element refs go stale, when CDP connection fails, or when verifying UI behavior. Covers all commands (snapshot, screenshot, click, fill, type), element ref strategy, DOM staleness rules, selector priority, and remote/headless/local environment troubleshooting.
3
+ description: How to interact with a browser for frontend verification using agent-browser CLI and CDP. ALWAYS use when UI or frontend files are modified and workflow.frontend_verification is true in .acstack/project.yaml. Also use before running agent-browser commands, when element refs go stale, when CDP connection fails, or when verifying UI behavior. Covers all commands (snapshot, screenshot, click, fill, type), element ref strategy, DOM staleness rules, selector priority, and remote/headless/local environment troubleshooting.
4
4
  ---
5
5
 
6
6
  # Browser helpers
@@ -13,11 +13,11 @@ For setup (installing agent-browser, creating config files, scaffolding knowledg
13
13
 
14
14
  ## Project configuration
15
15
 
16
- Read `acstack/project.yaml` for:
16
+ Read `.acstack/project.yaml` for:
17
17
 
18
18
  - `frontend.directory` – frontend source directory
19
19
  - `frontend.dev_server_url` – dev server URL
20
- - `frontend.helpers_dir` – path to verification knowledge (default: `<frontend.directory>/tests/helpers/`)
20
+ - `frontend.helpers_dir` – helper programs, not verification metadata
21
21
  - `frontend.browser.mode` – the browser environment this project prefers: `remote`, `headless`, or `local`
22
22
  - `frontend.browser.fallback` – set it to `none` to forbid any other mode standing in. Every other value allows one
23
23
  - `frontend.browser.cdp_port` – CDP port. Default `19988` for `mode: remote` (Playwriter bridge), `9555` for `headless`/`local`.
@@ -181,7 +181,16 @@ Omit `--headless` to see the browser. Useful during development.
181
181
 
182
182
  ## agent-browser command reference
183
183
 
184
- All commands assume `agent-browser.json` exists in the project root.
184
+ For configured verification, explicitly select the absolute `.acstack/agent-browser.json` path before running the commands below:
185
+
186
+ ```bash
187
+ export AGENT_BROWSER_CONFIG="$(pwd)/.acstack/agent-browser.json"
188
+ ```
189
+
190
+ - Run this from the project root only when the file exists; alternatively pass `--config /absolute/project/.acstack/agent-browser.json`
191
+ - Do not rely on root config autodiscovery
192
+ - Manual CDP quality checks remain available without project configuration or a configured browser mode
193
+ - For those checks, omit the missing config and use `agent-browser --cdp <port> ...` with the explicitly chosen endpoint
185
194
 
186
195
  | Command | Purpose |
187
196
  |---------|---------|
@@ -225,5 +234,5 @@ The snapshot gives you accessible names and roles automatically. Use these to fi
225
234
  - **frontend-verifier agent** uses agent-browser for configured real-browser verification – this skill is its reference
226
235
  - **verification owner** completes static and design checks under `skills/implement/design-pass.md` before configured browser verification
227
236
  - **/acstack:setup** runs the setup interviews (install, config, knowledge base scaffolding) and offers a fix for each row the health check fails
228
- - **`acstack config check`** audits the browser infrastructure and changes nothing
237
+ - **`acstack config check`** reports browser infrastructure gaps without changing browser settings
229
238
  - **/acstack:quick-fix** uses agent-browser for visual verification of bug fixes
@@ -7,10 +7,12 @@ description: Apply Linus Torvalds code philosophy – eliminate special cases, p
7
7
 
8
8
  Channel the mindset of Linux's creator: be direct, eliminate over-engineering, and prioritize simplicity.
9
9
 
10
+ Read `../../output-styles/ac-writing-style.md` relative to this skill directory; apply its shared standard to code design as well as explanations.
11
+
10
12
  ## Core Principles
11
13
 
12
14
  - **"Good Taste"**: Eliminate special cases through better design rather than adding conditionals
13
- - **Simplicity First**: If it needs more than 3 levels of indentation, redesign it
15
+ - **Simplicity First**: Simplify tangled control flow and mixed responsibilities; cite concrete complexity rather than indentation or line counts
14
16
  - **Data Structures Matter**: "Bad programmers worry about code. Good programmers worry about data structures"
15
17
  - **Pragmatism**: Solve real problems, not imaginary ones
16
18
 
@@ -27,7 +29,11 @@ When reviewing code or making design decisions, ask these questions in order:
27
29
 
28
30
  1. **Is this a real problem?** – Reject over-design
29
31
  2. **Is there a simpler way?** – Always seek the simplest solution
30
- 3. **What are the core data relationships?** – Design around data flow
32
+ 3. **What are the core data relationships?** – Read connected callers and dependencies, not only the diff
33
+ - Do boundaries group coherent responsibilities, with peer components at comparable abstraction levels?
34
+ - Do small, useful interfaces hide real complexity (deep modules), without exposing internals or adding pass-through layers?
35
+ - Do names match meaning and structure follow responsibility rather than folder layout?
36
+ - Do not force nesting or wrappers; judge effects on callers, not line count or indirection
31
37
  4. **Can we eliminate special cases?** – Redesign to avoid if/else branches
32
38
  5. **Does complexity match problem severity?** – Don't build rockets to swat flies
33
39
 
@@ -45,24 +45,25 @@ For each planned commit:
45
45
 
46
46
  **This step is non-negotiable.** After drafting the commit message but BEFORE creating the commit, spec sync runs automatically.
47
47
 
48
- Read `acstack/project.yaml` – if `workflow.spec_sync` is `true` (or not explicitly `false`), run spec sync:
48
+ Read `.acstack/project.yaml` – if `workflow.spec_sync` is `true` (or not explicitly `false`), run spec sync:
49
49
 
50
- 1. Read `acstack/domain-map.yaml` (if exists)
50
+ 1. Read `.acstack/domain-map.yaml` (if exists)
51
51
  2. Map staged files to spec domains
52
- 3. For each affected domain where `acstack/specs/[domain]/spec.md` exists:
52
+ 3. For each affected domain where `.acstack/specs/[domain]/spec.md` exists:
53
53
  - Analyze what the staged changes add, modify, or remove
54
54
  - Generate lightweight ADDED/MODIFIED/REMOVED entries
55
55
  - Update the domain's spec.md
56
56
  4. Refresh `DESIGN.md`, per Step 2 of the `sync` skill
57
- 5. Stage any updated spec files
57
+ 5. Stage updated specs only when native `.gitignore` rules allow tracking
58
+ - Keep ignored specs updated locally; never force-add them or change the Git index to bypass this choice
58
59
  - Stage `DESIGN.md` and `.impeccable/design.json` too when the refresh ran
59
- 6. Include spec updates in the commit
60
+ 6. Include only opted-in spec updates in the commit
60
61
  7. Flag unmapped source files and prompt user to map them
61
62
 
62
63
  **Skip spec sync ONLY when:**
63
64
 
64
65
  - `workflow.spec_sync` is explicitly `false` in project.yaml
65
- - No `acstack/domain-map.yaml` exists
66
+ - No `.acstack/domain-map.yaml` exists
66
67
  - Changed files don't match any domain
67
68
  - Changes are docs/config only (no behavioral changes)
68
69
  - No spec.md exists for affected domains (don't create from scratch here)
@@ -55,7 +55,7 @@ instead – in your final message, or through your host's agent-messaging tool
55
55
  or compacts.
56
56
 
57
57
  A child session would write the lead's quiet marker and the shared
58
- `acstack/HANDOFF.md` anchor. Both belong to the lead alone.
58
+ `.acstack/HANDOFF.md` anchor. Both belong to the lead alone.
59
59
 
60
60
  Five facts sit behind that command, measured on Claude Code 2.1.241. Each one
61
61
  names a way the command has already been got wrong:
@@ -99,8 +99,8 @@ something by running a command, it should run the command.
99
99
  | Map state and reading order | `~/.claude/acstack/bin/acstack node walk --map <name>` (reading order of the map) |
100
100
  | What can be worked next | `~/.claude/acstack/bin/acstack node frontier --map <name>` (what is workable now) |
101
101
  | Files in flight | `git status --short` and `git diff` |
102
- | Test baseline, last result | `.test-baseline`, then run the suite |
103
- | What the code does | the living specs in `acstack/specs/` |
102
+ | Test baseline, last result | `.acstack/.test-baseline`, then run the suite |
103
+ | What the code does | the living specs in `.acstack/specs/` |
104
104
 
105
105
  On GitHub, `--map` refuses – pipe `gh issue list` into `--stdin` per the
106
106
  map skill's `trackers/github.md`.
@@ -141,7 +141,7 @@ not optional.
141
141
 
142
142
  ## Write the anchor
143
143
 
144
- Write `acstack/HANDOFF.md`. The frontmatter is **mandatory and machine-read**.
144
+ Write `.acstack/HANDOFF.md`. The frontmatter is **mandatory and machine-read**.
145
145
  The hook ignores any file without the marker, so it never touches a user's own
146
146
  unrelated `HANDOFF.md`.
147
147
 
@@ -216,8 +216,9 @@ note.
216
216
  Tell them to run that `/compact` line, then to type `continue`. The hook
217
217
  re-injects the anchor and retires it, so the anchor never loads twice.
218
218
 
219
- `acstack/HANDOFF.md` is transient working state. If `.gitignore` does not cover
220
- it, say so. The file holds conversation content, so nobody should commit it.
219
+ `.acstack/HANDOFF.md` holds conversation content and stays local by default.
220
+ Run `~/.claude/acstack/bin/acstack project-data ensure` after creating `.acstack/`.
221
+ Warn if user exceptions expose the anchor or consumed handoffs to tracking.
221
222
 
222
223
  ## Notes
223
224
 
@@ -229,8 +230,8 @@ it, say so. The file holds conversation content, so nobody should commit it.
229
230
  skill moves the work to a genuinely new session
230
231
 
231
232
  - **Consume-once.** The hook retires the anchor as it injects it, moving it to
232
- `acstack/handoffs/<map>/<created>.md` (legacy
233
- `acstack/changes/<name>/handoffs/` when that directory still exists).
233
+ `.acstack/handoffs/<map>/<created>.md` (legacy
234
+ `.acstack/changes/<name>/handoffs/` when that directory still exists).
234
235
  Collisions get a `-2` suffix
235
236
 
236
237
  - **Subagents and teammates have isolated context.** This protects the
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: design-doc
3
+ description: Author a structured design document and review it through a live local or SSH connection that saves comments for the agent.
4
+ ---
5
+
6
+ # Author and review a design document
7
+
8
+ Author one design source for interactive browser review and a GitHub-readable Markdown companion with Mermaid.
9
+ The React Flow browser view supports drill-down and comments saved on the agent's device.
10
+
11
+ ```mermaid
12
+ flowchart LR
13
+ A[Agree on the design scope] --> B[Author entry and element files]
14
+ B --> C[Validate and review in the browser]
15
+ C -->|invalid source| B
16
+ C --> D[Save comments for the agent]
17
+ M[Map contributions when bound] --> E[Reconcile feedback and contributions]
18
+ D --> E
19
+ E -->|revise| B
20
+ E -->|ready| F[Approve the exact revision]
21
+ F --> G[Implement and retain review evidence]
22
+ G -->|review inputs change| B
23
+ ```
24
+
25
+ ## Agree on the design scope
26
+
27
+ - Read the writing and visual-docs skills before authoring prose
28
+ - Inspect the source to establish current responsibilities
29
+ - Ask the user about unresolved product decisions before inventing behavior
30
+ - Distinguish existing behavior from proposed changes throughout the document
31
+ - Open with the proposed change, the review questions, and the trade-offs the reviewer must judge
32
+ - Use the worked journey to show who does what and where the proposal changes today's flow
33
+ - Use `examples/design-doc/acstack/` as the worked example
34
+
35
+ ## Author entry and element files
36
+
37
+ - Default new project designs to `.acstack/designs/<id>/design.yaml`, unless the user chooses another location
38
+ - Keep the entry and its referenced files in one directory tree
39
+ - Use stable IDs matching `[a-zA-Z][a-zA-Z0-9_-]{0,79}`
40
+ - Give the entry `id`, `name`, `summary`, and an `elements` array of relative YAML paths
41
+ - Optionally add `detail` with a relative Markdown path for the overview and worked journey
42
+ - Give each element `id`, `name`, `summary`, and `kind`
43
+ - Write each summary as a standalone responsibility, not a code fragment or a list of implementation steps
44
+ - Keep peer elements at comparable levels of abstraction
45
+ - Reuse element names in the overview, relationships, and detail; connect readable names to code identifiers when they differ
46
+ - Model only real entities; the document overview is context, not an architecture node
47
+ - Choose `kind` from `actor`, `component`, `store`, or `external-system`
48
+ - An actor participates from outside the system, such as a person or an external autonomous agent
49
+ - An agent built into the system is a component
50
+ - Use optional `parent` only for genuine containment, not dependencies or shared concerns
51
+ - Each component represents one entity, shown as either a collapsed card or an expanded container, never both
52
+ - Keep relationships across containers explicit rather than inventing a shared owner
53
+ - Let nesting express containment without a duplicate "Contains" or "Embeds" arrow
54
+ - Do not draw an arrow between an ancestor and its descendant; nesting already expresses containment
55
+ - Show interactions between the responsible components rather than between a container and its contents
56
+ - Use optional `detail` to reference supporting Markdown
57
+ - Repository paths and other source metadata are optional context in that Markdown, not prerequisites for a design
58
+ - Use optional `channels` for zero or more software interfaces
59
+ - Allowed values: `web`, `mobile`, `desktop`, `cli`, `agent`, `email`, `sms`, and `voice`
60
+ - A web app, CLI, or agent can be its own component
61
+ - Put interface labels on the software that provides them, not on an actor because that actor uses them
62
+ - Channels describe access to software; channels do not replace elements
63
+ - Declare each relationship identically in both endpoint files under `relationships`
64
+ - Include `id`, `from`, `to`, `direction`, and `label`
65
+ - Choose `direction` from `one-way` or `bidirectional`
66
+ - Keep canonical `from` and `to` identical in both copies, including bidirectional relationships
67
+ - Read every arrow as source → verb → target: `Checkout CLI → Reads → Order files`
68
+ - Use the acting entity as `from`; reading files points from the reader to the store, not along the returned data
69
+ - Keep that action convention consistent throughout the document
70
+ - Use separate arrows when opposite actions need different labels
71
+ - Use `bidirectional` only when the same label accurately describes both directions, not merely because a workflow includes feedback
72
+ - Keep kind, concern, and channel separate: what an entity is, what requirement spans entities, and how interactions occur
73
+ - Put cross-element requirements in the entry's optional `concerns` array
74
+ - Include `id`, `name`, `elements`, `requirement`, and `response`
75
+ - Name at least two affected element IDs
76
+ - Explain both the requirement and the design response in meaningful prose
77
+ - The viewer shows these explanations in each affected element's drawer
78
+
79
+ ```yaml
80
+ id: checkout-design
81
+ name: Checkout design
82
+ summary: The checkout CLI reads orders from a local store.
83
+ elements: [checkout.yaml, orders.yaml]
84
+ concerns:
85
+ - id: local-data
86
+ name: Local data
87
+ elements: [checkout, orders]
88
+ requirement: Orders must stay on the developer's machine.
89
+ response: The CLI reads local files without a network service.
90
+ ```
91
+
92
+ ```yaml
93
+ # checkout.yaml
94
+ id: checkout
95
+ name: Checkout CLI
96
+ summary: Inspects locally stored orders.
97
+ kind: component
98
+ channels: [cli]
99
+ relationships:
100
+ - id: read-orders
101
+ from: checkout
102
+ to: orders
103
+ direction: one-way
104
+ label: Reads
105
+ ```
106
+
107
+ ```yaml
108
+ # orders.yaml
109
+ id: orders
110
+ name: Order files
111
+ summary: Persist the orders inspected by the checkout CLI.
112
+ kind: store
113
+ relationships:
114
+ - id: read-orders
115
+ from: checkout
116
+ to: orders
117
+ direction: one-way
118
+ label: Reads
119
+ ```
120
+
121
+ ## Validate and start review
122
+
123
+ ```sh
124
+ ~/.claude/acstack/bin/acstack design-doc path/to/design.yaml \
125
+ --markdown /tmp/design-review.md
126
+ ```
127
+
128
+ - Keep the command running while the reviewer works
129
+ - Open the printed localhost URL when the browser and agent share a device
130
+ - On separate devices, run the printed SSH forwarding command from the browser's device, then open the localhost URL
131
+ - Use `--port <port>` when another review already uses the default port
132
+ - Use a new Markdown path to protect existing files
133
+ - Keep Markdown beside source files when its relative source links must resolve on GitHub
134
+ - Generate the companion from the same YAML and supporting Markdown; revise the source instead of hand-editing its Mermaid
135
+ - Fix validation errors before asking the user to review
136
+ - Keep each source file within 256 KiB and the document within 4 MiB
137
+ - Keep the document within 200 elements, 100 concerns, and 200 relationships per element
138
+ - Referenced paths cannot escape the entry directory, including through symlinks
139
+
140
+ ## Review the design and saved feedback
141
+
142
+ - Review through the running server rather than an exported HTML file
143
+ - Read the document overview and worked journey separately from the architecture entities
144
+ - Select elements to read their responsibilities, types, channels, and concern explanations
145
+ - Check that each entity appears once, whether collapsed or expanded
146
+ - Inspect both collapsed and expanded views at a readable zoom
147
+ - Keep related elements close, with consistent padding around their group
148
+ - Reserve room for labels without spreading unrelated groups apart
149
+ - Compare width, height, and text readability; a smaller area alone can hide a taller diagram
150
+ - Read every relationship aloud as source → verb → target
151
+ - Inspect containment and crosscutting relationships before reviewing implementation detail
152
+ - Answer the opening review questions and discuss the stated trade-offs
153
+ - Review the generated Markdown companion on GitHub when useful
154
+ - GitHub publication remains separate from the live comment connection
155
+ - Use human feedback as the clarity loop; code tests do not establish whether the explanation makes sense
156
+ - Choose Send to agent to finish pending saves and copy the feedback prompt
157
+ - Copy the displayed prompt manually if the browser denies clipboard access
158
+ - Paste the prompt into the agent's chat to request revisions
159
+ - Read the prompt's `review.json` file and authored design entry
160
+ - Resolve comment targets against the authored design to recover names and context
161
+ - Use the developer's comments as requests to revise the design
162
+ - Retry a failed save before closing the review
163
+ - Preserve local edits when the server reports a conflicting revision
164
+ - Edit the authored files following feedback, then restart the review for the changed design
165
+ - Keep earlier feedback with its original design version rather than silently moving comments to changed text
166
+ - Comments do not approve a design or authorize implementation
167
+ - Approval records the exact authored source, ordered saved comments, and current map contributions
168
+
169
+ ## Reconcile and approve a map-linked design
170
+
171
+ - Invoke this workflow from map for shared behavior, component boundaries, or data-flow decisions
172
+ - Store `Design entry: <repository-relative-path>` in the map root body
173
+ - Add `planning: {tracker: files | github, map: <name>}` to the entry
174
+ - Use the same contribution format in files and GitHub node bodies
175
+ - Put one fenced JSON array under `## Design contributions`
176
+
177
+ ```json
178
+ [
179
+ {
180
+ "id": "interface-choice",
181
+ "designId": "checkout-design",
182
+ "targets": ["checkout"],
183
+ "statement": "The checkout component exposes the command interface"
184
+ }
185
+ ]
186
+ ```
187
+
188
+ - Use document, element, relationship, or concern IDs as targets
189
+ - Read `~/.claude/acstack/bin/acstack design-review status <entry>` for contribution keys and the exact revision tuple
190
+ - Select older feedback with `--review-file <canonical-review.json>` when the source changed
191
+ - Preserve the selected historical snapshot; reconciliation belongs to the current revision
192
+ - Resolve blocking decision nodes or mark them out of scope
193
+ - Surface contradictory proposals as decision nodes rather than choosing one silently
194
+ - Write reconciliation input with the four status fields: `sourceRevision`, `reviewRevision`, `commentsDigest`, and `mapInputsDigest`
195
+ - Add a `decisions` array with `comments`, `contributions`, `outcome`, and nonempty `rationale` in each decision
196
+ - Reference each selected comment index and current contribution key exactly once
197
+ - Choose `applied`, `retained`, or `needs-human`; `needs-human` keeps approval blocked
198
+ - Run `~/.claude/acstack/bin/acstack design-review reconcile <entry> --input <json-file>` with the same optional `--review-file`
199
+ - Empty feedback and contribution sets need no invented reconciliation
200
+ - Reopen `~/.claude/acstack/bin/acstack design-doc <entry>` after authored source changes
201
+ - Choose Approve this revision in the document details after reconciliation
202
+ - Keep unposted drafts intact; approval saves only posted comment edits
203
+ - Require `approval.valid: true` from status before implementation
204
+ - Reopen the gate after authored source, saved feedback, or meaningful contribution inputs change
205
+ - Presentation regeneration alone preserves approval
206
+ - Keep `workflow.design_review` unchanged; it controls the separate frontend design pass
207
+
208
+ ## Import legacy review history explicitly
209
+
210
+ - ACStack removes `map --map` and `align-viewer` without aliases
211
+ - Author the new design first; the old planning graph cannot define its architecture
212
+ - Keep map planning in `node walk`, `node frontier`, and `node diagram`
213
+ - Use a nonsymlink legacy directory under `.acstack/alignment-packs/`
214
+ - Write an explicit JSON mapping array of `{from: {type, id}, to: {type, id}}` pairs
215
+ - Map every commented legacy target to a valid current target
216
+ - Choose document context explicitly when a legacy target is ambiguous
217
+
218
+ ```sh
219
+ ~/.claude/acstack/bin/acstack design-review migrate <entry> \
220
+ --legacy-dir <path> --mapping <json-file> [--feedback <json-file>]
221
+ ```
222
+
223
+ - Supply `--feedback` only for an explicit exported feedback JSON file
224
+ - Migration reads saved pack versions, approvals, annotations, and the corresponding main-checkout decision log
225
+ - Migration preserves original artifacts and decision logs byte-for-byte
226
+ - Canonical `review.json` retains imported history, source fingerprints, and original comments, quotes, authors, timestamps, and provenance
227
+ - Imported comments append to existing feedback; duplicate source comments import once
228
+ - Historical approval remains history, never current approval
229
+ - An actual import advances the comment revision once and invalidates prior effective approval
230
+ - Repeating the same source and mapping imports nothing again
231
+ - Invalid inputs fail before any write; publication uses the canonical review lock
232
+ - Reconcile imported feedback and obtain current exact-revision approval before implementation or archive
233
+ - Never migrate automatically at startup or archive
234
+ - Retain design sources, canonical reviews, import history, and decision logs independently of `workflow.maps.persist`
235
+ - Respect native Git ignore rules; never force-add private review records