5-phase-workflow 2.1.0 → 3.0.0-beta-2

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.
@@ -14,99 +14,30 @@ You do NOT modify files. You do NOT stage unrelated changes. After reporting the
14
14
 
15
15
  # Commit
16
16
 
17
- ## Inputs
18
-
19
- - Optional short description from the command argument.
20
-
21
17
  Current branch: !`git branch --show-current 2>/dev/null || echo ""`
22
18
  Commit message pattern: !`node -e "try{const c=JSON.parse(require('fs').readFileSync('.5/config.json','utf8'));console.log(c?.git?.commitMessage?.pattern||'{ticket-id} {short-description}')}catch(e){console.log('{ticket-id} {short-description}')}" 2>/dev/null`
23
19
  Ticket pattern: !`node -e "try{const c=JSON.parse(require('fs').readFileSync('.5/config.json','utf8'));const p=c?.ticket?.pattern;console.log(p!=null?p:'(none)')}catch(e){console.log('(none)')}" 2>/dev/null`
24
20
  Extract ticket from branch: !`node -e "try{const c=JSON.parse(require('fs').readFileSync('.5/config.json','utf8'));console.log(c?.ticket?.extractFromBranch!==false)}catch(e){console.log(true)}" 2>/dev/null`
25
21
 
26
- ## Step 1: Inspect Changes
27
-
28
- Run:
29
-
30
- ```bash
31
- git status --short
32
- ```
33
-
34
- If there are no changed files, tell the user "No changes to commit." and stop.
35
-
36
- If there are staged changes, ask whether to commit the currently staged changes or adjust the staged set.
37
-
38
- If there are unstaged or untracked changes, show a concise file list and ask which files should be included. Stage only the selected files with explicit paths. Never use `git add .` or `git add -A`.
39
-
40
- After staging, run:
41
-
42
- ```bash
43
- git diff --cached --stat
44
- git diff --cached --name-only
45
- ```
46
-
47
- If nothing is staged, tell the user "No staged changes to commit." and stop.
48
-
49
- ## Step 2: Resolve Ticket ID
50
-
51
- Use the injected values from the Inputs section:
52
-
53
- - `pattern` = injected commit message pattern.
54
- - `ticketPattern` = injected ticket pattern (`(none)` means no pattern configured).
55
- - `extractFromBranch` = injected extract-ticket-from-branch flag.
56
-
57
- If `extractFromBranch` is true and `ticketPattern` is not `(none)`, match `ticketPattern` against the injected current branch to get `{ticket-id}`. If no match, use an empty string.
58
-
59
- ## Step 3: Get Short Description
60
-
61
- If the user provided a command argument, use it as `{short-description}`.
62
-
63
- Otherwise propose a short description from the staged file names and diff stat, then ask the user to confirm or replace it.
64
-
65
- Keep `{short-description}`:
66
-
67
- - Lowercase unless the project pattern clearly uses another style.
68
- - Under 72 characters when possible.
69
- - Written as an imperative or concise noun phrase, matching existing project commits if obvious.
70
-
71
- ## Step 4: Build Commit Message
72
-
73
- Apply the configured pattern:
74
-
75
- - Replace `{ticket-id}` with the extracted ticket ID or an empty string.
76
- - Replace `{short-description}` with the confirmed short description.
77
- - Trim redundant whitespace.
78
- - If `{ticket-id}` is empty, remove empty conventional wrappers such as `()` and tidy punctuation:
79
- - `feat({ticket-id}): {short-description}` -> `feat: {short-description}`
80
- - `{ticket-id}: {short-description}` -> `{short-description}`
81
- - `{ticket-id} {short-description}` -> `{short-description}`
82
-
83
- Build a commit body from the staged diff when useful:
84
-
85
- - Include 1-5 bullet points summarizing meaningful changes.
86
- - If you know the reason for the change, for example based on the chat history, include the reason in the body.
87
- - Skip the body for very small or self-explanatory commits.
88
- - Do not include raw diff excerpts.
89
-
90
- ## Step 5: Commit
22
+ ## Step 1: Stage
91
23
 
