km-spec-driven-development 0.1.0 → 0.2.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 CHANGED
@@ -11,6 +11,8 @@
11
11
  |_|
12
12
  ```
13
13
 
14
+ **Version:** 0.2.0
15
+
14
16
  ---
15
17
 
16
18
  ## What is KM Spec Driven Development?
@@ -69,44 +71,85 @@ km-spec <command> [options]
69
71
 
70
72
  ```bash
71
73
  km-spec init
72
- km-spec init --force # overwrite existing files
74
+ km-spec init --force # overwrite existing scaffold files
73
75
  ```
74
76
 
75
- ### Fill in project context
77
+ Creates (among other files): `AGENTS.md`, `HARNESS.md`, `SDD.md`, and the `.specs/` tree.
78
+
79
+ ### Create a feature (non-interactive by default)
76
80
 
77
81
  ```bash
78
- km-spec project # configure PROJECT.md
79
- km-spec roadmap # configure ROADMAP.md
80
- km-spec state # update STATE.md with session notes
82
+ km-spec feature "User Authentication"
83
+ km-spec feature "User Authentication" --description "Login and session management for the web application"
84
+ km-spec feature "User Authentication" --tier standard
85
+ km-spec feature "SSO Federation" --tier complex
86
+ km-spec feature "User Authentication" --interactive # optional legacy prompts
87
+ km-spec feature "User Authentication" --force # overwrite this feature dir only
81
88
  ```
82
89
 
83
- ### Document the technical stack
90
+ **Default is non-interactive.** The CLI does not wait for stdin unless `--interactive` is passed.
84
91
 
85
- ```bash
86
- km-spec stack # language, framework, runtime, database
87
- km-spec architecture # modules, data flow, patterns
88
- km-spec structure # folder layout and file placement rules
89
- km-spec testing # test framework, patterns, validation gates
90
- km-spec integrations # external APIs, SDKs, webhooks
91
- km-spec concerns # risks, tech debt, fragile areas
92
+ Supported tiers: `standard` (default), `complex`.
93
+
94
+ Generated layout:
95
+
96
+ ```text
97
+ .specs/features/<slug>/
98
+ ├── spec.md
99
+ ├── context.md
100
+ ├── plan.md
101
+ ├── tasks.md
102
+ └── validation.md
92
103
  ```
93
104
 
94
- ### Create feature specs and quick tasks
105
+ Scaffolded specs use confidence markers (`[CONFIRMED]`, `[INFERRED]`, `[NEEDS CLARIFICATION]`, `[DECISION REQUIRED]`). A `--description` value is recorded as `[CONFIRMED]` overview text. The CLI does **not** invent product requirements.
106
+
107
+ ### Create a quick task (non-interactive by default)
95
108
 
96
109
  ```bash
97
- km-spec feature "User Authentication"
98
- km-spec feature "User Authentication" --force
99
110
  km-spec quick "Fix login validation"
111
+ km-spec quick "Fix login validation" --description "Reject expired sessions during login"
112
+ km-spec quick "Fix login validation" --interactive
100
113
  km-spec quick "Fix login validation" --force
101
114
  ```
102
115
 
116
+ Generated layout:
117
+
118
+ ```text
119
+ .specs/quick/<slug>/
120
+ ├── TASK.md
121
+ └── SUMMARY.md
122
+ ```
123
+
124
+ ### Optional interview-style project docs
125
+
126
+ These commands still use interactive prompts when you want to fill files via the terminal:
127
+
128
+ ```bash
129
+ km-spec project
130
+ km-spec roadmap
131
+ km-spec state
132
+ km-spec stack
133
+ km-spec architecture
134
+ km-spec structure
135
+ km-spec testing
136
+ km-spec integrations
137
+ km-spec concerns
138
+ ```
139
+
140
+ Prefer editing the Markdown templates (or asking an agent to fill them) when automating.
141
+
103
142
  ### Inspect and validate
104
143
 
105
144
  ```bash
106
- km-spec status # show status of all spec files
107
- km-spec doctor # validate the full SDD setup
145
+ km-spec status # show status of spec files and layouts
146
+ km-spec doctor # structural validation + lightweight warnings
147
+ km-spec version
148
+ km-spec help
108
149
  ```
