with one click
spec-code
// Design/document specifications following strict template structure (syncs to Notion). Use when creating technical specifications, documenting API designs, or synchronizing specs with Notion.
// Design/document specifications following strict template structure (syncs to Notion). Use when creating technical specifications, documenting API designs, or synchronizing specs with Notion.
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | spec-code |
| description | Design/document specifications following strict template structure (syncs to Notion). Use when creating technical specifications, documenting API designs, or synchronizing specs with Notion. |
| model | opus |
| context | fork |
| agent | general-purpose |
| allowed-tools | Bash, Write, Read, Edit, Task, WebSearch, WebFetch, Glob, Grep, TodoWrite, AskUserQuestion |
| argument-hint | <instruction> [--type=api|web-app|mobile|library|fullstack] |
Design new project specifications OR retrospectively document existing implementations in DESIGN.md format, following strict Notion template structure. Works in three modes: CREATE (greenfield design), UPDATE (modify existing specs), or DOCUMENT (analyze and document existing code). Performs 2-way merge with Notion by default.
What this command does NOT do:
When to REJECT:
ultrathink: you'd perform the following steps
Determine Operation Mode:
Load Existing Design (if UPDATE mode)
Analyze Existing Codebase (if DOCUMENT mode)
Fetch Notion Template
Load Reference Documentation (if --reference provided)
Parse --sync-template Flag (if provided)
(Only if existing Notion pages found)
See references/merge-resolution.md for the full conflict-resolution protocol, AskUserQuestion decision tree, and merge report format.
For DOCUMENT mode, see references/document-mode.md for the full codebase-extraction workflow (project scan, package.json parsing, tech stack derivation, mapping to spec sections).
See references/frontmatter.md for the exact frontmatter schema (notion_url, last_edited_at, last_synced_at, related_files), filename mapping, and update rules.
(Unless --skip-notion-sync)
last_synced_atSee references/notion-sync.md for the full 4-step sync protocol, subagent inputs/responsibilities, and database/page property rules.
Output Format:
[✅/❌] Command: spec-code "$ARGUMENTS"
## Summary
- Mode: [CREATE / UPDATE / DOCUMENT]
- Package name: [name]
- Design document: [path]
- Child documents: [count and filenames]
- Template: Notion
- Project type: [type]
- Tech stack: [technologies]
- Notion sync: [Created/Updated/Skipped]
- Sync verification: [✅ Verified / ⚠️ Partial / Skipped]
## Actions Taken
1. [Actions based on mode]
## Files Created/Updated
- DESIGN.md (with frontmatter)
- REFERENCE.md (with frontmatter)
- [Other child files]
## Template Adherence
- Structure: Follows template exactly
- Sections: Only template sections included
## Next Steps
1. Review DESIGN.md and child files
2. Share with team for feedback
3. Begin implementation following specs
/spec-code "Create REST API for task management with user auth"
# Mode: CREATE
# Creates DESIGN.md with frontmatter
# Creates child page files
# Syncs to Notion
/spec-code "Add caching layer using Redis"
# Mode: UPDATE
# Updates Architecture section only
# Preserves all other sections
# Syncs changes to Notion
/spec-code "Document the existing Express API in this codebase"
# Mode: DOCUMENT (auto-detected)
# Analyzes codebase structure
# Documents actual implementation
# Creates DESIGN.md from code analysis
/spec-code "Create SaaS platform" --type=fullstack
# Uses fullstack template patterns
/spec-code "Document microservices" --skip-notion-sync
# Creates local files only
# Does NOT sync to Notion
/spec-code "Update API" --sync-template
# Updates to latest template structure
# Preserves content, reorganizes structure
/spec-code "app"
# Error: Please provide more details
# Suggestion: Describe what the app does
/spec-code "Create API with custom section"
# Warning: Template does not include custom section
# Cannot add sections outside template