92
- Create the commit using the final subject and optional body.
24
+ Run `git status --short`. With no changed files, say "No changes to commit." and stop.
93
25
 
94
- Use a command form that preserves newlines, for example:
26
+ Ask the user which files to include, then stage only those with explicit paths. **Never use `git add .` or `git add -A`.** If nothing ends up staged, say "No staged changes to commit." and stop.
95
27
 
96
- ```bash
97
- git commit -m "{subject}" -m "{body}"
98
- ```
28
+ ## Step 2: Build the Message
99
29
 
100
- If there is no body:
30
+ Use the injected values above — do not re-read the config.
101
31
 
102
- ```bash
103
- git commit -m "{subject}"
104
- ```
32
+ - If `extractFromBranch` is true and the ticket pattern is not `(none)`, match it against the injected branch to get `{ticket-id}`. No match means an empty string.
33
+ - `{short-description}` is the command argument if given, otherwise propose one from the staged diff and have the user confirm it.
34
+ - Apply the injected commit message pattern, then trim redundant whitespace. When `{ticket-id}` is empty, remove the empty wrapper it leaves behind:
35
+ - `feat({ticket-id}): {short-description}` → `feat: {short-description}`
36
+ - `{ticket-id}: {short-description}` → `{short-description}`
37
+ - `{ticket-id} {short-description}` → `{short-description}`
105
38
 
106
- After committing, run:
39
+ Add a body of 1-5 bullets only when the change is not self-explanatory, including the reason for the change when you know it from the conversation. No raw diff excerpts.
107
40
 
108
- ```bash
109
- git rev-parse --short HEAD
110
- ```
41
+ ## Step 3: Commit
111
42
 
112
- Report the commit SHA and subject.
43
+ Commit with `git commit -m "{subject}"`, adding a second `-m "{body}"` when there is a body. Then report the subject and the output of `git rev-parse --short HEAD`.
@@ -71,14 +71,6 @@ fi
71
71
  **1d. Detect available tools:**
72
72
 
73
73
  ```bash
74
- # CodeRabbit CLI
75
- if command -v coderabbit &> /dev/null; then
76
- coderabbit_available=true
77
- if coderabbit auth status | grep -q "authenticated"; then
78
- coderabbit_authenticated=true
79
- fi
80
- fi
81
-
82
74
  # IDE MCP (JetBrains) - check if MCP tools are available
83
75
 
84
76
  # Context7 - up-to-date documentation MCP server
@@ -165,20 +157,7 @@ If "Cancel": Exit immediately with message "Configuration unchanged."
165
157
  3. "Custom pattern" → free text
166
158
  - Note: "Body will automatically include bullet points of changes."
167
159
 
168
- **2h. Review tool preference:**
169
- - "Which code review tool would you like to use?"
170
- - Options:
171
- 1. "Native (built-in agent review, no setup needed)" — always available, works with any AI coding tool
172
- 2. "CodeRabbit CLI (requires installation)" — external tool
173
- 3. "None (skip automated review)"
174
- - If user selects CodeRabbit and it was not detected in Step 1d:
175
- - Inform: "CodeRabbit CLI is not installed. You can install it later:"
176
- - macOS: `brew install --cask coderabbit`
177
- - Other: `curl -fsSL https://cli.coderabbit.ai/install.sh | sh`
178
- - Then: `coderabbit auth login`
179
- - Record the preference as `coderabbit` regardless (will prompt at review time if still missing)
180
-
181
- **2i. Context7 documentation plugin:**
160
+ **2h. Context7 documentation plugin:**
182
161
 
183
162
  Context7 provides up-to-date, version-specific documentation and code examples directly in your prompts. It solves a common problem with LLMs: outdated training data leading to hallucinated APIs and deprecated code patterns.
