Cursor Integration
Spec Doc becomes the source of truth that Cursor references when generating code.
Spec Doc (What to build) โ Cursor (How to build)
Workflowโ
1. Write Spec โ 2. Export โ 3. Use in Cursor โ 4. Iterateโ
Export generates cursor-optimized Markdown with:
- Spec content
- Version metadata (frontmatter)
- Implementation checklist
- Cross-references to related specs
In Cursor:
User: "@specs/user-authentication-v12.md Implement this"
Cursor: [Reads spec, generates code matching exact requirements]
Export Formatโ
Recommended: Markdown with YAML Frontmatter
---
specdoc:
project: e-commerce-platform
type: epic
name: user-authentication
version: 12
url: https://specdoc.ai/specs/abc123/v12
previous_version: 11
changes:
- "Added refresh token rotation"
---
# Epic: User Authentication
[Content]
Alternatives:
- HTML comments (broader compatibility)
- JSON sidecar file (maximum flexibility)
Version Trackingโ
File naming: user-authentication-v12.md
Benefits:
- Cursor sees diff between versions (v12 โ v13)
- Targeted updates instead of full rewrites
- Spec and code stay in sync
- Code comments reference spec version
Integration Optionsโ
Option A: Context Files (MVP)โ
project/
โโโ .cursor/specs/
โ โโโ user-authentication-v12.md โ Spec Doc export
โโโ src/
โโโ README.md
Option B: Cursor Rulesโ
.cursorrules file references specs:
When implementing features, reference Spec Doc exports in .cursor/specs/
Current specs:
- User Authentication: @specs/user-authentication-v12.md
Option C: CLI (Future)โ
specdoc export --spec auth --to cursor
specdoc sync --watch # Auto-sync on changes
Option D: Cursor Extension (Future)โ
- Import from Spec Doc command
- Auto-sync on save
- Inline spec preview on hover
- Implementation checklist in sidebar
Why This Creates Lock-Inโ
| Timeline | Lock-in Level |
|---|---|
| Month 1 | 1 spec โ Convenient |
| Month 3 | 5 specs โ Workflow dependency |
| Month 6 | 12 specs โ Source of truth |
| Month 12 | 30 specs + team โ Impossible to leave |
Spec Doc becomes indispensable because:
- First tool opened daily
- Source of truth for all features
- Cursor depends on it
- All context lives there
Related Documentsโ
- Epic - Product scope
- Architecture - Technical design
- Prototyping - Prototype generation
- UX Vision - Interface philosophy
Status: Ready to Implement