specwf 0.2.2 → 0.3.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.
Files changed (56) hide show
  1. package/README.md +96 -59
  2. package/bin/cli.d.ts +2 -0
  3. package/bin/cli.js +4425 -0
  4. package/bin/specwf.js +4424 -1
  5. package/dist/cli.js +3821 -1462
  6. package/package.json +2 -1
  7. package/dist/templates/agents/archiver.md +0 -112
  8. package/dist/templates/agents/executor.md +0 -125
  9. package/dist/templates/agents/planner.md +0 -114
  10. package/dist/templates/agents/researcher.md +0 -104
  11. package/dist/templates/agents/reviewer.md +0 -98
  12. package/dist/templates/agents/verifier.md +0 -129
  13. package/dist/templates/artifacts/context.md +0 -151
  14. package/dist/templates/artifacts/design.md +0 -224
  15. package/dist/templates/artifacts/goal-review.md +0 -95
  16. package/dist/templates/artifacts/project.yml +0 -117
  17. package/dist/templates/artifacts/proposal.md +0 -124
  18. package/dist/templates/artifacts/quality-review.md +0 -131
  19. package/dist/templates/artifacts/research.md +0 -127
  20. package/dist/templates/artifacts/spec-review.md +0 -84
  21. package/dist/templates/artifacts/state.md +0 -158
  22. package/dist/templates/artifacts/summary.md +0 -129
  23. package/dist/templates/artifacts/tasks.md +0 -109
  24. package/dist/templates/artifacts/verification.md +0 -113
  25. package/dist/templates/commands/adhoc.md +0 -38
  26. package/dist/templates/commands/apply.md +0 -20
  27. package/dist/templates/commands/archive.md +0 -21
  28. package/dist/templates/commands/continue.md +0 -27
  29. package/dist/templates/commands/discuss.md +0 -24
  30. package/dist/templates/commands/grill.md +0 -24
  31. package/dist/templates/commands/init.md +0 -37
  32. package/dist/templates/commands/milestone.md +0 -27
  33. package/dist/templates/commands/plan.md +0 -22
  34. package/dist/templates/commands/research-phase.md +0 -20
  35. package/dist/templates/commands/research.md +0 -24
  36. package/dist/templates/commands/review.md +0 -20
  37. package/dist/templates/commands/roadmap.md +0 -23
  38. package/dist/templates/commands/ship.md +0 -36
  39. package/dist/templates/commands/split.md +0 -16
  40. package/dist/templates/commands/verify.md +0 -22
  41. package/dist/templates/skills/adhoc.md +0 -53
  42. package/dist/templates/skills/apply.md +0 -134
  43. package/dist/templates/skills/archive.md +0 -109
  44. package/dist/templates/skills/continue.md +0 -97
  45. package/dist/templates/skills/discuss.md +0 -95
  46. package/dist/templates/skills/grill.md +0 -90
  47. package/dist/templates/skills/init.md +0 -116
  48. package/dist/templates/skills/milestone.md +0 -36
  49. package/dist/templates/skills/plan.md +0 -144
  50. package/dist/templates/skills/research-phase.md +0 -66
  51. package/dist/templates/skills/research.md +0 -76
  52. package/dist/templates/skills/review.md +0 -148
  53. package/dist/templates/skills/roadmap.md +0 -104
  54. package/dist/templates/skills/ship.md +0 -94
  55. package/dist/templates/skills/split.md +0 -96
  56. package/dist/templates/skills/verify.md +0 -147
package/README.md CHANGED
@@ -1,78 +1,115 @@
1
- # specwf — 规格驱动开发工作流
1
+ # specwf — Spec-Driven Development Workflow
2
2
 
3
- spec-driven development workflow for AI coding agents.
3
+ specwf is an independent TypeScript CLI package that provides a spec-driven development workflow for AI coding agents. It combines core capabilities from three projects:
4
4
 