184
163
 
@@ -191,7 +170,7 @@ Context7 provides up-to-date, version-specific documentation and code examples d
191
170
  2. "Skip"
192
171
  - If user selects "Install now": execute the install command
193
172
 
194
- **2j. skill-creator plugin:**
173
+ **2i. skill-creator plugin:**
195
174
 
196
175
  The skill-creator plugin from the official Claude store helps generate higher-quality project-specific skills with structured authoring guidance.
197
176
 
@@ -206,16 +185,16 @@ The skill-creator plugin from the official Claude store helps generate higher-qu
206
185
  - If user selects "Install now": execute the install command, then set `tools.skillCreator.available = true` in the config
207
186
  - If user selects "Skip": `tools.skillCreator.available` remains `false`
208
187
 
209
- **2k. Confirm AGENTS.md generation:**
188
+ **2j. Confirm AGENTS.md generation:**
210
189
  - "Generate/update AGENTS.md? This will analyze your codebase to document structure and conventions. (A CLAUDE.md shim will also be created for Claude Code compatibility.)"
211
190
  - Options: "Yes (recommended)", "Skip"
212
191
 
213
- **2k2. Confirm rules generation:**
192
+ **2j2. Confirm rules generation:**
214
193
  - "Generate `.claude/rules/` files? These are scoped instruction files that automatically load when the agent works with matching file types (e.g., testing rules load only when editing test files, code-style rules load only for source files)."
215
194
  - Options: "Yes (recommended)", "Skip"
216
195
  - Note: Rules complement AGENTS.md — they provide focused, file-type-scoped directives derived from your project's actual conventions.
217
196
 
218
- **2l. Review detected patterns for skill generation:**
197
+ **2k. Review detected patterns for skill generation:**
219
198
 
220
199
  Present ONLY patterns that were actually detected in steps 1g and 1h.
221
200
 
@@ -256,13 +235,13 @@ If no patterns/commands detected:
256
235
  - Inform user: "No common patterns detected. Would you like to specify patterns manually?"
257
236
  - Allow manual entry of pattern names/locations or command names
258
237
 
259
- **2m. Git-ignore `.5/features/` folder:**
238
+ **2l. Git-ignore `.5/features/` folder:**
260
239
  - "The `.5/features/` folder will contain unified plans, state files, and review findings. Would you like to add it to `.gitignore`?"
261
240
  - Options:
262
241
  1. "Yes, add to .gitignore (recommended)" — workflow artifacts stay local, not tracked in version control
263
242
  2. "No, track in git" — useful if you want to share specs and plans with your team
264
243
 
265
- **2n. Code Conventions:**
244
+ **2m. Code Conventions:**
266
245
  - "Generate `.5/CONVENTIONS.md` with coding conventions for this project? It will include a default set of strict rules (typing, code structure, naming, error handling, testing, and documentation standards) plus project-specific conventions derived from your codebase."
267
246
  - Options:
268
247
  1. "Yes (recommended)" → `conventions.generate: true`
@@ -280,7 +259,7 @@ Using the values gathered from Steps 1 and 2, write `.5/config.json` directly.
280
259
  mkdir -p .5
