create-issflow 1.0.0 → 1.0.3

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 (28) hide show
  1. package/README.md +56 -41
  2. package/bin/cli.js +259 -96
  3. package/package.json +28 -23
  4. package/template/.claude/agents/debugger.md +47 -47
  5. package/template/.claude/agents/e2e-runner.md +66 -56
  6. package/template/.claude/agents/implementer.md +75 -75
  7. package/template/.claude/agents/planner.md +71 -65
  8. package/template/.claude/agents/researcher.md +103 -103
  9. package/template/.claude/agents/synthesizer.md +72 -72
  10. package/template/.claude/agents/test-author.md +70 -70
  11. package/template/.claude/commands/log-decision.md +33 -33
  12. package/template/.claude/commands/log-issue.md +28 -28
  13. package/template/.claude/commands/overview.md +99 -98
  14. package/template/.claude/commands/phase.md +202 -191
  15. package/template/.claude/commands/quick.md +30 -30
  16. package/template/.claude/commands/replan.md +63 -63
  17. package/template/.claude/commands/store-wisdom.md +195 -194
  18. package/template/.claude/commands/synthesize.md +26 -26
  19. package/template/.claude/commands/unstuck.md +40 -40
  20. package/template/.claude/hooks/pre-compact.sh +25 -25
  21. package/template/.claude/hooks/session-start.sh +120 -120
  22. package/template/.claude/hooks/subagent-stop.sh +11 -11
  23. package/template/.claude/istartsoft-flow/METHODOLOGY.md +229 -214
  24. package/template/.claude/skills/caveman/SKILL.md +39 -39
  25. package/template/.claude/skills/grill-me/SKILL.md +10 -10
  26. package/template/.claude/skills/karpathy-guidelines/SKILL.md +34 -34
  27. package/template/.claude/skills/ux-design/SKILL.md +99 -0
  28. package/template/.claude/skills/ux-design/wireframe-template.md +95 -0