109
150
 
151
+ `doctor` treats missing `context.md` / `plan.md` on older features as **warnings** (legacy layout), not hard errors. Legacy single-file quick tasks (`.specs/quick/*.md`) also produce warnings.
152
+
110
153
  ---
111
154
 
112
155
  ## Generated structure
@@ -115,7 +158,8 @@ Running `km-spec init` creates:
115
158
 
116
159
  ```txt
117
160
  .
118
- ├── AGENTS.md — AI agent operating instructions
161
+ ├── AGENTS.md — Permanent agent rules
162
+ ├── HARNESS.md — Execution lifecycle for agents
119
163
  ├── SDD.md — Full methodology reference
120
164
  └── .specs/
121
165
  ├── project/
@@ -127,81 +171,81 @@ Running `km-spec init` creates:
127
171
  ├── features/
128
172
  │ └── [feature-name]/
129
173
  │ ├── spec.md — Requirements and acceptance criteria
174
+ │ ├── context.md — Codebase context for the feature
175
+ │ ├── plan.md — Implementation plan (was design.md role)
130
176
  │ ├── tasks.md — Atomic tasks with traceability
131
- │ └── validation.md — Validation evidence
177
+ │ └── validation.md — Validation evidence ledger
132
178
  └── quick/
133
- └── [task-name].md — Quick tasks and bug fixes
179
+ └── [task-name]/
180
+ ├── TASK.md — Quick task definition
181
+ └── SUMMARY.md — Post-implementation summary
134
182
  ```
135
183
 
136
184
  ---
137
185
 
138
- ## How to use with different stacks
186
+ ## How AI agents use the specs
139
187
 
140
- KM SDD generates only Markdown files. It never modifies source code, package managers, frameworks, or runtimes. It works with any stack.
188
+ Read **`AGENTS.md`** first (mandatory reading order), then **`HARNESS.md`** for the lifecycle:
141
189
 
142
- ### PHP / Laravel
190
+ `Discover Read → Plan → Implement → Validate → Review → Report`
143
191
 
144
- ```bash
145
- cd my-laravel-app
146
- km-spec init
147
- km-spec stack # Language: PHP, Framework: Laravel, ...
148
- km-spec feature "User Registration"
149
- ```
192
+ Typical always-read set:
150
193
 
151
- ### Python / Django / FastAPI
194
+ 1. `.specs/project/STATE.md`
195
+ 2. `.specs/project/PROJECT.md`
196
+ 3. `.specs/codebase/CONVENTIONS.md`
197
+ 4. `HARNESS.md`
198
+ 5. Current feature or quick-task files only
152
199
 
