lee-spec-kit 0.9.3 → 0.9.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lee-spec-kit",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "Document-centered harness engineering toolkit for AI agent development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -117,6 +117,10 @@ When requirements/scope change, the “what to update” must be explicit in doc
117
117
  ## CLI Config (`.lee-spec-kit.json`)
118
118
 
119
119
  When you run `lee-spec-kit init`, it creates `.lee-spec-kit.json` in the docs root (default: `docs/`).
120
+ Interactive init lets you keep the recommended defaults or customize task
121
+ implementation delegation, Plan/Task/Feature reviews, and Local integration.
122
+ Non-interactive setup exposes the same choices through `--task-agent`,
123
+ `--reviews`, `--max-review-rounds`, and `--completion-strategy`.
120
124
 
121
125
  - Used by `lee-spec-kit feature`, `config`, `update`, `detect`, and workflow validators to resolve docs location / project type / language.
122
126
  - `docsRepo`, `pushDocs`, `docsRemote` are metadata for the CLI-managed **Docs Push policy** (the CLI does not auto-push).
@@ -130,11 +134,24 @@ When you run `lee-spec-kit init`, it creates `.lee-spec-kit.json` in the docs ro
130
134
  - `docsRepo` ("embedded" | "standalone"): How docs are managed
131
135
  - `pushDocs` (boolean, optional): Only written when `docsRepo: "standalone"` (whether to push to remote)
132
136
  - `docsRemote` (string, optional): Only written when `pushDocs: true` (remote repo URL)
133
- - `workflow.prePrReview.reviewer` (object): Pre-PR subagent execution settings
137
+ - `workflow.agentExecution.task` (object): task implementation delegation settings
138
+ - `enabled`: delegates each `task_execute` action to a subagent; new and updated projects default to `true`
134
139
  - `type`: currently only `"subagent"` is supported
135
140
  - `model`: `"inherit"` or a model name supported by the runtime
136
141
  - `reasoningEffort`: `low | medium | high | xhigh | max | ultra`
137
142
  - `onUnavailable`: `inherit | error` when the requested model is unavailable
143
+ - `workflow-stage` returns a stable task ID, working/docs directories, and a machine-readable `workerContract`. The worker executes directly without rerunning `workflow-stage` or delegating again.
144
+ - The implementation subagent can edit project code and run task-scoped checks. The main agent retains docs, task state, commits, approvals, and remote actions; official hooks reject commits while `task_execute` is active.
145
+ - `workflow.agentReview.maxRounds` (positive integer): maximum automatic finding-remediation passes shared by Plan/task/Feature reviews before `workflow-stage` returns `review_escalation`; the initial review is not counted and the default is `1`
146
+ - `workflow.agentReview.plan` / `workflow.agentReview.task` / `workflow.agentReview.feature` (object): Plan/task/Feature independent review settings
147
+ - `enabled`: enables that review gate; new projects default Plan and Feature to `true`, and task to `false`
148
+ - `evidenceMode`: `path_required | any`
149
+ - `reviewer`: fresh read-only subagent execution settings
150
+ - `type`: currently only `"subagent"` is supported
151
+ - `model`: `"inherit"` or a model name supported by the runtime
152
+ - `reasoningEffort`: `low | medium | high | xhigh | max | ultra`
153
+ - `onUnavailable`: `inherit | error` when the requested model is unavailable
154
+ - Plan review runs before Plan approval and binds its evidence to the exact `specHash` and `planHash` returned by `workflow-stage`; later spec/plan content changes require a fresh review
138
155
  - `workflow.baseBranch` (string): branch that receives a completed local Feature
139
156
  - `workflow.completionStrategy` (`"local-ff" | "local-squash" | "none"`): fast-forward, create one verified squash commit, or explicitly finish without integration
140
157
  - `workflow.deleteFeatureBranchAfterMerge` (boolean): delete the integrated local Feature branch after cleanup; remote branches are never deleted
@@ -171,14 +188,47 @@ When you run `lee-spec-kit init`, it creates `.lee-spec-kit.json` in the docs ro
171
188
  "deleteFeatureBranchAfterMerge": true,
172
189
  "featureChecks": [],
173
190
  "postMergeChecks": [],