5
- specwf 融合 OpenSpec、GSD Core、Trellis 的核心能力,提供从需求探讨到交付的完整规格驱动开发工作流。
5
+ - **OpenSpec** (MIT) — CLI architecture, change structure, delta-spec merge mechanism
6
+ - **GSD Core** (MIT) — milestone/phase hierarchy, fresh-context sub-agent parallel execution
7
+ - **Trellis** (AGPL-3.0, concept reference only) — spec auto-injection, code cognition backfill
6
8
 
7
- ## 安装
9
+ ## Why
8
10
 
9
- ```bash
10
- npm install -g specwf
11
- ```
11
+ AI coding agents are powerful but unpredictable — requirements exist only in chat history. specwf aligns on specs before writing code, executes heavy work in fresh-context sub-agents, and persists state across sessions through structured artifacts.
12
+
13
+ ## Core Principles
12
14
 
13
- ## 快速开始
15
+ 1. **Dual nested loops** — Phase loop (discuss→research→split→change loop→ship) ⊃ Change loop (plan→apply→review→verify→archive)
16
+ 2. **CLI as single source of truth** — all interaction through CLI; agents orchestrate, don't implement
17
+ 3. **Fresh-context sub-agents** — heavy work (research/apply/review/verify/archive) runs in fresh context to prevent context rot
18
+ 4. **Dual spec backfill** — delta-spec forward merge + code cognition backward extraction
19
+ 5. **TDD enforced** — type:behavior tasks follow RED→GREEN→REFACTOR
20
+ 6. **Single source templates** — commands and skills generated from the same TypeScript modules; all content in English
14
21
 
15
- ```bash
16
- # 1. 初始化项目
17
- specwf init
22
+ ## Entity Hierarchy
18
23
 
19
- # 2. 生成平台文件
20
- specwf update
24
+ ```
25
+ Project → Milestone (persistent, defaults to v1) → Phase → Change
26
+ ```
21
27
 
22
- # 3. 查看当前状态
23
- specwf state
28
+ - **Milestone** = release cycle (shippable increment)
29
+ - **Phase** = work unit (goes through discuss/research/split/ship)
30
+ - **Change** = change unit (goes through plan/apply/review/verify/archive)
31
+ - **Adhoc Change** = independent change outside milestone/phase (same change cycle)
32
+
33
+ ## CLI Commands
34
+
35
+ | Command | Scope | Description |
36
+ |---------|-------|-------------|
37
+ | `specwf init` | Project | Initialize specwf project structure |
38
+ | `specwf update` | Project | Regenerate platform files (commands, agents, skills) |
39
+ | `specwf continue` | Project/Phase | Advance project or phase to next step |
40
+ | `specwf continue change <name>` | Change | Advance a specific change to next step |
41
+ | `specwf change new <name>` | Change | Create an adhoc change |
42
+ | `specwf state` | All | View current state and pending work |
43
+ | `specwf config` | Project | View/modify configuration |
44
+ | `specwf context <step>` | All | Output file manifest for a step |
45
+ | `specwf template <type>` | All | Generate artifact template |
46
+ | `specwf list` | All | List milestones/phases/changes/archive |
47
+ | `specwf archive <change>` | Change | Archive a completed change |
48
+
49
+ ## Workflow
50
+
51
+ ### Project-level flow
52
+ ```
53
+ init → grill → research → roadmap → discuss → research-phase → split → [change cycle] → ship
54
+ ```
24
55
 
25
- # 4. 查看下一步
26
- specwf continue
56
+ Advance with: `specwf continue`
27
57
 
28
- # 5. 生成模板文件
29
- specwf template proposal --name my-feature
58
+ ### Change-level flow
59
+ ```
60
+ plan → apply → review → verify → archive
61
+ ```
62
+
63
+ Advance with: `specwf continue change <name>`
64
+
65
+ ### Adhoc change flow
66
+ ```
67
+ specwf change new <name> → plan → apply → review → verify → archive
30
68
  ```
31
69
 
32
- ## 工作流
70
+ Advance with: `specwf continue change <name>`
71
+
72
+ ## Template Architecture
73
+
74
+ Commands (`.omp/commands/`) and skills (`.omp/skills/`) are generated from a single TypeScript source per workflow step. Templates live in `src/templates/`:
33
75
 
34
76
  ```
