Skip to content

Commit 14e2cc6

Browse files
committed
docs(readme): enhance for public release with why, workflow diagram, AI integration, comparisons
1 parent 299171c commit 14e2cc6

File tree

1 file changed

+244
-35
lines changed

1 file changed

+244
-35
lines changed

README.md

Lines changed: 244 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,50 +8,140 @@
88

99
AI-native system for spec-driven development. Keep living specifications alongside code, propose changes as deltas, and archive once reality matches the spec.
1010

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
21+
- **Clear Workflow** - Know what's proposed, what's built, and what's archived
22+
- **Team Alignment** - Everyone sees the same requirements and changes
23+
24+
## How It Works
25+
26+
```
27+
┌─────────────┐ ┌─────────────┐ ┌──────────────┐
28+
│ SPECS │ │ CHANGES │ │ ARCHIVE │
29+
│ (Truth) │◀──────│ (Proposals) │──────▶│ (Completed) │
30+
└─────────────┘ └─────────────┘ └──────────────┘
31+
▲ │ │
32+
│ ▼ │
33+
│ ┌─────────────┐ │
34+
└───────────────│ CODE │◀──────────────┘
35+
└─────────────┘
36+
37+
1. SPECS define current capabilities (what IS built)
38+
2. CHANGES propose modifications using deltas (what SHOULD change)
39+
3. CODE implements the changes following tasks
40+
4. ARCHIVE preserves completed changes after deployment
41+
```
42+
1143
## Overview
1244

1345
- Specs are the current truth stored in `openspec/specs/<capability>/spec.md`.
1446
- Changes are proposals stored in `openspec/changes/<name>/` with delta-formatted spec updates.
1547
- The CLI favors verb-first commands: `list`, `show`, `validate`, `diff`, `archive`.
1648

17-
## Prerequisites
49+
## Installation
50+
51+
### Prerequisites
1852

1953
- Node.js >= 20.19.0
20-
- pnpm (project standard)
2154

22-
## Installation
55+
### Install OpenSpec
2356

24-
- Global: `pnpm add -g @fission-ai/openspec`
57+
- Global: `npm install -g @fission-ai/openspec`
2558
- Local (per project):
26-
- `pnpm add -D @fission-ai/openspec`
27-
- Run with `pnpm exec openspec ...`
59+
- `npm install --save-dev @fission-ai/openspec`
60+
- Run with `npx openspec ...`
2861

29-
## Quick Start
62+
## Getting Started
63+
64+
### 1. Initialize Your Project
3065

3166
```bash
32-
# Initialize OpenSpec in your project
67+
# Create a new project or navigate to existing one
68+
mkdir my-project && cd my-project
69+
70+
# Initialize OpenSpec
3371
openspec init
3472

35-
# Update OpenSpec instructions (team-friendly)
36-
openspec update
73+
# This creates:
74+
# openspec/
75+
# ├── specs/ # Your specifications
76+
# ├── changes/ # Proposed changes
77+
# └── README.md # Instructions for your team
78+
```
79+
80+
### 2. Create Your First Spec
3781

38-
# List items (IDs only). Use --specs to list specs
39-
openspec list # defaults to changes
40-
openspec list --specs
82+
```bash
83+
# Create a capability spec
84+
mkdir -p openspec/specs/user-auth
85+
echo "# User Authentication Specification
4186
42-
# Show an item (raw text by default)
43-
openspec show <item>
44-
openspec show <item> --json # automation-friendly output
87+
## Purpose
88+
Handle user authentication and session management.
4589
46-
# Validate
47-
openspec validate --changes --strict
48-
openspec validate --specs --json
90+
## Requirements
91+
### Requirement: User Login
92+
The system SHALL authenticate users with email and password.
4993
50-
# See diffs between a change and current specs
51-
openspec diff <change-id>
94+
#### Scenario: Valid credentials
95+
- WHEN a user submits valid credentials
96+
- THEN return a JWT token with 24-hour expiry" > openspec/specs/user-auth/spec.md
5297

53-
# Archive a completed change
54-
openspec archive <change-id> [--skip-specs]
98+
# Validate the spec
99+
openspec validate --specs
100+
```
101+
102+
### 3. Propose a Change
103+
104+
```bash
105+
# When you need to add two-factor authentication:
106+
mkdir -p openspec/changes/add-2fa/specs/user-auth
107+
108+
# Create the proposal
109+
echo "## Why
110+
Improve security by requiring a second authentication factor.
111+
112+
## What Changes
113+
- Add OTP-based two-factor authentication
114+
- Require 2FA for admin accounts
115+
116+
## Impact
117+
- Affected specs: user-auth
118+
- Affected code: auth service, login UI" > openspec/changes/add-2fa/proposal.md
119+
120+
# Create the delta (what's being added)
121+
echo "## ADDED Requirements
122+
### Requirement: Two-Factor Authentication
123+
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
55145
```
56146

57147
## Minimal Example
@@ -102,10 +192,22 @@ The system MUST require a second factor during login.
102192
- THEN an OTP challenge is required
103193
```
104194

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
109211

110212
## Core Commands
111213

@@ -155,14 +257,115 @@ Outputs shape:
155257
}
156258
```
157259

158-
## Team Workflow
260+
## AI Integration
159261

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.
162263

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 |
314+
| **Workflow** | Specs → Changes (deltas) → Archive | Requirements → Design → Tasks |
315+
| **File Format** | Markdown with specific headers | EARS notation for requirements |
316+
| **Change Tracking** | Delta-based proposals | Direct spec modification |
317+
| **AI Integration** | Works with any AI assistant | Built-in AI agents with hooks |
318+
| **Version Control** | Git-native, PR-friendly | Git-based with IDE integration |
319+
| **Learning Curve** | Simple CLI commands | New IDE and workflow |
320+
| **Team Adoption** | Drop into existing projects | Requires IDE adoption |
321+
322+
### OpenSpec vs Traditional Docs
323+
324+
| Aspect | OpenSpec | README/Wiki/Tickets |
325+
|--------|----------|--------------------|
326+
| **Location** | Next to code in repo | Separate systems |
327+
| **Drift Prevention** | Specs validated with code | Manual sync required |
328+
| **Change Process** | Structured proposals | Ad-hoc updates |
329+
| **AI Readability** | Structured, parseable | Varies widely |
330+
| **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.
164368

165-
Noun-first commands (`openspec spec ...`, `openspec change ...`) are available but deprecated. Prefer verb-first commands: `openspec list`, `openspec show`, `openspec validate`.
166369

167370
## Troubleshooting
168371

@@ -177,10 +380,16 @@ Noun-first commands (`openspec spec ...`, `openspec change ...`) are available b
177380

178381
## Contributing
179382

180-
- Use pnpm: `pnpm install`, `pnpm run build`, `pnpm test`.
181-
- Develop CLI locally: `pnpm dev` or `pnpm dev:cli`.
182-
- Conventional commits (one-line): `type(scope): subject`.
383+
- Install dependencies: `npm install`
384+
- Build: `npm run build`
385+
- Test: `npm test`
386+
- Develop CLI locally: `npm run dev` or `npm run dev:cli`
387+
- Conventional commits (one-line): `type(scope): subject`
183388

184389
## License
185390

186391
MIT
392+
393+
## Deprecation Note
394+
395+
Noun-first commands (`openspec spec ...`, `openspec change ...`) are available but deprecated. Prefer verb-first commands: `openspec list`, `openspec show`, `openspec validate`.

0 commit comments

Comments
 (0)