lee-spec-kit 0.7.3 → 0.7.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/README.en.md CHANGED
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
 
9
9
  <p align="center">
10
- <strong>CLI to generate a project docs structure for AI-assisted development</strong>
10
+ <strong>Agent-guided development harness CLI for spec-driven projects</strong>
11
11
  </p>
12
12
 
13
13
  <p align="center">
@@ -18,9 +18,9 @@
18
18
 
19
19
  <p align="center">
20
20
  <a href="#quick-start">Quick Start</a> •
21
- <a href="#features">Features</a> •
22
- <a href="#usage">Usage</a> •
23
- <a href="#generated-structure">Generated Structure</a>
21
+ <a href="#what-this-cli-does">Why</a> •
22
+ <a href="#commands-the-agent-usually-runs">Commands</a> •
23
+ <a href="#docs">Docs</a>
24
24
  </p>
25
25
 
26
26
  <p align="center">
@@ -36,736 +36,82 @@
36
36
 
37
37
  ## Quick Start
38
38
 
39
+ In most cases, the human asks in natural language and the main agent runs this flow.
40
+
39
41
  ```bash
40
- # 1) Initialize docs structure
41
42
  npx lee-spec-kit init
42
-
43
- # 2) Run initial onboarding checks
44
- npx lee-spec-kit onboard --strict
45
-
46
- # 3) Create a feature
43
+ npx lee-spec-kit idea improve-auth-flow
47
44
  npx lee-spec-kit feature user-auth
48
-
49
- # 4) Show next steps (for agents)
50
45
  npx lee-spec-kit context
46
+ npx lee-spec-kit flow
47
+ ```
51
48
 
52
- # 5) Show workflow dashboard
53
- npx lee-spec-kit view
49
+ ## Why It Exists
54
50
 
55
- # 6) Show overall status
56
- npx lee-spec-kit status
51
+ This CLI was built to make spec-driven development more consistent when working with AI agents.
52
+ The goal is not just to generate a docs folder, but to make it easier for both humans and agents to follow how a project moves from requirements, through ideas, into concrete implementation work.
57
53
 
58
- # 7) Validate docs / feature metadata
59
- npx lee-spec-kit doctor
60
- ```
54
+ To do that, `lee-spec-kit` structures work as `PRD → idea → feature`, and then connects that document flow to a git-centered issue/PR workflow.
55
+ The focus is to keep planning artifacts and code workflow aligned, so the agent-readable state and the human-reviewable state stay in the same operating model.
61
56
 
62
- ## New Project Start Order
57
+ In that flow, PRD lives in the top-level `docs/prd/` space created by `init`.
58
+ Ideas capture candidates and experiments that come out of those requirements, and Features turn the approved work into executable units with `spec.md`, `plan.md`, and `tasks.md`.
63
59
 
64
- For a brand-new project, scaffold the **codebase first**, then initialize docs.
65
- For most users (default: embedded), running `npx lee-spec-kit init` in project root is enough.
60
+ Structurally, it draws inspiration from [spec-kit](https://github.com/github/spec-kit) and [OpenSpec](https://github.com/Fission-AI/OpenSpec),
61
+ but it is adapted toward a more practical project workflow with explicit document stages, feature-level execution units, and tighter git workflow integration for agent orchestration.
66
62
 
67
- ```bash
68
- # 0) Create/init the code project first (example: Next.js)
69
- npx create-next-app@latest my-app
70
- cd my-app
63
+ ## What This CLI Does
71
64
 
72
- # 1) Initialize docs structure
73
- npx lee-spec-kit init
65
+ `lee-spec-kit` is less a power-user operator console and more a development harness that helps the main agent read project state and choose the next action.
74
66
 
75
- # 2) Run initial onboarding checks
76
- npx lee-spec-kit onboard --strict
67
+ - Humans usually ask in natural language.
68
+ - The main agent translates those requests into commands like `detect`, `context`, `flow`, `idea`, and `feature`.
69
+ - Deeper operational commands still exist, but they are no longer front-loaded in the default help output.
77
70
 
78
- # 3) Detect project (agent entrypoint)
79
- npx lee-spec-kit detect --json
71
+ ## How It Works
80
72
 
81
- # 4) Create feature and start workflow
82
- npx lee-spec-kit feature user-auth
83
- npx lee-spec-kit context --json-compact
84
- ```
73
+ 1. Use `init` to attach docs/workflow scaffolding.
74
+ 2. Define top-level requirements in `docs/prd/`.
75
+ 3. Create work with `idea` or `feature`.
76
+ 4. Let the main agent read `detect` and `context`.
77
+ 5. Humans step in for approvals, exceptions, and direction changes.
78
+ 6. Use `context` for the current action and `flow` for overall workflow health.
85
79
 
86
- - Apply lee-spec-kit workflow only when `detect --json` returns `isLeeSpecKitProject: true`.
87
- - If `isLeeSpecKitProject: false`, continue with normal non-lee-spec-kit workflow.
80
+ ## Humans Usually Ask Like This
88
81
 
89
- For teams that keep docs separate from the code repo (standalone), the recommended start point is the **parent workspace folder**.
82
+ - "Read this doc and help me start the project structure."
83
+ - "Organize ideas from these requirements."
84
+ - "Promote this idea into a feature and move it forward."
85
+ - "What is the next action right now?"
86
+ - "Check the overall project state."
90
87
 
91
- ```bash
92
- # Recommended layout:
93
- # workspace/
94
- # ├─ docs/ (lee-spec-kit docs)
95
- # └─ project/ (actual code repo)
96
- #
97
- # Run from workspace root
98
- npx lee-spec-kit init --docs-repo standalone --dir ./docs --project-root ./project
99
- npx lee-spec-kit detect --json
100
- ```
88
+ ## Commands The Agent Usually Runs
101
89
 
102
- ## Agent Kickoff Prompt
90
+ - `init`: initialize docs/workflow scaffolding
91
+ - `idea`: create a pre-feature idea document
92
+ - `feature`: create a concrete execution unit
93
+ - `detect`: detect whether the workspace uses lee-spec-kit
94
+ - `context`: read current feature state and next actions
95
+ - `flow`: summarize workflow state
103
96
 
104
- You can paste the following as an agent session-start instruction.
97
+ ## Agent Kickoff Prompt
105
98
 
106
99
  ```text
