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.
- package/README.md +2 -2
- package/dist/migrate.d.ts +3 -1
- package/dist/migrate.js +23 -1
- package/dist/setup.js +7 -0
- package/package.json +1 -1
- package/stacks/_shared/agents/claude-md-compactor.md +38 -4
- package/stacks/_shared/agents/commit-manager.md +100 -36
- package/stacks/_shared/agents/documenter.md +11 -6
- package/stacks/_shared/agents/domain-updater.md +107 -42
- package/stacks/_shared/commands/commit-mine.md +78 -0
- package/stacks/_shared/commands/feature.md +4 -2
- package/stacks/_shared/commands/fix.md +6 -4
- package/stacks/_shared/hooks/_state.README.md +2 -2
- package/stacks/_shared/hooks/_state.ts +25 -9
- package/stacks/_shared/hooks/pre-tool-use.ts +6 -5
- package/stacks/_shared/hooks/scope.ts +478 -0
- package/stacks/_shared/hooks/session-start.ts +3 -2
- package/stacks/_shared/hooks/stop-validator.ts +79 -14
- package/stacks/_shared/hooks/user-prompt-submit.ts +12 -4
- package/stacks/_shared/skills/git-workflow/SKILL.md +1 -1
- package/stacks/_shared/skills/hook-development/SKILL.md +5 -1
- package/stacks/_shared/skills/multi-instance-coordination/SKILL.md +5 -5
- package/templates/CLAUDE-default.md +8 -4
- package/templates/CLAUDE-nodejs.md +14 -10
- package/templates/CLAUDE-php.md +14 -10
- package/templates/CLAUDE-python.md +23 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @sv-version: 1.
|
|
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. "##
|
|
166
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
| <
|
|
27
|
-
|
|
|
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 (<
|
|
44
|
-
| any | idle (
|
|
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 (
|
|
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
|
-
##
|
|
3
|
+
## Recent Changes
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
##
|
|
5
|
+
## Recent Changes
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 |
|
|
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.
|
|
102
|
-
2. **Other sections** document HOW things work NOW
|
|
103
|
-
3. **Both must be current** —
|
|
104
|
-
4.
|
|
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
|
-
|
|
|
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
|
|
package/templates/CLAUDE-php.md
CHANGED
|
@@ -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
|
-
##
|
|
5
|
+
## Recent Changes
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 |
|
|
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.
|
|
152
|
-
2. **Other sections** document HOW things work NOW
|
|
153
|
-
3. **Both must be current** —
|
|
154
|
-
4.
|
|
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) —
|
|
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
|
-
##
|
|
5
|
+
## Recent Changes
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 |
|
|
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
|
-
###
|
|
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
|
-
##
|
|
231
|
+
## Recent Changes
|
|
232
|
+
|
|
233
|
+
<!-- APPEND-ONLY LIFO ... (HTML comment, do NOT edit) -->
|
|
226
234
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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 |
|