lee-spec-kit 0.7.11 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +32 -54
- package/README.md +32 -54
- package/dist/bootstrap-ZIJP7O72.js +5 -0
- package/dist/bootstrap-ZIJP7O72.js.map +1 -0
- package/dist/chunk-7V7RMGEU.js +11 -0
- package/dist/chunk-7V7RMGEU.js.map +1 -0
- package/dist/chunk-GR7JQBWF.js +26 -0
- package/dist/chunk-GR7JQBWF.js.map +1 -0
- package/dist/chunk-RYSDBL6X.js +250 -0
- package/dist/chunk-RYSDBL6X.js.map +1 -0
- package/dist/hooks-IP6FICAV.js +1004 -0
- package/dist/hooks-IP6FICAV.js.map +1 -0
- package/dist/index.js +4129 -15544
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/en/common/README.md +12 -10
- package/templates/en/common/agents/agents.md +31 -89
- package/templates/en/common/agents/skills/create-feature.md +30 -57
- package/templates/en/common/agents/skills/create-issue.md +5 -10
- package/templates/en/common/agents/skills/create-pr.md +4 -11
- package/templates/en/common/agents/skills/execute-task.md +32 -96
- package/templates/en/common/features/README.md +1 -1
- package/templates/en/common/features/feature-base/tasks.md +5 -5
- package/templates/ko/common/README.md +12 -10
- package/templates/ko/common/agents/agents.md +30 -87
- package/templates/ko/common/agents/skills/create-feature.md +30 -58
- package/templates/ko/common/agents/skills/create-issue.md +5 -10
- package/templates/ko/common/agents/skills/create-pr.md +4 -11
- package/templates/ko/common/agents/skills/execute-task.md +32 -102
- package/templates/ko/common/features/README.md +1 -1
- package/templates/ko/common/features/feature-base/tasks.md +5 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lee-spec-kit",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Document-centered harness engineering toolkit for AI agent development",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"lee-spec-kit": "./dist/index.js",
|
|
@@ -11,23 +11,23 @@ npx lee-spec-kit onboard --strict
|
|
|
11
11
|
# 1) Detect project
|
|
12
12
|
npx lee-spec-kit detect --json
|
|
13
13
|
|
|
14
|
-
# 2) If detected, read
|
|
15
|
-
npx lee-spec-kit
|
|
14
|
+
# 2) If detected, read the workflow policy
|
|
15
|
+
npx lee-spec-kit docs get agents --json
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
- Apply lee-spec-kit workflow only when `isLeeSpecKitProject: true`.
|
|
19
|
-
- Use
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
19
|
+
- Use workspace-scoped `AGENTS.md`, official Codex hooks, and the active feature docs as the default runtime path.
|
|
20
|
+
- Resolve the active feature, then treat `spec.md`, `plan.md`, `tasks.md`, and `decisions.md` as the working SSOT.
|
|
21
|
+
- Ask for approval only at documented workflow checkpoints and before remote or destructive actions.
|
|
22
|
+
- Use `npx lee-spec-kit commit-audit --json` before `git commit` when staged docs paths need validation.
|
|
23
|
+
- Use `npx lee-spec-kit workflow-audit --json` before stopping when code or feature docs changed.
|
|
24
24
|
- If `isLeeSpecKitProject: false`, skip lee-spec-kit-specific flow and continue with normal workflow.
|
|
25
25
|
|
|
26
26
|
## New Project Start Order
|
|
27
27
|
|
|
28
28
|
- Scaffold the code project first (for example Next.js/NestJS), then run `lee-spec-kit init`.
|
|
29
29
|
- After that, write top-level requirements in `docs/prd/`, then continue with `idea` and `feature`.
|
|
30
|
-
- Verify detection with `detect --json`, then continue
|
|
30
|
+
- Verify detection with `detect --json`, then continue through `docs get agents --json` and the active feature docs.
|
|
31
31
|
- In most cases (default: embedded), the steps above are all you need.
|
|
32
32
|
- Choose standalone only when docs are managed separately from the code repo. In that case, prefer running init from a parent workspace folder (for example `workspace/docs`, `workspace/project`) and set both docs/project paths together. (e.g. `npx lee-spec-kit init --docs-repo standalone --dir ./docs --project-root ./project`)
|
|
33
33
|
|
|
@@ -77,7 +77,7 @@ Recommended flow:
|
|
|
77
77
|
- **Unmanaged docs entries**: any top-level docs entry outside the canonical surface
|
|
78
78
|
- Examples: `docs/plans/`, `docs/superpowers/`, or another skill-created folder
|
|
79
79
|
- Treat them as staging/reference inputs only, not the active workflow SSOT
|
|
80
|
-
-
|
|
80
|
+
- Normalize or allowlist them before commit; `commit-audit` blocks staged non-canonical docs paths
|
|
81
81
|
- Normalize them into feature-local docs:
|
|
82
82
|
- design/spec artifact → `spec.md`, `plan.md`, `decisions.md`
|
|
83
83
|
- implementation plan artifact → `plan.md`, `tasks.md`
|
|
@@ -117,7 +117,9 @@ When you run `lee-spec-kit init`, it creates `.lee-spec-kit.json` in the docs ro
|
|
|
117
117
|
- `docsRepo` ("embedded" | "standalone"): How docs are managed
|
|
118
118
|
- `pushDocs` (boolean, optional): Only written when `docsRepo: "standalone"` (whether to push to remote)
|
|
119
119
|
- `docsRemote` (string, optional): Only written when `pushDocs: true` (remote repo URL)
|
|
120
|
-
- `approval` (object, optional):
|
|
120
|
+
- `approval` (object, optional): optional approval-checkpoint metadata for repo policy and custom validators
|
|
121
|
+
- The Codex-native default path still asks at documented checkpoints and before remote/destructive actions first.
|
|
122
|
+
- Legacy runtime consumed this field directly; keep it only when you intentionally want category-based checkpoint metadata.
|
|
121
123
|
- Current default:
|
|
122
124
|
- `mode: "category"`
|
|
123
125
|
- `default: "skip"`
|
|
@@ -1,107 +1,49 @@
|
|
|
1
1
|
# Agents Guide
|
|
2
2
|
|
|
3
3
|
Operating rules for AI code assistants.
|
|
4
|
-
This document
|
|
4
|
+
This document defines workflow policy, not a custom runtime loop.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Detection Gate
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
- Run `npx lee-spec-kit detect --json` first.
|
|
11
|
+
- Use lee-spec-kit policy only when detection returns `status === "ok"` and `isLeeSpecKitProject === true`.
|
|
12
|
+
- If detection fails or returns false, ignore lee-spec-kit-specific rules and continue normally.
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
> ✅ In approval-waiting state, replies must be in `<label>` or `<label> OK` format (e.g. `A`, `A OK`).
|
|
14
|
-
> ℹ️ Under the default policy, the main workflow approval boundaries are `spec_approve` and `implementation_approve`. Project config may add more.
|
|
15
|
-
> ℹ️ Some direct remote helper commands still require explicit command confirmation such as `--confirm OK`; that command-level confirm is separate from label-gated workflow approval.
|
|
14
|
+
## Default Runtime
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
- Prefer Codex native execution with workspace-scoped `AGENTS.md` plus official Codex hooks.
|
|
17
|
+
- If the user gives a generic request such as continuing the next feature according to the rules, interpret it through this workflow automatically.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
| --- | --- |
|
|
21
|
-
| Spec / plan / tasks review | The document or the exact section being reviewed |
|
|
22
|
-
| Task completion / final checklist | Outcome and verification evidence |
|
|
23
|
-
| Commit / push / merge | Commit message, included files, branch |
|
|
24
|
-
| Issue creation | Before `npx lee-spec-kit github issue <featureRef> --create` |
|
|
25
|
-
| PR creation | Before `npx lee-spec-kit github pr <featureRef> --create` |
|
|
26
|
-
| Assignee change | Target username |
|
|
27
|
-
|
|
28
|
-
Approval flow:
|
|
29
|
-
1. Share details first
|
|
30
|
-
2. Check whether approval is currently required via the latest `context --json-compact` (`approvalRequest.required`)
|
|
31
|
-
3. If approval is required, wait for the exact CLI-provided label prompt response; if not, do not invent a separate approval prompt
|
|
32
|
-
4. Execute after approval (for command execution, default to `npx lee-spec-kit flow <featureRef> --approve <LABEL> --execute`)
|
|
33
|
-
|
|
34
|
-
Prohibited:
|
|
35
|
-
- Proceeding without user response
|
|
19
|
+
## Docs Are SSOT
|
|
36
20
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
- Do not infer approval-waiting from conversation tone, action type, or the mere presence of `actionOptions[]`.
|
|
43
|
-
- Use the latest `npx lee-spec-kit context --json-compact` as the default source (fallback: `context --json` or `flow --json` when full detail is required; prefer `flow --json-compact` for default flow output).
|
|
44
|
-
- When using auto results from `flow --json-compact` (or `flow --json`), treat `autoRun.resume.flowCommand` as SSOT for resume (including after context compression/reset).
|
|
45
|
-
- Treat `AUTO_DELEGATED_HANDOFF` as a delegated pause, not a failure. Continue or resume the delegated run path and do not reopen the same approval label.
|
|
46
|
-
- Treat `AUTO_MANUAL_REQUIRED` as an instruction-only automation boundary, not an immediate failure. Re-check `context --json-compact`, then decide stop/report by `approvalRequest.required` (`context --json` only for full-detail debugging fields).
|
|
47
|
-
- Special case: if `matchedFeature.currentSubstateId === "change_request_sync"` or `matchedFeature.pendingChangeRequest` is present, treat that manual boundary as an internal docs-sync step first, not an immediate user-facing stop. Sync docs, clear the pending change field, then continue with fresh `context --json-compact` or `flow`.
|
|
48
|
-
- Treat `AUTO_SELECTION_REQUIRED` as a feature-selection pause, not an execution failure. Resolve the active feature first, then continue with fresh `context --json-compact` or `flow`.
|
|
49
|
-
- In approval-waiting state, if `matchedFeature.currentSubstateId` exists, prepend one brief current-stage recap derived from `matchedFeature.currentSubstateId/currentSubstateOwner/currentSubstatePhase`.
|
|
50
|
-
- Then prefer `approvalRequest.userFacingLines` from `context --json-compact`. If full `--json` is used, fall back to `actionOptions[*].approvalPrompt` plus `approvalRequest.finalPrompt`. Do not add your own rewritten label summary before or between those lines.
|
|
51
|
-
- Prefer `matchedFeature.currentSubstateOwner` plus `agentOrchestration.subAgentHandoff` as the delegation SSOT.
|
|
52
|
-
- In non-approval state, do not append labels or `approvalRequest.finalPrompt` unless the user explicitly asked for current options.
|
|
53
|
-
- If approval is still pending after answering an unrelated question, answer first, re-check `approvalRequest.required`, and if it is still `true`, re-open approval with one brief current-stage recap plus the exact CLI-provided approval lines (`approvalRequest.userFacingLines`, or `actionOptions[*].approvalPrompt` + `approvalRequest.finalPrompt` in full `--json`).
|
|
54
|
-
- If user input does not contain a valid label, do not execute; request label selection again.
|
|
55
|
-
- For non-delegated command options, prefer one-shot `flow --approve <LABEL> --execute`; do not split `context --approve` and `context --execute --ticket` across turns/sessions.
|
|
56
|
-
- If `matchedFeature.currentSubstateOwner="subagent"` and `agentOrchestration.subAgentHandoff.required=true` with `mode="command"`, delegation is mandatory: call `spawn_agent` first. Do not execute that command directly from the main agent.
|
|
57
|
-
- If that delegated command is handoff-only (`handoffOnly=true`, `advancesWorkflow=false`), treat `--execute` as handoff preparation only. Continue the delegated work immediately and do not re-approve the same label.
|
|
58
|
-
- Do not delegate auto loops from `autoRun.available` alone. Delegate auto loops only when `agentOrchestration.subAgentHandoff.required=true` and `agentOrchestration.subAgentHandoff.mode="auto_run"`.
|
|
59
|
-
- Prefer `agentOrchestration.subAgentHandoff` as the handoff SSOT. Pass only its minimal fields (`featureRef`, `category`, `cwd`, `cmd`) to the sub-agent.
|
|
60
|
-
- For delegated runs, execute one-time verification from `subAgentHandoff.verify` (`pwd`, `git rev-parse --show-toplevel`) and cache by `verify.cacheKey`. If mismatched, stop and report; collect detailed logs only on mismatch.
|
|
61
|
-
- Main-agent fallback is allowed only when sub-agent execution is unavailable (for example: tool not available, spawn failed, or sub-agent failed before command execution).
|
|
62
|
-
- When fallback is used, report a one-line fallback reason to the user before running the command in the main agent.
|
|
21
|
+
- Read `npx lee-spec-kit docs get agents --json` once at session start or right after context reset.
|
|
22
|
+
- Read every unread `requiredDocs[*].command` from that response.
|
|
23
|
+
- Resolve the active feature, then use that feature folder as the working SSOT.
|
|
24
|
+
- Minimum active feature docs: `spec.md`, `plan.md`, `tasks.md`, `decisions.md`.
|
|
25
|
+
- When GitHub workflow is involved, also use `issue.md` and `pr.md`.
|
|
63
26
|
|
|
64
|
-
|
|
27
|
+
## Execution Rules
|
|
65
28
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
29
|
+
- lee-spec-kit owns docs structure, workflow stages, and validators.
|
|
30
|
+
- Codex owns the execution loop, tool usage, and hook lifecycle.
|
|
31
|
+
- Keep docs synced with code changes in the same turn whenever behavior or scope changes.
|
|
32
|
+
- Use `npx lee-spec-kit commit-audit --json` before `git commit` when staged docs paths need validation.
|
|
33
|
+
- Use `npx lee-spec-kit workflow-audit --json` as the default end-of-turn docs sync check.
|
|
69
34
|
|
|
70
|
-
|
|
71
|
-
- Do not re-read the same doc again in the same session.
|
|
72
|
-
- From `requiredDocs[*].command`, fetch only docs not yet read in this session.
|
|
73
|
-
- You may re-read only when:
|
|
74
|
-
- user explicitly asks for policy refresh
|
|
75
|
-
- policy/config changed (for example after `update`)
|
|
76
|
-
- session restarted or context was compressed/reset
|
|
35
|
+
## Approval Rules
|
|
77
36
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- Highest-priority custom rules: `/docs/agents/custom.md`
|
|
83
|
-
- Project principles: `/docs/agents/constitution.md`
|
|
84
|
-
- Root guide: `npx lee-spec-kit docs get agents --json`
|
|
85
|
-
- Git workflow: `npx lee-spec-kit docs get git-workflow --json`
|
|
86
|
-
- Task execution: `npx lee-spec-kit docs get execute-task --json`
|
|
87
|
-
- Issue procedure/doc: `npx lee-spec-kit docs get create-issue --json` → `npx lee-spec-kit docs get issue-doc --json`
|
|
88
|
-
- PR procedure/doc: `npx lee-spec-kit docs get create-pr --json` → `npx lee-spec-kit docs get pr-doc --json`
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Scope Split
|
|
93
|
-
|
|
94
|
-
- Docs structure/path rules: use `docs/README.md` as SSOT
|
|
95
|
-
- Canonical docs surface is limited to the top-level entries defined by `docs/README.md`. Treat any non-allowlisted extra `docs/*` top-level entry as unmanaged docs.
|
|
96
|
-
- Unmanaged docs entries (for example `docs/plans/*`, `docs/superpowers/*`, or another skill-created docs folder) are staging/reference inputs only. When a feature is active, normalize them into feature-local docs and treat the feature folder as the final SSOT.
|
|
97
|
-
- If `context` surfaces a `docs_normalize` action/category, complete that normalization step before continuing implementation or workflow actions.
|
|
98
|
-
- ADR format: use feature `decisions.md` template as SSOT
|
|
99
|
-
- Issue/PR execution state: use each feature's `issue.md` and `pr.md` as SSOT
|
|
37
|
+
| Current action (examples) | What to share |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Issue creation | Before `npx lee-spec-kit github issue <featureRef> --create` |
|
|
40
|
+
| PR creation | Before `npx lee-spec-kit github pr <featureRef> --create` |
|
|
100
41
|
|
|
101
|
-
|
|
42
|
+
- Ask the user for approval at documented workflow checkpoints and before remote or destructive actions.
|
|
43
|
+
- Share the exact artifact or plan before remote GitHub actions.
|
|
102
44
|
|
|
103
|
-
##
|
|
45
|
+
## Formatting Rules
|
|
104
46
|
|
|
105
|
-
- Replies: English
|
|
106
|
-
- Code
|
|
107
|
-
-
|
|
47
|
+
- Replies: English unless project policy overrides it
|
|
48
|
+
- Code and filenames: English
|
|
49
|
+
- Dates and times: use the user's local system time
|
|
@@ -1,61 +1,34 @@
|
|
|
1
|
-
# Feature Implementation Process:
|
|
1
|
+
# Feature Implementation Process: Docs-first
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
As an agent, do not trust your own judgment—follow the **CLI output** only.
|
|
3
|
+
This guide defines how to start or continue a feature in the Codex-native lee-spec-kit path.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
## 🛑 Strict rules
|
|
38
|
-
|
|
39
|
-
1. **Do not jump ahead**: Never do “Plan” when the CLI says “Spec”.
|
|
40
|
-
2. **Do not skip**: Do not fake issue numbers/statuses to advance steps.
|
|
41
|
-
3. **No self-judgment**: If unsure, run `context` again.
|
|
42
|
-
|
|
43
|
-
> Note: the workflow steps may change over time. Do not memorize step numbers.
|
|
44
|
-
> Treat `context` output as the SSOT.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Getting started
|
|
49
|
-
|
|
50
|
-
If the Feature folder does not exist yet:
|
|
51
|
-
|
|
52
|
-
- If the user's request includes an explicit Idea ref such as `I001`, `I001-slug`, or `docs/ideas/...`, preserve that ref and create the feature with `npx lee-spec-kit feature <name> --idea <ref>`.
|
|
53
|
-
- Do not infer an Idea ref. Use `--idea` only when the request explicitly names one.
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# 1) Create the folder
|
|
57
|
-
npx lee-spec-kit feature <name> -d "<description>"
|
|
58
|
-
|
|
59
|
-
# 2) Enter the loop
|
|
60
|
-
npx lee-spec-kit context
|
|
61
|
-
```
|
|
7
|
+
## Start
|
|
8
|
+
|
|
9
|
+
1. Run `npx lee-spec-kit detect --json`.
|
|
10
|
+
2. If detected, read `npx lee-spec-kit docs get agents --json` and any unread follow-up docs.
|
|
11
|
+
3. If the feature folder does not exist yet:
|
|
12
|
+
- preserve an explicit Idea ref only when the user actually named one (`I001`, `I001-slug`, or `docs/ideas/...`)
|
|
13
|
+
- create the feature with `npx lee-spec-kit feature <name> --idea <ref>` only for that explicit ref
|
|
14
|
+
- otherwise create it with `npx lee-spec-kit feature <name> -d "<description>"`
|
|
15
|
+
4. Resolve the active feature and read its docs: `spec.md`, `plan.md`, `tasks.md`, `decisions.md`.
|
|
16
|
+
|
|
17
|
+
## Working Rules
|
|
18
|
+
|
|
19
|
+
- Docs are the SSOT. Follow the active feature docs directly.
|
|
20
|
+
- Progress through the documented stages directly:
|
|
21
|
+
- `spec.md` defines scope and review state
|
|
22
|
+
- `plan.md` defines the implementation approach
|
|
23
|
+
- `tasks.md` drives execution order
|
|
24
|
+
- `issue.md` / `pr.md` are used only when the feature reaches GitHub workflow stages
|
|
25
|
+
- When scope or behavior changes, update the active feature docs in the same turn before continuing.
|
|
26
|
+
- Ask for approval at documented review checkpoints and before remote or destructive actions.
|
|
27
|
+
- Use `npx lee-spec-kit commit-audit --json` before `git commit` when docs-path validation matters.
|
|
28
|
+
- Use `npx lee-spec-kit workflow-audit --json` before stopping when code or feature docs changed.
|
|
29
|
+
|
|
30
|
+
## Strict Rules
|
|
31
|
+
|
|
32
|
+
1. Do not invent issue/PR numbers or status transitions.
|
|
33
|
+
2. Do not skip required doc updates when scope, behavior, or evidence changed.
|
|
34
|
+
3. Do not treat unmanaged docs artifacts as the active workflow SSOT until they are normalized into the feature folder or allowlisted.
|
|
@@ -8,7 +8,7 @@ Execution-state SSOT is the feature-local `issue.md`.
|
|
|
8
8
|
## Prerequisites
|
|
9
9
|
|
|
10
10
|
- [ ] `spec.md` completed
|
|
11
|
-
- [ ]
|
|
11
|
+
- [ ] Active feature docs reviewed
|
|
12
12
|
|
|
13
13
|
---
|
|
14
14
|
|
|
@@ -38,9 +38,7 @@ Use `issue.md` status (`Draft | Ready`) as the actual workflow state.
|
|
|
38
38
|
| Labels | `enhancement`, `bug`, `documentation`, etc. |
|
|
39
39
|
| Assignee | `@me` (default) |
|
|
40
40
|
|
|
41
|
-
### 2. Move to `Ready`
|
|
42
|
-
|
|
43
|
-
> ⚠️ **Workflow label approval is conditional**
|
|
41
|
+
### 2. Move to `Ready`
|
|
44
42
|
|
|
45
43
|
Share the `issue.md` draft:
|
|
46
44
|
|
|
@@ -48,16 +46,13 @@ Share the `issue.md` draft:
|
|
|
48
46
|
- Full body draft (from `issue.md`)
|
|
49
47
|
- Labels
|
|
50
48
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- If `approvalRequest.required=true`, show the exact CLI-provided approval lines and wait for a label reply (`A` or `A OK`) before continuing.
|
|
54
|
-
- If `approvalRequest.required=false`, do not invent a separate label prompt; refine the draft and set `issue.md` status to `Ready`.
|
|
49
|
+
Refine the draft and set `issue.md` status to `Ready` once the document is complete.
|
|
55
50
|
|
|
56
51
|
### 3. Create Issue (when `issue.md` is `Ready`)
|
|
57
52
|
|
|
58
53
|
Remote issue creation must use the lee-spec-kit helper.
|
|
59
54
|
Do not call `gh issue create` directly or pass raw `issue.md` to `--body-file`.
|
|
60
|
-
|
|
55
|
+
Remote confirmation is always required:
|
|
61
56
|
|
|
62
57
|
- share the final title/body/labels with the user
|
|
63
58
|
- then run the helper with `--confirm OK`
|
|
@@ -76,6 +71,6 @@ After creation:
|
|
|
76
71
|
|
|
77
72
|
- **Draft generator**: `npx lee-spec-kit github issue <feature-name>`
|
|
78
73
|
- **Remote creation rule**: must use `npx lee-spec-kit github issue <feature-name> --create --confirm OK --labels ...`
|
|
79
|
-
- **Workflow approval rule**:
|
|
74
|
+
- **Workflow approval rule**: ask the user for approval before remote issue creation
|
|
80
75
|
- **Remote confirm rule**: share title/body/labels first, then run `--create --confirm OK`
|
|
81
76
|
- **Execution-state SSOT**: `docs/features/.../<feature>/issue.md`
|
|
@@ -22,7 +22,7 @@ Always run this checklist in Pre-PR review. Treat it as the minimum baseline, th
|
|
|
22
22
|
2. Inspect regression, exception handling, critical/security risks, side effects, user flow impact, and release readiness.
|
|
23
23
|
3. Check maintainability: split oversized functions/files when needed, reuse/integrate existing code where appropriate, and remove obsolete code.
|
|
24
24
|
4. Judge whether the implementation actually fits the feature intent and scope documented in `spec.md` / `plan.md` / `tasks.md`.
|
|
25
|
-
5. When `workflow.prePrReview.evidenceMode=path_required` (default),
|
|
25
|
+
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.
|
|
26
26
|
6. `Pre-PR Evidence` should follow the configured evidence policy. In `path_required`, it must point to a real existing path.
|
|
27
27
|
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.
|
|
28
28
|
8. Use `commandsExecuted` only for optional audit/targeted verification that you actually chose to run during review.
|
|
@@ -145,9 +145,7 @@ echo \"\"
|
|
|
145
145
|
- Write a Mermaid **`sequenceDiagram`** in the PR body and keep it aligned with the generated body template format.
|
|
146
146
|
- Apply this rule based on change type (logic/structure), not by frontend/backend classification.
|
|
147
147
|
|
|
148
|
-
### 4. Move to `Ready`
|
|
149
|
-
|
|
150
|
-
> ⚠️ **Workflow label approval is conditional**
|
|
148
|
+
### 4. Move to `Ready`
|
|
151
149
|
|
|
152
150
|
Before creating the PR, share the following **in a code block**:
|
|
153
151
|
|
|
@@ -155,18 +153,13 @@ Before creating the PR, share the following **in a code block**:
|
|
|
155
153
|
- Full body template (from `pr.md`)
|
|
156
154
|
- Labels (at least 1; cannot be empty)
|
|
157
155
|
|
|
158
|
-
Then re-check the latest `npx lee-spec-kit context --json-compact`.
|
|
159
|
-
|
|
160
|
-
- If `approvalRequest.required=true`, wait for the exact CLI-provided `<LABEL>` or `<LABEL> OK` reply.
|
|
161
|
-
- If `approvalRequest.required=false`, do not invent a separate label prompt.
|
|
162
|
-
|
|
163
156
|
Before moving on, refine `pr.md` Changes/Tests sections based on actual work and set `pr.md` status to `Ready`.
|
|
164
157
|
|
|
165
158
|
### 5. Create PR (when `pr.md` is `Ready`)
|
|
166
159
|
|
|
167
160
|
Remote PR creation must use the lee-spec-kit helper.
|
|
168
161
|
Do not call `gh pr create` directly or pass raw `pr.md` to `--body-file`.
|
|
169
|
-
|
|
162
|
+
Remote confirmation is always required:
|
|
170
163
|
|
|
171
164
|
- share the final title/body/labels with the user
|
|
172
165
|
- then run the helper with `--confirm OK`
|
|
@@ -221,6 +214,6 @@ Use **current branch name** for file links in PR body:
|
|
|
221
214
|
|
|
222
215
|
- **Body template generator**: `npx lee-spec-kit github pr <feature-name>`
|
|
223
216
|
- **Remote creation rule**: must use `npx lee-spec-kit github pr <feature-name> --create --confirm OK --labels ...`
|
|
224
|
-
- **Workflow approval rule**:
|
|
217
|
+
- **Workflow approval rule**: ask the user for approval before remote PR creation or merge
|
|
225
218
|
- **Remote confirm rule**: share title/body/labels first, then run `--create --confirm OK`
|
|
226
219
|
- **Execution-state SSOT**: `docs/features/.../<feature>/pr.md`
|
|
@@ -1,111 +1,47 @@
|
|
|
1
|
-
# Task Execution Process:
|
|
1
|
+
# Task Execution Process: Docs-first
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
As an agent, follow `npx lee-spec-kit context` as the single source of truth.
|
|
3
|
+
Use the active feature folder as the execution SSOT.
|
|
5
4
|
|
|
6
5
|
---
|
|
7
6
|
|
|
8
|
-
##
|
|
7
|
+
## 1. Pick the current task
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
- Resolve the active feature first.
|
|
10
|
+
- In `tasks.md`, either:
|
|
11
|
+
- continue the single `[DOING]` task, or
|
|
12
|
+
- move the next highest-priority `[TODO]` task to `[DOING]`
|
|
13
|
+
- Work one task at a time. Do not batch-complete multiple tasks in one pass.
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
## 2. Execute and record
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
- Keep `tasks.md` aligned with reality:
|
|
18
|
+
- do not mark `[DONE]` without real completion and verification
|
|
19
|
+
- update `Acceptance` and `Checklist` in the same edit when closing a task
|
|
20
|
+
- if a completed task needs follow-up, add a new task instead of rewriting history
|
|
21
|
+
- If you need to add a new task, prefer `npx lee-spec-kit task add <feature-ref> --title "..." --ref NON-PRD|PRD-*`.
|
|
22
|
+
- Do not leave placeholder `Acceptance` or `Checklist` items in newly added tasks.
|
|
17
23
|
|
|
18
|
-
|
|
24
|
+
## 3. Keep docs in sync
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
- `spec.md`: update when user-visible scope or acceptance criteria change
|
|
27
|
+
- `plan.md`: update when architecture, file structure, or test strategy changes
|
|
28
|
+
- `decisions.md`: record non-obvious decisions, trade-offs, compatibility behavior, and user-requested behavior changes
|
|
29
|
+
- If `Pending Change Request` is present, sync `tasks.md` first, then update supporting docs and clear the field before resuming implementation
|
|
21
30
|
|
|
22
|
-
|
|
23
|
-
- Treat task state transitions in `tasks.md` **"Task Rules"** as SSOT.
|
|
24
|
-
- Treat `approvalRequest.required` from `context --json-compact` as SSOT for approval waiting (`--json` only when full-detail debugging fields are required).
|
|
25
|
-
- `false`: continue without label approval.
|
|
26
|
-
- `true`: wait for label-token approval (`A`, `A OK`) before execution.
|
|
27
|
-
- Default execution model is **main-agent orchestration + sub-agent-first execution for sub-agent-owned run states**. Use `matchedFeature.currentSubstateId/currentSubstateOwner/currentSubstatePhase` from `context --json-compact` as the execution-state SSOT when present.
|
|
28
|
-
- Main agent owns approval boundaries, state transitions, record/commit steps, and remote operations. Sub-agent execution is the default for command substates owned by `subagent` (for example `task_run`, `pre_pr_review_run`, `code_review_run`, and auto-run handoff commands).
|
|
29
|
-
- `pre_pr_review` is split into `pre_pr_review_run` (sub-agent review execution) and `pre_pr_review_record` (main-agent recording of evidence/results).
|
|
30
|
-
- PR review follows the same pattern: `code_review_run` is the sub-agent review/fix execution state, and the merge/push/final decision stays in the main-agent finalize state.
|
|
31
|
-
- Prefer `matchedFeature.currentSubstateOwner` plus `agentOrchestration.subAgentHandoff` as the delegation SSOT.
|
|
32
|
-
- When `matchedFeature.currentSubstateOwner="subagent"` and `agentOrchestration.subAgentHandoff.required=true` with `mode="command"`, delegation is mandatory: call `spawn_agent` first and do not execute the command directly from the main agent.
|
|
33
|
-
- Do not delegate auto loops from `autoRun.available` alone. Delegate auto loops only when `agentOrchestration.subAgentHandoff.required=true` and `agentOrchestration.subAgentHandoff.mode="auto_run"`.
|
|
34
|
-
- Use `agentOrchestration.subAgentHandoff` as the minimal handoff contract (`featureRef`, `category`, `cwd`, `cmd`).
|
|
35
|
-
- If an action option exposes `handoffOnly=true` and `advancesWorkflow=false`, do not treat `--execute` success as workflow progress. Finish the delegated work and update the required evidence/state before running `context` again.
|
|
36
|
-
- Run `subAgentHandoff.verify.commands` only once per session using `verify.cacheKey` (`pwd`, `git rev-parse --show-toplevel`). Stop/report on mismatch, and gather detailed logs only when mismatch happens.
|
|
37
|
-
- Main-agent fallback is allowed only when sub-agent execution is unavailable (for example: tool not available, spawn failed, or sub-agent failed before command execution). Before fallback execution, report a one-line fallback reason to the user.
|
|
38
|
-
- Use `autoRun.command` only when `context --json-compact` exposes `autoRun.available=true`.
|
|
39
|
-
- If `autoRun.policyEligible=true` but `autoRun.executableNow=false`, handle `autoRun.manualBoundary` first instead of starting an auto loop.
|
|
40
|
-
- For long-running auto execution, start with `flow <feature> --auto-... --start-auto --json-compact` and prefer `autoRun.run.resumeCommand` (`flow --resume <RUN_ID>`) after interruption/compression (`--json` only when full-detail debugging fields are required).
|
|
41
|
-
- If auto execution stops, treat `autoRun.resume` from `flow --json-compact` (or `flow --json`) as SSOT. After interruption/compression, resume with `autoRun.resume.flowCommand`; if needed, check current state first with `autoRun.resume.contextCommand`.
|
|
42
|
-
- Treat `AUTO_DELEGATED_HANDOFF` as a delegated pause, not a crash. Reuse the delegated run path and continue the delegated work before asking for a fresh approval label.
|
|
43
|
-
- Treat `AUTO_MANUAL_REQUIRED` as an automation boundary (instruction-only segment), not an immediate crash. Re-check `context --json-compact` and report whether `approvalRequest.required` is now true.
|
|
44
|
-
- Treat `AUTO_SELECTION_REQUIRED` as a feature-selection pause, not a crash. Resolve the active feature first, then rerun `context --json-compact` or `flow`.
|
|
45
|
-
- If `matchedFeature.currentSubstateId === "change_request_sync"` or `matchedFeature.pendingChangeRequest` is present, sync docs before more code work: update `tasks.md` first, add or retag the affected task, and if shipped behavior or scope changed, sync `decisions.md` plus `spec.md` / PRD refs as needed. Clear `Pending Change Request` after syncing, then rerun `context --json-compact` or `flow`.
|
|
46
|
-
- If the CLI prints commands, copy/paste them. (In standalone setups commands may include `git -C ...` and scopes like `project`/`docs`.)
|
|
47
|
-
- Follow `agents.md` **"Label Response Contract (SSOT)"**. Show label prompts only in approval-waiting state, and reuse the exact CLI-provided approval lines instead of paraphrasing them.
|
|
48
|
-
- If you answer a side question while `approvalRequest.required=true`, answer first, then briefly restate `matchedFeature.currentSubstateId/currentSubstateOwner/currentSubstatePhase` when available and re-show the exact CLI approval lines before waiting again.
|
|
49
|
-
- For non-delegated command options, default to `npx lee-spec-kit flow <slug|F001|F001-slug> --approve <LABEL> --execute` and avoid split `context --approve` / `context --execute --ticket` runs across turns.
|
|
50
|
-
- If the current command is delegated (`matchedFeature.currentSubstateOwner="subagent"` and `agentOrchestration.subAgentHandoff.required=true` with `mode="command"`), call `spawn_agent` first and pass the handoff contract instead of executing that command from the main agent.
|
|
51
|
-
- If `flow/context --execute --json` returns `approved_handoff_prepared`, stop re-approving the same label. Complete the delegated work first, then refresh context.
|
|
31
|
+
## 4. Commit and stop guardrails
|
|
52
32
|
|
|
53
|
-
|
|
33
|
+
- Before `git commit`, use `npx lee-spec-kit commit-audit --json` when docs-path validation matters.
|
|
34
|
+
- Before stopping, use `npx lee-spec-kit workflow-audit --json` if code or feature docs changed.
|
|
35
|
+
- Keep one row per test command in the `tasks.md` test log and update that row on reruns instead of appending duplicates.
|
|
54
36
|
|
|
55
|
-
|
|
37
|
+
## 5. Approval boundaries
|
|
56
38
|
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
- Do not leave placeholder `Acceptance` / `Checklist` items in a newly added task. `task-run` will block until those fields contain concrete execution/verification items.
|
|
61
|
-
- If manual editing is unavoidable, append the new task directly below the last existing task block in the `Task List` section.
|
|
62
|
-
- Do not insert it near the current task or right before `Completion Criteria` / the next `##` heading.
|
|
63
|
-
- When handling a mid-implementation user change request, treat `Pending Change Request` as a temporary sync marker: reflect the request in `tasks.md`, sync supporting docs if the behavior/scope changed, then clear that field before resuming implementation.
|
|
39
|
+
- Ask for approval only at documented review checkpoints and before remote or destructive actions.
|
|
40
|
+
- Before issue creation, PR creation, push, merge, or similar remote actions, share the exact artifact or plan first.
|
|
41
|
+
- Codex may delegate implementation work, but docs updates, approval handling, and remote actions stay with the main session.
|
|
64
42
|
|
|
65
|
-
|
|
43
|
+
## Strict Rules
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- There was a tradeoff (performance / reliability / security / maintainability)
|
|
72
|
-
- You introduced a new rule/heuristic/state transition (e.g., context detection logic, exception criteria)
|
|
73
|
-
- The user asked “why did you do it this way?” (requested rationale/justification)
|
|
74
|
-
- The user explicitly asked to change behavior (requirements/policy/criteria changes)
|
|
75
|
-
- You changed behavior for compatibility or as a workaround
|
|
76
|
-
- You changed data shape, file structure, or CLI output rules
|
|
77
|
-
- You expect future readers to ask “why this way?”
|
|
78
|
-
|
|
79
|
-
Timing rules:
|
|
80
|
-
|
|
81
|
-
- When moving a task to `[DOING]`, first add 1-3 lines for `Context/Constraints` and `Trace (initial hypothesis)`.
|
|
82
|
-
- Before moving a task to `[DONE]`, finalize `Options/Decision/Rationale` and strengthen `Trace (final reasoning)`.
|
|
83
|
-
- After PR merge, append 1-2 lines in `Trace (post-merge check)` with actual outcome/impact.
|
|
84
|
-
|
|
85
|
-
Evidence rules:
|
|
86
|
-
|
|
87
|
-
- Every ADR must include at least one Evidence link (commit, PR, or test/log evidence).
|
|
88
|
-
- Prefer filling all three (`Commit`, `PR`, `Test/Log`); if not applicable, mark as `N/A`.
|
|
89
|
-
|
|
90
|
-
Use the feature’s `decisions.md` template format as final SSOT. (Context/Constraints/Options/Decision/Rationale/Trace/Evidence/Consequences)
|
|
91
|
-
|
|
92
|
-
### Step 3.5: Commit per task (important)
|
|
93
|
-
|
|
94
|
-
- Complete **only one task at a time** (do not batch-finish multiple tasks in one commit).
|
|
95
|
-
- After you share the outcome/verification, mark the task `[DONE]` and update the task-local checklist items in the same edit. `task-complete` will reject `[DONE]` if unchecked checklist boxes remain. If approval is required (`approvalRequest.required=true`), reuse the exact CLI-provided approval lines and wait for a `<LABEL>` or `<LABEL> OK` reply first. If approval is not required, do not invent a separate approval prompt before marking `[DONE]`.
|
|
96
|
-
- In `tasks.md` test logs, keep one entry per test command and update its date/result on reruns (do not keep appending duplicates). Use `YYYY-MM-DD` in local date.
|
|
97
|
-
- If `context` shows `[CHECK required]`, for commits/push/merge, **share the commit message + included files and wait for the latest CLI-provided label reply** before running the commands.
|
|
98
|
-
- Once all tasks are `[DONE]`, share the "Completion Criteria" checklist with the user. If that point is approval-waiting, get a `<LABEL>` or `<LABEL> OK` reply before checking it; otherwise get a normal confirmation reply. (especially the final outcome/user confirmation item).
|
|
99
|
-
- Note: both progress approval and final approval must follow the current `approvalRequest.required` state. When approval is label-gated, always use label replies instead of standalone `OK` as the approval token.
|
|
100
|
-
|
|
101
|
-
### Step 4: Repeat
|
|
102
|
-
|
|
103
|
-
After finishing a meaningful chunk of work, run `context` again.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## 🛑 Strict rules
|
|
108
|
-
|
|
109
|
-
1. **No skipping**: Never “finish” tasks by editing status only.
|
|
110
|
-
2. **No jumping ahead**: If the CLI is waiting for approvals, stop and ask the user.
|
|
111
|
-
3. **No rewriting history**: Do not modify `[DONE]` tasks; add a new one.
|
|
45
|
+
1. Do not skip required doc updates.
|
|
46
|
+
2. Do not rewrite `[DONE]` tasks.
|
|
47
|
+
3. Do not treat unmanaged docs artifacts as active workflow state until they are normalized or allowlisted.
|
|
@@ -106,7 +106,7 @@ When a feature is already in progress, treat those files as staging/reference ar
|
|
|
106
106
|
|
|
107
107
|
- If the extra docs entry is intentional, add it to `.lee-spec-kit.json` `allowedDocsEntries`
|
|
108
108
|
- If it is a planning/reference artifact, normalize it before continuing active feature execution
|
|
109
|
-
-
|
|
109
|
+
- `commit-audit` blocks staged unmanaged or non-canonical feature docs until they are normalized or allowlisted
|
|
110
110
|
|
|
111
111
|
- Move user-facing scope and acceptance criteria into `spec.md`
|
|
112
112
|
- Move architecture/file structure/test strategy into `plan.md`
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
- **Status**: `[TODO]` → `[DOING]` → `[DONE]`
|
|
6
6
|
- **Task communication / confirmation**:
|
|
7
|
-
- `[TODO] → [DOING]`: share the task title first, then
|
|
8
|
-
- `[DOING] → [DONE]`: share the result
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- `[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
|
+
- Ask for approval before changing task state only when the task crosses a documented review checkpoint or before remote/destructive actions.
|
|
10
|
+
- Do not invent a standalone `OK` approval step when the workflow does not require one.
|
|
11
11
|
- `task-complete` rejects `[DONE]` while any item in that task's `Checklist` remains unchecked.
|
|
12
12
|
- **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
13
|
- Do not invent PRD IDs in `tasks.md`. Only reference IDs that already exist in `docs/prd` or the upstream requirements doc.
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
- [ ] All tasks are `[DONE]`, and each task's `Acceptance` is verified and `Checklist` is checked
|
|
83
83
|
- [ ] Tests executed and passing (record command/result below)
|
|
84
|
-
- [ ] Final outcome shared and user confirmation recorded
|
|
84
|
+
- [ ] Final outcome shared and any required user confirmation recorded at the documented workflow checkpoint
|
|
85
85
|
|
|
86
86
|
### Test Run Log (Latest by Command)
|
|
87
87
|
|