start-vibing-stacks 2.25.2 → 2.28.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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @sv-version: 1.1.0
2
+ // @sv-version: 1.2.0
3
3
  /**
4
4
  * UserPromptSubmit Hook — Start Vibing Stacks
5
5
  *
@@ -9,6 +9,10 @@
9
9
  * from the first prompt (matches `claude --resume`), drain the inbox so
10
10
  * peer messages reach the user before this turn runs, and warn if active
11
11
  * peers exist.
12
+ *
13
+ * v1.2.0: workflow guidance now points at `## Recent Changes` (append-only LIFO)
14
+ * instead of `## Last Change` (overwritten). Aligned with `commit-manager` v3.0.0
15
+ * and `domain-updater` v3.0.0 — multi-instance safe.
12
16
  */
13
17
 
14
18
  import { existsSync, readFileSync } from 'fs';
@@ -159,11 +163,15 @@ async function main(): Promise<void> {
159
163
 
160
164
  3. Run quality gates: ${qualityCmd}
161
165
 
162
- 4. COMMIT using conventional commits via commit-manager agent.
166
+ 4. COMMIT using conventional commits via commit-manager agent (v3.0.0+: stages only THIS session's files via scope.ts when .claude/state/ exists — peers' uncommitted files are never bundled).
163
167
 
164
168
  5. UPDATE CLAUDE.md:
165
- a. "## Last Change" (date: ${today}, branch, summary)
166
- b. Update ALL affected rule/flow sections
169
+ a. PREPEND a new entry under "## Recent Changes" heading exactly:
170
+ "### ${today} · <branch> · <version-or-tag>" followed by 1-4 plain-text lines.
171
+ Append-only LIFO; cap 10 (drop ONLY the oldest if exceeded). Multi-instance safe.
172
+ Triggered automatically by domain-updater v3.0.0; do it manually only if running outside the chain.
173
+ b. Update ALL affected rule/flow sections (Critical Rules, FORBIDDEN, NRY) when the change
174
+ modifies how the project works.
167
175
 
168
176
  6. Run stop-validator before finishing.${standardsContext}${peersBlock}`;
169
177
 
@@ -123,7 +123,7 @@ End state in **both flows**: clean tree, on `main`, in sync with `origin/main`.
123
123
  - [ ] Quality gate passed (typecheck / lint / tests / build)
124
124
  - [ ] Security gate passed (`security-auditor` clean)
125
125
  - [ ] No secrets in diff (gitleaks)
126
- - [ ] CLAUDE.md `Last Change` updated when scope warrants it
126
+ - [ ] CLAUDE.md `## Recent Changes` updated (PREPEND a new `### YYYY-MM-DD · branch · vX.Y.Z` block — append-only LIFO, cap 10; `domain-updater` v3.0.0+ does this automatically post-commit)
127
127
  - [ ] Conventional commit message drafted
128
128
  - [ ] Push target confirmed (`origin main` vs `origin feature/*`)
129
129
 
@@ -221,7 +221,11 @@ const issues: string[] = [];
221
221
 
222
222
  if (dirty) issues.push(`GIT_TREE_NOT_CLEAN: ${dirty.split('\n').length} file(s)`);
223
223
  if (existsSync('CLAUDE.md') &&
224
- !readFileSync('CLAUDE.md', 'utf8').includes('Last Change')) issues.push('CLAUDE_MD_NOT_UPDATED');
224
+ !/^## (Last Change|Recent Changes)/m.test(readFileSync('CLAUDE.md', 'utf8'))) {
225
+ // Accepts the legacy `## Last Change` (single, overwritten) OR `## Recent Changes`
226
+ // (append-only LIFO, multi-instance safe — see claude-md-compactor §6.1).
227
+ issues.push('CLAUDE_MD_NOT_UPDATED');
228
+ }
225
229
 
226
230
  const result = issues.length === 0
227
231
  ? { continue: false, decision: 'approve', reason: 'All checks passed' }
@@ -23,8 +23,8 @@ Every hook updates `lastSeenAt` (heartbeat). Thresholds:
23
23
 
24
24
  | Age of last activity | State | Effect |
25
25
  | -------------------- | -------- | ---------------------------------------------------------------------- |
