spec-update
Skill0 starsChanged 8 months agoMITView on GitHub
Post-change documentation: update functional spec per domain, README, and lessons learned. Invoked by /commit step 6 or standalone. Init mode bootstraps all specs on a new project. Triggers: "update spec", "functional spec", "spec documentation", "init specs", "bootstrap specs".
2 other projects use a version of this.
Adopted by
Most recently taken up by
- NashEQify/forgetheir own version, first seen Oct 25, 2026
- HHU3637kr/skillstheir own version, first seen Sep 22, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- HHU3637kr/skills★ 146same name
- NashEQify/forge★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ci-watchSkill
- commitSkill
- discovery-interview-prepSkill
- doc-generateSkill
- incident-responseSkill
- opportunity-solution-treeSkill
- polarisSkill
- prd-developmentSkill
- prioritization-advisorSkill
- reviewSkill
- roadmapSkill
- security-auditSkill
- session-wrapSkill
- tddSkill
- tech-debt-auditSkill
- test-runnerSkill
- user-storySkill
- uxSkill
- workshop-facilitationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
24 rules. About 0 are common, 18 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
If invoked from /commit step 6 (last git log returns a conventional commit format) → skip to Step 1
- Very specific: line 29
If docs/specs/*.md files already exist AND user did not explicitly request init → skip to Step 1
- Distinctive: line 61
After generation → go directly to Step 5 (Review).
- Distinctive: line 94
Update Overview if the feature scope expanded
- Very specific: line 95
Add new User Stories for new capabilities (Mike Cohn + Gherkin format from /user-story)
- Distinctive: line 96
Add or update Behavior sections for changed behaviors
- Distinctive: line 97
Update Configuration if new options were added
- Distinctive: line 102
Always incremental update — never recreate from scratch
- Distinctive: line 105
If the scope is ambiguous or the domain boundary is unclear → ask the PO
- Distinctive: line 109
Check if the change impacts installation, configuration, or usage:
- Very specific: line 111
If the commit is feat and introduces a new user-facing capability:
- Distinctive: line 112
Check if README mentions the affected domain
- Distinctive: line 113
If yes → propose updating the relevant section
- Distinctive: line 114
If no and the change is significant → propose adding a mention
- Very specific: line 115
If the change affects setup/install/config → propose updating the relevant section
- Distinctive: line 116
If not relevant → skip silently
- Very specific: line 125
If yes → update memory/MEMORY.md (for project-level insights) or memory/patterns.md (for reusable patterns).
- Distinctive: line 127
If nothing notable → continue without interruption.
- Distinctive: line 135
Ask the user to validate before proceeding
- Distinctive: line 137
If the user requests changes → iterate.
- Distinctive: line 189
Always read existing files before modifying — never overwrite blindly
- Distinctive: line 191
If scope is ambiguous → ask the PO for confirmation
- Distinctive: line 199
Stale specs: If a spec exists but is outdated, update it — don't create a new one.
- Distinctive: line 200
Scope creep: Only document what changed in this commit, not the entire domain.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spec Update — Post-change Documentation
When to use
- After implementing a feature or fix — update the functional spec for the affected domain
- From
/commitstep 6 — automatically invoked during the commit workflow - Standalone — run
/spec-updateto update docs without committing - To bootstrap specs on an existing codebase — run
/spec-updatewhen no specs exist; init mode activates automatically - Never for trivial changes (
chore,test,perfcommits with no user-visible impact)
Process
Step 0: Init mode (bootstrap)
Only when invoked standalone (not from
/commit). Skipped ifdocs/specs/already contains.mdfiles, unless the user explicitly requests init.
0a. Activation check
- If invoked from
/commitstep 6 (last git log returns a conventional commit format) → skip to Step 1 - If
docs/specs/*.mdfiles already exist AND user did not explicitly request init → skip to Step 1 - Otherwise → enter init mode
0b. Scan codebase for domains
Stack-agnostic, 4-pass heuristic (in order of confidence):
| Pass | Source | Candidate = | Confidence |
| 1 | Feature directories under src/, app/, lib/, packages/, modules/, features/ | Directory name | High |
| 2 | Route/controller files (routes/*.{js,ts,py}, controllers/*, views/*) | File stem | Medium |
| 3 | Package manifests (packages/*/package.json, apps/*/pyproject.toml) | Package name | High |
| 4 | README headings (## ) excluding generic ones (Install, Usage, License, Contributing, Configuration) | Heading text | Low |
Exclude infrastructure dirs: node_modules, .git, .claude, dist, build, __pycache__, .venv, coverage, docs, config, migrations, assets, public, static, vendor, tests, test.
De-duplicate by normalized name (lowercase, strip - and _). Keep the most descriptive variant.
0c. User validation (Level 3 — mandatory)
Present discovered domains with confidence level and source. The user must confirm, add, remove, or rename domains before any file is written. Never auto-generate without confirmation.
0d. Generate specs
For each confirmed domain, create docs/specs/<domain>.md using the template below:
- Overview: 1-2 sentences inferred from code/README. Prefix with
> Draft — to be refined. - User Stories: 1-2 placeholder stories in Mike Cohn + Gherkin format. Prefix with
> Draft — inferred from codebase scan. - Behavior: one empty scaffold section
- Configuration: empty table (no rows)
- History:
| <today> | init | Initial spec generated by /spec-update init |
After generation → go directly to Step 5 (Review). Skip Steps 1-4.
Step 1: Detect scope and type
Skip this step if you just completed Step 0 (init mode). Go directly to Step 5.
Parse the commit message (planned or last) to extract the conventional commit type and scope:
git log -1 --format=%sExtract: type(scope): description → type = feat, scope = payment, etc.
If scope is absent: infer from the main directory touched in the diff and ask the user to confirm.
Decision matrix:
| Type | Action |
feat | Create or update functional spec |
fix | Update existing spec (corrected behavior + History entry) |
refactor | Update only if user-visible behavior changes — ask PO if unsure |
docs, chore, test, perf | Skip step 2, go to step 3 |
Step 2: Update Functional Spec (6a)
Target file: docs/specs/<scope>.md
If file does not exist → create from the template below.
If file exists → read it, then:
- Update Overview if the feature scope expanded
- Add new User Stories for new capabilities (Mike Cohn + Gherkin format from
/user-story) - Add or update Behavior sections for changed behaviors
- Update Configuration if new options were added
- Append a row to History with date, short commit hash, and change summary
Rules:
- Always incremental update — never recreate from scratch
- Focus on "WHAT" (user perspective), not "HOW" (technical implementation)
- Reuse the Mike Cohn + Gherkin format from the
/user-storyskill - If the scope is ambiguous or the domain boundary is unclear → ask the PO
Step 3: Update README (6b)
Check if the change impacts installation, configuration, or usage:
- If the commit is
featand introduces a new user-facing capability:- Check if README mentions the affected domain
- If yes → propose updating the relevant section
- If no and the change is significant → propose adding a mention
- If the change affects setup/install/config → propose updating the relevant section
- If not relevant → skip silently
Step 4: Lessons Learned (6c)
Evaluate whether the changes reveal:
- A non-obvious pattern, platform quirk, or debugging lesson
- A key technical decision worth recording for future reference
If yes → update memory/MEMORY.md (for project-level insights) or memory/patterns.md (for reusable patterns).
If nothing notable → continue without interruption.
Step 5: Review with user
Present a summary of all proposed documentation changes:
- Which files were created or modified
- Key content added or changed
- Ask the user to validate before proceeding
If the user requests changes → iterate. If the user declines → skip without blocking.
Template: Functional Specification
File: docs/specs/<scope>.md
# <Scope> — Functional Specification
> Auto-generated by /spec-update. Last updated: YYYY-MM-DD.
## Overview
[1-2 paragraphs: what this domain does from the user's perspective]
## User Stories
### <Story title>
- **As a** [persona]
- **I want to** [action]
- **so that** [outcome]
**Acceptance criteria:**
- **Given** [context], **when** [action], **then** [result]
## Behavior
### <Behavior name>
- **Trigger:** what initiates this
- **Input:** what the user provides
- **Output:** what the user sees/gets
- **Edge cases:** known edge cases handled
## Configuration
| Option | Type | Default | Description |
| ------ | ---- | ------- | ----------- |
## History
| Date | Commit | Change |
| ---- | ------ | ------ |
| YYYY-MM-DD | `abc1234` | Initial specification |Rules
- Advisory — never blocking. The user can always decline documentation updates
- Focus on "WHAT" (user perspective), not "HOW" (technical details)
- Always read existing files before modifying — never overwrite blindly
- Incremental updates only — never recreate a spec from scratch
- If scope is ambiguous → ask the PO for confirmation
- When in doubt at any step → ask the PO via
AskUserQuestionbefore continuing (never guess intent) - Init mode requires user confirmation of domain list before any file is created (Level 3 gate)
- Init specs are draft scaffolds — real content accumulates through incremental updates after commits
Common Pitfalls
- Over-documenting internals: Specs describe user-visible behavior, not code structure. "The payment module uses Stripe webhooks" is too technical. "Users receive a confirmation email after payment" is correct.
- Stale specs: If a spec exists but is outdated, update it — don't create a new one. One spec per domain, always current.
- Scope creep: Only document what changed in this commit, not the entire domain. The spec grows incrementally over time.
- Missing the audience: Specs are for the PO and future developers to understand WHAT the system does. Architecture docs (see
/doc-generate) cover HOW. - Confusing init with complete documentation: Init generates scaffolding with placeholder text, not authoritative specs. The real content grows via incremental
/spec-updateafter each/commit. Don't treat init output as final.
References
Related Skills
/commit— Invokes this skill at step 6/user-story— Mike Cohn + Gherkin format reused for user stories/doc-generate— Architecture, API, and onboarding documentation (complementary)/review— May flag missing documentation
Inspiration
- claude-code-spec-workflow — spec-driven development workflow
- cc-sdd — Kiro-style spec-driven development
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

