sw:update-instructions
Update Instructions Skill
Smart merge for CLAUDE.md and AGENTS.md instruction files.
What It Does
- Reads existing instruction files (if present)
- Parses SW-managed sections (marked with
<!-- SW:SECTION:X -->) - Preserves user content (anything between or after SW sections)
- Updates SW sections with latest template content
- Writes merged result back to file
When to Use
- After running
specweave refresh-marketplace - After upgrading SpecWeave version (
npm update -g specweave) - When CLAUDE.md or AGENTS.md seem outdated
- To sync instruction files with latest framework features
Usage
/sw:update-instructions
Or via CLI:
npx specweave update-instructions
How Merge Works
Fresh Install (no existing file)
Creates new file with all SW sections + meta header
Legacy File (no SW markers)
Prepends new SW content, preserves original below separator
Marked File (has SW markers)
Updates SW sections in-place, preserves user content between sections
Section Format
Template sections (in .template files):
<!-- SECTION:rules required -->
## Rules
Content here...
<!-- /SECTION -->
Generated sections (in output files):
<!-- SW:META template="claude" version="1.0.0" sections="header,rules,..." -->
<!-- SW:SECTION:header version="1.0.0" -->
Content...
<!-- SW:END:header -->
User Customization
Add custom content between SW sections or after the last section:
<!-- SW:END:docs -->
## My Custom Section
This will be preserved during updates!
Files Affected
CLAUDE.md- Claude Code instruction fileAGENTS.md- Generic AI tool instruction file
Project-Specific Learnings
Before starting work, check for project-specific learnings:
# Check if skill memory exists for this skill
cat .specweave/skill-memories/update-instructions.md 2>/dev/null || echo "No project learnings yet"
Project learnings are automatically captured by the reflection system when corrections or patterns are identified during development. These learnings help you understand project-specific conventions and past decisions.
More from anton-abyzov/specweave
technical-writing
Technical writing expert for API documentation, README files, tutorials, changelog management, and developer documentation. Covers style guides, information architecture, versioning docs, OpenAPI/Swagger, and documentation-as-code. Activates for technical writing, API docs, README, changelog, tutorial writing, documentation, technical communication, style guide, OpenAPI, Swagger, developer docs.
45spec-driven-brainstorming
Spec-driven brainstorming and product discovery expert. Helps teams ideate features, break down epics, conduct story mapping sessions, prioritize using MoSCoW/RICE/Kano, and validate ideas with lean startup methods. Activates for brainstorming, product discovery, story mapping, feature ideation, prioritization, MoSCoW, RICE, Kano model, lean startup, MVP definition, product backlog, feature breakdown.
43kafka-architecture
Apache Kafka architecture expert for cluster design, capacity planning, and high availability. Use when designing Kafka clusters, choosing partition strategies, or sizing brokers for production workloads.
34docusaurus
Docusaurus 3.x documentation framework - MDX authoring, theming, versioning, i18n. Use for documentation sites or spec-weave.com.
29frontend
Expert frontend developer for React, Vue, Angular, and modern JavaScript/TypeScript. Use when creating components, implementing hooks, handling state management, or building responsive web interfaces. Covers React 18+ features, custom hooks, form handling, and accessibility best practices.
29reflect
Self-improving AI memory system that persists learnings across sessions in CLAUDE.md. Use when capturing corrections, remembering user preferences, or extracting patterns from successful implementations. Enables continual learning without starting from zero each conversation.
27