You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI-native system for spec-driven development. Keep living specifications alongside code, propose changes as deltas, and archive once reality matches the spec.
10
10
11
+
OpenSpec turns specifications into living documentation that drives development. Your specs and code stay in sync—propose changes, track implementation, and know exactly when features are complete. No more outdated docs or unclear requirements.
12
+
13
+
## Why OpenSpec?
14
+
15
+
**The Problem:** Documentation drifts from code. Requirements get lost in tickets. AI assistants lack context. Teams struggle to track what's actually built versus what's planned.
16
+
17
+
**The Solution:** OpenSpec makes specifications the single source of truth:
18
+
-**Living Documentation** - Specs stay next to code and evolve together
19
+
-**Change Proposals** - Delta-based changes show exactly what's being modified
20
+
-**AI-Friendly** - Structured format that AI assistants understand and follow
The system SHALL require OTP verification after password authentication.
124
+
125
+
#### Scenario: OTP verification required
126
+
- WHEN a user submits valid credentials
127
+
- THEN prompt for OTP code
128
+
- AND verify code before issuing JWT"> openspec/changes/add-2fa/specs/user-auth/spec.md
129
+
130
+
# See what changes
131
+
openspec diff add-2fa
132
+
```
133
+
134
+
### 4. Track Implementation
135
+
136
+
```bash
137
+
# View active changes
138
+
openspec list
139
+
140
+
# Show change details
141
+
openspec show add-2fa
142
+
143
+
# After implementing, archive the change
144
+
openspec archive add-2fa
55
145
```
56
146
57
147
## Minimal Example
@@ -102,10 +192,22 @@ The system MUST require a second factor during login.
102
192
- THEN an OTP challenge is required
103
193
```
104
194
105
-
Critical formatting rules:
106
-
- Use `### Requirement: <name>` for requirement headers.
107
-
- Every requirement MUST include at least one `#### Scenario:` block.
108
-
- Use SHALL/MUST in ADDED/MODIFIED requirement text.
195
+
### Understanding Delta Format
196
+
197
+
Deltas describe how specifications change using operation headers:
198
+
199
+
-**`## ADDED Requirements`** - New capabilities being introduced
200
+
-**`## MODIFIED Requirements`** - Changes to existing behavior (include the complete modified text)
201
+
-**`## REMOVED Requirements`** - Features being deprecated (include reason and migration path)
202
+
-**`## RENAMED Requirements`** - Simple name changes
203
+
204
+
Each delta operation contains complete requirement blocks that will be merged into the main spec. Think of deltas as "patches" that transform your current specifications into the desired state.
205
+
206
+
**Critical formatting rules:**
207
+
- Use `### Requirement: <name>` for requirement headers
208
+
- Every requirement MUST include at least one `#### Scenario:` block
209
+
- Use SHALL/MUST in ADDED/MODIFIED requirement text
210
+
- MODIFIED sections must contain the complete updated requirement, not just the changes
109
211
110
212
## Core Commands
111
213
@@ -155,14 +257,115 @@ Outputs shape:
155
257
}
156
258
```
157
259
158
-
## Team Workflow
260
+
## AI Integration
159
261
160
-
-`openspec update` is team-friendly: it updates `openspec/README.md` and only modifies AI config files that already exist (e.g., CLAUDE.md), never forcing tools on teammates.
161
-
- Multiple AI tools can co-exist without conflicts.
262
+
OpenSpec is designed to work seamlessly with AI coding assistants like Claude, GitHub Copilot, and Cursor.
162
263
163
-
## Deprecation Note
264
+
### How AI Assistants Use OpenSpec
265
+
266
+
1.**Context Loading** - AI reads specs to understand current capabilities
267
+
2.**Change Creation** - AI creates properly formatted proposals and deltas
268
+
3.**Task Execution** - AI follows tasks.md to implement changes systematically
269
+
4.**Validation** - AI uses CLI to validate changes before committing
270
+
271
+
### Setting Up AI Integration
272
+
273
+
```bash
274
+
# Update AI configuration files (only modifies existing files)
275
+
openspec update
276
+
277
+
# This updates:
278
+
# - openspec/README.md with latest conventions
279
+
# - CLAUDE.md (if exists) with Claude-specific instructions
280
+
# - .cursorrules (if exists) with Cursor rules
281
+
# - Other AI config files as needed
282
+
```
283
+
284
+
### Example AI Workflow
285
+
286
+
```markdown
287
+
// Tell your AI assistant:
288
+
"We use OpenSpec for spec-driven development.
289
+
Before making changes, check openspec/specs/ for current state.
290
+
Create proposals in openspec/changes/ for new features."
291
+
292
+
// AI will then:
293
+
1. Run `openspec list --specs` to see capabilities
294
+
2. Read relevant specs with `openspec show <spec>`
295
+
3. Create change proposal if needed
296
+
4. Implement following the tasks.md checklist
297
+
5. Validate with `openspec validate --strict`
298
+
```
299
+
300
+
### Best Practices for AI Development
301
+
302
+
- Always have AI read specs before implementing
303
+
- Use `openspec validate` to catch formatting issues
304
+
- Let AI create proposals for complex changes
305
+
- Archive changes only after deployment
306
+
307
+
## Comparison with Alternatives
308
+
309
+
### OpenSpec vs Kiro.dev
310
+
311
+
| Aspect | OpenSpec | Kiro |
312
+
|--------|----------|------|
313
+
|**Approach**| CLI tool, works with any editor/IDE | Full IDE with built-in agents |
|**Completeness Tracking**| Archive shows when done | Manual status updates |
331
+
332
+
## Team Adoption
333
+
334
+
### Introducing to Existing Projects
335
+
336
+
1.**Start Small** - Begin with one capability (e.g., authentication)
337
+
2.**Document Current State** - Create specs for what exists today
338
+
3.**Use for Next Feature** - Create your first change proposal
339
+
4.**Iterate** - Refine the process based on team feedback
340
+
341
+
### Migration Strategy
342
+
343
+
```bash
344
+
# Step 1: Initialize OpenSpec
345
+
openspec init
346
+
347
+
# Step 2: Create specs for existing features
348
+
mkdir -p openspec/specs/existing-feature
349
+
# Document current behavior in spec.md
350
+
351
+
# Step 3: All new features use changes
352
+
mkdir -p openspec/changes/new-feature
353
+
# Team creates proposals before coding
354
+
355
+
# Step 4: Gradually migrate docs
356
+
# Move requirements from tickets/wikis to specs
357
+
```
358
+
359
+
### Team Workflow
360
+
361
+
-**Product/PM** - Write requirements in proposal.md
362
+
-**Engineers** - Create technical specs and implement
363
+
-**AI Assistants** - Follow specs for consistent implementation
364
+
-**QA** - Test against scenarios in specs
365
+
-**Documentation** - Specs ARE the documentation
366
+
367
+
`openspec update` is team-friendly: it updates instruction files without forcing tools on teammates. Multiple AI assistants can coexist without conflicts.
164
368
165
-
Noun-first commands (`openspec spec ...`, `openspec change ...`) are available but deprecated. Prefer verb-first commands: `openspec list`, `openspec show`, `openspec validate`.
166
369
167
370
## Troubleshooting
168
371
@@ -177,10 +380,16 @@ Noun-first commands (`openspec spec ...`, `openspec change ...`) are available b
177
380
178
381
## Contributing
179
382
180
-
- Use pnpm: `pnpm install`, `pnpm run build`, `pnpm test`.
181
-
- Develop CLI locally: `pnpm dev` or `pnpm dev:cli`.
0 commit comments