174
- "prePrReview": {
175
- "evidenceMode": "path_required",
176
- "reviewer": {
191
+ "agentExecution": {
192
+ "task": {
193
+ "enabled": true,
177
194
  "type": "subagent",
178
195
  "model": "inherit",
179
196
  "reasoningEffort": "high",
180
197
  "onUnavailable": "inherit"
181
198
  }
199
+ },
200
+ "agentReview": {
201
+ "maxRounds": 1,
202
+ "plan": {
203
+ "enabled": true,
204
+ "evidenceMode": "path_required",
205
+ "reviewer": {
206
+ "type": "subagent",
207
+ "model": "inherit",
208
+ "reasoningEffort": "high",
209
+ "onUnavailable": "inherit"
210
+ }
211
+ },
212
+ "task": {
213
+ "enabled": false,
214
+ "evidenceMode": "path_required",
215
+ "reviewer": {
216
+ "type": "subagent",
217
+ "model": "inherit",
218
+ "reasoningEffort": "high",
219
+ "onUnavailable": "inherit"
220
+ }
221
+ },
222
+ "feature": {
223
+ "enabled": true,
224
+ "evidenceMode": "path_required",
225
+ "reviewer": {
226
+ "type": "subagent",
227
+ "model": "inherit",
228
+ "reasoningEffort": "high",
229
+ "onUnavailable": "inherit"
230
+ }
231
+ }
182
232
  }
183
233
  },
184
234
  "allowedDocsEntries": {
@@ -192,7 +242,7 @@ When you run `lee-spec-kit init`, it creates `.lee-spec-kit.json` in the docs ro
192
242
  }
193
243
  ```
194
244
 
195
- New local projects use `local-ff`. Choose `local-squash` to create one base-branch commit while preserving the source Feature tip under an internal `refs/lee-spec-kit/integrations/*` ref for task-checkpoint evidence. During `update`, an existing local project with no explicit `completionStrategy` receives `none` so an upgrade does not unexpectedly merge its current branch. Set it to `local-ff` or `local-squash` deliberately when ready.
245
+ New and updated projects delegate task implementation and enable Plan review by default; set `workflow.agentExecution.task.enabled` or `workflow.agentReview.plan.enabled` to `false` to opt out. New local projects use `local-ff` with Feature agent review enabled. Set `workflow.agentReview.task.enabled` to `true` when every task also needs independent review. Finding remediation defaults to `1`: findings from the first review are applied once and reviewed again, and another `changes_requested` decision returns `review_escalation`. Increase `workflow.agentReview.maxRounds` before authorizing another remediation and fresh review. Choose `local-squash` to create one base-branch commit while preserving the source Feature tip under an internal `refs/lee-spec-kit/integrations/*` ref for task-checkpoint evidence. During `update`, an existing local project with no explicit `completionStrategy` receives `none` so an upgrade does not unexpectedly merge its current branch. Set it to `local-ff` or `local-squash` deliberately when ready.
196
246
 
197
247
  ```json
198
248
  {
@@ -52,9 +52,14 @@ This document defines workflow policy, not a custom runtime loop.
52
52
 
53
53
  - lee-spec-kit owns docs structure, workflow stages, and validators.
54
54
  - Codex owns the execution loop, tool usage, and hook lifecycle.
55
- - Do not start implementation unless `workflow-stage --json` reports `stage === "implementation"` and `implementationAllowed === true`.
56
- - When `workflow-stage --json` returns `nextAction.category: pre_pr_review` with `executor: subagent`, run a fresh, read-only subagent review using the returned `model`, `reasoningEffort`, and `onUnavailable` policy. Do not select or require a named review skill.
57
- - The Pre-PR review subagent returns findings without modifying code. The main agent remediates findings and records reviewer metadata and the final decision as evidence.
55
+ - Modify implementation code only when `implementationAllowed === true`. Normal task work uses `stage === "implementation"`; review fixes use `task_review_fix` or `feature_review_fix`, and verification fixes use `feature_remediation`.
56
+ - When `nextAction.category` is `plan_review` with `executor: subagent`, delegate a fresh read-only review of `spec.md` and `plan.md` for the returned `specHash` and `planHash`. The main agent records the returned `reviewRound`, Plan Review evidence, decision, reviewer metadata, and both hashes. Any later spec/plan content change invalidates that review.
57
+ - When `nextAction.category` is `task_execute` with `executor: subagent`, mark that one task active, then delegate its implementation and task-scoped checks to a fresh subagent in the returned `workingDirectory` with the returned model, reasoning effort, unavailability policy, and exact `workerContract`. No named execution skill is required.
58
+ - The implementation worker executes directly, follows the approved Verification Contract, and does not add unplanned durable tests. It must not run `workflow-stage` or spawn another subagent. It may edit project code and run scoped checks, but it must not edit lee-spec-kit docs, change task state, commit, request approvals, or perform remote/destructive actions. The main agent inspects the result and owns docs synchronization, task transitions, commits, and workflow continuation; official hooks block commits while `task_execute` remains active.
59
+ - When `nextAction.category` is `task_review` with `executor: subagent`, delegate a fresh read-only review for the returned task ID and SHA/tree range, then record the returned `reviewRound`.
60
+ - When `nextAction.category` is `pre_pr_review` with `executor: subagent`, run a fresh read-only Feature review using the returned model, reasoning effort, `reviewRound`, and SHA/tree range. Do not select or require a named review skill.
61
+ - Review subagents return findings without modifying code. The main agent remediates findings and records reviewer metadata, reviewed scope, evidence, decision, and exact hash/SHA/tree target metadata.
62
+ - `workflow.agentReview.maxRounds` counts automatic finding-remediation passes, not the initial review. When `nextAction.category` is `review_escalation`, those passes have been exhausted. Do not remediate or delegate another review. Keep implementation blocked, present the exact returned action options, and require `maxRounds` to be increased before another remediation pass.
58
63
  - Treat spec/plan/tasks approval, issue creation, and branch creation as hard gates before implementation.
59
64
  - In standalone mode, do not hand-write `git worktree add`; run the exact `nextAction.command` from `workflow-stage` so the managed workspace path, stale directory cleanup, and `.env`/`.env.*` copy step stay consistent.
60
65
  - In local mode, do not stop after implementation approval. Follow the exact `local verify`, `local merge`, and `local cleanup` commands returned by `workflow-stage` until verified integration and cleanup produce `done`. A `feature_remediation` stage explicitly permits fixes in the Feature worktree.
@@ -20,10 +20,12 @@ This guide defines how to start or continue a feature in the Codex-native lee-sp
20
20
  - Docs are the SSOT. Follow the active feature docs directly.
21
21
  - Progress through the documented stages directly:
22
22
  - `spec.md` defines scope and review state
23
- - `plan.md` defines the implementation approach
23
+ - `plan.md` defines the implementation approach and Verification Contract
24
24
  - `tasks.md` drives execution order
25
25
  - `issue.md` / `pr.md` are part of the stage gate once the feature reaches GitHub workflow stages
26
26
  - Do not begin implementation just because `tasks.md` exists. Implementation starts only when `workflow-stage --json` allows it.
27
+ - When Plan review is enabled, move `plan.md` to Review, delegate the returned fresh read-only `plan_review`, and record its `reviewRound`, evidence, decision, reviewer metadata, `specHash`, and `planHash`. Only an approved review of the current hashes can reach Plan approval. The reviewer challenges NONE/UPDATE/ADD decisions, requirement coverage, independent oracles, stable observation boundaries, realistic failure/rollback cases, exclusions, and focused/full verification scope without editing docs.
28
+ - `workflow.agentReview.maxRounds` counts Plan finding-remediation passes, not the initial review. If `workflow-stage` returns `review_escalation`, stop automatic Plan remediation and present its exact action options. Another remediation requires increasing the setting first.
27
29
  - When scope or behavior changes, update the active feature docs in the same turn before continuing.
28
30
  - Ask for approval at documented review checkpoints and before remote or destructive actions.
29
31
  - Use `npx lee-spec-kit commit-audit --json` before `git commit` when docs-path validation matters.
@@ -25,15 +25,18 @@ When `workflow-stage --json` returns `nextAction.executor: subagent`, delegate t
25
25
  2. Inspect regression, exception handling, critical/security risks, side effects, user flow impact, and release readiness.
26
26
  3. Check maintainability: split oversized functions/files when needed, reuse/integrate existing code where appropriate, and remove obsolete code.
27
27
  4. Judge whether the implementation actually fits the feature intent and scope documented in `spec.md` / `plan.md` / `tasks.md`.
28
- 5. When `workflow.prePrReview.evidenceMode=path_required` (default), generate a real review artifact such as `review-trace.json` before approval. In `evidenceMode=any`, direct record mode without a separate artifact is also allowed unless execution evidence is explicitly enforced.
28
+ 5. When `workflow.agentReview.feature.evidenceMode=path_required` (default), generate a real review artifact such as `review-trace.json` before approval. In `evidenceMode=any`, direct record mode without a separate artifact is also allowed unless execution evidence is explicitly enforced.
29
29
  6. `Pre-PR Evidence` should follow the configured evidence policy. In `path_required`, it must point to a real existing path.
30
30
  7. Record `Summary`, `Feature Intent Summary`, `Implementation Fit`, `Missing Cases`, `Spec Alignment Checked`, `Finding Count`, `Blocking Findings`, `Findings`, and `Residual Risks` with non-placeholder content.
31
31
  8. Use `commandsExecuted` only for optional audit/targeted verification that you actually chose to run during review.
32
32
  9. In code-review stage, keep `PR Review Evidence/Decision` aligned with `decisions.md` by adding a `PR Review Log` section with `Summary` and `Decision`.
33
33
  10. `Pre-PR Decision` must use `decision: approve|changes_requested|blocked ...` (or `결정: ...`).
34
- 11. Ensure the final decision is `approve` before moving to PR creation.
34
+ 11. Record `Pre-PR Review Round` from the returned `reviewRound`.
35
+ 12. Confirm `Pre-PR Reviewed Head` and `Pre-PR Reviewed Tree` match the `targetSha` and `targetTree` returned by `workflow-stage`.
36
+ 13. `workflow.agentReview.maxRounds` counts Feature finding-remediation passes, not the initial review. If `workflow-stage` returns `review_escalation`, stop automatic remediation and present its exact action options. Another remediation requires increasing the setting first.
37
+ 14. Ensure the final decision is `approve` before moving to PR creation.
35
38
 
36
- The review artifact must record the actual `executor`, `model`, `reasoningEffort`, reviewed commit/diff scope, findings, and final decision. The review subagent must not modify code; the main agent owns finding remediation and documentation updates.
39
+ The review artifact must record the actual `executor`, `model`, `reasoningEffort`, reviewed commit/diff scope, target SHA/tree, findings, and final decision. The review subagent must not modify code; the main agent owns finding remediation and documentation updates.
37
40
 
38
41
  ---
39
42
 
@@ -13,11 +13,18 @@ Use the active feature folder as the execution SSOT.
13
13
  - continue the single `[DOING]` task, or
14
14
  - move the next highest-priority `[TODO]` task to `[DOING]`
15
15
  - Work one task at a time. Do not batch-complete multiple tasks in one pass.
16
+ - When `nextAction.executor === "subagent"`, delegate that task's implementation and task-scoped verification to a fresh subagent in `nextAction.workingDirectory` using the returned `model`, `reasoningEffort`, `onUnavailable`, and exact `workerContract`. If a requested model is unavailable, `inherit` means retry with the current model inherited and `error` means stop and report the failure.
17
+ - The implementation worker executes the assigned task directly. It must not run `workflow-stage`, delegate again, edit lee-spec-kit docs, change task state, commit, request approval, or perform remote/destructive actions. It may edit project code and run task-scoped checks only.
18
+ - The implementation worker follows the approved `plan.md` Verification Contract: `NONE` adds no durable test, `UPDATE` minimally changes the owning existing test, and `ADD` adds only contract-linked tests. If the approved decision is insufficient, report the gap to the main agent instead of expanding test scope.
19
+ - Legacy task lines without an explicit ID receive a stable synthetic `taskId` from `workflow-stage`; use that returned ID without rewriting the legacy task solely to add an ID.
16
20
 
17
21
  ## 2. Execute and record
18
22
 
19
23
  - Keep `tasks.md` aligned with reality:
20
24
  - do not mark `[DONE]` without real completion and verification
25
+ - when `workflow.agentReview.task.enabled=true`, move completed implementation to `[REVIEW]` instead of `[DONE]`, create the checkpoint commit, and run the independent review
26
+ - record the returned `reviewRound`, and move `[REVIEW]` to `[DONE]` only after the task reviewer approves the current SHA/tree
27
+ - `workflow.agentReview.maxRounds` counts task finding-remediation passes, not the initial review; at `review_escalation`, stop automatic remediation and present the exact action options, and increase the setting before another remediation
21
28
  - update `Acceptance` and `Checklist` in the same edit when closing a task
22
29
  - if a completed task needs follow-up, add a new task instead of rewriting history
23
30
  - If you need to add a new task, append a complete task block in `tasks.md` with a concrete title, `Acceptance`, `Checklist`, and `NON-PRD` or existing `PRD-*` tag.
@@ -33,6 +40,7 @@ Use the active feature folder as the execution SSOT.
33
40
  ## 4. Commit and stop guardrails
34
41
 
35
42
  - Before `git commit`, use `npx lee-spec-kit commit-audit --json` when docs-path validation matters.
43
+ - The main agent, never the implementation subagent, owns docs/project commits and the task checkpoint.
36
44
  - Before stopping, use `npx lee-spec-kit workflow-audit --json` if code or feature docs changed.
37
45
  - Keep one row per test command in the `tasks.md` test log and update that row on reruns instead of appending duplicates.
38
46
 
@@ -40,7 +48,7 @@ Use the active feature folder as the execution SSOT.
40
48
 
41
49
  - Ask for approval only at documented review checkpoints and before remote or destructive actions.
42
50
  - Before issue creation, PR creation, push, merge, or similar remote actions, share the exact artifact or plan first.
43
- - Codex may delegate implementation work, but docs updates, approval handling, and remote actions stay with the main session.
51
+ - Delegate Plan/task/Feature review to the fresh read-only subagent and exact hash/SHA/tree target returned by `workflow-stage`; keep docs updates, finding remediation, approval handling, and remote actions in the main session.
44
52
 
45
53
  ## Strict Rules
46
54
 
@@ -57,9 +57,13 @@ npx lee-spec-kit workflow-stage <feature-ref> --json
57
57
 
58
58
  Use the returned `stage`, `nextAction`, and `implementationAllowed` values as the current workflow state.
59
59
 
60
+ With Plan review enabled, planning follows `plan Review → fresh read-only Plan review → plan approval`. The review is bound to the returned `specHash` and `planHash`; changing either document's content invalidates the prior evidence. The reviewer checks the Verification Contract and test decisions without editing docs.
61
+
60
62
  The three final completion checkboxes in `tasks.md` carry `lee-spec-kit:completion:*` HTML markers. You may customize their visible wording, but preserve the marker on each checkbox line; `workflow-stage` uses the marker as the machine-readable identity and falls back to the legacy canonical wording for older projects.
61
63
 
62
- In a local workflow with `completionStrategy: "local-ff"` or `"local-squash"`, completion is `implementation_approve → feature_verify → local_merge → local_cleanup → done`. Failed checks enter `feature_remediation` with implementation enabled. `local-ff` moves only the verified Feature SHA; `local-squash` requires the integration tree to match the verified Feature tree. Both require cleanup before `done`. After cleanup, a Feature remains `done` while its recorded integration commit is still an ancestor of the current base, even when later Features advance that base.
64
+ With Feature agent review enabled, local completion is `feature review implementation_approve → feature_verify → local_merge → local_cleanup → done`. With task review enabled, every task follows `DOING → REVIEW → task review → DONE`. Failed checks enter `feature_remediation` with implementation enabled. `local-ff` moves only the verified Feature SHA; `local-squash` requires the integration tree to match the verified Feature tree. Both require cleanup before `done`. After cleanup, a Feature remains `done` while its recorded integration commit is still an ancestor of the current base, even when later Features advance that base.
65
+
66
+ When `workflow.agentExecution.task.enabled=true`, each `task_execute` action carries the configured subagent model, reasoning effort, stable task ID, implementation working directory, and a machine-readable `workerContract`. The worker executes directly without calling `workflow-stage` or delegating again. It follows the approved Verification Contract, does not add unplanned durable tests, edits project code, and runs task-scoped checks only; the main agent owns docs synchronization, task transitions, commits, approvals, and remote actions. Official hooks block commits until the main agent advances the workflow to `task_commit`.
63
67
 
64
68
  A remediation commit invalidates verification and the prior local-merge confirmation. Refresh review evidence for the changed diff when Pre-PR review is enabled, verify the new tip, and obtain local-merge approval again.
65
69
 
@@ -124,20 +128,24 @@ Keeping the shared artifact for history is fine, but when it conflicts with feat
124
128
  | Scope | Field | Values |
125
129
  | --- | --- | --- |
126
130
  | Document status | `Status` in `spec.md`/`plan.md`, `Doc Status` in `tasks.md` | `Draft` \| `Review` \| `Approved` |
131
+ | Plan review status | `Plan Review` in `plan.md` | `Pending` \| `Running` \| `Done` |
132
+ | Plan review evidence/decision | `Plan Review Evidence` / `Plan Review Decision` | evidence path and `decision: approve\|changes_requested\|blocked ...` |
133
+ | Plan review target | `Plan Reviewed Spec Hash` / `Plan Reviewed Plan Hash` | current content hashes returned by `workflow-stage` |
127
134
  | Issue doc status | `Status` in `issue.md` | `Draft` \| `Ready` |
128
135
  | PR doc status | `Status` in `pr.md` | `Draft` \| `Ready` |
129
136
  | PR review status | `PR Status` in `tasks.md` | `Review` \| `Approved` |
130
137
  | Pre-PR review status | `Pre-PR Review` in `tasks.md` | `Pending` \| `Done` |
131
138
  | Pre-PR review evidence | `Pre-PR Evidence` in `tasks.md` | evidence link/log/doc path |
132
139
  | Pre-PR review decision | `Pre-PR Decision` in `tasks.md` | `decision: approve\|changes_requested\|blocked ...` |
140
+ | Pre-PR review target | `Pre-PR Reviewed Head` / `Pre-PR Reviewed Tree` | current SHA/tree returned by `workflow-stage` |
133
141
  | PR review evidence | `PR Review Evidence` in `tasks.md` | evidence link/log/doc path |
134
142
  | PR review decision | `PR Review Decision` in `tasks.md` | `decision: ...` (or `결정: ...`) |
135
143
 
136
144
  ---
137
145
 
138
- ## Pre-PR Subagent Checklist
146
+ ## Agent Review Checklist
139
147
 
140
- Delegate every Pre-PR review to a fresh, read-only subagent using the model and reasoning effort returned by `workflow-stage --json`. The subagent follows `agents/skills/create-pr.md` (`Pre-PR Baseline Checklist`); the main agent owns finding remediation and evidence recording.
148
+ Delegate Plan, task, and Feature reviews to fresh, read-only subagents using the model, reasoning effort, and exact target returned by `workflow-stage --json`. Plan review covers current spec/plan content hashes, task review covers its checkpoint range, and Feature review covers the base-to-Feature-tip diff. The subagent returns defect-focused findings without modifying code or docs; the main agent owns remediation and evidence recording. No named review skill is required.
141
149
 
142
150
  ---
143
151
 
@@ -146,7 +154,7 @@ Delegate every Pre-PR review to a fresh, read-only subagent using the model and
146
154
  | File | Role | When to Write |
147
155
  | -------------- | ------------------------- | ------------------- |
148
156
  | `spec.md` | **What and Why** | Feature definition |
149
- | `plan.md` | **How** (technical) | After spec approval |
157
+ | `plan.md` | **How** + Verification Contract | After spec approval |
150
158
  | `tasks.md` | Specific work items | After plan approval |
151
159
  | `issue.md` | Issue draft + issue state (`Draft/Ready`) | Before/when creating issue |
152
160
  | `pr.md` | PR draft + PR state (`Draft/Ready`) | Before/when creating PR |
@@ -12,6 +12,18 @@
12
12
  - **Created**: {YYYY-MM-DD}
13
13
  - **Status**: -
14
14
  - Values: Draft | Review | Approved
15
+ - **Plan Review**: Pending
16
+ - Values: Pending | Running | Done
17
+ - **Plan Review Evidence**: -
18
+ - Example: `docs/features/F001-foo/decisions.md` or another existing review artifact under the docs root
19
+ - **Plan Review Decision**: -
20
+ - Format: `decision: approve|changes_requested|blocked ...`
21
+ - **Plan Review Round**: -
22
+ - Positive integer returned by `workflow-stage --json`; the first review is `1`
23
+ - **Plan Reviewed Spec Hash**: -
24
+ - Exact `specHash` returned by `workflow-stage --json`
25
+ - **Plan Reviewed Plan Hash**: -
26
+ - Exact `planHash` returned by `workflow-stage --json`
15
27
 
16
28
  ---
17
29
 
@@ -37,11 +49,38 @@ src/
37
49
 
38
50
  ---
39
51
 
40
- ## Test Strategy
52
+ ## Verification Contract
41
53
 
42
- - **Unit Tests**:
43
- - **Integration Tests**:
44
- - **E2E Tests**:
54
+ ### Change Classification
55
+
56
+ - **Type**: COPY | REFACTOR | BUG_FIX | NEW_BEHAVIOR | HIGH_RISK
57
+ - **Risk**: LOW | MEDIUM | HIGH
58
+
59
+ ### Observable Contract
60
+
61
+ - **Supported behavior**:
62
+ - **Preconditions**:
63
+ - **Success guarantees**:
64
+ - **Important failure guarantees**:
65
+ - **Intentionally unsupported cases**:
66
+
67
+ ### Test Decisions
68
+
69
+ | Contract / Requirement | Decision | Test Level | Realistic Regression Protected | Independent Oracle |
70
+ | ---------------------- | -------- | ---------- | ------------------------------ | ------------------ |
71
+ | (AC/FR reference) | NONE \| UPDATE \| ADD | Unit \| Integration \| E2E \| Non-test | (failure this prevents) | (spec/released behavior/external reference) |
72
+
73
+ ### Excluded Tests
74
+
75
+ - (duplicates, implementation details, unsupported synthetic inputs, or framework behavior intentionally not tested)
76
+
77
+ ### Verification Execution
78
+
79
+ - **During implementation**:
80
+ - **Before task completion**:
81
+ - **Before Feature completion**:
82
+ - **Manual/UI verification**:
83
+ - **Full suite required**: Yes | No — (reason)
45
84
 
46
85
  ---
47
86
 
@@ -2,13 +2,16 @@
2
2
 
3
3
  ## Task Rules
4
4
 
5
- - **Status**: `[TODO]` → `[DOING]` → `[DONE]`
5
+ - **Status**: normally `[TODO]` → `[DOING]` → `[DONE]`; when `workflow.agentReview.task.enabled=true`, use `[DOING]` → `[REVIEW]` → `[DONE]`
6
+ - **Implementation delegation**: when `workflow.agentExecution.task.enabled=true`, the configured worker follows the returned `workerContract`, executes directly without running `workflow-stage` or delegating again, and may edit project code plus run task-scoped checks only; the main agent retains this document, task state, commits, approvals, and remote actions.
6
7
  - **Task communication / confirmation**:
7
8
  - `[TODO] → [DOING]`: share the task title first, then update the task state in `tasks.md`
8
- - `[DOING] → [DONE]`: share the result and verification first, then update `Acceptance` and `Checklist` in the same edit
9
+ - `[DOING] → [REVIEW]/[DONE]`: share the result and verification first, then update `Acceptance` and `Checklist` in the same edit
10
+ - `[REVIEW] → [DONE]`: record the returned review round, fresh task review evidence, decision, reviewed head, and reviewed tree before completion
9
11
  - Ask for approval before changing task state only when the task crosses a documented review checkpoint or before remote/destructive actions.
10
12
  - Do not invent a standalone `OK` approval step when the workflow does not require one.
11
13
  - Do not mark `[DONE]` while any item in that task's `Checklist` remains unchecked.
14
+ - `workflow.agentReview.maxRounds` counts automatic finding-remediation passes, not the initial review. Stop at `review_escalation` after those passes are exhausted; another remediation requires increasing the setting first.
12
15
  - **PRD mapping (recommended)**: add an existing PRD requirement ID tag like `[PRD-FR-001]` or `[PRD-SCOPE-V1-DESKTOP-EDITOR]` to each task line, or tag non-PRD tasks as `[NON-PRD]`.
13
16
  - Do not invent PRD IDs in `tasks.md`. Only reference IDs that already exist in `docs/prd` or the upstream requirements doc.
14
17
  - If this is a legacy feature without PRD IDs yet, backfill IDs in the source requirements doc first, then align `spec.md` `PRD Refs` and task tags together.
@@ -39,7 +42,12 @@
39
42
  - **Pre-PR Decision**: -
40
43
  - Format: `decision: approve|changes_requested|blocked ...` (or `결정: ...`)
41
44
  - PR creation requires final decision `approve`
42
- - Follow `agents/skills/create-pr.md` (`Pre-PR Baseline Checklist`) as the default baseline
45
+ - **Pre-PR Review Round**: -
46
+ - Positive integer returned by `workflow-stage --json`; the first review is `1`
47
+ - **Pre-PR Reviewed Head**: -
48
+ - Project code commit SHA reviewed by the Feature reviewer
49
+ - **Pre-PR Reviewed Tree**: -
50
+ - Project code tree SHA reviewed by the Feature reviewer
43
51
  - **PR Review**: -
44
52
  - Values: Pending | Running | Done
45
53
  - Mark `Running` when PR review handoff starts; use `Done` only if your team explicitly tracks review completion here
@@ -59,6 +67,11 @@
59
67
  - (verification condition)
60
68
  - Checklist:
61
69
  - [ ] (subtask)
70
+ - Review Evidence: -
71
+ - Review Decision: -
72
+ - Review Round: -
73
+ - Reviewed Head: -
74
+ - Reviewed Tree: -
62
75
  ```
63
76
 
64
77
  > `PRD-FR-001` in the example is just one valid `PRD-*` key. If the key is not defined in the PRD source yet, do not add it to tasks first.
@@ -117,6 +117,9 @@ npx lee-spec-kit docs get agents --json
117
117
  ## CLI 설정 파일 (`.lee-spec-kit.json`)
118
118
 
119
119
  `lee-spec-kit init`을 실행하면 문서 루트(기본: `docs/`)에 `.lee-spec-kit.json`이 생성됩니다.
120
+ 대화형 init에서는 권장 설정을 그대로 쓰거나 Task 구현 위임, Plan/Task/Feature 검수,
121
+ Local 통합 방식을 직접 선택할 수 있습니다. 비대화형 실행에서는 `--task-agent`,
122
+ `--reviews`, `--max-review-rounds`, `--completion-strategy`로 같은 값을 지정합니다.
120
123
 
121
124
  - `lee-spec-kit feature`, `config`, `update`, `detect`, workflow validator에서 문서 위치/프로젝트 타입/언어를 해석하는 용도로 사용됩니다.
122
125
  - `docsRepo`, `pushDocs`, `docsRemote`는 CLI 관리 **Docs Push 정책**을 위한 메타데이터입니다. (자동 push는 하지 않습니다)
@@ -130,11 +133,24 @@ npx lee-spec-kit docs get agents --json
130
133
  - `docsRepo` ("embedded" | "standalone"): Docs 관리 방식
131
134
  - `pushDocs` (boolean, optional): `docsRepo: "standalone"`일 때만 생성 (원격 push 여부)
132
135
  - `docsRemote` (string, optional): `pushDocs: true`일 때만 생성 (원격 레포 URL)
133
- - `workflow.prePrReview.reviewer` (object): Pre-PR 서브에이전트 실행 설정
136
+ - `workflow.agentExecution.task` (object): 태스크 구현 위임 설정
137
+ - `enabled`: 각 `task_execute`를 서브에이전트에게 위임할지 여부. 새 프로젝트와 업데이트된 프로젝트의 기본값은 `true`
134
138
  - `type`: 현재 `"subagent"`만 지원
135
139
  - `model`: `"inherit"` 또는 런타임이 지원하는 모델명
136
140
  - `reasoningEffort`: `low | medium | high | xhigh | max | ultra`
137
141
  - `onUnavailable`: 지정 모델을 사용할 수 없을 때 `inherit | error`
142
+ - `workflow-stage`는 안정적인 태스크 ID, 작업/docs 경로, machine-readable `workerContract`를 반환합니다. worker는 `workflow-stage` 재호출이나 재위임 없이 직접 실행합니다.
143
+ - 구현 서브에이전트는 프로젝트 코드와 태스크 범위 검사를 담당하고, 메인 에이전트는 문서, 태스크 상태, 커밋, 승인, 원격 작업을 유지합니다. 공식 hook은 `task_execute` 중 커밋을 거부합니다.
144
+ - `workflow.agentReview.maxRounds` (양의 정수): Plan/태스크/Feature 리뷰에 공통 적용되는 리뷰 지적 자동 반영 최대 횟수. 최초 리뷰는 세지 않으며 기본값은 `1`
145
+ - `workflow.agentReview.plan` / `workflow.agentReview.task` / `workflow.agentReview.feature` (object): Plan/태스크/Feature 독립 리뷰 설정
146
+ - `enabled`: 해당 리뷰 게이트 활성화 여부. 새 프로젝트는 Plan과 Feature `true`, task `false`
147
+ - `evidenceMode`: `path_required | any`
148
+ - `reviewer`: fresh 읽기 전용 서브에이전트 실행 설정
149
+ - `type`: 현재 `"subagent"`만 지원
150
+ - `model`: `"inherit"` 또는 런타임이 지원하는 모델명
151
+ - `reasoningEffort`: `low | medium | high | xhigh | max | ultra`
152
+ - `onUnavailable`: 지정 모델을 사용할 수 없을 때 `inherit | error`
153
+ - Plan 검수는 Plan 승인 전에 실행되며 `workflow-stage`가 반환한 정확한 `specHash`와 `planHash`에 evidence를 묶습니다. 이후 spec/plan 내용이 바뀌면 fresh 검수가 필요합니다.
138
154
  - `workflow.baseBranch` (string): 완료된 local Feature를 통합할 기준 브랜치
139
155
  - `workflow.completionStrategy` (`"local-ff" | "local-squash" | "none"`): fast-forward, 검증된 단일 squash commit 생성, 또는 명시적으로 통합 없이 종료
140
156
  - `workflow.deleteFeatureBranchAfterMerge` (boolean): cleanup 후 통합된 local Feature 브랜치 삭제 여부. 원격 브랜치는 삭제하지 않음
@@ -171,14 +187,47 @@ npx lee-spec-kit docs get agents --json
171
187
  "deleteFeatureBranchAfterMerge": true,
172
188
  "featureChecks": [],
173
189
  "postMergeChecks": [],
174
- "prePrReview": {
175
- "evidenceMode": "path_required",
176
- "reviewer": {
190
+ "agentExecution": {
191
+ "task": {
192
+ "enabled": true,
177
193
  "type": "subagent",
178
194
  "model": "inherit",
179
195
  "reasoningEffort": "high",
180
196
  "onUnavailable": "inherit"
181
197
  }
198
+ },
199
+ "agentReview": {
200
+ "maxRounds": 1,
201
+ "plan": {
202
+ "enabled": true,
203
+ "evidenceMode": "path_required",
204
+ "reviewer": {
205
+ "type": "subagent",
206
+ "model": "inherit",
207
+ "reasoningEffort": "high",
208
+ "onUnavailable": "inherit"
209
+ }
210
+ },
211
+ "task": {
212
+ "enabled": false,
213
+ "evidenceMode": "path_required",
214
+ "reviewer": {
215
+ "type": "subagent",
216
+ "model": "inherit",
217
+ "reasoningEffort": "high",
218
+ "onUnavailable": "inherit"
219
+ }
220
+ },
221
+ "feature": {
222
+ "enabled": true,
223
+ "evidenceMode": "path_required",
224
+ "reviewer": {
225
+ "type": "subagent",
226
+ "model": "inherit",
227
+ "reasoningEffort": "high",
228
+ "onUnavailable": "inherit"
229
+ }
230
+ }
182
231
  }
183
232
  },
184
233
  "allowedDocsEntries": {
@@ -192,7 +241,7 @@ npx lee-spec-kit docs get agents --json
192
241
  }
193
242
  ```
194
243
 
195
- 새 local 프로젝트는 `local-ff`를 사용합니다. base branch에 하나의 commit만 남기려면 `local-squash`를 선택하세요. 이때 task checkpoint 증거를 위해 원본 Feature tip을 내부 `refs/lee-spec-kit/integrations/*` ref로 보존합니다. 기존 local 프로젝트에 명시적 `completionStrategy`가 없으면 `update`가 `none`을 넣어 업그레이드 도중 현재 브랜치를 갑자기 병합하지 않습니다. 준비가 끝난 뒤 `local-ff` 또는 `local-squash`로 명시적으로 전환하세요.
244
+ 프로젝트와 업데이트된 프로젝트는 기본적으로 태스크 구현을 위임하고 Plan 검수를 활성화합니다. 직접 구현하거나 Plan 검수를 끄려면 각각 `workflow.agentExecution.task.enabled` 또는 `workflow.agentReview.plan.enabled`를 `false`로 설정하세요. 새 local 프로젝트는 `local-ff`와 Feature agent review를 사용합니다. 태스크마다 리뷰하려면 `workflow.agentReview.task.enabled`를 `true`로 켜세요. 리뷰 지적 자동 반영 기본값은 `1`입니다. 즉 첫 리뷰 지적은 한 번 반영하고 다시 리뷰하며, 또 `changes_requested`가 나오면 `review_escalation`으로 전환합니다. 추가 반영과 fresh 리뷰를 허용하려면 먼저 `workflow.agentReview.maxRounds`를 늘리세요. base branch에 하나의 commit만 남기려면 `local-squash`를 선택하세요. 이때 task checkpoint 증거를 위해 원본 Feature tip을 내부 `refs/lee-spec-kit/integrations/*` ref로 보존합니다. 기존 local 프로젝트에 명시적 `completionStrategy`가 없으면 `update`가 `none`을 넣어 업그레이드 도중 현재 브랜치를 갑자기 병합하지 않습니다. 준비가 끝난 뒤 `local-ff` 또는 `local-squash`로 명시적으로 전환하세요.
196
245
 
197
246
  ```json
198
247
  {
@@ -52,9 +52,14 @@
52
52
 
53
53
  - lee-spec-kit은 문서 구조, workflow 단계, validator를 담당합니다.
54
54
  - Codex는 실행 루프, 도구 사용, hook lifecycle을 담당합니다.
55
- - `workflow-stage --json`가 `stage === "implementation"`이고 `implementationAllowed === true`를 반환하기 전에는 구현을 시작하지 않습니다.
56
- - `workflow-stage --json`의 `nextAction.category`가 `pre_pr_review`이고 `executor`가 `subagent`이면, 반환된 `model`, `reasoningEffort`, `onUnavailable` 정책으로 fresh context의 읽기 전용 서브에이전트 리뷰를 실행합니다. 리뷰 스킬 이름을 선택하거나 요구하지 않습니다.
57
- - Pre-PR 리뷰 서브에이전트는 finding만 반환하며 코드를 수정하지 않습니다. 메인 에이전트가 finding을 반영하고 reviewer metadata와 최종 decision을 evidence에 기록합니다.
55
+ - `implementationAllowed === true`일 때만 구현 코드를 수정합니다. 일반 태스크 구현은 `stage === "implementation"`에서, 리뷰 수정은 `task_review_fix` 또는 `feature_review_fix`에서, 검증 수정은 `feature_remediation`에서만 수행합니다.
56
+ - `nextAction.category`가 `plan_review`이고 `executor`가 `subagent`이면 반환된 `specHash`와 `planHash`를 대상으로 fresh 읽기 전용 서브에이전트가 `spec.md`와 `plan.md`를 검수합니다. 메인 에이전트가 반환된 `reviewRound`, Plan 검수 evidence, decision, reviewer metadata와 hash를 기록하며 이후 spec/plan 내용 변경은 기존 검수를 무효화합니다.
57
+ - `nextAction.category`가 `task_execute`이고 `executor`가 `subagent`이면 해당 태스크 하나를 활성화한 뒤, 반환된 `workingDirectory`에서 fresh 서브에이전트에게 반환된 모델·추론도·unavailability 정책과 정확한 `workerContract`로 구현과 태스크 범위 검증을 위임합니다. 특정 이름의 실행 스킬은 요구하지 않습니다.
58
+ - 구현 worker는 승인된 Verification Contract를 따르고 계획되지 않은 영구 테스트를 추가하지 않으며 직접 실행합니다. `workflow-stage`를 호출하거나 다른 서브에이전트를 생성하지 않습니다. 프로젝트 코드 수정과 범위 내 검사는 수행할 수 있지만 lee-spec-kit 문서 수정, 태스크 상태 변경, 커밋, 승인 요청, 원격/파괴적 작업은 하지 않습니다. 메인 에이전트가 결과를 확인하고 문서 동기화, 태스크 전환, 커밋, 후속 workflow를 소유하며, 공식 hook은 `task_execute`가 활성화된 동안 커밋을 차단합니다.
59
+ - `nextAction.category`가 `task_review`이고 `executor`가 `subagent`이면 반환된 task ID와 SHA/tree 범위를 fresh context의 읽기 전용 서브에이전트가 리뷰하고 반환된 `reviewRound`를 기록합니다.
60
+ - `nextAction.category`가 `pre_pr_review`이고 `executor`가 `subagent`이면 반환된 모델·추론도·`reviewRound`·SHA/tree 범위로 fresh context의 읽기 전용 Feature 리뷰를 실행합니다. 리뷰 스킬 이름을 선택하거나 요구하지 않습니다.
61
+ - 리뷰 서브에이전트는 finding만 반환하고 코드를 수정하지 않습니다. 메인 에이전트가 finding을 반영하고 reviewer metadata, reviewed scope, evidence, decision, 정확한 hash/SHA/tree target metadata를 기록합니다.
62
+ - `workflow.agentReview.maxRounds`는 최초 리뷰 횟수가 아니라 리뷰 지적 자동 반영 횟수입니다. `nextAction.category`가 `review_escalation`이면 그 횟수를 모두 사용한 상태입니다. 자동 수정이나 추가 리뷰 위임을 하지 말고 구현을 차단한 채 반환된 선택지를 그대로 제시합니다. 추가 반영은 먼저 `maxRounds`를 늘려야 합니다.
58
63
  - spec / plan / tasks 승인, issue 생성, branch 생성은 구현 전 하드 게이트로 취급합니다.
59
64
  - standalone 모드에서는 `git worktree add`를 직접 만들지 말고 `workflow-stage`의 정확한 `nextAction.command`를 실행해 managed workspace 경로, stale 디렉터리 정리, `.env`/`.env.*` 복사 단계가 일관되게 유지되도록 합니다.
60
65
  - local 모드에서는 구현 승인 직후 종료하지 않습니다. `workflow-stage`가 반환하는 정확한 `local verify`, `local merge`, `local cleanup` 명령을 따라 검증·통합·정리가 확인되어 `done`이 될 때까지 진행합니다. `feature_remediation` 단계에서는 Feature worktree 수정이 명시적으로 허용됩니다.
@@ -20,10 +20,12 @@
20
20
  - 문서가 SSOT입니다. 활성 feature 문서를 직접 따라갑니다.
21
21
  - 문서 단계는 직접 따라갑니다:
22
22
  - `spec.md`는 범위와 리뷰 상태를 정의합니다
23
- - `plan.md`는 구현 접근을 정의합니다
23
+ - `plan.md`는 구현 접근과 Verification Contract를 정의합니다
24
24
  - `tasks.md`는 실제 실행 순서를 정의합니다
25
25
  - `issue.md`, `pr.md`는 GitHub 단계에 들어가면 stage gate의 일부로 사용합니다
26
26
  - `tasks.md`가 있다고 바로 구현하지 않습니다. 구현은 `workflow-stage --json`가 허용할 때만 시작합니다.
27
+ - Plan 검수가 활성화되어 있으면 `plan.md`를 Review로 바꾸고 반환된 fresh 읽기 전용 `plan_review`를 위임한 뒤 `reviewRound`, evidence, decision, reviewer metadata, `specHash`, `planHash`를 기록합니다. 현재 hash에 대한 approve 검수만 Plan 승인으로 이어질 수 있습니다. reviewer는 문서를 수정하지 않고 NONE/UPDATE/ADD 결정, 요구사항 커버리지, 독립적인 Oracle, 안정적인 관찰 경계, 현실적인 실패/롤백, 제외 범위, focused/full 검증 범위를 점검합니다.
28
+ - `workflow.agentReview.maxRounds`는 최초 Plan 리뷰가 아니라 지적 자동 반영 횟수입니다. `workflow-stage`가 `review_escalation`을 반환하면 Plan 자동 수정을 멈추고 정확한 선택지를 사용자에게 제시합니다. 추가 반영은 먼저 설정값을 늘려야 합니다.
27
29
  - 범위나 동작이 바뀌면 같은 턴 안에서 활성 feature 문서를 같이 업데이트합니다.
28
30
  - 사용자 승인은 문서화된 review checkpoint와 원격/파괴적 작업 전에만 요청합니다.
29
31
  - docs 경로 검사가 중요하면 `git commit` 전에 `npx lee-spec-kit commit-audit --json`를 사용합니다.
@@ -25,15 +25,18 @@ Pre-PR 리뷰에서 서브에이전트가 항상 수행하는 최소 기준입
25
25
  2. 회귀/예외 처리, 크리티컬·보안 리스크, 사이드 이펙트, 사용자 흐름 영향, 배포 준비도를 점검합니다.
26
26
  3. 유지보수성을 점검합니다: 큰 함수/파일은 필요 시 분리하고, 기존 코드 재사용·통합 가능성을 확인하며, 불필요해진 코드를 정리합니다.
27
27
  4. 현재 구현이 `spec.md` / `plan.md` / `tasks.md`에 기록된 feature 의도와 범위에 실제로 맞는지 평가합니다.
28
- 5. `workflow.prePrReview.evidenceMode=path_required`(기본)일 때는 승인 전에 `review-trace.json` 같은 실제 리뷰 산출물을 남깁니다. `evidenceMode=any`에서는 실행 증거 강제가 없는 한 별도 산출물 없이 직접 기록하는 경로도 허용됩니다.
28
+ 5. `workflow.agentReview.feature.evidenceMode=path_required`(기본)일 때는 승인 전에 `review-trace.json` 같은 실제 리뷰 산출물을 남깁니다. `evidenceMode=any`에서는 실행 증거 강제가 없는 한 별도 산출물 없이 직접 기록하는 경로도 허용됩니다.
29
29
  6. `PR 전 리뷰 Evidence`는 설정된 evidence 정책을 따라야 합니다. `path_required`일 때는 실제 존재하는 문서 경로를 사용합니다.
30
30
  7. `Summary`, `Feature Intent Summary`, `Implementation Fit`, `Missing Cases`, `Spec Alignment Checked`, `Finding Count`, `Blocking Findings`, `Findings`, `Residual Risks`를 placeholder 없이 기록합니다.
31
31
  8. 리뷰 중에 audit/타깃 검증 명령을 실제로 실행했다면 그때만 `commandsExecuted`에 기록합니다.
32
32
  9. 코드리뷰 단계에서도 `PR 리뷰 Evidence/Decision`과 `decisions.md`를 동기화하고 `PR Review Log`(또는 `PR 리뷰 로그`)의 `Summary`/`Decision`을 기록합니다.
33
33
  10. `PR 전 리뷰 Decision`은 `결정: approve|changes_requested|blocked ...` (또는 `decision: ...`) 형식을 사용합니다.
34
- 11. PR 생성 단계로 이동하기 최종 Decision이 `approve`인지 확인합니다.
34
+ 11. 반환된 `reviewRound`를 `PR리뷰 Round`에 기록합니다.
35
+ 12. `PR 전 리뷰 Head`와 `PR 전 리뷰 Tree`가 `workflow-stage`의 `targetSha`와 `targetTree`와 일치하는지 확인합니다.
36
+ 13. `workflow.agentReview.maxRounds`는 최초 Feature 리뷰가 아니라 지적 자동 반영 횟수입니다. `workflow-stage`가 `review_escalation`을 반환하면 자동 수정을 멈추고 정확한 선택지를 사용자에게 제시합니다. 추가 반영은 먼저 설정값을 늘려야 합니다.
37
+ 14. PR 생성 단계로 이동하기 전 최종 Decision이 `approve`인지 확인합니다.
35
38
 
36
- 리뷰 산출물에는 실제 사용한 `executor`, `model`, `reasoningEffort`, 검토한 commit/diff 범위, finding과 최종 decision을 기록합니다. 리뷰 서브에이전트는 코드를 수정하지 않으며, finding 반영과 문서 갱신은 메인 에이전트가 담당합니다.
39
+ 리뷰 산출물에는 실제 사용한 `executor`, `model`, `reasoningEffort`, 검토한 commit/diff 범위, target SHA/tree, finding과 최종 decision을 기록합니다. 리뷰 서브에이전트는 코드를 수정하지 않으며, finding 반영과 문서 갱신은 메인 에이전트가 담당합니다.
37
40
 
38
41
  ---
39
42
 
@@ -13,11 +13,18 @@
13
13
  - 이미 `[DOING]`인 태스크가 하나 있으면 그것을 이어서 수행하고
14
14
  - 없으면 가장 우선순위가 높은 `[TODO]` 태스크를 `[DOING]`으로 바꿉니다
15
15
  - 한 번에 하나의 태스크만 진행합니다.
16
+ - `nextAction.executor === "subagent"`이면 반환된 `workingDirectory`에서 해당 태스크의 구현과 태스크 범위 검증을 fresh 서브에이전트에게 반환된 `model`, `reasoningEffort`, `onUnavailable` 설정과 정확한 `workerContract`로 위임합니다. 지정 모델을 사용할 수 없을 때 `inherit`은 현재 모델을 상속해 다시 위임하고, `error`는 중단 후 실패를 보고한다는 뜻입니다.
17
+ - 구현 worker는 할당된 태스크를 직접 실행합니다. `workflow-stage` 재호출, 재위임, lee-spec-kit 문서 수정, 태스크 상태 변경, 커밋, 승인 요청, 원격/파괴적 작업은 하지 않습니다. 프로젝트 코드 수정과 태스크 범위 검사만 수행합니다.
18
+ - 구현 worker는 승인된 `plan.md` Verification Contract를 따릅니다. `NONE`이면 영구 테스트를 추가하지 않고, `UPDATE`이면 계약을 소유한 기존 테스트만 최소 수정하며, `ADD`이면 계약에 연결된 테스트만 추가합니다. 승인된 결정이 충분하지 않다면 테스트 범위를 임의로 넓히지 말고 메인 에이전트에 보고합니다.
19
+ - 명시적 ID가 없는 레거시 태스크는 `workflow-stage`가 안정적인 synthetic `taskId`를 반환합니다. ID 추가만을 위해 레거시 태스크 문서를 다시 쓰지 말고 반환된 ID를 사용합니다.
16
20
 
17
21
  ## 2. 실행과 기록
18
22
 
19
23
  - `tasks.md`를 현실과 맞게 유지합니다:
20
24
  - 실제 완료/검증 없이 `[DONE]`로 바꾸지 않습니다
25
+ - `workflow.agentReview.task.enabled=true`이면 구현/검증 완료 후 `[DONE]` 대신 `[REVIEW]`로 바꾸고 checkpoint commit을 만든 뒤 독립 리뷰를 진행합니다
26
+ - 반환된 `reviewRound`를 기록하고, task review가 현재 SHA/tree를 `approve`한 뒤에만 `[REVIEW]`를 `[DONE]`으로 바꿉니다
27
+ - `workflow.agentReview.maxRounds`는 최초 task 리뷰가 아니라 지적 자동 반영 횟수입니다. `review_escalation`에서는 자동 수정을 멈추고 정확한 선택지를 사용자에게 제시하며, 추가 반영 전에 설정값을 늘려야 합니다
21
28
  - 태스크를 닫을 때는 같은 수정에서 `Acceptance`와 `Checklist`도 함께 갱신합니다
22
29
  - 완료된 태스크에 후속 작업이 생기면 히스토리를 고치지 말고 새 태스크를 추가합니다
23
30
  - 새 태스크를 추가해야 한다면 `tasks.md`에 구체적인 제목, `Acceptance`, `Checklist`, 그리고 `NON-PRD` 또는 기존 `PRD-*` 태그가 있는 완전한 태스크 블록을 추가하세요.
@@ -33,6 +40,7 @@
33
40
  ## 4. 커밋과 종료 가드레일
34
41
 
35
42
  - docs 경로 검사가 중요하면 `git commit` 전에 `npx lee-spec-kit commit-audit --json`를 사용합니다.
43
+ - 문서/프로젝트 커밋과 태스크 checkpoint는 구현 서브에이전트가 아니라 메인 에이전트가 소유합니다.
36
44
  - 코드나 feature 문서를 바꿨다면 종료 전에 `npx lee-spec-kit workflow-audit --json`로 동기화 상태를 확인합니다.
37
45
  - `tasks.md` 테스트 로그는 명령어당 1개 행만 유지하고, 재실행 시 기존 행을 갱신합니다.
38
46
 
@@ -40,7 +48,7 @@
40
48
 
41
49
  - 사용자 승인은 문서화된 review checkpoint와 원격/파괴적 작업 전에만 요청합니다.
42
50
  - issue 생성, PR 생성, push, merge 같은 원격 작업 전에는 올릴 artifact나 계획을 먼저 공유합니다.
43
- - 구현 자체는 Codex가 필요하면 위임할 있지만, 문서 갱신, 승인 처리, 원격 작업은 메인 세션에서 유지합니다.
51
+ - Plan/task/Feature review는 `workflow-stage`가 반환한 모델·추론도와 정확한 hash/SHA/tree target 설정의 fresh 읽기 전용 서브에이전트에게 맡기고, 문서 갱신, finding 반영, 승인 처리, 원격 작업은 메인 세션에서 유지합니다.
44
52
 
45
53
  ## 절대 규칙
46
54