Skip to main content

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โ€‹

TimelineLock-in Level
Month 11 spec โ†’ Convenient
Month 35 specs โ†’ Workflow dependency
Month 612 specs โ†’ Source of truth
Month 1230 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


Status: Ready to Implement