From claude-code-forge
This skill should be used when the user asks to "create CLAUDE.md", "initialize CLAUDE.md", "sync CLAUDE.md with code", "update documentation from codebase", "create .claude/rules/", "manage modular rules", "split large CLAUDE.md", or mentions project documentation setup. Manages complete lifecycle of project instructions including creation, synchronization with code patterns, and modular organization.
npx claudepluginhub oshankhz/cc-swiss-knife --plugin claude-code-forgeThis skill uses the workspace's default tool permissions.
Manages the complete lifecycle of project instructions: creating initial documentation, syncing with codebase patterns, and organizing modular rules.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Manages the complete lifecycle of project instructions: creating initial documentation, syncing with codebase patterns, and organizing modular rules.
Use when:
Provides 4 main operations:
Note: .claude/rules/ only works in project directories, not in global ~/.claude/
Before creating any project-level documentation, ALWAYS read the user's global CLAUDE.md:
# Check if global CLAUDE.md exists
~/.claude/CLAUDE.md
If it exists:
If it doesn't exist:
Use AskUserQuestion tool with THREE questions:
{
"questions": [
{
"question": "What do you need help with?",
"header": "Operation",
"multiSelect": false,
"options": [
{
"label": "Create new CLAUDE.md",
"description": "Start from scratch with opinionated baseline"
},
{
"label": "Sync CLAUDE.md with existing code",
"description": "Analyze codebase to detect patterns and update docs"
},
{
"label": "Split large CLAUDE.md into rules/",
"description": "Break CLAUDE.md (>500 lines) into focused files"
}
]
},
{
"question": "What complexity level?",
"header": "Structure",
"multiSelect": false,
"options": [
{
"label": "Simple (just CLAUDE.md)",
"description": "Single file, good for small/medium projects"
},
{
"label": "Modular (CLAUDE.md + .claude/rules/)",
"description": "Multiple files with path patterns, for large projects"
}
]
},
{
"question": "Should this be shared with your team or kept local?",
"header": "Sharing",
"multiSelect": false,
"options": [
{
"label": "Shared (CLAUDE.md)",
"description": "Committed to git, shared across team and sessions"
},
{
"label": "Local only (CLAUDE.local.md)",
"description": "Git-ignored, personal workspace rules only"
}
]
}
]
}
Route to workflow:
Create opinionated baseline CLAUDE.md for new projects.
Process:
Determine filename (from Step 1 answer):
CLAUDE.mdCLAUDE.local.mdDetect project type
Think through design:
Show preview with:
Generate and write (after confirmation):
If local only (CLAUDE.local.md):
CLAUDE.local.md to .gitignoreInform user with next steps
See references/initialize-workflow.md for complete details
Analyze codebase to extract patterns and update documentation.
Process:
Detect current setup:
Analyze codebase (use Task tool with Explore agent):
Extract patterns:
Think through findings:
Show findings to user:
Ask approach (AskUserQuestion):
Generate updates and write (after confirmation)
Inform user with summary of changes
See references/sync-workflow.md for complete details
Set up modular documentation with focused rule files.
Process:
Detect stack (same as initialize)
Ask which rules to create (AskUserQuestion):
Think through design:
Show preview:
Create files (after confirmation):
Inform user with structure overview
See references/organize-and-split-workflows.md for templates and details
Break CLAUDE.md (>500 lines) into focused modular files.
Process:
Read and analyze CLAUDE.md:
Think through split strategy:
Show split preview:
Execute split (after confirmation):
Inform user with results
See references/organize-and-split-workflows.md for complete details
Quick reference:
| Stack | Recommended Pattern |
|---|---|
| React/Vue SPA | Feature-Sliced Design (FSD) |
| Next.js | FSD or Feature-First |
| Express/Fastify | Feature-First |
| NestJS | Feature-First |
| Django/Flask | MVC |
| Rails | MVC |
| Spring Boot | Package by Feature |
| Go API | Package by Feature |
See references/architecture-patterns.md for complete guide
# Coding standards for TypeScript
---
paths: src/**/*.{ts,tsx}
---
# Testing conventions
---
paths: **/*.{test,spec}.*
---
# API-specific rules
---
paths: src/{api,routes}/**/*
---
Control whether @-mention file picker respects .gitignore:
{
"respectGitignore": true
}
Add to .claude/settings.json (project-specific) or ~/.claude/settings.json (global).
Use when: You want file suggestions to exclude gitignored files
Customize @ file search commands:
{
"fileSuggestion": {
"command": "rg --files",
"timeout": 5000
}
}
Use when:
These settings affect how documentation discovery and file reference tools work.
Complete workflows and detailed guides:
references/initialize-workflow.md - Creating new CLAUDE.md from scratchreferences/sync-workflow.md - Analyzing code and extracting patternsreferences/organize-and-split-workflows.md - Managing .claude/rules/ structurereferences/modular-organization.md - Modular documentation guidereferences/architecture-patterns.md - Complete architecture pattern guideStudy these as templates:
examples/minimal-claude-md.md - Single file example (~200 lines)examples/modular-setup/ - Complete modular structure
Project size?
├─ <10k lines → Single file CLAUDE.md
└─ >10k lines → Modular with .claude/rules/
Different rules for different areas?
├─ Yes → Modular (use path patterns)
└─ No → Single file
Have documentation?
├─ No → Initialize workflow
└─ Yes → Is it outdated?
├─ Yes → Sync workflow
└─ No → Is it >500 lines?
├─ Yes → Split workflow
└─ No → Organize workflow (if want modular)
Type of project?
├─ Frontend SPA (React/Vue)
│ ├─ Large (>50k lines) → FSD
│ └─ Medium → Feature-First
├─ Backend API
│ ├─ Go/Java/C# → Package by Feature
│ ├─ Express/Flask/FastAPI → Feature-First
│ └─ Django/Rails → MVC
└─ Unsure → Ask user preferences
Initialize (Single File):
Initialize (Modular):
Sync:
Organize:
Split:
All outputs: 100% English, no dynamic data, user-confirmed, ready to use