281
260
  ```
282
261
 
283
- **Schema:** Read `.claude/references/configure-tables.md` section "Config Schema" for the full JSON structure. Fill all values from user responses (including `rules.generate` from step 2k2 and `conventions.generate` from step 2n). Write with pretty-printed JSON. Read back to verify correctness.
262
+ **Schema:** Read `.claude/references/configure-tables.md` section "Config Schema" for the full JSON structure. Fill all values from user responses (including `rules.generate` from step 2j2 and `conventions.generate` from step 2m). Write with pretty-printed JSON. Read back to verify correctness.
284
263
 
285
264
  **Update `.5/version.json` with configure timestamp:**
286
265
 
@@ -7,39 +7,43 @@ argument-hint: [feature-name]
7
7
  ---
8
8
 
9
9
  <role>
10
- You are an Implementation Orchestrator. Keep your context lean, delegate all code edits, and use `.5/features/{name}/state.json` as the durable source of truth for cross-session resume. You do NOT write source code yourself.
10
+ You are an Implementation Orchestrator. Keep your context lean, delegate all code edits, and use `.5/features/{name}/state.json` for cross-session resume. You do NOT write source code yourself.
11
11
  </role>
12
12
 
13
13
  # Implement
14
14
 
15
- ## Step 1: Load Artifacts & Decide Path
15
+ ## Step 1: Load Artifacts
16
16
 
17
- Read `.5/features/{feature-name}/state.json` first if it exists. Then read only what the current path needs:
17
+ Read `plan.md`, `codebase-scan.md` if it exists, and `.5/config.json` if it exists. If `plan.md` is missing, stop and ask the user to run `/5:plan` first, then rerun `/5:implement {feature-name}`.
18
18
 
19
- - Resume existing state: `.5/config.json` if needed for baseline, verification, or auto-commit.
20
- - New state or restart: `plan.md`, `codebase-scan.md` if it exists, and `.5/config.json` if it exists.
21
-
22
- If `plan.md` is missing, stop and ask the user to run `/5:plan` first, then rerun `/5:implement {feature-name}`.
23
-
24
- State machine, if state exists:
19
+ Then read `.5/features/{feature-name}/state.json` if it exists:
25
20
 
26
21
  - `completed`: tell the user it is already implemented and verified; stop.
27
- - `in-progress`: resume from `currentStep` (only run components not in `completedComponents`).
28
- - `failed`: ask whether to resume or restart.
22
+ - `in-progress`: resume — skip every component listed in `completedComponents`.
23
+ - `failed`: ask whether to resume or restart. Restart clears `completedComponents`.
29
24
 
30
- A plan is **compact** when `plan.md` frontmatter has `planFormat: compact` (1-2 components, no data migration, no security/auth change, no public API change).
25
+ A plan is **compact** when `plan.md` frontmatter has `planFormat: compact` (1-2 components, no data migration, no security/auth change, no public API change). `/5:plan` implements compact plans inline as soon as the user approves them, so a compact plan usually already has a `completed` or `failed` state here — the common reasons to reach this command are resuming a failed inline run or re-running after the plan changed. Treat that state exactly as above; do not re-run completed components.
31
26
 
32
- Remove `.5/.planning-active` once you have a valid plan to execute.
27
+ The execution graph — steps, component wiring, model choices, pattern references, verify commands — is derived fresh on every run and lives only in this run. `state.json` persists only what resume needs:
33
28
 
34
- ## Step 2: Establish Baseline
29
+ ```json
30
+ {
31
+ "feature": "{feature-name}",
32
+ "status": "in-progress|completed|failed",
33
+ "completedComponents": ["component-name"],
34
+ "verification": {"status": "passed|partial|failed", "summary": "one line"},
35
+ "startedAt": "{ISO-timestamp}",
36
+ "lastUpdated": "{ISO-timestamp}"
37
+ }
38
+ ```
35
39
 
36
- Run build/test commands from `.5/config.json` (or an explicit baseline block in `state.json`). Skip commands set to `none`. If `state.json.baseline` already records the same commands for this run/resume, reuse it.
40
+ Resume matches on component name alone, so component names must always be copied verbatim from the plan's Component Checklist. Write `state.json` with `status: "in-progress"` now if it does not exist.
37
41
 
38
- Record compact results in `state.json.baseline` (command, status, one-line summary). Append full history to `state-events.jsonl`. If baseline fails, warn and continue; verification treats those as pre-existing.
42
+ Create one task per planned component with `TaskCreate` so the user can see progress, and mark already-completed components as completed.
39
43
 
40
- ```json
41
- {"type":"command","timestamp":"{ISO}","step":0,"component":null,"status":"passed|failed|skipped","summary":"one line","details":{"command":"{command}","phase":"baseline"}}
42
- ```
44
+ ## Step 2: Establish Baseline
45
+
46
+ Run build/test commands from `.5/config.json`. Skip commands set to `none`. Keep the results in context for this run — they are what lets verification tell pre-existing failures apart from new ones. Do not persist them. If baseline fails, warn and continue.
43
47
 
44
48
  ## Step 3: Run
45
49
 
@@ -54,41 +58,41 @@ Record compact results in `state.json.baseline` (command, status, one-line summa
54
58
  "isCompact": true,
55
59
  "components": [{"name": "...", "action": "create|modify|delete|rename", "file": "...", "sourceFile": null, "description": "...", "dependsOn": []}],
56
60
  "baseline": [{"command": "...", "status": "passed|failed|skipped", "summary": "one line"}],
57
- "resume": null
61
+ "completedComponents": []
58
62
  }
59
63
  ```