26
- | < 60s | active | Counts for collision detection; PreToolUse may BLOCK Edit/Write. |
27
- | 60s – 30min | idle | Surfaced as a warning; edits NOT blocked. |
26
+ | < 180s | active | Counts for collision detection; PreToolUse may BLOCK Edit/Write. |
27
+ | 180s – 30min | idle | Surfaced as a warning; edits NOT blocked. |
28
28
  | > 30min | stale | Auto-archived on the next sweep. |
29
29
  | > 24h | removed | Deleted entirely. |
30
30
 
@@ -40,12 +40,12 @@ Every hook updates `lastSeenAt` (heartbeat). Thresholds:
40
40
 
41
41
  | Peer who touched the same file last | Peer's heartbeat | Touch age | Decision |
42
42
  | ----------------------------------- | ---------------- | --------- | --------------------------------------------- |
43
- | any | active (<60s) | < 5min | **BLOCK** with a recovery hint |
44
- | any | idle (60s–30min) | < 5min | APPROVE + warning in `systemMessage` |
43
+ | any | active (<180s) | < 5min | **BLOCK** with a recovery hint |
44
+ | any | idle (180s–30min)| < 5min | APPROVE + warning in `systemMessage` |
45
45
  | any | stale or gone | any | APPROVE silently |
46
46
  | no peer touched the file | n/a | n/a | APPROVE silently |
47
47
 
48
- Override path: wait until the active peer's heartbeat goes idle (60s of no activity), then retry — the hook will downgrade to a warning. If the user explicitly tells you to override, ask them to run `peers notify <id> "I'm taking over <file>"` first so the other instance gets the heads-up.
48
+ Override path: wait until the active peer's heartbeat goes idle (180s of no activity), then retry — the hook will downgrade to a warning. If the user explicitly tells you to override, ask them to run `peers notify <id> "I'm taking over <file>"` first so the other instance gets the heads-up.
49
49
 
50
50
  ## Talking to a peer
51
51
 
@@ -1,10 +1,14 @@
1
1
  # {{PROJECT_NAME}}
2
2
 
3
- ## Last Change
3
+ ## Recent Changes
4
4
 
5
- **Branch:** main
6
- **Date:** {{DATE}}
7
- **Summary:** Initial project setup with start-vibing-stacks
5
+ <!-- APPEND-ONLY LIFO. Each Claude instance PREPENDS a new `### YYYY-MM-DD · branch · vX.Y.Z` heading
6
+ + 1-4 lines below it. Drop only the OLDEST entry when count > 10. NEVER edit a peer's entry.
7
+ `domain-updater` v3.0.0+ does this automatically post-commit.
8
+ Compactor (`claude-md-compactor.md §5-§6`) enforces the cap, not the prepend. -->
9
+
10
+ ### {{DATE}} · main · v0.1.0
11
+ Initial project setup with start-vibing-stacks.
8
12
 
9
13
  ## 30 Seconds Overview
10
14
 
@@ -2,11 +2,15 @@
2
2
 
3
3
  > **CHARACTER LIMIT**: Max 40,000 chars. Validate with `wc -m CLAUDE.md` before commit.
4
4
 
5
- ## Last Change
5
+ ## Recent Changes
6
6
 
7
- **Branch:** main
8
- **Date:** {{DATE}}
9
- **Summary:** Initial project setup with start-vibing-stacks (Node.js)
7
+ <!-- APPEND-ONLY LIFO. Each Claude instance PREPENDS a new `### YYYY-MM-DD · branch · vX.Y.Z` heading
8
+ + 1-4 lines below it. Drop only the OLDEST entry when count > 10. NEVER edit a peer's entry.
9
+ `domain-updater` v3.0.0+ does this automatically post-commit.
10
+ Compactor (`claude-md-compactor.md §5-§6`) enforces the cap, not the prepend. -->
11
+
12
+ ### {{DATE}} · main · v0.1.0
13
+ Initial project setup with start-vibing-stacks (Node.js).
10
14
 
11
15
  ## 30 Seconds Overview
12
16
 
@@ -90,7 +94,7 @@ project/
90
94
 
91
95
  | Change Type | Sections to Update |
92
96
  |-------------|-------------------|
