borghei/claude-code-mastery
npx skills add https://github.com/borghei/Claude-Skills --skill claude-code-mastery
Expert skill for Claude Code CLI -- CLAUDE.md optimization, skill authoring, subagent creation, hooks automation, and context engineering.
Keywords: claude-code, claude-cli, CLAUDE.md, skill-authoring, subagents, hooks, context-window, token-budget, MCP-servers, worktrees, permission-modes, prompt-engineering, context-engineering, slash-commands
allowed-tools and structured custom instructions.PreToolUse/PostToolUse/Stop lifecycle scripts via .claude/settings.json.Before scaffolding or optimizing, confirm these inputs. If any is unknown or vague, ASK — do not assume:
skill_scaffolder.py vs claudemd_optimizer.py vs context_analyzer.py)--token-limit and what counts as over-budget)Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
# Scaffold a new skill package
python scripts/skill_scaffolder.py my-new-skill --domain engineering --description "Brief description"
# Analyze and optimize an existing CLAUDE.md
python scripts/claudemd_optimizer.py path/to/CLAUDE.md
# Estimate context window usage across a project
python scripts/context_analyzer.py /path/to/project
# All tools support JSON output
python scripts/claudemd_optimizer.py CLAUDE.md --json
| Tool | Purpose | Command |
|------|---------|---------|
| skill_scaffolder.py | Scaffold a new skill package with correct structure + frontmatter | python scripts/skill_scaffolder.py my-skill -d engineering --description "Does X" |
| claudemd_optimizer.py | Score a CLAUDE.md for structure, tokens, and redundancy with recommendations | python scripts/claudemd_optimizer.py CLAUDE.md --token-limit 4000 |
| context_analyzer.py | Estimate context-window consumption by file category with a budget breakdown | python scripts/context_analyzer.py /path/to/project --max-depth 4 |
All tools support --json. See references/tool-reference.md for full parameter tables and output formats.
Load the reference that matches the task — keep this file lean and pull detail on demand:
Templates: assets/skill-template.md, assets/agent-template.md
This skill covers:
This skill does NOT cover:
| Skill | Integration | Data Flow |
|-------|-------------|-----------|
| senior-architect | Architecture decisions inform CLAUDE.md structure sections | Architecture diagrams and patterns feed into the Architecture Overview section of CLAUDE.md |
| code-reviewer | Subagent creation for automated code review | Claude Code Mastery creates the agent YAML; Code Reviewer provides the review logic |
| senior-prompt-engineer | Prompt optimization for skill descriptions and agent instructions | Prompt engineering techniques improve YAML frontmatter trigger phrases and agent custom-instructions |
| doc-drift-detector | Detects when CLAUDE.md drifts out of sync with the codebase | Context Analyzer output feeds drift detection; drift findings trigger CLAUDE.md optimization |
| context-engine | Advanced context management strategies | Context Analyzer provides token budgets; Context Engine applies compression and prioritization |
| senior-secops | Security hooks and permission mode configuration | SecOps policies define which tools to deny; Claude Code Mastery configures the permission allowlists |
Take borghei/claude-code-mastery from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.