60
64
 
61
65
  - For a **compact** plan, set `isCompact: true` and parse `components` from the plan's Component Checklist (the workflow builds a trivial single step with no orchestrator agent).
62
66
  - For a **full** plan, set `isCompact: false` and omit `components` — the workflow's orchestrate phase derives steps itself.
63
- - `baseline` is the array you recorded in Step 2 (or `[]`); the workflow's verifier treats those failures as pre-existing and reuses passing results instead of rerunning them.
64
- - `resume` is `null` for a fresh run. To resume, pass `{"completedComponents": [...], "steps": [...], "pendingComponents": [...]}` copied verbatim from the existing `state.json`, so the workflow reuses the original steps rather than re-deriving them (re-derivation is non-deterministic and could rename components, breaking resume matching).
67
+ - `baseline` is the array from Step 2 (or `[]`); the workflow's verifier treats those failures as pre-existing and reuses passing results instead of rerunning them.
68
+ - `completedComponents` is `[]` for a fresh run, or the array from `state.json` to resume. The workflow re-derives the graph and skips those components by name.
65
69
  - The workflow reads the config **file** at `paths.config` itself; do not pass build/test/commit settings inline — baseline (Step 2) and auto-commit (Step 5) are run by this command, not the workflow.
66
70
 
67
71
  2. Call `Workflow({name: "5-implement", args})`.
68
- 3. When it returns, **persist its result** (Step 4): write the returned `steps`, `components`, and `verification` into `state.json`, and **merge** (never replace) the returned `completedComponents` and per-component `results` into the existing arrays — a resumed run reports only the components it ran this invocation, so earlier-session history must be preserved. Append events to `state-events.jsonl`. The workflow does not touch the filesystem itself.
72
+ 3. When it returns, **merge** (never replace) its `completedComponents` into the existing array and write `state.json` (Step 4). A resumed run reports only the components it ran this invocation. Mark the matching tasks completed with `TaskUpdate`. The workflow does not touch the filesystem itself.
69
73
  4. Auto-commit per step (Step 5), then report (Step 6).
70
74
 
71
- > Cross-session resume stays durable via `state.json`, but the Workflow path persists **only after the workflow returns** — if a run is interrupted mid-way, this session's progress is not yet saved. On the next `/5:implement`, resume reconciles against the persisted `completedComponents` (only components recorded there are skipped), so re-running a partially-applied step is possible; the executor's smallest-coherent-change contract makes a re-touch safe but not free. Workflow's own in-session resume is a bonus; you are the one who persists state after it returns.
75
+ > The Workflow path persists only after the workflow returns — if a run is interrupted mid-way, this session's progress is not saved and those components run again on the next `/5:implement`. The executor's smallest-coherent-change contract makes a re-touch safe but not free.
72
76
 
73
- **Otherwise, run the prose loop (fallback).** It produces the same `state.json` outcome:
77
+ **Otherwise, run the prose loop (fallback).** It produces the same outcome:
74
78
 
