catalyst-os 1.1.1 → 1.3.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 (35) hide show
  1. package/.catalyst/bin/validate-artifacts.js +213 -0
  2. package/.catalyst/main/project-config.yaml +3 -0
  3. package/.catalyst/spec-structure.yaml +4 -4
  4. package/.claude/agents/alchemist.md +29 -1
  5. package/.claude/agents/arbiter.md +1 -1
  6. package/.claude/agents/enforcer.md +26 -0
  7. package/.claude/agents/forge-master.md +22 -1
  8. package/.claude/agents/inquisitor.md +20 -3
  9. package/.claude/agents/shaper.md +29 -1
  10. package/.claude/agents/smith.md +29 -1
  11. package/.claude/commands/build-spec-worktree.md +19 -0
  12. package/.claude/commands/build-spec.md +12 -0
  13. package/.claude/commands/commit-spec.md +20 -0
  14. package/.claude/commands/{reject-spec.md → discard-spec.md} +9 -9
  15. package/.claude/commands/iterate-spec.md +10 -0
  16. package/.claude/commands/primer-spec.md +23 -13
  17. package/.claude/commands/review-spec.md +29 -0
  18. package/.claude/commands/status-spec.md +20 -12
  19. package/.claude/hooks/post-edit-format.sh +62 -0
  20. package/.claude/hooks/pre-compact-save.sh +98 -0
  21. package/.claude/rules/coding-standards.md +21 -0
  22. package/.claude/rules/git-workflow.md +25 -0
  23. package/.claude/rules/security.md +23 -0
  24. package/.claude/settings.json +15 -0
  25. package/.claude/settings.local.json +5 -3
  26. package/.claude/skills/build-orchestration/SKILL.md +39 -8
  27. package/.claude/skills/spec-approval/SKILL.md +3 -3
  28. package/.claude/skills/spec-iteration/SKILL.md +6 -4
  29. package/.claude/skills/spec-shaping/SKILL.md +1 -1
  30. package/.claude/skills/spec-validation/SKILL.md +10 -6
  31. package/.claude/skills/using-skills/SKILL.md +2 -2
  32. package/README.md +9 -9
  33. package/package.json +3 -2
  34. package/.claude/commands/approve-spec.md +0 -22
  35. package/.claude/commands/validate-spec.md +0 -17
@@ -2,6 +2,20 @@
2
2
 
3
3
  Quickly load spec context into a fresh conversation.
4
4
 
5
+ ## Pre-computed Context
6
+
7
+ ```bash
8
+ # Git state
9
+ echo "=== BRANCH ===" && git branch --show-current
10
+ echo "=== STATUS ===" && git status --short
11
+ echo "=== RECENT COMMITS ===" && git log --oneline -5
12
+
13
+ # Spec files
14
+ echo "=== TASKS.MD ===" && cat .catalyst/specs/*$ARGUMENTS*/tasks.md 2>/dev/null || echo "No tasks.md for: $ARGUMENTS"
15
+ echo "=== SPEC FRONTMATTER ===" && head -30 .catalyst/specs/*$ARGUMENTS*/spec.md 2>/dev/null || echo "No spec.md"
16
+ echo "=== RESEARCH ===" && head -30 .catalyst/specs/*$ARGUMENTS*/research.md 2>/dev/null || echo "No research.md"
17
+ ```
18
+
5
19
  ---
6
20
 
7
21
  ## Purpose
@@ -26,22 +40,18 @@ When you start a new conversation (context was full), use this command to:
26
40
 
27
41
  ## What To Do
28
42
 
29
- ### Step 1: Read Spec Files
43
+ ### Step 1: Use Pre-computed Context
30
44
 
31
- Read these files from `.catalyst/specs/{slug}/`:
45
+ The bash blocks above already loaded tasks.md, spec frontmatter, research, and git state. Use this data directly — do NOT re-read these files unless you need more detail beyond what was loaded.
32
46
 
33
- ```
34
- 1. spec.md → What is this feature? Requirements?
35
- 2. tasks.md → What's done? What's pending? What's in progress?
36
- 3. research.md → (if exists) Any key technical decisions?
37
- ```
47
+ ### Step 2: Read Full Files Only If Needed
38
48
 
39
- ### Step 2: Check Git State
49
+ If the pre-computed context was truncated, read the full file:
40
50
 
