format-cc
Formats Claude Code files with markdownlint, prettier, and shellcheck. Use when user asks to "format my files", "fix markdown…
Interactively helps users optimize their CLAUDE.md files. Use when user asks to "optimize my CLAUDE.md", "my CLAUDE.md is too long", "improve organization", or "split my CLAUDE.md". Runs validation, explains issues conversationally, and helps create @import files to reduce size
Claude Code
$ npx -y skills add pdugan20/claudelint --skill optimize-cc-md --agent claude-code
Codex
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a codex -y
Cursor
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a cursor -y
Gemini CLI
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a gemini-cli -y
GitHub Copilot
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a github-copilot -y
OpenCode
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a opencode -y
Windsurf
$ npx skills add pdugan20/claudelint --skill optimize-cc-md -a windsurf -y
name: optimize-cc-md description: Interactively helps users optimize their CLAUDE.md files. Use when user asks to "optimize my CLAUDE.md", "my CLAUDE.md is too long", "improve organization", or "split my CLAUDE.md". Runs validation, explains issues conversationally, and helps create @import files to reduce size and improve structure. version: 1.0.0 argument-hint: "[path]" allowed-tools: - Bash(claudelint:*) - Read - Edit - Write - Grep
An interactive skill that helps you optimize your CLAUDE.md file through a 3-phase workflow: validate, assess quality, then make guided improvements. Each phase builds on the previous one so the user understands what's wrong, why it matters, and what to do about it.
Invoke with `/optimize-cc-md` or say "optimize my CLAUDE.md". Optionally pass a path: `/optimize-cc-md CLAUDE.md`. The skill guides you through three phases: validation, quality assessment, and guided improvement.
If a specific path is provided, optimize that file: $ARGUMENTS
Phase A: Validate Phase B: Assess Quality Phase C: Guided Improvement
───────────────── ─────────────────────── ───────────────────────────
Run claudelint → Explain issues plainly → Ask user what to fix
Read CLAUDE.md → Check quality criteria → Make surgical changes
Collect violations → Identify opportunities → Create @import files
→ Verify resultsRun automated validation and read the file to understand its current state.
Use the Bash tool to run claudelint validation with verbose output:
npx claude-code-lint validate-claude-md --verbose
This identifies all CLAUDE.md issues including:
Use the Read tool to examine the user's CLAUDE.md:
Read(file_path: "CLAUDE.md")
Understand the current structure, content, and patterns. Note:
Go beyond automated checks. Explain issues conversationally and evaluate quality using criteria that linting can't catch.
Translate validation errors into plain language:
Focus on the "why" not just the "what". Help users understand the impact.
Walk through the key quality dimensions from [quality criteria](./references/quality-criteria.md):
Present a brief assessment to the user:
"Your CLAUDE.md has 3 validation errors and some quality gaps: - 45KB (over 30KB threshold) - needs splitting - 12 generic statements that should be removed - Testing section is thorough but git workflow is missing - Good: all commands are current and paths are valid"
For each issue, determine the root cause and link to reference files:
Let the user choose what to fix, then make the changes and verify results.
Use the AskUserQuestion tool to present prioritized options:
What would you like me to fix first? 1. Reduce file size (45KB → under 30KB) 2. Fix circular import in git-workflow.md 3. Split content into organized @imports 4. Remove generic/obvious content
Let the user prioritize. Don't assume.
Use the Edit tool for surgical changes to CLAUDE.md:
Edit( file_path: "CLAUDE.md", old_string: "existing content to replace", new_string: "new content" )
For removing content:
Use the Write tool to create new files in .claude/rules/:
Write(
file_path: ".claude/rules/git-workflow.md",
content: "---\nglob: \"**/*.{ts,js}\"\n---\n\n# Git Workflow\n\n..."
)Then update CLAUDE.md to import the file:
Edit( file_path: "CLAUDE.md", old_string: "# Git Workflow\n\nLong content here...", new_string: "@import .claude/rules/git-workflow.md" )
**Best practices for @imports:**
Run validation again to confirm fixes:
npx claude-code-lint validate-claude-md --verbose
Show before/after comparison:
A linter for Claude Code projects. Validates CLAUDE.md files, skills, settings, hooks, MCP servers, plugins, and more.
Formats Claude Code files with markdownlint, prettier, and shellcheck. Use when user asks to "format my files", "fix markdown…
Runs comprehensive claudelint validation on all Claude Code project files. Use when user asks to "check everything", "run all…
Validates CLAUDE.md files for size, imports, and structure. Use when user asks to "check my CLAUDE.md", "why is my CLAUDE.md too…
Validates Claude Code hooks.json files for schema, events, and commands. Use when user asks to "check my hooks", "validate…
Validates MCP server configuration files (.mcp.json). Use when user asks to "check my .mcp.json", "why isn't my MCP working",…
Validates Claude Code plugin manifest files (plugin.json). Use when user asks to "check my plugin.json", "validate plugin.json",…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.