75
- ### 3a. Orchestrate into state
79
+ ### 3a. Derive the execution graph
76
80
 
77
- - **Compact plan:** build `state.json` inline from the Component Checklist — one step, `mode: "parallel"` unless components share a file or have a dependency (then `sequential`), `model: "haiku"`. **Do not spawn `step-orchestrator-agent`.**
78
- - **Full plan:** spawn `step-orchestrator-agent` with `plan.md`, `codebase-scan.md`, and config; it writes `state.json` with steps, dependencies, model choices, `patternRefs` (line ranges/symbols), and verify commands.
81
+ - **Compact plan:** build the graph inline from the Component Checklist — one step, `mode: "parallel"` unless components share a file or have a dependency (then `sequential`), `model: "haiku"`. **Do not spawn `step-orchestrator-agent`.**
82
+ - **Full plan:** spawn `step-orchestrator-agent` with `plan.md`, `codebase-scan.md`, and config; it returns steps, dependencies, model choices, `patternRefs` (line ranges/symbols), and verify commands.
79
83
 
80
- Verify `state.json`: `status: in-progress`, non-empty `steps`, each pending component has `step`, `mode`, `model`, `patternRefs` (or legacy `patternFiles`), and `verifyCommands`.
84
+ Check the returned graph: non-empty steps, every component name copied verbatim from the plan's Component Checklist, and each component carrying `step`, `mode`, `model`, `patternRefs`, and `verifyCommands`.
81
85
 
82
86
  ### 3b. Execute steps in waves
83
87
 
84
- For each step from `currentStep`, skipping components already in `completedComponents`:
88
+ For each step, skipping components already in `completedComponents`:
85
89
 
86
90
  1. Pre-check: every dependency component is completed and its files still exist.
87
- 2. Update progress tasks for the step.
91
+ 2. Mark the step's tasks in progress with `TaskUpdate`.
88
92
  3. Spawn executors:
89
93
  - **Parallel step: emit all of the step's executor Agent calls in a single message so they run concurrently.**
90
94
  - Sequential step (same-file or dependency): one executor at a time.
91
- - Give each executor only its component block, required `patternRefs`, verify commands, and the inline contract below — do not make it read `step-executor-agent.md`. (For legacy `patternFiles`, tell it to read only the smallest relevant sections.)
95
+ - Give each executor only its component block, required `patternRefs`, verify commands, and the inline contract below — do not make it read `step-executor-agent.md`.
92
96
 
93
97
  ```text
94
98
  Implement exactly the assigned component. Read only listed patternRefs ranges/symbols and the target file. Make the smallest coherent change, run assigned verify commands, and stop (STATUS: failed) for missing dependencies, unplanned auth/schema/API changes, or unclear product decisions. If verify fails only from pre-existing unrelated issues, report it under DEVIATIONS with the exact evidence and keep STATUS: success — your change is complete. Do not make more than three attempts on the same failing issue.
@@ -105,19 +109,14 @@ ERROR: none | {error description}
105
109
  ```
106
110
 
107
111
  4. Parse only the `---RESULT---` block from each executor.
108
- 5. **Once per wave** (not per component), update `completedComponents`, `recentFailures`, `pendingComponents`, `currentStep`, `latestCommandResults`, `lastUpdated`, and append `component_result` / `retry` / `command` events to `state-events.jsonl`. Trust the executor's report — do not re-read files you did not change to confirm them.
109
-
110
- ```json
111
- {"type":"component_result","timestamp":"{ISO}","step":1,"component":"{name}","status":"success|failed","summary":"one line","details":{"filesCreated":[],"filesModified":[],"verify":"passed|failed|skipped"}}
112
- {"type":"retry","timestamp":"{ISO}","step":1,"component":"{name}","status":"failed","summary":"retry reason","details":{"attempt":2,"model":"sonnet"}}
113
- ```
112
+ 5. **Once per wave** (not per component), append the succeeded component names to `state.json.completedComponents`, refresh `lastUpdated`, and mark the matching tasks completed. Trust the executor's report — do not re-read files you did not change to confirm them.
114
113
 
