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.
/plugin marketplace add OshanKHZ/oshankhz-claude-code/plugin install oshankhz-claude-code@oshankhz-claude-codeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
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 TWO 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"
}
]
}
]
}
Route to workflow:
Create opinionated baseline CLAUDE.md for new projects.
Process:
Detect project type
Think through design:
Show preview with:
Generate and write (after confirmation):
Inform 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}/**/*
---
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
This 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.