153
- ```bash
154
- cd my-python-app
155
- km-spec init
156
- km-spec stack # Language: Python, Framework: FastAPI, ...
157
- km-spec feature "REST API Endpoints"
200
+ For Claude Code, you can add:
201
+
202
+ ```markdown
203
+ # Development Guide
204
+ This project uses Spec Driven Development. See `AGENTS.md` and `HARNESS.md`.
205
+ Always start a session by reading `.specs/project/STATE.md`.
158
206
  ```
159
207
 
160
- ### Node.js / Express / NestJS
208
+ ---
161
209
 
162
- ```bash
163
- cd my-node-app
164
- km-spec init
165
- km-spec stack # Language: TypeScript, Runtime: Node.js, ...
166
- km-spec feature "Auth Middleware"
167
- ```
210
+ ## Migration notes (0.1.x → 0.2.0)
168
211
 
169
- ### Java / Spring
212
+ Breaking / behavior changes for **new** scaffolds:
170
213
 
171
- ```bash
172
- cd my-spring-app
173
- km-spec init
174
- km-spec stack # Language: Java, Framework: Spring Boot, ...
175
- km-spec feature "Payment Service"
176
- ```
214
+ | Area | 0.1.x | 0.2.0 |
215
+ |------|-------|-------|
216
+ | Feature create | Interactive prompts by default | **Non-interactive** by default; rich templates |
217
+ | Feature files | `spec.md`, `tasks.md`, `validation.md` | + `context.md`, `plan.md` |
218
+ | Quick create | Interactive; single `.md` file | **Non-interactive**; `quick/<slug>/TASK.md` + `SUMMARY.md` |
219
+ | Agent docs | `AGENTS.md` only | + `HARNESS.md` |
220
+ | Planning artifact | (docs said `design.md`) | Canonical **`plan.md`** |
177
221
 
178
- ### Android / Kotlin
222
+ **Compatibility:**
179
223
 
180
- ```bash
181
- cd my-android-app
182
- km-spec init
183
- km-spec stack # Language: Kotlin, Framework: Android SDK, ...
184
- km-spec feature "Push Notifications"
185
- ```
224
+ - Existing files are **never** overwritten without `--force`.
225
+ - `init` still skips existing files unless `--force`.
226
+ - `doctor` accepts legacy feature layouts (warns on missing `context.md` / `plan.md`).
227
+ - Legacy `.specs/quick/*.md` files produce warnings only.
228
+ - No automatic migration is performed. Re-scaffold only with `--force` (destructive for that feature/quick directory).
186
229
 
187
- ### Go
230
+ To adopt 0.2 agent docs in an existing repo without wiping specs:
188
231
 
189
- ```bash
190
- cd my-go-app
191
- km-spec init
192
- km-spec stack # Language: Go, Runtime: Go 1.22, ...
193
- km-spec feature "gRPC Service"
194
- ```
232
+ 1. Copy `HARNESS.md` from the package templates (or re-run `init` and keep skips).
233
+ 2. Replace `AGENTS.md` manually if you want the new rules (or `init --force` only if you accept overwriting root agent docs).
234
+
235
+ ---
236
+
237
+ ## How to use with different stacks
195
238
 
196
- ### .NET / C#
239
+ KM SDD generates only Markdown files. It never modifies source code, package managers, frameworks, or runtimes. It works with any stack.
197
240
 
198
241
  ```bash
199
- cd my-dotnet-app
242
+ cd my-app
200
243
  km-spec init
201
- km-spec stack # Language: C#, Framework: ASP.NET Core, ...
202
- km-spec feature "Background Job Service"
244
+ km-spec feature "User Registration" --description "Email signup and verification"
203
245
  ```
204
246
 
247
+ Fill `CONVENTIONS.md` (manually or via optional `km-spec stack` interview) so agents know language, test commands, and layout.
248
+
205
249
  ---
206
250
 
207
251
  ## How CONVENTIONS.md consolidates technical context
@@ -230,49 +274,12 @@ If one section becomes too large, it can optionally be extracted to a dedicated
230
274
 
231
275
  ---
232
276
 
233
- ## How AI agents use the specs
234
-
235
- The `AGENTS.md` file at the project root instructs AI agents to read three files before doing any work:
236
-
237
- 1. `.specs/project/STATE.md` — current project state and last session notes
238
- 2. `.specs/project/PROJECT.md` — project goals, users, and constraints
239
- 3. `.specs/codebase/CONVENTIONS.md` — technical rules for every line of code
240
-
241
- For Claude Code, add this to your `CLAUDE.md`:
242
-
243
- ```markdown
244
- # Development Guide
245
- This project uses Spec Driven Development. See `SDD.md` for the full methodology.
246
-
247
- Always start a session by reading `.specs/project/STATE.md`.
248
- All work follows the AI Development Harness in `SDD.md` Section 7.
249
- ```
250
-
251
- ---
252
-
253
277
  ## Local test commands
254
278
 
255
279
  ```bash
256
280
  chmod +x bin/km-spec
257
- npm link
258
- km-spec
259
- km-spec help
260
- km-spec init
261
- km-spec project
262
- km-spec stack
263
- km-spec feature "User Authentication"
264
- km-spec quick "Fix login validation"
265
- km-spec status
266
- km-spec doctor
267
- ```
268
-
269
- ---
270
-
271
- ## Publish to npm
272
-
273
- ```bash
274
- npm login
275
- npm publish
281
+ npm test
282
+ npm pack --dry-run
276
283
  ```
277
284
 
278
285
  ---