93
- | Any file change | Last Change (branch, date, summary) |
97
+ | Any file change | PREPEND new entry to `## Recent Changes` (heading: `### YYYY-MM-DD · branch · vX.Y.Z` + 1-4 lines) |
94
98
  | API/routes | Critical Rules, Architecture |
95
99
  | UI components | Architecture, Component Organization |
96
100
  | New feature | 30s Overview, Architecture |
@@ -98,10 +102,10 @@ project/
98
102
  | New dependency | Stack |
99
103
  | Workflow change | Workflow section |
100
104
 
101
- 1. **Last Change** documents WHAT was done
102
- 2. **Other sections** document HOW things work NOW
103
- 3. **Both must be current** — updating only Last Change is insufficient
104
- 4. Keep only the LATEST Last Change entry (no stacking)
105
+ 1. **`## Recent Changes`** documents WHAT was done across recent sessions (append-only LIFO, cap 10).
106
+ 2. **Other sections** document HOW things work NOW.
107
+ 3. **Both must be current** — prepending to Recent Changes is insufficient if rule sections went stale.
108
+ 4. **APPEND-ONLY** — PREPEND your entry below the HTML comment anchor; drop only the OLDEST entry when count > 10. NEVER edit a peer's entry, NEVER collapse two entries into one. Multi-instance safe by construction.
105
109
 
106
110
  ## Agent System
107
111
 
@@ -247,7 +251,7 @@ source: 'listed' as const; // CORRECT (literal type)
247
251
  | Skip todo list creation | Loses track of tasks |
248
252
  | Skip documenter agent | Documentation is mandatory |