@@ -1,194 +1,195 @@
1
- ---
2
- description: Promote resolved issues and research findings from this project to the shared istartsoft-flow-kb repo. Analyzes, proposes candidates for your review, then pushes approved entries.
3
- ---
4
-
5
- Caveman ULTRA mode. You are the ORCHESTRATOR.
6
-
7
- Purpose: share what this project learned with all future projects.
8
- Only resolved issues and completed research qualify. Open issues do NOT.
9
-
10
- ---
11
-
12
- ## PRE-FLIGHT
13
-
14
- 1. Read `.claude/kb-config.json`.
15
- - Not found -> STOP. Tell me: "KB not configured. Run setup.sh to set up the
16
- shared KB repo, then retry /store-wisdom."
17
- - Found -> extract `kb_path` and `kb_remote`.
18
-
19
- 2. Expand `kb_path` (resolve `~` to home directory).
20
- Verify the path exists and is a git repo (`git -C <path> status`).
21
- - Fails -> STOP. Tell me the path is broken and to re-run setup.sh.
22
-
23
- ---
24
-
25
- ## STEP 1 — PULL LATEST KB
26
-
27
- Run: `git -C <kb_path> pull --ff-only`
28
-
29
- - Success -> continue.
30
- - Conflict or diverged -> STOP. Tell me:
31
- "KB has a conflict. Resolve manually in <kb_path>, then retry /store-wisdom."
32
- - Offline (no network) -> WARN me, ask: "KB pull failed (offline?). Continue
33
- with local KB copy, or abort?" Wait for answer.
34
-
35
- ---
36
-
37
- ## STEP 2 — ANALYZE LOCAL PROJECT
38
-
39
- Scan this project for promotion candidates:
40
-
41
- ### From docs/ISSUES.md — resolved issues only
42
- - Read all entries marked `- [x] resolved`.
43
- - Exclude: entries with no root cause filled in, entries without a solution.
44
- - For each qualifying entry, note: title, symptom, root cause, solution,
45
- failed attempts.
46
-
47
- ### From docs/research/ — completed research files
48
- - Read docs/research/INDEX.md. For each entry:
49
- - Read the corresponding file.
50
- - A research entry qualifies if: it documents an external service behavior,
51
- API contract, SDK gotcha, architectural constraint, or cost finding that
52
- would be useful in a different project.
53
- - A research entry does NOT qualify if: it is a project-specific config
54
- finding, a one-off trace with no generalizable conclusion, or a debug
55
- trace (`debug-*.md`).
56
- - Note: research entries get a `created:` timestamp (today's date if not
57
- already present in the file). Staleness is measured from this date.
58
-
59
- ### Cross-check against KB
60
- - Read `<kb_path>/INDEX.md` (if it exists).
61
- - For each candidate: does a matching slug already exist in the KB?
62
- - YES, fresh entry: skip (already in KB, not stale).
63
- - YES, stale entry (marked [STALE] in the snapshot): flag as REWRITE candidate.
64
- - NO: flag as NEW candidate.
65
-
66
- ---
67
-
68
- ## STEP 3 — PROPOSE CANDIDATES
69
-
70
- Present candidates one at a time. For each:
71
- ```
72
-
73
- [N of M] <type: NEW | REWRITE> — <slug>
74
- Tags: <tag1, tag2, tag3>
75
- Action: <“new entry” | “replaces stale entry from YYYY-MM-DD”>
76
-
77
- ## Preview:
78
-
79
- ## [<slug>]
80
-
81
- ## created: <YYYY-MM-DD>
82
- tags: <tags>
83
- symptom/context: <…>
84
- root-cause / finding: <…>
85
- fix / recommendation: <…>
86
-
87
- [APPROVE / EDIT / SKIP]
88
-
89
- ```
90
- - APPROVE: add to approved list.
91
- - EDIT: ask me for the edit, apply it, re-show, wait for APPROVE or SKIP.
92
- - SKIP: discard this candidate.
93
-
94
- After all candidates: show me the summary:
95
- ```
96
-
97
- Approved: <N> entries
98
- Skipped: <M> entries
99
- Domains to write: <list>
100
- New domain folders to create: <list or “none”>
101
- Proceed? [yes / abort]
102
-
103
- ```
104
- Wait for "yes" before writing anything.
105
-
106
- ---
107
-
108
- ## STEP 4 — WRITE TO KB
109
-
110
- For each approved entry:
111
-
112
- 1. Determine the domain file path: `<kb_path>/<domain>/<file>.md`
113
- - If the directory does not exist: create it.
114
- - If the file does not exist: create it with a `# <domain> — <file>` header.
115
-
116
- 2. REWRITE candidates: find the existing `## [<slug>]` block in the file and
117
- replace it entirely with the new entry.
118
-
119
- 3. NEW candidates: append the entry to the end of the domain file.
120
-
121
- 4. Update `<kb_path>/INDEX.md`:
122
- - For NEW entries: append a line:
123
- `YYYY-MM-DD | <domain>/<file> | <slug> | <one-sentence summary>`
124
- - For REWRITE entries: update the existing line in-place (new date, same slug).
125
-
126
- 5. If this is the first `/store-wisdom` run (no INDEX.md existed):
127
- Also create `<kb_path>/KB_GUIDE.md` with the entry format reference:
128
-
129
- ```markdown
130
- # istartsoft-flow-kb — guide
131
-
132
- This repo accumulates resolved issues and research findings from iStartSoftFlow projects.
133
- Populated by `/store-wisdom`. Read by the iStartSoftFlow `researcher` agent at session start.
134
-
135
- ## Entry format — issues
136
- ## [slug]
137
- created: YYYY-MM-DD
138
- tags: tag1, tag2
139
- symptom: what was observed
140
- root-cause: the real underlying cause
141
- fix: exact solution
142
- failed-attempts: what did not work
143
-
144
- ## Entry format — research
145
- ## [slug]
146
- created: YYYY-MM-DD
147
- tags: tag1, tag2
148
- symptom/context: what prompted the research
149
- finding: what was discovered
150
- recommendation: what to do
151
-
152
- ## INDEX.md format
153
- YYYY-MM-DD | domain/file | slug | one-sentence summary
154
-
155
- ## Staleness
156
- Research entries older than 6 months are flagged [STALE] at session load.
157
- Stale entries are re-researched locally and rewritten via /store-wisdom.
158
- Issue entries never go stale.
159
- ```
160
-
161
- -----
162
-
163
- ## STEP 5 — COMMIT AND PUSH
164
-
165
- Run from `<kb_path>`:
166
-
167
- ```bash
168
- git add -A
169
- git commit -m "store-wisdom: <N> entries from <project-name> (<YYYY-MM-DD>)"
170
- git push
171
- ```
172
-
173
- - Push success -> tell me:
174
-
175
- ```
176
- KB updated.
177
- - entries written: <N> (<list of slugs>)
178
- - domains touched: <list>
179
- - new domains created: <list or "none">
180
- - pushed to: <kb_remote>
181
- ```
182
- - Push fails -> tell me the push failed, show the git error.
183
- The entries ARE written locally — tell me to push manually:
184
- `git -C <kb_path> push`
185
-
186
- -----
187
-
188
- ## NOTES
189
-
190
- - `/store-wisdom` never modifies docs/ISSUES.md or docs/research/ in this project.
191
- It reads them; it does not change them.
192
- - If there are no qualifying candidates, tell me so and stop. Do not push an empty commit.
193
- - The KB is append-only except for REWRITE of stale research entries.
194
- Issue entries are never deleted or overwritten they are facts.
1
+ ---
2
+ description: Promote resolved issues and research findings from this project to the shared istartsoft-flow-kb repo. Analyzes, proposes candidates for your review, then pushes approved entries.
3
+ ---
4
+
5
+ Caveman ULTRA mode. You are the ORCHESTRATOR.
6
+
7
+ Purpose: share what this project learned with all future projects.
8
+ Only resolved issues and completed research qualify. Open issues do NOT.
9
+
10
+ ---
11
+
12
+ ## PRE-FLIGHT
13
+
14
+ 1. Read `.claude/kb-config.json`.
15
+ - Not found -> STOP. Tell me: "KB not configured. Create `.claude/kb-config.json`
16
+ with `kb_path` + `kb_remote` pointing at the shared KB repo, then retry /store-wisdom."
17
+ - Found -> extract `kb_path` and `kb_remote`.
18
+
19
+ 2. Expand `kb_path` (resolve `~` to home directory).
20
+ Verify the path exists and is a git repo (`git -C <path> status`).
21
+ - Fails -> STOP. Tell me the path is broken and to fix `kb_path` in
22
+ `.claude/kb-config.json`.
23
+
24
+ ---
25
+
26
+ ## STEP 1 — PULL LATEST KB
27
+
28
+ Run: `git -C <kb_path> pull --ff-only`
29
+
30
+ - Success -> continue.
31
+ - Conflict or diverged -> STOP. Tell me:
32
+ "KB has a conflict. Resolve manually in <kb_path>, then retry /store-wisdom."
33
+ - Offline (no network) -> WARN me, ask: "KB pull failed (offline?). Continue
34
+ with local KB copy, or abort?" Wait for answer.
35
+
36
+ ---
37
+
38
+ ## STEP 2 — ANALYZE LOCAL PROJECT
39
+
40
+ Scan this project for promotion candidates:
41
+
42
+ ### From docs/ISSUES.md resolved issues only
43
+ - Read all entries marked `- [x] resolved`.
44
+ - Exclude: entries with no root cause filled in, entries without a solution.
45
+ - For each qualifying entry, note: title, symptom, root cause, solution,
46
+ failed attempts.
47
+
48
+ ### From docs/research/ completed research files
49
+ - Read docs/research/INDEX.md. For each entry:
50
+ - Read the corresponding file.
51
+ - A research entry qualifies if: it documents an external service behavior,
52
+ API contract, SDK gotcha, architectural constraint, or cost finding that
53
+ would be useful in a different project.
54
+ - A research entry does NOT qualify if: it is a project-specific config
55
+ finding, a one-off trace with no generalizable conclusion, or a debug
56
+ trace (`debug-*.md`).
57
+ - Note: research entries get a `created:` timestamp (today's date if not
58
+ already present in the file). Staleness is measured from this date.
59
+
60
+ ### Cross-check against KB
61
+ - Read `<kb_path>/INDEX.md` (if it exists).
62
+ - For each candidate: does a matching slug already exist in the KB?
63
+ - YES, fresh entry: skip (already in KB, not stale).
64
+ - YES, stale entry (marked [STALE] in the snapshot): flag as REWRITE candidate.
65
+ - NO: flag as NEW candidate.
66
+
67
+ ---
68
+
69
+ ## STEP 3 — PROPOSE CANDIDATES
70
+
71
+ Present candidates one at a time. For each:
72
+ ```
73
+
74
+ [N of M] <type: NEW | REWRITE> — <slug>
75
+ Tags: <tag1, tag2, tag3>
76
+ Action: <“new entry” | “replaces stale entry from YYYY-MM-DD”>
77
+
78
+ ## Preview:
79
+
80
+ ## [<slug>]
81
+
82
+ ## created: <YYYY-MM-DD>
83
+ tags: <tags>
84
+ symptom/context: <…>
85
+ root-cause / finding: <…>
86
+ fix / recommendation: <…>
87
+
88
+ [APPROVE / EDIT / SKIP]
89
+
90
+ ```
91
+ - APPROVE: add to approved list.
92
+ - EDIT: ask me for the edit, apply it, re-show, wait for APPROVE or SKIP.
93
+ - SKIP: discard this candidate.
94
+
95
+ After all candidates: show me the summary:
96
+ ```
97
+
98
+ Approved: <N> entries
99
+ Skipped: <M> entries
100
+ Domains to write: <list>
101
+ New domain folders to create: <list or “none”>
102
+ Proceed? [yes / abort]
103
+
104
+ ```
105
+ Wait for "yes" before writing anything.
106
+
107
+ ---
108
+
109
+ ## STEP 4 — WRITE TO KB
110
+
111
+ For each approved entry:
112
+
113
+ 1. Determine the domain file path: `<kb_path>/<domain>/<file>.md`
114
+ - If the directory does not exist: create it.
115
+ - If the file does not exist: create it with a `# <domain> — <file>` header.
116
+
117
+ 2. REWRITE candidates: find the existing `## [<slug>]` block in the file and
118
+ replace it entirely with the new entry.
119
+
120
+ 3. NEW candidates: append the entry to the end of the domain file.
121
+
122
+ 4. Update `<kb_path>/INDEX.md`:
123
+ - For NEW entries: append a line:
124
+ `YYYY-MM-DD | <domain>/<file> | <slug> | <one-sentence summary>`
125
+ - For REWRITE entries: update the existing line in-place (new date, same slug).
126
+
127
+ 5. If this is the first `/store-wisdom` run (no INDEX.md existed):
128
+ Also create `<kb_path>/KB_GUIDE.md` with the entry format reference:
129
+
130
+ ```markdown
131
+ # istartsoft-flow-kb — guide
132
+
133
+ This repo accumulates resolved issues and research findings from iStartSoftFlow projects.
134
+ Populated by `/store-wisdom`. Read by the iStartSoftFlow `researcher` agent at session start.
135
+
136
+ ## Entry format — issues
137
+ ## [slug]
138
+ created: YYYY-MM-DD
139
+ tags: tag1, tag2
140
+ symptom: what was observed
141
+ root-cause: the real underlying cause
142
+ fix: exact solution
143
+ failed-attempts: what did not work
144
+
145
+ ## Entry format — research
146
+ ## [slug]
147
+ created: YYYY-MM-DD
148
+ tags: tag1, tag2
149
+ symptom/context: what prompted the research
150
+ finding: what was discovered
151
+ recommendation: what to do
152
+
153
+ ## INDEX.md format
154
+ YYYY-MM-DD | domain/file | slug | one-sentence summary
155
+
156
+ ## Staleness
157
+ Research entries older than 6 months are flagged [STALE] at session load.
158
+ Stale entries are re-researched locally and rewritten via /store-wisdom.
159
+ Issue entries never go stale.
160
+ ```
161
+
162
+ -----
163
+
164
+ ## STEP 5 — COMMIT AND PUSH
165
+
166
+ Run from `<kb_path>`:
167
+
168
+ ```bash
169
+ git add -A
170
+ git commit -m "store-wisdom: <N> entries from <project-name> (<YYYY-MM-DD>)"
171
+ git push
172
+ ```
173
+
174
+ - Push success -> tell me:
175
+
176
+ ```
177
+ KB updated.
178
+ - entries written: <N> (<list of slugs>)
179
+ - domains touched: <list>
180
+ - new domains created: <list or "none">
181
+ - pushed to: <kb_remote>
182
+ ```
183
+ - Push fails -> tell me the push failed, show the git error.
184
+ The entries ARE written locally — tell me to push manually:
185
+ `git -C <kb_path> push`
186
+
187
+ -----
188
+
189
+ ## NOTES
190
+
191
+ - `/store-wisdom` never modifies docs/ISSUES.md or docs/research/ in this project.
192
+ It reads them; it does not change them.
193
+ - If there are no qualifying candidates, tell me so and stop. Do not push an empty commit.
194
+ - The KB is append-only except for REWRITE of stale research entries.
195
+ Issue entries are never deleted or overwritten — they are facts.
@@ -1,26 +1,26 @@
1
- ---
2
- description: Compress handoff docs, dedup the issue log, prune snapshots. Run before /clear.
3
- ---
4
-
5
- Caveman ULTRA mode.
6
-
7
- Trigger: end of a phase, or any time STATE.md / ISSUES.md feel bloated.
8
-
9
- Dispatch the `synthesizer` subagent.
10
-
11
- For a normal phase: it rewrites STATE.md, dedups ISSUES.md, prunes snapshots,
12
- appends to HISTORY.md.
13
-
14
- For the FINAL phase (no further pending phases): also pass the signal
15
- "FINAL PHASE" so the synthesizer runs the extended pass — updating OVERVIEW.md
16
- and README.md to reflect the completed project state.
17
-
18
- To determine if this is the final phase: read docs/PLAN.md. If no phases remain
19
- with status "pending" after the current one, it is the final phase.
20
-
21
- When synthesizer returns "safe to /clear: yes", tell me:
22
- - before/after line counts
23
- - whether the final-pass ran
24
- - that I can now run /clear (or proceed to the endpoint summary if final phase)
25
-
26
- If it returns anything unsafe, show me what and stop.
1
+ ---
2
+ description: Compress handoff docs, dedup the issue log, prune snapshots. Run before /clear.
3
+ ---
4
+
5
+ Caveman ULTRA mode.
6
+
7
+ Trigger: end of a phase, or any time STATE.md / ISSUES.md feel bloated.
8
+
9
+ Dispatch the `synthesizer` subagent.
10
+
11
+ For a normal phase: it rewrites STATE.md, dedups ISSUES.md, prunes snapshots,
12
+ appends to HISTORY.md.
13
+
14
+ For the FINAL phase (no further pending phases): also pass the signal
15
+ "FINAL PHASE" so the synthesizer runs the extended pass — updating OVERVIEW.md
16
+ and README.md to reflect the completed project state.
17
+
18
+ To determine if this is the final phase: read docs/PLAN.md. If no phases remain
19
+ with status "pending" after the current one, it is the final phase.
20
+
21
+ When synthesizer returns "safe to /clear: yes", tell me:
22
+ - before/after line counts
23
+ - whether the final-pass ran
24
+ - that I can now run /clear (or proceed to the endpoint summary if final phase)
25
+
26
+ If it returns anything unsafe, show me what and stop.
@@ -1,40 +1,40 @@
1
- ---
2
- description: Forced re-research after a circuit breaker. Stops flailing, re-routes to deep research with full memory of dead ends.
3
- ---
4
-
5
- Caveman ULTRA mode.
6
-
7
- Trigger: I chose "re-research" at a circuit breaker (see /phase step 5).
8
-
9
- Steps:
10
-
11
- 1. WRITE IT DOWN. Append to docs/ISSUES.md as OPEN:
12
- ```
13
-
14
- ### <error title>
15
-
16
- - [ ] open - stuck after 3 attempts
17
- - symptom: <…>
18
- - attempts that FAILED: <hypothesis 1>, <2>, <3>
19
-
20
- ```
21
- Reference the existing debug-<slug>.md.
22
-
23
- 2. RESET FRAME. The 3 failed hypotheses are probably all wrong. Discard them.
24
-
25
- 3. DEEP RESEARCH. Dispatch `researcher` in IMPL mode WIDE:
26
- - Read existing debug-<slug>.md and ISSUES.md failed-attempts FIRST.
27
- - Re-read the actual error from scratch.
28
- - Check real external service contract / docs.
29
- - Look one layer below: config? env? version? data shape?
30
- - Return fresh HYPOTHESIS backed by NEW evidence.
31
-
32
- 4. RE-PLAN if needed. Research shows phase design was wrong -> dispatch planner.
33
-
34
- 5. RESUME. Hand fresh hypothesis to `debugger`. It reads the prior debug file
35
- (already knows what's ruled out). Budget = 3, NEW hypotheses only.
36
-
37
- 6. This counts as the path chosen at the first breaker. If STUCK again ->
38
- /phase step 5 SECOND STUCK. Do not loop further.
39
-
40
- Report each step.
1
+ ---
2
+ description: Forced re-research after a circuit breaker. Stops flailing, re-routes to deep research with full memory of dead ends.
3
+ ---
4
+
5
+ Caveman ULTRA mode.
6
+
7
+ Trigger: I chose "re-research" at a circuit breaker (see /phase step 5).
8
+
9
+ Steps:
10
+
11
+ 1. WRITE IT DOWN. Append to docs/ISSUES.md as OPEN:
12
+ ```
13
+
14
+ ### <error title>
15
+
16
+ - [ ] open - stuck after 3 attempts
17
+ - symptom: <…>
18
+ - attempts that FAILED: <hypothesis 1>, <2>, <3>
19
+
20
+ ```
21
+ Reference the existing debug-<slug>.md.
22
+
23
+ 2. RESET FRAME. The 3 failed hypotheses are probably all wrong. Discard them.
24
+
25
+ 3. DEEP RESEARCH. Dispatch `researcher` in IMPL mode WIDE:
26
+ - Read existing debug-<slug>.md and ISSUES.md failed-attempts FIRST.
27
+ - Re-read the actual error from scratch.
28
+ - Check real external service contract / docs.
29
+ - Look one layer below: config? env? version? data shape?
30
+ - Return fresh HYPOTHESIS backed by NEW evidence.
31
+
32
+ 4. RE-PLAN if needed. Research shows phase design was wrong -> dispatch planner.
33
+
34
+ 5. RESUME. Hand fresh hypothesis to `debugger`. It reads the prior debug file
35
+ (already knows what's ruled out). Budget = 3, NEW hypotheses only.
36
+
37
+ 6. This counts as the path chosen at the first breaker. If STUCK again ->
38
+ /phase step 5 SECOND STUCK. Do not loop further.
39
+
40
+ Report each step.
@@ -1,25 +1,25 @@
1
- #!/usr/bin/env bash
2
- # PreCompact hook. Fires before auto/manual /compact.
3
- set -euo pipefail
4
- cd "${CLAUDE_PROJECT_DIR:-.}"
5
-
6
- mkdir -p docs/.snapshots
7
- STAMP=$(date +%Y%m%d-%H%M%S)
8
- SNAP="docs/.snapshots/precompact-${STAMP}.md"
9
-
10
- {
11
- echo "# Pre-compact snapshot ${STAMP}"
12
- echo
13
- echo "## Git"
14
- git status --short 2>/dev/null || true
15
- git diff --stat 2>/dev/null || true
16
- echo
17
- echo "## STATE.md at compact time"
18
- [ -f docs/STATE.md ] && cat docs/STATE.md || echo "(no STATE.md)"
19
- } > "$SNAP"
20
-
21
- ls -1t docs/.snapshots/precompact-*.md 2>/dev/null | tail -n +6 | xargs -r rm -f
22
-
23
- echo "Context was compacted. Recovery snapshot saved at ${SNAP}."
24
- echo "STATE.md and ISSUES.md were re-injected by the SessionStart hook - trust those."
25
- exit 0
1
+ #!/usr/bin/env bash
2
+ # PreCompact hook. Fires before auto/manual /compact.
3
+ set -euo pipefail
4
+ cd "${CLAUDE_PROJECT_DIR:-.}"
5
+
6
+ mkdir -p docs/.snapshots
7
+ STAMP=$(date +%Y%m%d-%H%M%S)
8
+ SNAP="docs/.snapshots/precompact-${STAMP}.md"
9
+
10
+ {
11
+ echo "# Pre-compact snapshot ${STAMP}"
12
+ echo
13
+ echo "## Git"
14
+ git status --short 2>/dev/null || true
15
+ git diff --stat 2>/dev/null || true
16
+ echo
17
+ echo "## STATE.md at compact time"
18
+ [ -f docs/STATE.md ] && cat docs/STATE.md || echo "(no STATE.md)"
19
+ } > "$SNAP"
20
+
21
+ ls -1t docs/.snapshots/precompact-*.md 2>/dev/null | tail -n +6 | xargs -r rm -f
22
+
23
+ echo "Context was compacted. Recovery snapshot saved at ${SNAP}."
24
+ echo "STATE.md and ISSUES.md were re-injected by the SessionStart hook - trust those."
25
+ exit 0