Generates Claude Code skills from cached documentation with intelligent templates and auto-activation rules
Generates Claude Code skills from your cached documentation using intelligent templates. It automatically creates expert skills when you have docs cached for a library, setting up auto-activation rules based on your project's dependencies and file structure.
/plugin marketplace add squirrelsoft-dev/doc-fetcher/plugin install doc-fetcher@squirrelsoft-dev-toolsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
I generate Claude Code skills from cached documentation, creating version-specific expert skills that reference your locally cached docs.
I transform cached documentation into functional Claude Code skills:
I support multiple templates for different use cases:
Best for: Comprehensive library coverage
Features:
- Complete topic coverage
- All API references included
- Code examples from docs
- Auto-activation rules
- Version-specific guidance
- Migration notes (if available)
Use case:
"I want Claude to be an expert in Next.js 15"
Best for: Fast lookups and common patterns
Features:
- Condensed documentation
- Top 20% most-used features
- Cheat-sheet style
- Minimal context overhead
- Fast activation
Use case:
"I just need quick API references"
Best for: Version upgrades
Features:
- What's new comparison
- Breaking changes highlighted
- Before/after examples
- Deprecation warnings
- Upgrade checklist
Use case:
"I'm upgrading from Next.js 14 to 15"
Requirements:
- Multiple versions cached
Best for: Debugging and problem-solving
Features:
- Common errors catalog
- Debug strategies
- Performance issues
- Configuration problems
- Stack trace interpretation
Use case:
"Help me debug issues faster"
Best for: Code quality and optimization
Features:
- Recommended patterns
- Anti-patterns to avoid
- Performance optimization
- Security considerations
- Accessibility tips
Use case:
"Ensure I'm using the library correctly"
Reading cached documentation...
Path: .claude/docs/nextjs/15.0.3/
Files: 234 markdown files
Size: 5.2 MB
Index: index.json loaded
Sitemap: sitemap.json loaded
// Conceptual analysis
const analysis = {
topics: extractTopics(pages), // ["Routing", "Data Fetching", ...]
apiMethods: extractAPIMethods(pages), // ["fetch", "cookies", "headers", ...]
codeExamples: extractCodeBlocks(pages), // 156 code examples
sections: buildHierarchy(sitemap), // Nested structure
keywords: generateKeywords(content), // ["server actions", "app router", ...]
version: extractVersion(metadata) // "15.0.3"
};
Based on the selected template, I create the skill file:
Example: Expert Template
---
name: nextjs-15-expert
description: Expert knowledge of Next.js 15.0.3 based on official documentation
version: 15.0.3
library: nextjs
docs_path: .claude/docs/nextjs/15.0.3
auto_activate: true
activation_patterns:
- "package.json contains next@15"
- "directory contains app/ or pages/"
- "imports from 'next'"
---
# Next.js 15 Expert
I have comprehensive, version-specific knowledge of Next.js 15.0.3 based on the complete official documentation.
## Topics I Cover
{/* Auto-generated from documentation structure */}
- **Routing** (App Router & Pages Router)
- **Data Fetching** (Server Components, fetch API, caching)
- **Rendering** (SSG, SSR, CSR, Streaming)
- **Server Actions** (Mutations, form handling)
- **API Routes** (Route handlers, middleware)
- **Optimization** (Images, fonts, scripts)
- **Metadata** (SEO, Open Graph)
- **Configuration** (next.config.js options)
## What I Know
{/* Auto-generated capability list */}
I can help you with:
- Setting up new Next.js 15 projects
- Implementing App Router patterns
- Creating Server Actions for mutations
- Optimizing performance and bundle size
- Configuring metadata for SEO
- Deploying to Vercel or self-hosting
- Migrating from Pages Router to App Router
- Troubleshooting common issues
## Code Examples
{/* Reference to extracted code examples */}
I have access to 156 code examples covering:
- TypeScript and JavaScript
- Server Components
- Client Components
- Server Actions
- Route Handlers
- Middleware
- Configuration
## Version Notes
This skill is specifically for Next.js **15.0.3**.
Key features in this version:
- Partial Prerendering (PPR)
- Enhanced Server Actions
- Improved fetch caching
- Better error handling
I will NOT suggest deprecated patterns from earlier versions.
---
*Generated by doc-fetcher plugin*
*Source: https://nextjs.org/docs*
*Cached: 2025-01-17*
I create a .doc-reference.json file to link the skill to cached docs:
{
"library": "nextjs",
"version": "15.0.3",
"docs_path": ".claude/docs/nextjs/15.0.3",
"generated_at": "2025-01-17T15:30:00Z",
"template_used": "expert",
"source_url": "https://nextjs.org/docs",
"page_count": 234,
"code_examples": 156,
"auto_generated": true,
"last_regenerated": "2025-01-17T15:30:00Z"
}
I set up intelligent activation rules:
# When to auto-activate this skill
activation_patterns:
# package.json dependency
- "package.json contains next@15"
- "package.json contains next@^15"
# Directory structure
- "directory contains app/"
- "directory contains pages/"
# File imports
- "imports from 'next'"
- "imports from 'next/server'"
- "imports from 'next/navigation'"
# File names
- "file named next.config.js"
- "file named middleware.ts"
- "file matches app/**/*.tsx"
# User intent
- "user asks about Next.js 15"
- "user mentions App Router"
- "user mentions Server Actions"
activation_priority: high # high, medium, low
activation_confidence: 0.9 # 0.0 - 1.0
Includes:
- All topics from documentation
- Complete API reference
- All code examples
- Migration notes
- Best practices sections
Content structure:
1. Overview
2. Topics covered (exhaustive)
3. What I know (capabilities)
4. Code examples catalog
5. Version-specific notes
6. Usage examples
Activation:
- Aggressive auto-activation
- High confidence threshold
Includes:
- Top 20% most-used features only
- Essential APIs
- Common code patterns
- Quick tips
Content structure:
1. Brief overview
2. Core features (condensed)
3. Common patterns
4. Quick reference tables
Activation:
- Manual activation preferred
- Low overhead
Includes:
- Version comparison (e.g., 14 → 15)
- Breaking changes
- New features
- Deprecated features
- Code migration examples
Content structure:
1. What's new
2. Breaking changes
3. Deprecated APIs
4. Migration checklist
5. Before/after examples
Activation:
- On version mismatch detection
- Manual for upgrade planning
Requirements:
- Requires multiple versions cached
- Compares v14 vs v15 docs
Includes:
- Common errors from docs
- Debug strategies
- Performance issues
- Configuration gotchas
Content structure:
1. Error catalog
2. Debugging tips
3. Performance checklist
4. Configuration guide
5. FAQ
Activation:
- On error keywords
- Manual for debugging sessions
Includes:
- Recommended patterns from docs
- Anti-patterns
- Performance tips
- Security guidelines
Content structure:
1. Do's and Don'ts
2. Performance optimization
3. Security best practices
4. Accessibility considerations
5. Production checklist
Activation:
- Manual for code review
- On "best practice" queries
I intelligently extract different content types:
// Detected from documentation
const apiMethods = [
{
name: "cookies()",
signature: "cookies(): RequestCookies",
description: "Read incoming request cookies",
availability: "Server Components, Route Handlers",
example: "const cookieStore = cookies(); const theme = cookieStore.get('theme')"
},
// ... more methods
];
// Extracted and categorized
const codeExamples = [
{
language: "tsx",
category: "Server Actions",
title: "Creating a Server Action",
code: "export async function createUser(formData: FormData) { ... }",
sourceUrl: "https://nextjs.org/docs/app/building-your-application/data-fetching/server-actions"
},
// ... 155 more examples
];
// Built from sitemap hierarchy
const topics = [
{
title: "Routing",
pages: 24,
subtopics: [
"Defining Routes",
"Pages and Layouts",
"Dynamic Routes",
"Route Groups",
"Parallel Routes"
]
},
// ... more topics
];
I generate meaningful skill names:
// Naming patterns
const patterns = {
expert: "{library}-{major-version}-expert",
quickRef: "{library}-quick-ref",
migration: "{library}-{old-version}-to-{new-version}",
troubleshoot: "{library}-troubleshooter",
bestPractices: "{library}-best-practices"
};
// Examples:
// "nextjs-15-expert"
// "supabase-quick-ref"
// "react-17-to-18"
// "nextjs-troubleshooter"
// "nextjs-best-practices"
When documentation is updated, I intelligently regenerate:
Detected documentation update for Next.js
Old: 15.0.0
New: 15.0.3
Regenerating skill: nextjs-15-expert
Changes detected:
- 12 new pages added
- 3 pages modified
- 1 page removed
- 8 new code examples
Skill updated:
✓ New features added to topics
✓ Code examples refreshed
✓ Version metadata updated
✓ Activation rules preserved
Skill ready: nextjs-15-expert
Generating skill for Next.js 15.0.3...
[1/5] Loading documentation
✓ Read 234 markdown files
✓ Loaded metadata and sitemap
✓ Parsed code examples
[2/5] Analyzing content
✓ Identified 12 major topics
✓ Extracted 156 code examples
✓ Found 89 API methods
✓ Generated 247 keywords
[3/5] Generating skill (expert template)
✓ Created skill description
✓ Listed all topics and capabilities
✓ Included code example references
✓ Added version-specific notes
[4/5] Configuring auto-activation
✓ Set activation patterns
✓ Priority: high
✓ Confidence: 0.9
[5/5] Saving skill
✓ Written to: skills/nextjs-15-expert/SKILL.md
✓ Created metadata: .doc-reference.json
✓ Registered with Claude Code
✓ Skill generated successfully!
Skill name: nextjs-15-expert
Location: skills/nextjs-15-expert/
Template: expert
Auto-activation: enabled
The skill is now active. Ask me anything about Next.js 15!
Configure my behavior in doc-fetcher-config.json:
{
"skill_generation": {
"auto_generate": true,
"default_template": "expert",
"auto_activate": true,
"naming_pattern": "{library}-{major-version}-expert",
"output_directory": "skills",
"include_code_examples": true,
"max_examples_per_topic": 5,
"generate_metadata": true
}
}
Generate and maintain skills for multiple versions:
/generate-doc-skill nextjs 14.2.0 --output skills/nextjs-14-expert
/generate-doc-skill nextjs 15.0.3 --output skills/nextjs-15-expert
Both skills coexist. Activation rules ensure the correct version is used.
Combine multiple libraries into one skill:
/generate-doc-skill nextjs,react,typescript --template full-stack
Creates a unified skill with knowledge of all three libraries.
Create your own templates:
# templates/my-custom-template.yml
name: "{library}-custom"
description: "Custom skill for {library}"
sections:
- overview
- quick_start
- api_reference
activation: manual
Use:
/generate-doc-skill nextjs --template ./templates/my-custom-template.yml
"Skill generation failed"
"Skill too large"
quick-reference template instead"Skill not auto-activating"
"Outdated skill content"
/update-docs <library>/generate-doc-skill <library>/generate-doc-skill command - Main entry pointdoc-indexer skill - Creates the cached docs I use/fetch-docs command - Auto-generates skills after fetchingThis skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.