41
- ```bash
42
- git branch --show-current # What branch are we on?
43
- git status --short # Any uncommitted changes?
44
- git log --oneline -3 # Recent commits?
51
+ ```
52
+ 1. tasks.md → What's done? What's pending? What's in progress?
53
+ 2. spec.md → What is this feature? Requirements?
54
+ 3. research.md → (if exists) Any key technical decisions?
45
55
  ```
46
56
 
47
57
  ### Step 3: Output Brief Summary
@@ -146,7 +156,7 @@ Ready to continue. What would you like to work on?
146
156
  |-----------|---------|
147
157
  | Context full, need to continue building | `/primer-spec` |
148
158
  | Want to add improvement mid-build | `/iterate-spec` |
149
- | Need full validation | `/validate-spec` |
159
+ | Need full validation | `/review-spec` |
150
160
  | Check status without loading context | `/status-spec` |
151
161
 
152
162
  ---
@@ -0,0 +1,29 @@
1
+ # /review-spec
2
+
3
+ Run validation checks and code simplification on a completed implementation.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ /review-spec @2025-11-29-stripe-integration
9
+ ```
10
+
11
+ ## Pre-computed Context
12
+
13
+ ```bash
14
+ # Build state for validation
15
+ echo "=== BRANCH ===" && git branch --show-current
16
+ echo "=== STATUS ===" && git status --short
17
+ echo "=== TASKS.MD PROGRESS ===" && grep -A 5 "## Progress" .catalyst/specs/*$ARGUMENTS*/tasks.md 2>/dev/null || echo "No tasks.md"
18
+ echo "=== SPEC STATUS ===" && head -20 .catalyst/specs/*$ARGUMENTS*/spec.md 2>/dev/null || echo "No spec.md"
19
+ echo "=== DIFF STAT VS BASE ===" && git diff --stat main...HEAD 2>/dev/null || echo "No diff from main"
20
+ echo "=== FILES CHANGED ===" && git diff --name-only main...HEAD 2>/dev/null || echo "No changes from main"
21
+ ```
22
+
23
+ ---
24
+
25
+ **Invoke skill:** `spec-validation`
26
+
27
+ **Orchestrator:** Arbiter (delegates to Enforcer, Sentinel, Inquisitor, Watcher)
28
+
29
+ **Process skills used:** `verification-before-completion`, `agent-delegation`, `test-driven-development`
@@ -8,6 +8,19 @@ Check the current status of a spec and sync progress with reality.
8
8
  /status-spec @2025-11-29-stripe-integration
9
9
  ```
10
10
 
11
+ ## Pre-computed Context
12
+
13
+ ```bash
14
+ # Current git state
15
+ echo "=== BRANCH ===" && git branch --show-current
16
+ echo "=== STATUS ===" && git status --short
17
+ echo "=== DIFF STAT ===" && git diff --stat
18
+ echo "=== RECENT COMMITS ===" && git log --oneline -10
19
+ echo "=== SPEC FILES ===" && ls .catalyst/specs/*$ARGUMENTS*/ 2>/dev/null || echo "No spec found for: $ARGUMENTS"
20
+ echo "=== TASKS.MD ===" && cat .catalyst/specs/*$ARGUMENTS*/tasks.md 2>/dev/null | head -80 || echo "No tasks.md"
21
+ echo "=== SPEC STATUS ===" && head -20 .catalyst/specs/*$ARGUMENTS*/spec.md 2>/dev/null || echo "No spec.md"
22
+ ```
23
+
11
24
  ---
12
25
 
13
26
  ## Purpose
@@ -18,13 +31,15 @@ Resume work on a spec after being away. This command:
18
31
  3. Syncs tasks.md with reality
19
32
  4. Gives you a clear "where we are" summary
20
33
 
34
+ Use the pre-computed context above — do NOT re-run these commands. Only run additional commands if specific details are missing.
35
+
21
36
  ---
22
37
 
23
38
  ## Workflow
24
39
 
25
40
  ### Phase 1: Read Spec State
26
41
 
27
- Read all spec files:
42
+ Read all spec files (use pre-computed context first, read full files only if needed):
28
43
  - `spec.md` → Feature overview, requirements, status
29
44
  - `tasks.md` → Task breakdown, marked progress
30
45
  - `research.md` → Context and decisions made
@@ -32,18 +47,11 @@ Read all spec files:
32
47
 
33
48
  ### Phase 2: Check Git Reality
34
49
 
35
- Run git commands to see actual state:
50
+ Use pre-computed git context. Only run additional commands if needed:
36
51
 
37
52
  ```bash
