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