249
253
  | Skip domain documentation | MUST update domains/*.md |
250
- | Stack Last Change entries | Keep only the LATEST |
254
+ | Overwrite `## Recent Changes` or collapse entries | PREPEND only; drop oldest when > 10 (NEVER edit peer entries) |
251
255
  | Use MUI/Chakra | Use shadcn/ui + Radix |
252
256
  | Skip CLAUDE.md update | MUST update after implementations |
253
257
 
@@ -2,11 +2,15 @@
2
2
 
3
3
  > **CHARACTER LIMIT**: Max 40,000 chars. Validate with `wc -m CLAUDE.md` before commit.
4
4
 
5
- ## Last Change
5
+ ## Recent Changes
6
6
 
7
- **Branch:** main
8
- **Date:** {{DATE}}
9
- **Summary:** Initial project setup with start-vibing-stacks (PHP — API-first React SPA)
7
+ <!-- APPEND-ONLY LIFO. Each Claude instance PREPENDS a new `### YYYY-MM-DD · branch · vX.Y.Z` heading
8
+ + 1-4 lines below it. Drop only the OLDEST entry when count > 10. NEVER edit a peer's entry.
9
+ `domain-updater` v3.0.0+ does this automatically post-commit.
10
+ Compactor (`claude-md-compactor.md §5-§6`) enforces the cap, not the prepend. -->
11
+
12
+ ### {{DATE}} · main · v0.1.0
13
+ Initial project setup with start-vibing-stacks (PHP — API-first React SPA).
10
14
 
11
15
  ## 30 Seconds Overview
12
16
 
@@ -141,17 +145,17 @@ project/
141
145
 
142
146
  | Change Type | Sections to Update |
143
147
  |-------------|-------------------|
144
- | Any file change | Last Change (branch, date, summary) |
148
+ | Any file change | PREPEND new entry to `## Recent Changes` (heading: `### YYYY-MM-DD · branch · vX.Y.Z` + 1-4 lines) |
145
149
  | API/routes | Critical Rules, Architecture |
146
150
  | New feature | 30s Overview, Architecture |
147
151
  | New gotcha | FORBIDDEN or NRY |
148
152
  | New dependency | Stack |
149
153
  | Workflow change | Workflow section |
150
154
 
151
- 1. **Last Change** documents WHAT was done
152
- 2. **Other sections** document HOW things work NOW
153
- 3. **Both must be current** — updating only Last Change is insufficient
154
- 4. Keep only the LATEST Last Change entry (no stacking)
155
+ 1. **`## Recent Changes`** documents WHAT was done across recent sessions (append-only LIFO, cap 10).
156
+ 2. **Other sections** document HOW things work NOW.
157
+ 3. **Both must be current** — prepending to Recent Changes is insufficient if rule sections went stale.
158
+ 4. **APPEND-ONLY** — PREPEND your entry below the HTML comment anchor; drop only the OLDEST entry when count > 10. NEVER edit a peer's entry, NEVER collapse two entries into one. Multi-instance safe by construction.
155
159
 
156
160
  ## Critical Rules
157
161
 
@@ -372,7 +376,7 @@ $results = DB::select('SELECT * FROM users WHERE id = ?', [$id]);
372
376
  3. IMPLEMENT → Bottom-up: FormRequest+Policy → Service → Resource → Controller → Route → React page
373
377
  4. TEST → PHPUnit feature tests (happy + 401 + 403 + 422); React: api.test.ts
374
378
  5. DOCUMENT → documenter agent for modified files; update domain docs
375
- 6. UPDATE → Update THIS FILE (CLAUDE.md) — Last Change + relevant sections
379
+ 6. UPDATE → Update THIS FILE (CLAUDE.md) — PREPEND entry to ## Recent Changes (LIFO) + refresh relevant rule sections
376
380
  7. QUALITY → PHPStan + PHPUnit + PHP-CS-Fixer + tsc + eslint
377
381
  8. COMMIT → Conventional commits; merge to main
378
382
  ```
@@ -2,11 +2,15 @@
2
2
 
3
3
  > **CHARACTER LIMIT**: Max 40,000 chars. Validate with `wc -m CLAUDE.md` before commit.
4
4
 
5
- ## Last Change
5
+ ## Recent Changes
6
6
 
7
- **Branch:** main
8
- **Date:** {{DATE}}
9
- **Summary:** Initial project setup with start-vibing-stacks (Python)
7
+ <!-- APPEND-ONLY LIFO. Each Claude instance PREPENDS a new `### YYYY-MM-DD · branch · vX.Y.Z` heading
8
+ + 1-4 lines below it. Drop only the OLDEST entry when count > 10. NEVER edit a peer's entry.
9
+ `domain-updater` v3.0.0+ does this automatically post-commit.
10
+ Compactor (`claude-md-compactor.md §5-§6`) enforces the cap, not the prepend. -->
11
+
12
+ ### {{DATE}} · main · v0.1.0
13
+ Initial project setup with start-vibing-stacks (Python).
10
14
 
11
15
  ## 30 Seconds Overview
12
16
 
@@ -213,22 +217,31 @@ pytest --tb=short # Tests (MUST pass)
213
217
 
214
218
  | Change Type | What to Update |
215
219
  |-------------|----------------|
216
- | Any file change | Last Change section |
220
+ | Any file change | PREPEND new entry to `## Recent Changes` (LIFO, cap 10) |
217
221
  | New feature | 30s Overview, Architecture if needed |
218
222
  | New pattern | Add to relevant section |
219
223
  | Gotcha discovered | Add to FORBIDDEN or NRY |
220
224
  | New dependency | Update Stack table |
221
225
 
222
- ### Last Change Format (MANDATORY)
226
+ ### Recent Changes Format (MANDATORY)
227
+
228
+ Each new entry is a `###` block PREPENDED below the HTML comment anchor. Multi-instance safe by construction (append-only LIFO, cap 10).
223
229
 
224
230
  ```markdown
225
- ## Last Change
231
+ ## Recent Changes
232
+
233
+ <!-- APPEND-ONLY LIFO ... (HTML comment, do NOT edit) -->
226
234
 
227
- **Branch:** feature/example
228
- **Date:** YYYY-MM-DD
229
- **Summary:** 1-2 sentences describing WHAT and WHY.
235
+ ### YYYY-MM-DD · feature/example · v0.2.0
236
+ 1-4 plain-text lines describing WHAT and WHY. Inline `code` allowed for agent/skill/file names.
237
+ No bullets, no nested headers, no horizontal rules.
238
+
239
+ ### YYYY-MM-DD · main · v0.1.0
240
+ (previous entry below — never edit a peer's entry)
230
241
  ```
231
242
 
243
+ `domain-updater` v3.0.0+ does the prepend automatically post-commit. Drop only the OLDEST `### ` block when count exceeds 10. NEVER reorder middle entries; NEVER collapse two entries into one.
244
+
232
245
  ## Agent System
233
246
 
234
247
  | Agent | Purpose |