35
- init → grill → research → roadmap → discuss → plan → apply → review → verify → archive → ship
77
+ src/templates/
78
+ ├── types.ts — SkillTemplate, CommandTemplate, ArtifactTemplate, AgentPromptTemplate
79
+ ├── workflows/
80
+ │ ├── registry.ts — 16-step registry with direct imports
81
+ │ ├── init.ts … continue.ts
82
+ ├── artifacts/index.ts — 11 output document templates
83
+ └── agents/index.ts — 9 agent system prompts
36
84
  ```
37
85
 
38
- - **init**: 初始化 specwf 项目结构
39
- - **grill**: 需求探讨(无限制细节提问)
40
- - **research**: 技术调研(并行多方向)
41
- - **roadmap**: 拆分里程碑和阶段
42
- - **discuss**: Phase 讨论,捕获实现决策
43
- - **plan**: Change 设计(TDD 强制)
44
- - **apply**: 代码实现(分组子代理并发)
45
- - **review**: 三重审查(规格/质量/目标并行)
46
- - **verify**: 测试验证(诊断回环)
47
- - **archive**: 归档(delta-spec 合并 + 代码认知回灌)
48
- - **ship**: 交付(PR + 状态更新)
49
-
50
- ## 命令
51
-
52
- | 命令 | 说明 |
53
- |---|---|
54
- | `specwf init` | 初始化项目 |
55
- | `specwf update` | 更新平台文件 |
56
- | `specwf config` | 查看/修改配置 |
57
- | `specwf state` | 查看状态 |
58
- | `specwf context <step>` | 输出上下文清单 |
59
- | `specwf continue` | 自动推进 |
60
- | `specwf archive <change>` | 归档 change |
61
- | `specwf list` | 列出 milestones/phases/changes |
62
- | `specwf template <type>` | 生成模板文件 |
63
-
64
- ## 配置
65
-
66
- `specwf/project.yml` 中的关键配置:
67
-
68
- - `profile`: 工作流严格度 (`lite` / `standard` / `strict`)
69
- - `platform`: 目标平台 (`omp` / `claude-code`)
70
- - `workflow.tdd`: TDD 强制
71
- - `review.gate`: review 门控 (`all-pass` / `severity` / `report-only`)
72
-
73
- ## 自举
74
-
75
- specwf 用自身的工作流构建了自己。详见 `specwf/state.md` 了解完整构建历史和 21 项设计决策。
86
+ Run `specwf update` to regenerate all 40 platform files from the TypeScript source.
87
+
88
+ ## Configuration
89
+
90
+ Key settings in `specwf/project.yml`:
91
+
92
+ - `profile`: workflow strictness (`lite` / `standard` / `strict`)
93
+ - `platform`: target platform (`omp` / `claude-code`)
94
+ - `workflow.tdd`: enforce TDD for type:behavior tasks
95
+ - `workflow.triple_review`: parallel spec/quality/goal reviews
96
+ - `review.gate`: review gate mode (`all-pass` / `severity` / `report-only`)
97
+
98
+ ## Tech Stack
99
+
100
+ - Language: TypeScript
101
+ - Runtime: Node.js ≥ 20
102
+ - Test: Vitest
103
+ - Target platforms: OMP (primary), Claude Code (planned)
104
+
105
+ ## Version
106
+
107
+ - **Current**: v0.2.2 — English templates, inline continue instructions, sub-agent dispatch clarity
108
+ - **Next**: m2-claude-code Claude Code platform support
109
+
110
+ ## Bootstrapping
111
+
112
+ specwf was built using its own workflow. See `specwf/state.md` for the complete build history and all design decisions.
76
113
 
77
114
  ## License
78
115
 
package/bin/cli.d.ts ADDED
@@ -0,0 +1,2 @@
1
+
2
+ export { }