115
114
  Retry failed components up to twice, escalating to `sonnet`. Never fix code in the orchestrator context.
116
115
 
117
116
  ### 3c. Verify
118
117
 
119
- - **Fast path:** when every component reported `success` with `verify` `passed` or `skipped`, and no component was planned as **or escalated to** `sonnet` (i.e. a mechanical change), verify inline — run the configured build/test once (reuse fresh baseline/component results), set the verification fields directly, and skip `verification-agent`.
120
- - **Otherwise:** spawn `verification-agent` with `plan.md`, `state.json`, and config (and `codebase-scan.md` only if needed). It reuses fresh `baseline`/component/`latestCommandResults` instead of rerunning identical passing commands, then updates `state.json` verification fields and returns:
118
+ - **Fast path:** when every component reported `success` with `verify` `passed` or `skipped`, and no component was planned as **or escalated to** `sonnet` (i.e. a mechanical change), verify inline — run the configured build/test once (reuse fresh baseline/component results) and set the verification result directly, skipping `verification-agent`.
119
+ - **Otherwise:** spawn `verification-agent` with `plan.md`, the component results, the baseline from Step 2, and config (and `codebase-scan.md` only if needed). It returns:
121
120
 
122
121
  ```text
123
122
  ---VERIFICATION---
@@ -130,23 +129,19 @@ ERRORS: none | {summary}
130
129
  ---END_VERIFICATION---
131
130
  ```
132
131
 
133
- ## Step 4: Persist Verification Result
132
+ ## Step 4: Persist Result
134
133
 
135
- Set `state.json` `status` to `completed` when verification passed; otherwise `failed`, and tell the user to fix the reported issues and rerun `/5:implement {feature-name}` to resume.
134
+ Write `state.json` with the merged `completedComponents`, a one-line `verification` summary condensed from the block above, and `lastUpdated`. Set `status` to `completed` when verification passed; otherwise `failed`, and tell the user to fix the reported issues and rerun `/5:implement {feature-name}` to resume.
136
135
 
137
136
  ## Step 5: Auto-commit
138
137
 
139
138
  If `.5/config.json` `git.autoCommit` is `true`, commit once per completed step:
140
139
 
141
140
  1. Stage only files owned by that step's components: `file` for create/modify/delete, both `sourceFile` and `file` for rename, plus the executor's reported `FILES_CREATED`/`FILES_MODIFIED`. Do not stage unrelated changes.
142
- 2. Build the message from `git.commitMessage.pattern`, replacing `{ticket-id}` with `state.ticket` (or empty) and `{short-description}` with `step {number}: {step-name}`; trim redundant whitespace/punctuation when the ticket is empty.
143
- 3. Commit, and record a compact entry in `state.json.latestCommitResults` plus a detailed `commit` event:
144
-
145
- ```json
146
- {"type":"commit","timestamp":"{ISO}","step":1,"component":null,"status":"committed|skipped|failed","summary":"{message-or-reason}","details":{"commit":"{sha-or-null}","files":["path"],"error":null}}
147
- ```
141
+ 2. Build the message from `git.commitMessage.pattern`, replacing `{ticket-id}` with the ticket from the plan frontmatter (or empty) and `{short-description}` with `step {number}: {step-name}`; trim redundant whitespace/punctuation when the ticket is empty.
142
+ 3. Commit.
148
143
 
149
- No changed files → `status: "skipped"`. Commit error → `status: "failed"`, continue; do not retry with broader paths. If `git.autoCommit` is missing/`false`, do not commit.
144
+ No changed files → skip. Commit error → report it and continue; do not retry with broader paths. If `git.autoCommit` is missing/`false`, do not commit.
150
145
 
151
146
  ## Step 6: Report
152
147