skill-generator
npx skills add https://github.com/zacdcook/skill-generator --skill skill-generator
Agent 安装分布
Skill 文档
Project Context Skill Generator
Purpose
Generate and maintain comprehensive Claude Code skills that preserve project context between chat sessions. This meta-skill teaches Claude HOW to create and maintain other skills.
Goal: Zero context loss. A new session should be able to pick up exactly where the previous one left off.
When to Use This Skill
Explicit Triggers (user requests)
- “create a skill for this project”
- “update the skill” / “update the project skill”
- “save this context”
- “remember this for next session”
- “generate a skill file”
Proactive Triggers (Claude offers automatically)
Offer to create/update a project skill when:
- Session exceeds ~30 minutes of project-specific work
- Significant decisions were made (architecture, tech choices, patterns)
- Complex problems were solved (with solutions worth preserving)
- Technical patterns or gotchas were discovered
- Multi-step implementations were completed
- User asks “what did we do today” or similar wrap-up questions
Proactive prompt: “This session established significant context. Would you like me to create/update the project skill to preserve it?”
Workflow
For the detailed 6-phase generation workflow, refer to Reference/phase-procedures.md.
Quick summary:
- Analyze â Identify domain and complexity
- Plan â Determine structure (get user confirmation)
- Extract â Gather content using zero-context-loss test
- Build â Create files
- Verify â Run 25-point checklist
- Confirm â Present summary to user
Core Principles
1. Single Skill Architecture
- ONE skill per project/domain, not fragments
- All related information stays together
- Progressive disclosure: SKILL.md lean, details in Reference/
- Prevents sync issues between separate skills
2. Snippetizable Content
Every file must be structured so Claude can extract specific answers without loading the entire file:
- Clear headers (H2 major, H3 sub, H4 detail)
- Tables over prose
- Bullet points over paragraphs
- Self-contained sections
3. Zero Context Loss Standard
For each piece of information, ask:
“If a new session started without this, would I lose important context, have to re-explain something, risk re-discovering something the hard way, or make inconsistent decisions?”
If YES to any â Extract it.
4. White-Paper Ready
Technical specifications must be written at handoff quality:
- Include “what it does” + “how it works”
- Use ASCII diagrams for architecture
- Enough detail that someone unfamiliar could maintain it
5. Never Delete, Only Supersede
- Mark old info with
[SUPERSEDED: YYYY-MM-DD], don’t delete - Required sections are required â use “None yet” for empty
- Preserve history for context
Required Skill Structure
Every generated skill MUST have:
.claude/skills/[skill-name]/
âââ SKILL.md # Entry point (~400 lines max)
âââ Reference/
â âââ skill-maintenance.md # Update governance (REQUIRED)
â âââ [topic-files].md # Domain-specific reference files
âââ Templates/ # Optional, if skill tracks entities
âââ [entity]-template.md
SKILL.md Required Sections
Generated SKILL.md files MUST contain these sections in order:
1. YAML Frontmatter
---
name: skill-name-lowercase-hyphens
description: Detailed paragraph describing what the skill covers, when Claude should use it, and specific trigger contexts.
---
2. Mandatory Update Gate
# Mandatory: Read Before ANY Updates
**If you are about to modify ANY file in this skill:**
1. **STOP** â Read `Reference/skill-maintenance.md` in full first
2. **COMPLETE** the Pre-Update Checklist
3. **FOLLOW** the procedure for your update type
4. **COMPLETE** Post-Update Verification
5. **ADD** changelog entry to affected file(s)
**Do not proceed with updates until steps 1-5 are understood.**
3. Quick Reference
At-a-glance summaries using tables and lists:
- Project/domain identity
- Key metrics or status
- Primary entities list
- Capabilities overview
4. Reference File Index
| File | Contents | When to Use |
|---|---|---|
path/file.md |
What it contains | When to read it |
5. Critical Rules
Non-negotiable principles for this domain (numbered, specific, actionable)
6. Changelog
| Date | Change | Source |
|---|---|---|
| YYYY-MM-DD | Description | Conversation/trigger |
skill-maintenance.md Required Sections
Every generated skill-maintenance.md MUST contain these 11 sections:
- Update Trigger Protocol â 6-step process before modifications
- Pre-Update Checklist â 4-step table (identify, search, classify, proceed)
- Update Classifications â NEW, UPDATE, DUPLICATE, CORRECTION
- Update Categories & Procedures â 5-10 domain-specific procedures
- Template Usage â How to use templates for new entities
- Post-Update Verification â Confirmation format with specific quotes
- Formatting Standards (Rigid) â Date formats, headers, status flags
- Content Standards (Flexible) â Writing style, good vs bad examples
- Cross-File Synchronization â 5-8 sync rules
- Emergency Procedures â Corruption recovery, conflict resolution
- Version History â Changelog table
Templates:
Templates/maintenance-template.md
Update Classifications
Use these for ALL skill updates:
| Classification | Condition | Action |
|---|---|---|
| NEW | Topic doesn’t exist in target file | Append to correct section |
| UPDATE | Topic exists but info changed | Mark old [SUPERSEDED: YYYY-MM-DD], add new |
| DUPLICATE | Same info already present | Skip, no update needed |
| CORRECTION | Info was wrong | Mark old [CORRECTED: YYYY-MM-DD], add fixed |
Standard Marker Flags
Use consistently across all generated skills:
[ACTIVE] - Currently in use/progress
[COMPLETED] - Finished
[CLOSED] - Fully concluded
[PROSPECT] - In discussions, not confirmed
[PAUSED] - On hold
[CANCELLED] - Planned but no longer happening
[BUILT] - Implemented and deployed
[PENDING] - Scoped but not built
[PLANNED] - Discussed but not scoped
[SUPERSEDED: YYYY-MM-DD] - Replaced by newer info below
[CORRECTED: YYYY-MM-DD] - Was incorrect, now fixed
[UNCONFIRMED] - Not yet verified
[ASSUMPTION] - Based on inference
[RECONSTRUCTED: YYYY-MM-DD] - Rebuilt from history
[NEEDS CLARIFICATION] - Identified gap requiring input
Verification Checklist Summary
Before delivering any generated skill, verify:
Structure:
- Single skill architecture (not fragmented)
- SKILL.md exists with mandatory update gate
- SKILL.md under 400 lines
- Reference/skill-maintenance.md exists
- skill-maintenance.md has all 11 required sections
Content:
- 5-10 domain-specific update procedures
- 5-8 cross-file sync rules
- All files have changelog at bottom
- No duplicate content across files
- Uncertain info marked with appropriate flags
- Technical specs are white-paper ready
Principles:
- Progressive disclosure (SKILL.md lean, details in Reference/)
- Snippetizable (headers, tables, bullets)
- Zero context loss (all valuable info captured)
Full 25-point checklist:
Reference/phase-procedures.md§ Verification
Reference File Index
| File | Contents | When to Use |
|---|---|---|
Reference/phase-procedures.md |
Detailed 6-phase workflow, update procedures, full verification checklist | During skill creation or update |
Reference/formatting-standards.md |
All formatting rules, flag definitions, required sections | When writing skill content |
Reference/skill-maintenance.md |
Self-governance for THIS meta-skill | Before modifying skill-generator |
Templates/project-skill-template.md |
Complete SKILL.md starting template | Creating new project skill |
Templates/maintenance-template.md |
Complete skill-maintenance.md template | Creating new project skill |
Templates/entity-template.md |
Template for entity files (9 sections) | When skill tracks entities |
Critical Rules
- Read before write â Always read existing skill files before modifying
- One skill per project â Never fragment into multiple skills
- Required sections are required â Use “None yet”, never delete
- Verify before delivering â Run checklist, fix all failures first
- Lead with facts â No narrative, no filler phrases
- Cross-reference everything â Entity files â technical specs
- Dates in YYYY-MM-DD â Never MM/DD/YYYY in skill files
- Mark uncertainty â Use [UNCONFIRMED], [ASSUMPTION] flags
Changelog
| Date | Change | Source |
|---|---|---|
| 2025-12-28 | Initial creation | Adapted from ChatGPT skill generation prompt for Claude Code |
| 2025-12-29 | Skill Generator 2.0 Upgrade: (1) Replaced Quick Start table with pointer to phase-procedures.md (DRY fix); (2) Updated project-skill-template.md with badge dashboard pattern; (3) Added Session Handoff Protocol to maintenance-template.md; (4) Added implementation-status.md as required file; (5) Added schema-summary.md + validation-rules.md for DB projects; (6) Added Golden Scenarios requirement for calculations | Gemini/Claude collaborative session |