specwf 0.2.1 → 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.
- package/README.md +96 -59
- package/bin/cli.d.ts +2 -0
- package/bin/cli.js +4425 -0
- package/bin/specwf.js +4424 -1
- package/dist/cli.js +3819 -1455
- package/package.json +2 -1
- package/dist/templates/agents/archiver.md +0 -112
- package/dist/templates/agents/executor.md +0 -125
- package/dist/templates/agents/planner.md +0 -114
- package/dist/templates/agents/researcher.md +0 -104
- package/dist/templates/agents/reviewer.md +0 -98
- package/dist/templates/agents/verifier.md +0 -129
- package/dist/templates/artifacts/context.md +0 -151
- package/dist/templates/artifacts/design.md +0 -224
- package/dist/templates/artifacts/goal-review.md +0 -95
- package/dist/templates/artifacts/project.yml +0 -117
- package/dist/templates/artifacts/proposal.md +0 -124
- package/dist/templates/artifacts/quality-review.md +0 -131
- package/dist/templates/artifacts/research.md +0 -127
- package/dist/templates/artifacts/spec-review.md +0 -84
- package/dist/templates/artifacts/state.md +0 -158
- package/dist/templates/artifacts/summary.md +0 -129
- package/dist/templates/artifacts/tasks.md +0 -109
- package/dist/templates/artifacts/verification.md +0 -113
- package/dist/templates/commands/adhoc.md +0 -38
- package/dist/templates/commands/apply.md +0 -20
- package/dist/templates/commands/archive.md +0 -21
- package/dist/templates/commands/continue.md +0 -27
- package/dist/templates/commands/discuss.md +0 -24
- package/dist/templates/commands/grill.md +0 -24
- package/dist/templates/commands/init.md +0 -20
- package/dist/templates/commands/milestone.md +0 -27
- package/dist/templates/commands/plan.md +0 -22
- package/dist/templates/commands/research-phase.md +0 -20
- package/dist/templates/commands/research.md +0 -24
- package/dist/templates/commands/review.md +0 -20
- package/dist/templates/commands/roadmap.md +0 -23
- package/dist/templates/commands/ship.md +0 -36
- package/dist/templates/commands/split.md +0 -16
- package/dist/templates/commands/verify.md +0 -22
- package/dist/templates/skills/adhoc.md +0 -53
- package/dist/templates/skills/apply.md +0 -134
- package/dist/templates/skills/archive.md +0 -109
- package/dist/templates/skills/continue.md +0 -97
- package/dist/templates/skills/discuss.md +0 -95
- package/dist/templates/skills/grill.md +0 -90
- package/dist/templates/skills/init.md +0 -116
- package/dist/templates/skills/milestone.md +0 -36
- package/dist/templates/skills/plan.md +0 -144
- package/dist/templates/skills/research-phase.md +0 -66
- package/dist/templates/skills/research.md +0 -76
- package/dist/templates/skills/review.md +0 -148
- package/dist/templates/skills/roadmap.md +0 -104
- package/dist/templates/skills/ship.md +0 -94
- package/dist/templates/skills/split.md +0 -96
- 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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
16
|
-
# 1. 初始化项目
|
|
17
|
-
specwf init
|
|
22
|
+
## Entity Hierarchy
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
```
|
|
25
|
+
Project → Milestone (persistent, defaults to v1) → Phase → Change
|
|
26
|
+
```
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
specwf continue
|
|
56
|
+
Advance with: `specwf continue`
|
|
27
57
|
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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