skills/update-specs/SKILL.md
Update OpenSpec specs to reflect implementation reality after debugging, testing, and review
npx skillsauth add jankneumann/agentic-coding-tools update-specsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Update OpenSpec spec files to reflect what was actually built. Use this after implementation work where debugging, integration testing, code review, or interactive refinements revealed differences between the original spec and the final implementation.
/implement-feature when the implementation diverged from the specspec.md or design.md describe$ARGUMENTS - Spec capability name (e.g., "agent-coordinator") or path to spec directory. If omitted, detect from recent git history.
Before any other work, verify exclusive access — this skill commits spec updates to main and must not race other agents:
python skills/shared/active_agents.py
0: no active agents → proceed.1: one or more active agents hold worktrees → stop, surface the list to the operator (the script's stdout already prints it), and ask whether to wait or pass --force. Never auto-force.An entry is "active" when it is pinned OR its last_heartbeat is within 1 hour. See skills/shared/active_agents.py and CLAUDE.md "Sync-Point Skills" for the contract; docs/mental-models.md gap G10 for the rationale.
# From argument
SPEC_DIR=openspec/specs/$ARGUMENTS
# Or detect from recent commits
git log --oneline -10 --name-only | grep "openspec/specs\|src/"
Read the spec directory to understand which files exist:
spec.md - Requirements, scenarios, behavior contractsdesign.md - Architecture, patterns, component descriptionstasks.md - Implementation tasks and statusCompare what's documented vs what's implemented. Read the actual source code and tests:
# Find recently changed source files
git log --oneline -5 --name-only
# Review the implementation
# Read source files, test files, migrations, configs
Focus on discovering spec drift — places where the implementation differs from the spec:
Open spec.md and update it to reflect implementation reality:
Implementation Status — Add or update a status table showing what's implemented vs planned:
## Implementation Status
| Phase | Scope | Status |
|-------|-------|--------|
| Phase 1 | Core feature X, Y | **Implemented** |
| Phase 2 | Extended feature Z | Specified |
Requirements and Scenarios — Fix any scenarios where the actual behavior differs from what was specified:
{success: false, reason: "..."} not {success: true, task_id: null})Component Lists — Update lists of tools, endpoints, tables, etc. to match what was actually built. Organize by implementation phase if some items are planned but not yet built.
Remove Duplicates — If sections were added during implementation that overlap with existing content, consolidate them.
Open design.md and update it to reflect implementation reality:
Patterns and Algorithms — If debugging or testing revealed that the original pattern didn't work and was replaced, document the actual pattern. Include the reasoning for the change:
### Lock Acquisition Pattern
Uses INSERT ON CONFLICT DO NOTHING for race-safe acquisition.
Original SELECT FOR UPDATE approach caused PK violations under concurrent access.
File Structure — Update the file tree to show what actually exists. Split into "Implemented" and "Planned" sections if applicable.
Component Descriptions — Update descriptions of modules, services, and tools to match their actual capabilities. Note which are implemented vs planned.
If tasks.md exists in the spec directory, update task status:
[x]# See what changed
git diff openspec/specs/
# Verify specs are internally consistent
# Check cross-references between spec.md and design.md
Ask yourself:
git add openspec/specs/
git commit -m "$(cat <<'EOF'
docs: Update <capability> specs to reflect implementation
Sync spec.md and design.md with actual implemented behavior:
- <key change 1>
- <key change 2>
- <key change 3>
Co-Authored-By: Claude <[email protected]>
EOF
)"
| Drift Type | Where to Fix | Example |
|------------|-------------|---------|
| Response shape changed | spec.md scenarios | Error returns {success: false} not {error: true} |
| Algorithm replaced | design.md patterns | INSERT ON CONFLICT instead of SELECT FOR UPDATE |
| New config option added | spec.md requirements, design.md components | rest_prefix for direct PostgREST connections |
| New infrastructure file | design.md file structure | Bootstrap migration 000_bootstrap.sql |
| Phase boundary shifted | spec.md status table, design.md components | Tool moved from Phase 2 to Phase 1 |
| Edge case discovered | spec.md scenarios | TTL=0 doesn't expire within same transaction |
spec.md reflects actual implemented behavior and contractsdesign.md reflects actual architecture and patternstasks.md reflects actual completion status (if present)This skill fits into the feature lifecycle as a feedback loop:
/plan-feature → Proposal (spec is aspirational)
/implement-feature → Build + PR (spec may drift)
/update-specs → Sync specs with reality ← YOU ARE HERE
/cleanup-feature → Merge + archive
Run /update-specs whenever implementation diverges from the original spec — whether during /implement-feature, after debugging sessions, or after code review feedback.
testing
Create and edit Obsidian Flavored Markdown with wikilinks, embeds, callouts, properties, and other Obsidian-specific syntax. Use when working with .md files in Obsidian, or when the user mentions wikilinks, callouts, frontmatter, tags, embeds, or Obsidian notes.
tools
Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their Obsidian vault, manage notes, search vault content, perform vault operations from the command line, or develop and debug Obsidian plugins and themes.
data-ai
Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.
tools
Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.