107
100
  Start procedure:
108
101
  1) Run npx lee-spec-kit detect --json
109
- 2) If isLeeSpecKitProject === true, run npx lee-spec-kit context --json-compact (use --json only when full detail is needed)
110
- 3) If approvalRequest.required=true, show approvalRequest.userFacingLines exactly as provided, then wait for user approval (<LABEL> or <LABEL> OK)
102
+ 2) If isLeeSpecKitProject === true, run npx lee-spec-kit context --json-compact
103
+ 3) If approvalRequest.required=true, show approvalRequest.userFacingLines exactly as provided, then wait for user approval
111
104
  4) Do not execute before approval; execute requiresUserCheck=true actions only after approval
112
105
  5) If isLeeSpecKitProject === false, skip lee-spec-kit-specific flow and continue with normal workflow
113
106
  ```
114
107
 
115
- ## Features
116
-
117
- ### 📁 Project initialization
118
-
119
- - Interactive init or CLI options
120
- - Default is `multi`; `single` remains supported for simple single-repo and backward-compatibility scenarios (`fullstack` is a backward-compatible alias of `multi`)
121
- - Korean/English templates
122
-
123
- ### 🚀 Feature creation
124
-
125
- - Generates `spec.md`, `plan.md`, `tasks.md`, `decisions.md`
126
- - Multi mode supports flexible component separation (e.g. app/api/worker)
127
- - Integrates Issue/PR templates (docs side)
128
-
129
- ### 📊 Status management
130
-
131
- - View feature progress at a glance
132
- - Print to terminal or write a Markdown report
133
-
134
- ### 👀 View dashboard
135
-
136
- - Show context-style workflow dashboard in one command
137
- - Works for single feature or aggregated feature list
138
-
139
- ### 🔁 Flow orchestration
140
-
141
- - Combine `context + status + doctor` in one command
142
- - Supports approval/execute passthrough for atomic context actions
143
-
144
- ### 🩺 Doctor
145
-
146
- - Checks docs structure and feature metadata (missing status, duplicate IDs, placeholders, etc.)
147
- - `--json` output for automation/agents
148
-
149
- ### 🔄 Template updates
150
-
151
- - Updates docs templates to the latest version
152
-
153
- ## Usage
154
-
155
- ### Init
156
-
157
- ```bash
158
- npx lee-spec-kit init
159
- npx lee-spec-kit init --name my-project --type multi
160
- npx lee-spec-kit init --name my-project --type fullstack # alias
161
- ```
162
-
163
- **Options:**
164
-
165
- | Option | Description | Default |
166
- | ------------------- | ------------------------------------------------------------------------------------------- | ------------------------------- |
167
- | `-n, --name <name>` | Project name | current folder |
168
- | `-t, --type <type>` | `single` or `multi` (`fullstack` alias supported) | interactive (`multi` with `--yes`/`--non-interactive`) |
169
- | `--components <list>` | multi component list (comma-separated, e.g. `app,api,worker`) | `app` |
170
- | `-l, --lang <lang>` | `ko` or `en` | `en` |
171
- | `--workflow <mode>` | Workflow mode: `github` (issue/PR/review) or `local` (local-first) | `github` |
172
- | `-d, --dir <dir>` | Install directory | `./docs` |
173
- | `--docs-repo <mode>` | docs repo mode (`embedded` or `standalone`) | `embedded` |
174
- | `--project-root <path>` | standalone(single) project repo path or standalone(multi) JSON map (`{"app":"/path/app","api":"/path/api"}`) | - |
175
- | `--component-project-roots <pairs>` | standalone(multi) component roots (`app=/path/app,api=/path/api,worker=/path/worker`) | - |
176
- | `--push-docs` | enable standalone docs push (use with `--docs-remote`) | `false` |
177
- | `--docs-remote <url>` | standalone docs remote URL (used with `--push-docs`) | - |
178
- | `-y, --yes` | Skip most interactive inputs (overwrite confirmation still appears if target dir is not empty) | - |
179
- | `-f, --force` | Overwrite non-empty target directory without confirmation | `false` |
180
- | `--non-interactive` | Fail immediately instead of prompting for user input | `false` |
181
-
182
- > After generating docs, `init` automatically attempts Git setup/commit (`git init`, `git add`, `git commit`). Auto-commit may be skipped depending on environment/state.
183
-
184
- ### Project detection (agent entrypoint)
185
-
186
- ```bash
187
- # detect from current directory
188
- npx lee-spec-kit detect
189
-
190
- # JSON output for agents/automation
191
- npx lee-spec-kit detect --json
192
-
193
- # detect against a specific path
194
- npx lee-spec-kit detect --dir /path/to/workspace
195
- ```
196
-
197
- The `--json` payload includes `isLeeSpecKitProject`, `reasonCode` (`PROJECT_DETECTED` | `PROJECT_NOT_DETECTED`), `docsDir`, `configPath`, and `detectionSource` (`config` | `heuristic`).
198
-
199
- ### Onboarding checks
200
-
201
- Validate initial setup readiness (Constitution/PRD/git remotes, etc.).
202
-
203
- ```bash
204
- # human-readable output
205
- npx lee-spec-kit onboard
206
-
207
- # JSON output for agents/automation
208
- npx lee-spec-kit onboard --json
209
-
210
- # exit code 1 when WARN/BLOCK exists
211
- npx lee-spec-kit onboard --strict
212
- ```
213
-
214
- ### Create a feature
215
-
216
- ```bash
217
- # Single
218
- npx lee-spec-kit feature user-auth
219
-
220
- # Multi
221
- npx lee-spec-kit feature --component api user-auth
222
- npx lee-spec-kit feature --component app user-profile
223
- npx lee-spec-kit feature --component worker queue-jobs
224
-
225
- # Specify Feature ID/description
226
- npx lee-spec-kit feature payment --id F123 --desc "Improve payment flow"
227
- ```
228
-
229
- **Options:**
230
-
231
- | Option | Description | Default |
232
- | ------------------- | ------------------------------------------- | ------------ |
233
- | `--component <id>` | Multi target component | interactive |
234
- | `--id <id>` | Feature ID (`F001` format) | auto-generate |
235
- | `-d, --desc <desc>` | Default purpose/description text for `spec.md` | empty string |
236
- | `--non-interactive` | Fail immediately instead of prompting for user input | `false` |
237
- | `--json` | JSON output (`featureId`, `featurePath`, `component`) | `false` |
238
-
239
- ### Context (agent guide)
240
-
241
- For a single matched feature, next steps are always shown as `A/B/C` options.
242
-
243
- ```bash
244
- # basic check (auto-detect from branch)
245
- npx lee-spec-kit context
246
-
247
- # recommended: one feature + labels
248
- npx lee-spec-kit context F001
249
- npx lee-spec-kit context F001 --json
250
- npx lee-spec-kit context F001 --json-compact
251
-
252
- # approve + execute (common path)
253
- npx lee-spec-kit context F001 --approve A --execute
254
-
255
- # include ticket only when selected action has `requiresUserCheck=true`
256
- npx lee-spec-kit context F001 --approve A --execute --ticket <TICKET>
257
-
258
- # strict mode: fail if approved label is instruction-only
259
- npx lee-spec-kit context F001 --approve A --execute --ticket <TICKET> --execute-strict
260
- ```
261
-
262
- Use advanced selectors (`--component`, `--all`, `--done`) only when you need multi-scope filtering or exceptional fallback behavior.
263
-
264
- **Options:**
265
-
266
- | Option | Description |
267
- | -------------- | ----------------------------------------------- |
268
- | `--json` | JSON output for agents |
269
- | `--json-compact` | Compact JSON for agents (implies `--json`, minimizes duplicated fields) |
270
- | `--component <id>` | Select target component in multi mode (e.g. `app`, `api`, `worker`) |
271
- | `--all` | Include completed features when auto-detecting |
272
- | `--done` | Show completed (workflow-done) features only |
273
- | `--approve <reply>` | Approve one labeled option using any reply that includes a label token (e.g. `A`, `A OK`, `A proceed`) |
274
- | `--ticket <token>` | One-time execution ticket from `--approve` (required when selected option has `requiresUserCheck=true`) |
275
- | `--execute` | Execute only the approved option when it is a command (`--ticket` required only for check-required options) |
276
- | `--execute-strict` | With `--execute`, fail if the approved option is instruction-only |
277
-
278
- **What is a ticket (approval ticket)?**
279
-
280
- - A one-time execution token issued by the CLI when you approve a label via `--approve`.
281
- - `--ticket` is required for `--execute` only when the selected action has `requiresUserCheck=true`.
282
- - It is short-lived (5 minutes by default) and cannot be reused after one execution.
283
- - When you `--execute` a handoff-only command (`pre_pr_review_run`, `code_review_run`), the result is `approved_handoff_prepared` with `nextMainState` instead of the normal `approved_executed`.
284
- - Treat `approved_handoff_prepared` as delegated-work-required: continue the delegated review/fix loop immediately, do not re-approve the same label, and refresh `context` only after the required evidence/state update.
285
-
286
- `context --json-compact` is the default recommended format, providing a minimal hot-path contract for agents.
287
- Use `context --json` only when full-detail debugging fields are required.
288
-
289
- **Core fields (recommended for normal agent flows)**
290
-
291
- - `status` / `reasonCode`: current state and reason code
292
- - `actionOptions[]`: `label` (`A`, `B`, `C`...) + the minimal execution contract (`detail`, `actionType`, `category`, `operationType`, `requiresUserCheck`, plus command/instruction payload)
293
- - `approvalRequest`: approval state and user-facing prompt lines (`required`, `userFacingLines`, `finalPrompt`)
294
- - `requiredDocs`: built-in docs to read before the current action (`id`, `command`)
295
- - `checkPolicy`: minimal approval state (`token`, `validLabels`, `checkRequiredLabels`, `checkRequiredCategories`, `approvalRequired`, `contextVersion`)
296
- - `agentOrchestration`: compact keeps only `subAgentHandoff`. Delegation SSOT is `matchedFeature.currentSubstate*` + `subAgentHandoff`.
297
- - `matchedFeature.currentSubstateId/currentSubstateOwner/currentSubstatePhase`: current step-internal execution state for owner/phase-aware orchestration
298
- - `actions[]`: the raw atomic action list remains available in detailed `context --json`.
299
-
300
- **Advanced/reference fields (automation edge cases or debugging)**
301
-
302
- - `selectionFallback`: fallback used when branch auto-detection does not match (`none` | `open_features` | `all_features` | `done_features`) and only appears in compact for non-hot-path selection states
303
- - `primaryActionLabel` / `workflowPolicy` / `taskCommitGatePolicy` / `prePrReviewPolicy`: detailed debugging/policy fields available from `context --json`
304
-
305
- Error payloads (`status: "error"`) include `reasonCode` and labeled `suggestions` (`A/B/C`) (e.g. `INVALID_APPROVAL`, `CONTEXT_STALE`, `EXECUTION_FAILED`, `EXECUTION_NOT_COMMAND`).
306
-
307
- ### Built-in Docs
308
-
309
- If you do not restore `agents.md` into project docs, fetch CLI-managed guides directly:
310
- `docs get create-issue|issue-doc|create-pr|pr-doc --json` also returns `contract` (required sections / artifact rules).
311
-
312
- ```bash
313
- # list built-in docs
314
- npx lee-spec-kit docs list --json
315
-
316
- # root agent guide
317
- npx lee-spec-kit docs get agents --json
318
-
319
- # issue/PR procedure + templates
320
- npx lee-spec-kit docs get create-issue --json
321
- npx lee-spec-kit docs get issue-doc --json
322
- npx lee-spec-kit docs get create-pr --json
323
- npx lee-spec-kit docs get pr-doc --json
324
- ```
325
-
326
- ### View
327
-
328
- ```bash
329
- npx lee-spec-kit view
330
- npx lee-spec-kit view F001
331
- npx lee-spec-kit view --all
332
- npx lee-spec-kit view --json
333
- ```
334
-
335
- **Options:**
336
-
337
- | Option | Description |
338
- | -------------- | ----------------------------------------------- |
339
- | `--json` | JSON output for agents |
340
- | `--component <id>` | Select target component in multi mode (e.g. `app`, `api`, `worker`) |
341
- | `--all` | Include completed features when auto-detecting |
342
- | `--done` | Show completed (workflow-done) features only |
343
-
344
- ### Flow
345
-
346
- ```bash
347
- # workflow summary (context + status + doctor)
348
- npx lee-spec-kit flow
349
-
350
- # approve + execute (recommended agent path)
351
- npx lee-spec-kit flow F001 --approve A --execute
352
-
353
- # auto-run: stop and wait for approval when one of target categories appears
354
- npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update
355
-
356
- # auto-run using preset
357
- npx lee-spec-kit flow F004 --auto-preset pr-handoff
358
-
359
- # auto-run + apply new request first (runs user_request_replan first)
360
- npx lee-spec-kit flow F004 --request "promote issue 004 to F004 and proceed" --auto-until-category pr_create,code_review,pr_status_update
361
-
362
- # with default preset configured, request-only auto mode is available
363
- npx lee-spec-kit flow F004 --request "promote issue 004 to F004 and proceed"
364
-
365
- # long-running auto: create checkpoint + resume
366
- npx lee-spec-kit flow F004 --auto-until-category pr_create,code_review,pr_status_update --start-auto --json-compact
367
- npx lee-spec-kit flow --resume <RUN_ID> --json-compact
368
-
369
- # JSON output for automation
370
- npx lee-spec-kit flow --json
371
- npx lee-spec-kit flow --json-compact
372
-
373
- # strict checks (optional)
374
- npx lee-spec-kit flow --strict
375
- ```
376
-
377
- **Options:**
378
-
379
- | Option | Description |
380
- | ----------------- | ----------- |
381
- | `--json` | JSON output for agents |
382
- | `--json-compact` | Compact JSON output for agents (implies `--json`, reduced duplication) |
383
- | `--component <id>`| Select target component in multi mode (e.g. `app`, `api`, `worker`) |
384
- | `--all` | Include completed features when auto-detecting |
385
- | `--done` | Show completed (workflow-done) features only |
386
- | `--request <text>` | In auto mode, apply a new user request first (auto-selects `user_request_replan`) |
387
- | `--auto-preset <name>` | Use a named auto preset (builtin: `pr-handoff`) |
388
- | `--auto-until-category <categories>` | Auto-execute command actions until one of target categories appears (comma-separated) |
389
- | `--start-auto` | Persist auto checkpoint (run id) and include resume metadata (`autoRun.run`) in JSON |
390
- | `--resume <run-id>`| Resume stored auto checkpoint by run id |
391
- | `--approve <reply>` | Pass through context label approval (e.g. `A`, `A OK`, `A proceed`) |
392
- | `--execute` | Execute approved option when it is a command (ticket is required only when `requiresUserCheck=true`) |
393
- | `--execute-strict`| With `--execute`, fail if approved option is instruction-only |
394
- | `--strict` | Also run `status --strict` and `doctor --strict` |
395
-
396
- Auto gate mode rules:
397
- - `<feature-name>` is required with auto mode (`--auto-until-category` / `--auto-preset`) (for example `F004`).
398
- - Auto mode (`--auto-until-category` / `--auto-preset`) cannot be combined with `--approve` or `--execute`.
399
- - `--request` requires auto mode.
400
- - Exception: if `workflow.auto.defaultPreset` is configured, `--request` alone enables auto mode.
401
- - `--resume <run-id>` cannot be combined with `<feature-name>`, `--component`, `--all`, `--done`, `--auto-*`, or `--request`. (It uses settings from the stored checkpoint.)
402
- - Auto-run stops as `gate_reached` when a target category appears, then prints `autoRun.gate.userFacingLines`. (This is copied from that step's `approvalRequest.userFacingLines`.)
403
- - In `context --json` / `--json-compact`, `autoRun.available` means "auto-run can execute right now". If config allows auto-run but the current step is instruction-only, you get `autoRun.available=false`, `autoRun.policyEligible=true`, `autoRun.executableNow=false`, and `autoRun.manualBoundary`.
404
- - If the current action set is instruction-only (no executable command), auto-run may stop with `AUTO_MANUAL_REQUIRED`. This is an automation boundary, not a CLI crash.
405
- - If progress stalls (same context/action repeating), it stops with `AUTO_NO_PROGRESS`.
406
- - In JSON mode, inspect `autoRun.status`, `autoRun.reasonCode`, `autoRun.gate`, `autoRun.manual`, and `autoRun.resume`.
407
- - Detailed `flow --json` keeps the full `autoRun.executions` array.
408
- - Compact `flow --json-compact` keeps only `autoRun.executionCount` and `autoRun.lastExecution`.
409
- - Inspect JSON `agentOrchestration` and `matchedFeature.currentSubstate*` for main/sub-agent responsibilities and pause/report boundaries.
410
- - Prefer `matchedFeature.currentSubstateOwner` plus `subAgentHandoff` as the delegation signal when present. Compact keeps only `subAgentHandoff`; use detailed `--json` / `flow --json` when you need extra orchestration metadata.
411
- - With `--start-auto`, JSON also includes `autoRun.run` (`runId`, `status`, `resumeCommand`).
412
-
413
- Agent resume rules (recommended):
414
- - When `flow --json-compact` (or `flow --json`) returns `autoRun.enabled=true`, resume with `autoRun.resume.flowCommand` after interruption/compression.
415
- - If you need a fresh checkpoint before resuming, run `autoRun.resume.contextCommand` first.
416
- - If `context --json-compact` (or `context --json`) returns `approvalRequest.required=true`, stop immediately and report to the user.
417
- - When `--start-auto` is used, prefer `autoRun.run.resumeCommand` (`flow --resume <runId>`) as the first resume path.
418
-
419
- ### GitHub helpers
420
-
421
- ```bash
422
- # Generate issue body from selected feature
423
- npx lee-spec-kit github issue F001
424
-
425
- # Generate + create issue
426
- npx lee-spec-kit github issue F001 --create --confirm OK --labels enhancement,frontend
427
-
428
- # Generate PR body
429
- npx lee-spec-kit github pr F001
430
-
431
- # Generate PR body (force screenshots/Mermaid sections)
432
- npx lee-spec-kit github pr F001 --screenshots on --mermaid on
433
-
434
- # Generate + create PR + sync tasks.md metadata + merge with retry
435
- npx lee-spec-kit github pr F001 --create --merge --confirm OK --labels enhancement,frontend
436
- ```
437
-
438
- Key points:
439
- - Issue/PR helpers validate required body sections and related docs paths.
440
- - `--json` output includes both `body` (inline markdown) and `bodyFile` (file path).
441
- - If `--labels` is omitted, the default label is `enhancement`. When you pass `--labels` explicitly, it must not be empty.
442
- - `--create`/`--merge` are remote operations and require `--confirm OK`.
443
- - PR helper can sync `tasks.md` PR URL/PR Status automatically (`--no-sync-tasks` to skip).
444
- - PR artifact sections are controlled by `--screenshots (auto|on|off)` and `--mermaid (auto|on|off)`.
445
- - Merge includes retry and automatic head-branch refresh (fetch/rebase/force-push) on out-of-date failures.
446
-
447
- ### Status
448
-
449
- ```bash
450
- npx lee-spec-kit status
451
- npx lee-spec-kit status --json
452
- npx lee-spec-kit status --write
453
- npx lee-spec-kit status --strict
454
- ```
455
-
456
- **Options:**
457
-
458
- | Option | Description |
459
- | -------------- | ---------------------------------------------------- |
460
- | `--json` | JSON output for agents |
461
- | `-w, --write` | Write `features/status.md` |
462
- | `-s, --strict` | Exit with code 1 when duplicate/missing Feature IDs exist |
463
-
464
- Status values distinguish implementation vs workflow completion:
465
- - `DONE`: all tasks are marked done, but workflow requirements are not fully satisfied
466
- - `WORKFLOW_DONE`: implementation + workflow requirements are both satisfied
467
-
468
- ### PRD Requirement Traceability
469
-
470
- Aggregate PRD coverage from PRD requirement IDs (e.g. `PRD-FR-001`) and Feature `tasks.md` bracket tags (e.g. `[PRD-FR-001]`).
471
-
472
- Recommended SSOT:
473
- - PRD (`docs/prd/`): requirements SSOT (keep stable IDs)
474
- - Ideas (`docs/ideas/`): pre-Feature stage (record `PRD Refs` at the top)
475
- - Features (`docs/features/`): implementation/progress SSOT (`PRD Refs` in `spec.md`, task tags in `tasks.md`, change records in `decisions.md`)
476
-
477
- When requirements/scope change mid-work, update at minimum:
478
- - PRD docs + `spec.md` `PRD Refs` + `tasks.md` task tags
479
- - (when applicable) `plan.md`, `decisions.md`
480
-
481
- ```bash
482
- npx lee-spec-kit requirements
483
-
484
- # alias
485
- npx lee-spec-kit prd
486
-
487
- # JSON output for agents
488
- npx lee-spec-kit requirements --json
489
-
490
- # Write report (docs/prd/status.md)
491
- npx lee-spec-kit requirements --write
492
-
493
- # Exit code 1 when issues exist (unknown refs / unmapped tasks / untracked requirements)
494
- npx lee-spec-kit requirements --strict --json
495
- ```
496
-
497
- ### Global Option
498
-
499
- ```bash
500
- npx lee-spec-kit --no-banner --help
501
- ```
502
-
503
- You can also disable banner output via `LEE_SPEC_KIT_NO_BANNER=1`.
504
- Banner output is also suppressed by default for non-TTY runs (for example, agent/pipeline execution).
505
-
506
- ### Doctor
507
-
508
- ```bash
509
- npx lee-spec-kit doctor
510
- npx lee-spec-kit doctor --strict
511
- npx lee-spec-kit doctor --json
512
- npx lee-spec-kit doctor --fix
513
- npx lee-spec-kit doctor --fix --dry-run
514
- npx lee-spec-kit doctor --decisions-placeholders off
515
- npx lee-spec-kit doctor --decisions-placeholders info
516
- npx lee-spec-kit doctor --decisions-placeholders warn
517
- ```
518
-
519
- - `--decisions-placeholders <mode>`:
520
- - `off`: ignore `decisions.md` placeholders
521
- - `info` (default): include as informational findings (non-blocking)
522
- - `warn`: treat as warnings
523
-
524
- ### Update templates
525
-
526
- By default, `update` runs only when the `docs/` working tree is clean; in that case it overwrites changed files without prompting.
527
- If you want to update while you have uncommitted changes, use `--force`.
528
- `update` also backfills missing `.lee-spec-kit.json` keys using current defaults (e.g. `workflow.taskCommitGate: "warn"`).
529
-
530
- ```bash
531
- npx lee-spec-kit update
532
- npx lee-spec-kit update --agents
533
- npx lee-spec-kit update --skills
534
- npx lee-spec-kit update --templates
535
- npx lee-spec-kit update --force
536
- ```
537
-
538
- > `agents/skills` and `features/feature-base` are now CLI-managed (SSOT).
539
- > `update --skills` and `update --templates` are used to clean up legacy copied files in existing docs trees.
540
-
541
- ## Configuration
542
-
543
- ### `.lee-spec-kit.json`
544
-
545
- Running `init` creates `.lee-spec-kit.json` in your docs root (default: `docs/`).
546
-
547
- ```json
548
- {
549
- "projectName": "my-project",
550
- "projectType": "single",
551
- "lang": "en",
552
- "createdAt": "YYYY-MM-DD",
553
- "docsRepo": "embedded",
554
- "workflow": {
555
- "mode": "github",
556
- "codeDirtyScope": "auto",
557
- "taskCommitGate": "warn",
558
- "prePrReview": {
559
- "skills": ["code-review-excellence"],
560
- "enforceExecutionEvidence": false
561
- }
562
- },
563
- "pr": { "screenshots": { "upload": false } },
564
- "approval": { "mode": "builtin" }
565
- }
566
- ```
567
-
568
- | Field | Description |
569
- | ------------- | ------------------------------------------------ |
570
- | `projectName` | Project name |
571
- | `projectType` | `single` or `multi` (`fullstack` alias supported) |
572
- | `components` | (multi only) component list (e.g. `["app","api","worker"]`) |
573
- | `lang` | `ko` or `en` |
574
- | `createdAt` | Creation date |
575
- | `docsRepo` | `embedded` or `standalone` |
576
- | `pushDocs` | (standalone only) whether to manage/push docs repo as a separate git repo |
577
- | `docsRemote` | (standalone + pushDocs) docs repo remote URL |
578
- | `projectRoot` | (standalone only) project repo path (single: string, multi: `{ [component]: path }`) |
579
- | `workflow` | (optional) workflow completion policy (`github`/`local`, `codeDirtyScope`, `taskCommitGate`, `prePrReview`) |
580
- | `pr` | (optional) PR artifacts policy (e.g. screenshot upload) |
581
- | `approval` | (optional) Override CHECK-required policy in `context` output (for automation/semi-auto) |
582
-
583
- > In standalone mode, `init` can add `pushDocs`, `docsRemote`, and `projectRoot` to this config.
584
- > If you run the CLI outside the docs repo in standalone mode, set `LEE_SPEC_KIT_DOCS_DIR` to the docs repo path.
585
-
586
- ### approval (check policy)
587
-
588
- `approval` only affects the following values produced by `context`:
589
-
590
- - the `[CHECK required]` tag in text output
591
- - `actionOptions[].requiresUserCheck` in `context --json-compact` (`actions[].requiresUserCheck` in `--json`)
592
- - `checkPolicy.token` (`context --json-compact`/`--json`): approval token format (`<LABEL>`)
593
- - `checkPolicy.validLabels`: currently selectable labels (`A`, `B`, `C`...)
594
- - `checkPolicy.checkRequiredLabels` / `checkPolicy.checkRequiredCategories`: labels/categories that currently require approval
595
- - `checkPolicy.approvalRequired`: whether the current state is approval-blocked
596
- - `checkPolicy.contextVersion`: snapshot hash for stale-context validation
597
- - `checkPolicy.acceptedTokens`, `tokenPattern`, `activeCategories`, `knownCategories`, `uncategorizedLabels`, `categoryPolicyGuidance`, `requireExplanationBeforeApproval`, and `requiredExplanationFields` remain available in detailed `context --json`.
598
- - `actionOptions`: maps `label` (`A`, `B`, `C`...) to each atomic `action`
599
- - `workflowPolicy`: current completion policy (`mode`, `requireIssue`, `requireBranch`, `requirePr`, `requireReview`)
600
- - `taskCommitGatePolicy`: task commit gate policy (`off` | `warn` | `strict`)
601
-
602
- > This does not enforce/deny execution by itself; it’s a signal for agents.
603
- > If `approval` is omitted, it behaves as `builtin`. (No migration required)
604
- > When `requiresUserCheck: true`, it’s recommended that agents wait for an explicit `<label>` or `<label> OK` response (e.g. `A`, `A OK`) before proceeding.
605
-
606
- ### workflow (completion policy)
607
-
608
- - `workflow.mode: "github"` (default): issue/branch/PR/review are required in workflow completion
609
- - `workflow.mode: "local"`: local-first workflow; issue/branch/PR/review are not required
610
- - Feature templates generated in local mode minimize Issue/PR-focused sections by default.
611
- - `workflow.codeDirtyScope`:
612
- - `repo`: evaluate uncommitted code changes across the whole project repo
613
- - `component`: evaluate only paths mapped to the current feature component (recommended for multi)
614
- - `auto`: `single => repo`, `multi => component`
615
- - `workflow.componentPaths` (optional): explicit per-component paths for component-scoped checks (e.g. `"web": ["apps/web", "packages/web-ui"]`)
616
- - backward compatibility: if omitted, runtime defaults to `repo`
617
- - `workflow.taskCommitGate`:
618
- - `strict`: block only when the latest `tasks.md` commit includes 2+ DONE transitions
619
- - `warn`: show warning but allow progress
620
- - `off`: disable the check
621
- - backward compatibility: if omitted, runtime defaults to `warn`
622
- - `workflow.prePrReview`:
623
- - `enabled` (optional): enforce pre-PR review stage (default: same as `requirePr`)
624
- - `skills` (optional): preferred skill names in priority order (default: `["code-review-excellence"]`)
625
- - `fallback` (optional): baseline review policy (default: `"builtin-checklist"`)
626
- - Use the `Pre-PR Baseline Checklist` section in `docs get create-pr --json` as the single source of truth
627
- - `evidenceMode` (optional): evidence validation mode (`"path_required"` | `"any"`, default: `"path_required"`)
628
- - `path_required`: evidence must be a real existing local path
629
- - `decisionEnum` (optional): allowed decision outcomes (default: `["approve","changes_requested","blocked"]`)
630
- - Moving to PR step requires final decision `approve`
631
- - `enforceExecutionEvidence` (optional): require proof that a review agent was actually executed (default: `false`)
632
- - when `true`, `pre-pr-review` requires `--evidence` and non-empty `commandsExecuted`
633
- - when `false`, implementation-quality review fields remain required, while `commandsExecuted` is optional review evidence
634
- - `executionCommandPrefixes` (optional): command prefixes to match against `commandsExecuted` when execution evidence is enforced (default: `[]`)
635
- - when non-empty, at least one executed command must start with one of these prefixes
636
- - `workflow.auto`:
637
- - `defaultPreset` (optional): default auto preset used by `flow --request "<text>"` (default: `"pr-handoff"`)
638
- - `defaultUntilCategories` (optional): default gate categories (takes precedence over `defaultPreset`)
639
- - `presets` (optional): custom preset map
640
- - Example: `"my-handoff": ["pr_create", "code_review"]`
641
-
642
- Example:
643
-
644
- ```json
645
- {
646
- "workflow": {
647
- "mode": "github",
648
- "codeDirtyScope": "auto",
649
- "taskCommitGate": "warn",
650
- "auto": {
651
- "defaultPreset": "pr-handoff",
652
- "presets": {
653
- "my-handoff": ["pr_create", "code_review", "pr_status_update"]
654
- }
655
- },
656
- "prePrReview": {
657
- "skills": ["code-review-excellence"],
658
- "fallback": "builtin-checklist",
659
- "evidenceMode": "path_required",
660
- "decisionEnum": ["approve", "changes_requested", "blocked"],
661
- "enforceExecutionEvidence": false,
662
- "executionCommandPrefixes": []
663
- }
664
- }
665
- }
666
- ```
667
-
668
- Pre-PR execution gate risks and mitigations:
669
- - Throughput bottleneck: add timeout/retry and a maintainer override route.
670
- - Cost increase: scope review agent execution by changed files/size threshold.
671
- - Quality illusion: keep periodic human spot-checks even with automatic review logs.
672
- - False positives/noise: block only on high-severity findings; keep low-severity as comments.
673
- - Tool lock-in: standardize output JSON schema so executors can be replaced.
674
-
675
- #### Modes
676
-
677
- - `builtin` (default): keep built-in `requiresUserCheck` in steps/actions
678
- - `category` (recommended): control CHECK policy by `actionOptions[].category` (`actions[].category` in `--json`)
679
- - `steps`: control by step numbers (not recommended; fragile)
680
-
681
- #### Fields
682
-
683
- - `default` (`category` only): `keep` | `require` | `skip` (default: `keep`)
684
- - `requireCheckCategories` (`category` only): categories that **always** require CHECK (e.g. `["pr_create"]`, `["*"]`)
685
- - `skipCheckCategories` (`category` only): categories that **never** require CHECK (e.g. `["docs_commit"]`, `["*"]`)
686
- - `requireCheckSteps` (`steps` only): step numbers that require CHECK (e.g. `[3, 5, 12]`)
687
- - `taskExecuteCheck` (optional): legacy `task_execute` start/complete phase compatibility override (`both` | `start_only`, default: `both`)
688
- - `both`: on legacy `task_execute` compatibility paths, require approval for both TODO→DOING and DOING→DONE transitions
689
- - `start_only`: on legacy `task_execute` compatibility paths, require approval only for TODO→DOING and skip default approval for DOING→DONE
690
-
691
- #### category examples
692
-
693
- ```json
694
- {
695
- "approval": { "mode": "category", "default": "skip" }
696
- }
697
- ```
698
-
699
- ```json
700
- {
701
- "approval": {
702
- "mode": "category",
703
- "default": "keep",
704
- "skipCheckCategories": ["docs_commit"]
705
- }
706
- }
707
- ```
708
-
709
- > Discover category values from detailed `context --json` using `checkPolicy.activeCategories` / `checkPolicy.knownCategories`, or from `actionOptions[].category`. Compact keeps only the hot-path contract.
710
-
711
- ### pr (PR artifacts policy)
712
-
713
- - `pr.screenshots.upload` (default: `false`): When `true`, agents may upload screenshots (e.g. GitHub Release assets) and include URLs in PR body. When `false`, agents should not upload/include URLs and should omit screenshot sections from the PR body.
714
-
715
- ### View/Update Config
716
-
717
- ```bash
718
- # show current config
719
- npx lee-spec-kit config
720
-
721
- # target a specific docs path when multiple docs directories exist
722
- npx lee-spec-kit config --dir ./docs2
723
-
724
- # update projectRoot (single)
725
- npx lee-spec-kit config --project-root /new/path
726
- npx lee-spec-kit config --dir ./docs2 --project-root /new/path
727
-
728
- # update projectRoot (multi)
729
- npx lee-spec-kit config --project-root /new/app/path --component app
730
- npx lee-spec-kit config --project-root /new/api/path --component api
731
- npx lee-spec-kit config --project-root /new/worker/path --component worker
732
-
733
- # non-interactive mode (fails immediately if required input is missing)
734
- npx lee-spec-kit config --project-root /new/app/path --component app --non-interactive
735
- ```
736
-
737
- **Options:**
738
-
739
- | Option | Description |
740
- | --- | --- |
741
- | `--dir <dir>` | Target docs directory or project path |
742
- | `--project-root <path>` | Set projectRoot path |
743
- | `--component <id>` | Target component in multi mode |
744
- | `--non-interactive` | Fail immediately instead of prompting for user input |
745
-
746
- > `--non-interactive` is supported by `init`, `feature`, and `config`.
747
- > For automation, command errors print `[REASON_CODE]` (e.g. `PROMPT_BLOCKED`, `CONFIG_NOT_FOUND`).
748
- > Text-mode errors also print labeled next options under `👉 Next Options (Error)`.
749
-
750
- ### Error Codes
751
-
752
- - This CLI exposes error reason codes for automation:
753
- - `reasonCode` in JSON responses
754
- - `[REASON_CODE]` in text error output
755
- - Error responses also provide labeled next-step suggestions (`A/B/C`):
756
- - `suggestions` in JSON mode
757
- - `👉 Next Options (Error)` in text mode
758
- - Common examples:
759
- - `PROMPT_BLOCKED`
760
- - `CONFIG_NOT_FOUND`
761
- - `DOCS_NOT_FOUND`
762
- - `LOCK_WAIT_TIMEOUT` / `LOCK_ACQUIRE_TIMEOUT`
763
- - `INVALID_APPROVAL`, `CONTEXT_STALE`, `EXECUTION_FAILED`, `EXECUTION_NOT_COMMAND`
764
-
765
- For the full code list and meanings, see `errors.en.md` (English) or `errors.md` (Korean).
108
+ ## Docs
766
109
 
767
- ## Generated Structure
110
+ - [Public CLI Reference](./docs/reference/public-cli.md)
111
+ - [Agent CLI Reference](./docs/reference/agent-cli.md)
112
+ - [Internal CLI Reference](./docs/reference/internal-cli.md)
113
+ - [Reference Index](./docs/reference/README.md)
768
114
 
769
- See the Korean README for the full tree examples and workflow details: `README.md`.
115
+ ## License
770
116
 
771
- Note: generated docs keep project-scoped policy docs (`agents/custom.md`, `agents/constitution.md`) and do not sync CLI-managed docs (`agents.md`, `agents/skills/*`, `git-workflow.md`, `features/feature-base/*`).
117
+ MIT