38
- # What files are modified but not committed?
39
- git status --short
40
-
41
- # What's the diff for uncommitted work?
42
- git diff --stat
43
-
44
- # Recent commits related to this spec
53
+ # Additional detail if needed
45
54
  git log --oneline -10 --grep="{slug}"
46
- git log --oneline -10 -- "src/" "lib/" "app/" # Recent code commits
47
55
  ```
48
56
 
49
57
  ### Phase 3: Reconcile Tasks
@@ -234,9 +242,9 @@ VALIDATION STATUS
234
242
 
235
243
  NEXT STEPS
236
244
  ----------
237
- 1. Complete validation: /validate-spec @slug
245
+ 1. Complete validation: /review-spec @slug
238
246
  2. Review handoff.md when ready
239
- 3. Approve: /approve-spec @slug
247
+ 3. Commit: /commit-spec @slug
240
248
  ```
241
249
 
242
250
  ---
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ # PostToolUse hook: Auto-format files after Edit/Write operations
3
+ # Runs the project's formatter on changed code files.
4
+ # Always exits 0 — formatting is advisory, never blocks.
5
+
6
+ set -euo pipefail
7
+
8
+ FILE_PATH="${1:-}"
9
+
10
+ # Skip if no file path provided or file doesn't exist
11
+ [[ -z "$FILE_PATH" || ! -f "$FILE_PATH" ]] && exit 0
12
+
13
+ # Get file extension
14
+ EXT="${FILE_PATH##*.}"
15
+
16
+ # Skip non-code files
17
+ case "$EXT" in
18
+ md|txt|yaml|yml|json|lock|log|csv|svg|png|jpg|gif|ico|woff|woff2|ttf|eot)
19
+ exit 0
20
+ ;;
21
+ esac
22
+
23
+ # Find project root (where package.json or .git lives)
24
+ PROJECT_ROOT="$(cd "$(dirname "$FILE_PATH")" && git rev-parse --show-toplevel 2>/dev/null || echo "")"
25
+ [[ -z "$PROJECT_ROOT" ]] && exit 0
26
+
27
+ # --- Formatter detection (first match wins) ---
28
+
29
+ # Biome
30
+ if [[ -f "$PROJECT_ROOT/biome.json" || -f "$PROJECT_ROOT/biome.jsonc" ]]; then
31
+ if command -v npx &>/dev/null; then
32
+ npx --yes @biomejs/biome format --write "$FILE_PATH" 2>/dev/null || true
33
+ exit 0
34
+ fi
35
+ fi
36
+
37
+ # Prettier
38
+ if [[ -f "$PROJECT_ROOT/.prettierrc" || -f "$PROJECT_ROOT/.prettierrc.json" || -f "$PROJECT_ROOT/.prettierrc.js" || -f "$PROJECT_ROOT/.prettierrc.yaml" || -f "$PROJECT_ROOT/.prettierrc.yml" || -f "$PROJECT_ROOT/prettier.config.js" || -f "$PROJECT_ROOT/prettier.config.mjs" ]]; then
39
+ if command -v npx &>/dev/null; then
40
+ npx --yes prettier --write "$FILE_PATH" 2>/dev/null || true
41
+ exit 0
42
+ fi
43
+ fi
44
+
45
+ # Check package.json for prettier as dependency (common case: no .prettierrc but prettier installed)
46
+ if [[ -f "$PROJECT_ROOT/package.json" ]] && grep -q '"prettier"' "$PROJECT_ROOT/package.json" 2>/dev/null; then
47
+ if command -v npx &>/dev/null; then
48
+ npx --yes prettier --write "$FILE_PATH" 2>/dev/null || true
49
+ exit 0
50
+ fi
51
+ fi
52
+
53
+ # --- TypeScript type-check (non-blocking) ---
54
+ case "$EXT" in
55
+ ts|tsx)
56
+ if [[ -f "$PROJECT_ROOT/tsconfig.json" ]] && command -v npx &>/dev/null; then
57
+ npx --yes tsc --noEmit 2>/dev/null || true
58
+ fi
59
+ ;;
60
+ esac
61
+
62
+ exit 0
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env bash
2
+ # PreCompact hook: Auto-save current state to tasks.md before context compaction
3
+ # Ensures /primer-spec always has accurate resume info, even if agents forgot to update.
4
+ # Always exits 0 — state saving should never block compaction.
5
+
6
+ set -euo pipefail
7
+
8
+ # Find project root
9
+ PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo "")"
10
+ [[ -z "$PROJECT_ROOT" ]] && exit 0
11
+
12
+ # --- Detect active spec from branch name ---
13
+ BRANCH="$(git branch --show-current 2>/dev/null || echo "")"
14
+ SLUG=""
15
+
16
+ # Extract slug from branch: feat/YYYY-MM-DD-slug or feat/slug
17
+ if [[ "$BRANCH" =~ ^[^/]+/(.+)$ ]]; then
18
+ SLUG="${BASH_REMATCH[1]}"
19
+ fi
20
+
21
+ [[ -z "$SLUG" ]] && exit 0
22
+
23
+ # --- Find matching tasks.md ---
24
+ TASKS_FILE=""
25
+
26
+ # Try exact match first
27
+ for dir in "$PROJECT_ROOT"/.catalyst/specs/*-"$SLUG"; do
28
+ if [[ -f "$dir/tasks.md" ]]; then
29
+ TASKS_FILE="$dir/tasks.md"
30
+ break
31
+ fi
32
+ done
33
+
34
+ # Try broader match if exact didn't work
35
+ if [[ -z "$TASKS_FILE" ]]; then
36
+ for dir in "$PROJECT_ROOT"/.catalyst/specs/*"$SLUG"*; do
37
+ if [[ -f "$dir/tasks.md" ]]; then
38
+ TASKS_FILE="$dir/tasks.md"
39
+ break
40
+ fi
41
+ done
42
+ fi
43
+
44
+ [[ -z "$TASKS_FILE" ]] && exit 0
45
+
46
+ # --- Build state snapshot ---
47
+ TIMESTAMP="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
48
+ GIT_STATUS="$(git status --short 2>/dev/null | head -20 || echo "unknown")"
49
+ MODIFIED_COUNT="$(git status --short 2>/dev/null | wc -l | tr -d ' ' || echo "0")"
50
+
51
+ STATE_BLOCK="**Phase:** (check Progress table above)
52
+ **Timestamp:** $TIMESTAMP
53
+ **Branch:** $BRANCH
54
+ **Modified files:** $MODIFIED_COUNT
55
+ **Auto-saved:** Yes (PreCompact hook)
56
+
57
+ \`\`\`
58
+ $GIT_STATUS
59
+ \`\`\`
60
+
61
+ > Resume with \`/primer-spec @$SLUG\` in a new conversation."
62
+
63
+ # --- Update Current Session section ---
64
+ # Replace existing Current Session content, or append if missing
65
+ if grep -q "^## Current Session" "$TASKS_FILE" 2>/dev/null; then
66
+ # Find the line number of "## Current Session" and the next "##" heading
67
+ SESSION_LINE="$(grep -n "^## Current Session" "$TASKS_FILE" | head -1 | cut -d: -f1)"
68
+ NEXT_HEADING="$(tail -n +"$((SESSION_LINE + 1))" "$TASKS_FILE" | grep -n "^## " | head -1 | cut -d: -f1)"
69
+
70
+ if [[ -n "$NEXT_HEADING" ]]; then
71
+ # There's a section after Current Session — replace between them
72
+ END_LINE="$((SESSION_LINE + NEXT_HEADING - 1))"
73
+ {
74
+ head -n "$SESSION_LINE" "$TASKS_FILE"
75
+ echo ""
76
+ echo -e "$STATE_BLOCK"
77
+ echo ""
78
+ tail -n +"$END_LINE" "$TASKS_FILE"
79
+ } > "${TASKS_FILE}.tmp" && mv "${TASKS_FILE}.tmp" "$TASKS_FILE"
80
+ else
81
+ # Current Session is the last section — replace to end
82
+ {
83
+ head -n "$SESSION_LINE" "$TASKS_FILE"
84
+ echo ""
85
+ echo -e "$STATE_BLOCK"
86
+ } > "${TASKS_FILE}.tmp" && mv "${TASKS_FILE}.tmp" "$TASKS_FILE"
87
+ fi
88
+ else
89
+ # No Current Session section — append it
90
+ {
91
+ echo ""
92
+ echo "## Current Session"
93
+ echo ""
94
+ echo -e "$STATE_BLOCK"
95
+ } >> "$TASKS_FILE"
96
+ fi
97
+
98
+ exit 0
@@ -0,0 +1,21 @@
1
+ # Coding Standards
2
+
3
+ These rules apply to ALL code generation, regardless of which skill is active.
4
+
5
+ ## Language
6
+
7
+ - All generated artifacts MUST be in English (code, comments, docs, commit messages)
8
+ - Communicate with the user in their preferred language
9
+
10
+ ## File Hygiene
11
+
12
+ - Keep files under 300 lines — split if larger
13
+ - No deep nesting (max 3 levels of indentation for logic)
14
+ - One concept per file — don't mix unrelated concerns
15
+
16
+ ## Quality
17
+
18
+ - Write minimal code that solves the current requirement
19
+ - Don't add features, abstractions, or config that wasn't requested
20
+ - Prefer clarity over cleverness
21
+ - Delete dead code — don't comment it out
@@ -0,0 +1,25 @@
1
+ # Git Workflow Rules
2
+
3
+ These rules apply to ALL git operations, regardless of which skill is active.
4
+
5
+ ## Branch Naming
6
+
7
+ - Feature branches: `{branch_prefix}/{spec-slug}` (e.g., `feat/2026-01-11-user-auth`)
8
+ - Read `branch_prefix` from `.catalyst/main/project-config.yaml`
9
+ - Never commit directly to protected branches (`main`, `master`)
10
+
11
+ ## Commit Messages
12
+
13
+ - Red phase: `test({scope}): write failing tests for {spec}`
14
+ - Green phase: `feat({scope}): implement {spec}`
15
+ - Bug fixes: `fix({scope}): description`
16
+ - Refactors: `refactor({scope}): description`
17
+ - Keep subject line under 72 characters
18
+ - Use imperative mood ("add", not "added")
19
+
20
+ ## Operations
21
+
22
+ - Always check `git status` before destructive operations
23
+ - Never force-push to shared branches without user confirmation
24
+ - Prefer creating new commits over amending published ones
25
+ - Stage specific files — avoid `git add -A` which may catch secrets
@@ -0,0 +1,23 @@
1
+ # Security Rules
2
+
3
+ These rules apply to ALL actions, regardless of which skill is active.
4
+
5
+ ## Secrets
6
+
7
+ - **NEVER** commit `.env`, `.env.*`, credentials, API keys, or tokens
8
+ - **NEVER** hardcode secrets in source code — use environment variables
9
+ - Verify `.gitignore` includes `.env*` before any git operations
10
+ - If a secret is accidentally staged, **unstage immediately** and rotate the key
11
+
12
+ ## Dependencies
13
+
14
+ - Do not install packages with known critical CVEs
15
+ - Prefer well-maintained packages with active security practices
16
+ - Pin major versions in production dependencies
17
+
18
+ ## Code
19
+
20
+ - Sanitize all user input at system boundaries
21
+ - Use parameterized queries — never string-concatenate SQL
22
+ - Escape output to prevent XSS
23
+ - Validate file paths to prevent traversal attacks
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PostToolUse": [
4
+ {
5
+ "matcher": "Edit|Write",
6
+ "command": ".claude/hooks/post-edit-format.sh $FILE_PATH"
7
+ }
8
+ ],
9
+ "PreCompact": [
10
+ {
11
+ "command": ".claude/hooks/pre-compact-save.sh"
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -6,8 +6,10 @@
6
6
  "deny": [],
7
7
  "ask": []
8
8
  },
9
+ "enableAllProjectMcpServers": true,
9
10
  "enabledMcpjsonServers": [
10
- "shadcn"
11
- ],
12
- "enableAllProjectMcpServers": true
11
+ "shadcn",
12
+ "supabase-local",
13
+ "exa"
14
+ ]
13
15
  }
@@ -1,7 +1,7 @@
1
1
  # Build Orchestration
2
2
 
3
3
  > **When to invoke:** When implementing a specification using strict TDD.
4
- > **Invoked by:** `/build-spec` command.
4
+ > **Invoked by:** `/build-spec` or `/build-spec-worktree` command.
5
5
  > **Orchestrator:** Forge-Master agent.
6
6
 
7
7
  ## Purpose
@@ -28,7 +28,7 @@ Orchestrate the full build workflow: task breakdown, test writing, foundation, c
28
28
  ├── spec.md # Already exists from /catalyze-spec
29
29
  ├── research.md # Already exists from /catalyze-spec
30
30
  ├── tasks.md # Forger creates (this phase)
31
- ├── validation.md # Arbiter creates (in /validate-spec)
31
+ ├── validation.md # Arbiter creates (in /review-spec)
32
32
  ├── handoff.md # Updated throughout
33
33
  └── assets/
34
34
  ```
@@ -38,8 +38,14 @@ Orchestrate the full build workflow: task breakdown, test writing, foundation, c
38
38
  ```
39
39
  PHASE 0: Setup
40
40
  ├── Read .catalyst/main/project-config.yaml
41
- ├── Checkout to development_branch (default: main)
42
- └── Create branch: {branch_prefix}/{spec-slug}
41
+ ├── IF --worktree flag:
42
+ │ ├── mkdir -p {worktree_path}
43
+ │ ├── git worktree add {worktree_path}/{spec-slug} -b {branch_prefix}/{spec-slug} {development_branch}
44
+ │ ├── cd {worktree_path}/{spec-slug}
45
+ │ └── Record worktree path in spec's handoff.md
46
+ ├── ELSE (default):
47
+ │ ├── Checkout to development_branch (default: main)
48
+ │ └── Create branch: {branch_prefix}/{spec-slug}
43
49
 
44
50
  GATE 1: RED FLAG
45
51
  └── Commit: "test({scope}): write failing tests for {spec}"
@@ -105,9 +111,15 @@ Phase 6: Integration (Enforcer — cross-boundary tests)
105
111
 
106
112
  ### Phase 0: Git Setup
107
113
 
108
- 1. Read `project-config.yaml` for `development_branch` and `branch_prefix`
109
- 2. Checkout development branch and pull
110
- 3. Create spec feature branch: `{branch_prefix}/{spec-slug}`
114
+ 1. Read `project-config.yaml` for `development_branch`, `branch_prefix`, and `worktree_path`
115
+ 2. IF `--worktree` flag (from `/build-spec-worktree`):
116
+ - `mkdir -p {worktree_path}` (default: `.catalyst/worktrees`)
117
+ - `git worktree add {worktree_path}/{spec-slug} -b {branch_prefix}/{spec-slug} {development_branch}`
118
+ - `cd {worktree_path}/{spec-slug}` — all subsequent work happens here
119
+ - Record `worktree: {worktree_path}/{spec-slug}` in the spec's `handoff.md`
120
+ 3. ELSE (default — branch checkout):
121
+ - Checkout development branch and pull
122
+ - Create spec feature branch: `{branch_prefix}/{spec-slug}`
111
123
 
112
124
  ### Phase 1: Task Breakdown (Forger)
113
125
 
@@ -132,6 +144,9 @@ Only AFTER this commit exists may implementation begin.
132
144
  No commit = no implementation. No exceptions.
133
145
  ```
134
146
 
147
+ > **Context checkpoint:** If context is getting long, compact now. All state is in `tasks.md`.
148
+ > Run `/primer-spec @{slug}` in a new conversation to resume.
149
+
135
150
  - Every task has at least one test
136
151
  - All tests executed
137
152
  - All tests FAIL (for the right reasons — missing feature, not import errors)
@@ -139,6 +154,9 @@ No commit = no implementation. No exceptions.
139
154
 
140
155
  ### Phase 3-4: Foundation & Contracts
141
156
 
157
+ > **Context checkpoint:** If context is getting long, compact now. All state is in `tasks.md`.
158
+ > Run `/primer-spec @{slug}` in a new conversation to resume.
159
+
142
160
  Spawn Alchemist (foundation) → WAIT → Spawn Smith (contracts) → WAIT
143
161
 
144
162
  ### Phase 5: Parallel Implementation
@@ -166,8 +184,14 @@ COMMIT: "feat({scope}): implement {spec}"
166
184
  Only AFTER this commit exists may integration begin.
167
185
  ```
168
186
 
187
+ > **Context checkpoint:** If context is getting long, compact now. All state is in `tasks.md`.
188
+ > Run `/primer-spec @{slug}` in a new conversation to resume.
189
+
169
190
  ### Phase 6: Integration
170
191
 
192
+ > **Context checkpoint:** If context is getting long, compact now. All state is in `tasks.md`.
193
+ > Run `/primer-spec @{slug}` in a new conversation to resume.
194
+
171
195
  Spawn Enforcer for cross-boundary integration tests.
172
196
 
173
197
  ## Implementation Rules
@@ -179,13 +203,20 @@ FOR EACH TASK:
179
203
  3. Run test → must PASS
180
204
  4. Refactor if needed
181
205
  5. Run test → must still PASS
182
- 6. Update tasks.md Progress
206
+ 6. Update tasks.md Progress — THE AGENT DOING THE WORK MUST DO THIS
183
207
 
184
208
  NEVER write code without a failing test first
185
209
  NEVER write more code than needed to pass the test
186
210
  NEVER modify files outside your SCOPE
211
+ NEVER report done without updating tasks.md first
187
212
  ```
188
213
 
214
+ ### tasks.md Update Responsibility
215
+
216
+ **Every agent (smith, shaper, alchemist, enforcer) MUST update tasks.md before reporting back.**
217
+ The orchestrator (forge-master) verifies and fills gaps, but agents are the primary updaters.
218
+ This ensures `/primer-spec` always reflects actual progress, even if the orchestrator loses context.
219
+
189
220
  ## Failure Modes
190
221
 
191
222
  | Failure | Action |
@@ -1,7 +1,7 @@
1
1
  # Spec Approval
2
2
 
3
3
  > **When to invoke:** When accepting an implementation and archiving the spec.
4
- > **Invoked by:** `/approve-spec` command.
4
+ > **Invoked by:** `/commit-spec` command.
5
5
 
6
6
  ## Purpose
7
7
 
@@ -15,10 +15,10 @@ Final verification, git commit, spec archival, self-documentation (propagate lea
15
15
  ## Prerequisites — HARD GATES
16
16
 
17
17
  > **This skill is the FINAL step in the spec lifecycle.** It runs ONLY after build and validation are complete.
18
- > **Flow:** `/catalyze-spec` → `/build-spec` → `/validate-spec` → **`/approve-spec`** (you are here)
18
+ > **Flow:** `/catalyze-spec` → `/build-spec` → `/review-spec` → **`/commit-spec`** (you are here)
19
19
  >
20
20
  > If the spec has not been built yet, STOP and tell the user to run `/build-spec` first.
21
- > If the spec has not been validated yet, STOP and tell the user to run `/validate-spec` first.
21
+ > If the spec has not been validated yet, STOP and tell the user to run `/review-spec` first.
22
22
 
23
23
  - `/build-spec` must have been completed (tasks.md exists with completed tasks)
24
24
  - Validation must be complete (`validation.md` must show all checks passed)
@@ -68,9 +68,11 @@ Phase 5: Implement (Smith/Shaper/Alchemist)
68
68
 
69
69
  ### Phase 0: Verify State
70
70
 
71
- 1. Verify on feature branch: `git branch --show-current`
72
- 2. Read existing spec.md and tasks.md
73
- 3. If NOT on feature branch: ask user to checkout or run `/build-spec`
71
+ 1. Check if `.catalyst/worktrees/{spec-slug}` exists
72
+ - IF exists: `cd` into it (worktree mode)
73
+ 2. ELSE: Verify on feature branch: `git branch --show-current`
74
+ 3. Read existing spec.md and tasks.md
75
+ 4. If neither worktree nor feature branch: ask user to run `/build-spec` or `/build-spec-worktree`
74
76
 
75
77
  ### Phase 1: Clarify (Oracle — Optional)
76
78
 
@@ -116,7 +118,7 @@ Spawn appropriate agents (Smith/Shaper/Alchemist) based on task types. Parallel
116
118
 
117
119
  | Failure | Action |
118
120
  |---------|--------|
119
- | Not on feature branch | Checkout or run `/build-spec` first |
121
+ | Not on feature branch | Checkout, run `/build-spec`, or `/build-spec-worktree` first |
120
122
  | Spec not found | Run `/catalyze-spec` first |
121
123
  | tasks.md missing | Run `/build-spec` first |
122
124
  | Improvement conflicts with existing | Spawn Oracle to discuss options |
@@ -178,4 +178,4 @@ Next steps:
178
178
  - Or /iterate-spec if you want changes first
179
179
  ```
180
180
 
181
- **IMPORTANT: Do NOT suggest `/approve-spec` after spec shaping.** `/approve-spec` is only for accepting a fully built and validated implementation — it is the FINAL step, not a plan-approval step. The correct flow is: `/catalyze-spec` → `/build-spec` → `/validate-spec` → `/approve-spec`.
181
+ **IMPORTANT: Do NOT suggest `/commit-spec` after spec shaping.** `/commit-spec` is only for committing a fully built and validated implementation — it is the FINAL step, not a plan-approval step. The correct flow is: `/catalyze-spec` → `/build-spec` → `/review-spec` → `/commit-spec`.
@@ -1,7 +1,7 @@
1
1
  # Spec Validation
2
2
 
3
3
  > **When to invoke:** When running validation checks on a completed implementation.
4
- > **Invoked by:** `/validate-spec` command.
4
+ > **Invoked by:** `/review-spec` command.
5
5
  > **Orchestrator:** Arbiter agent.
6
6
 
7
7
  ## Purpose
@@ -76,10 +76,13 @@ Spawn all Guardians in parallel:
76
76
  - Test user flows
77
77
  - Capture screenshots on failure
78
78
 
79
- **Inquisitor** (Code Quality):
79
+ **Inquisitor** (Code Quality + Simplification):
80
80
  - Run linters
81
81
  - Code review checks
82
82
  - Documentation gaps
83
+ - **Code simplification suggestions** (unnecessary abstractions, over-engineering, dead code, verbose patterns)
84
+ - Simplifications must NOT change behavior — only structure
85
+ - Provide before/after snippets for each suggestion
83
86
 
84
87
  **Watcher** (Security):
85
88
  - Dependency audit
@@ -126,8 +129,9 @@ If all validation passes, create handoff.md with:
126
129
  - Total: N, Passing: N
127
130
 
128
131
  ## Quality Checks
129
- ### Lint (Inquisitor)
130
- - Status: PASS/FAIL, Errors: N, Warnings: N
132
+ ### Lint & Simplification (Inquisitor)
133
+ - Lint Status: PASS/FAIL, Errors: N, Warnings: N
134
+ - Simplification Opportunities: N found
131
135
 
132
136
  ### Security (Watcher)
133
137
  - Dependencies: status
@@ -153,7 +157,7 @@ If all validation passes, create handoff.md with:
153
157
  ```
154
158
  Validation complete!
155
159
  Status: READY FOR APPROVAL
156
- Next: /approve-spec @slug
160
+ Next: /commit-spec @slug
157
161
  ```
158
162
 
159
163
  ### TDD Failure
@@ -167,5 +171,5 @@ Action: Return to /build-spec and follow TDD process
167
171
  ```
168
172
  Validation failed!
169
173
  Failed Checks: [details]
170
- Action: Fix issues and re-run /validate-spec
174
+ Action: Fix issues and re-run /review-spec
171
175
  ```
@@ -44,8 +44,8 @@ Skills tell you HOW. User instructions tell you WHAT.
44
44
  | **spec-shaping** | `.claude/skills/spec-shaping/SKILL.md` | `/catalyze-spec` — shaping a new specification |
45
45
  | **build-orchestration** | `.claude/skills/build-orchestration/SKILL.md` | `/build-spec` — implementing a specification |
46
46
  | **spec-iteration** | `.claude/skills/spec-iteration/SKILL.md` | `/iterate-spec` — updating and continuing a build |
47
- | **spec-validation** | `.claude/skills/spec-validation/SKILL.md` | `/validate-spec` — quality checks on implementation |
48
- | **spec-approval** | `.claude/skills/spec-approval/SKILL.md` | `/approve-spec` — final approval and archival |
47
+ | **spec-validation** | `.claude/skills/spec-validation/SKILL.md` | `/review-spec` — quality checks on implementation |
48
+ | **spec-approval** | `.claude/skills/spec-approval/SKILL.md` | `/commit-spec` — final commit and archival |
49
49
  | **project-initialization** | `.claude/skills/project-initialization/SKILL.md` | `/catalyze-project` — setting up a new project |
50
50
  | **task-building** | `.claude/skills/task-building/SKILL.md` | `/build-task` — building a single task (brownfield) |
51
51
  | **spec-update** | `.claude/skills/spec-update/SKILL.md` | `/update-spec` — modifying an existing spec |