Claude Ecosystem
Comprehensive guide for Claude Code CLI tool, extensibility (agents/skills/output styles), and CLAUDE.md architecture.
Module Selection
| Need |
Module |
Reference |
| Setup/Configuration |
CLI |
references/getting-started.md, references/configuration.md |
| Slash Commands |
CLI |
references/slash-commands.md |
| MCP Servers |
CLI |
references/mcp-integration.md |
| Hooks & Plugins |
CLI |
references/hooks-and-plugins.md |
| Create Agents |
Extensibility |
references/agent-development.md |
| Create/Refine Skills |
Extensibility |
references/skill-creation-workflow.md, references/skill-writing-guide.md, references/skill-description-guide.md |
| Output Styles |
Extensibility |
references/skill-development.md |
| Init CLAUDE.md |
Architecture |
references/initialization-workflow.md |
| Optimize CLAUDE.md |
Architecture |
references/optimization-patterns.md |
| Enterprise/CI-CD |
CLI |
references/enterprise-features.md, references/cicd-integration.md |
| Troubleshooting |
CLI |
references/troubleshooting.md |
Quick Reference
Extension Types
| Type |
Invocation |
Purpose |
Location |
| Agents |
Task tool |
Specialized sub-processes |
.claude/agents/ |
| Skills |
Model-invoked |
Domain knowledge |
.claude/skills/{name}/ |
| Output Styles |
/output-style |
Modify main agent |
.claude/output-styles/ |
Model Selection (Agents)
| Model |
Use When |
Target Time |
haiku |
Fast tasks, exploration |
< 3s |
sonnet |
Balanced, most use cases |
< 10s |
opus |
Complex reasoning |
< 30s |
CLAUDE.md Token Budget
| Complexity |
Target Tokens |
| Simple |
100-200 |
| Medium |
200-400 |
| Complex |
400-800 |
| Maximum |
1000 |
Extensibility Principles
Core Truths
| Truth |
Meaning |
| Expertise Transfer |
Make Claude think like expert, not follow steps |
| Flow, Not Friction |
Produce output, not intermediate work |
| Voice Matches Domain |
Sound like practitioner, not documentation |
| Focused Beats Comprehensive |
Constrain ruthlessly |
Decision Heuristics
| Rule |
Guidance |
| 3-File Rule |
3+ files → agent. Enhances YOUR work → skill. |
| Delegation Test |
Runs independently? Agent. Guides you? Skill. |
| Activation Breadth |
Trigger on 80% of relevant requests |
| Tool Constraint |
Start with 2-3 essential tools |
Activation Keywords
The description field is your activation gate. Include:
- Task verbs: create, build, debug, fix, deploy
- Problem descriptions: slow, broken, failing
- Artifact types: component, API, database
- Casual synonyms: "make it faster" → optimize
Common Workflows
Create Agent
For the agent's prompt content (soul, tensions, mental models, thinking approaches), invoke Skill("prompt-architect") — it handles expertise transfer and dialectic design. This skill handles structure and frontmatter.
---
name: agent-name
description: "Use when [use case]. PROACTIVELY for [triggers].\n\nExamples:\n<example>\nContext: [situation]\nuser: [request]\nassistant: [response]\n</example>"
tools: Grep, Glob, Read, Bash
model: haiku
---
# Agent Name
Mission statement.
## Strategy
[Approach]
## Does NOT Do
- [boundary] (use X instead)
Create Skill
Each skill is a context engineering problem: what information does Claude need, when should it load, and how much freedom should the instructions leave?
For body content (soul, tensions, mental models, anti-patterns), invoke Skill("prompt-architect") — it handles expertise transfer and dialectic design.
Key Principles
- Claude is smart — only add what Claude doesn't already know
- Explain WHY — reasoning beats commands; reframe ALWAYS/NEVER as consequences
- Be pushy in descriptions — Claude undertriggers by default; use directive language ("ALWAYS invoke")
- Match freedom to fragility — exact scripts for dangerous ops, principles for judgment tasks
- Generalize from examples — skills run millions of times; don't overfit
Architecture
skill-name/
├── SKILL.md # Required: YAML frontmatter + instructions (<500 lines)
├── scripts/ # Optional: deterministic operations (execute without loading)
├── references/ # Optional: domain docs loaded as needed
└── assets/ # Optional: templates, fonts, icons for output
Creation Workflow
- Capture Intent — mine conversation for workflow, tools, corrections before asking questions
- Research Domain — best practices, failure modes, decision heuristics, similar skills
- Draft SKILL.md — quick orientation → core workflow → patterns → edge cases → reference routing → frontmatter (LAST)
- Review — token audit, freedom calibration, generalization, trigger check, "Rationalizations to Reject", "When NOT to Use"
- Test Cases — 2-3 realistic messy prompts as users actually type
- Iterate — generalize from feedback, keep lean, reframe don't restrict
Detailed workflow: references/skill-creation-workflow.md
Writing principles: references/skill-writing-guide.md
Description optimization: references/skill-description-guide.md
Deliverables
- Complete SKILL.md with frontmatter and body
- Directory structure with any bundled scripts/references/assets
- 2-3 test prompts — realistic, messy, user-style
- Description rationale — brief triggering strategy explanation
Initialize CLAUDE.md
- Analyze codebase (language, framework, structure)
- Extract code style, commands, patterns
- Generate with template, customize
- Validate commands, check token count
- Target <400 lines, prefer <250
Detailed: references/initialization-workflow.md
Optimize CLAUDE.md
- Evaluate token efficiency
- Find redundancy, outdated info
- Apply token reduction techniques
- Target 40%+ reduction
- Verify critical info retained
Detailed: references/optimization-patterns.md
Anti-Patterns
| Pattern |
Problem |
Fix |
| Kitchen Sink Agent |
10+ tools, handles "everything" |
Constrain to 3-5 tools |
| Echo Skill |
Restates docs without insight |
Add expert layer |
| Invisible Trigger |
Description uses only formal terms |
Include user language |
| Procedure Manual |
Step 1, 2, 3... |
Teach patterns, not steps |
| Over-Documentation |
CLAUDE.md > 400 lines |
Document project-specific only |
Quality Signals
Good Signs
- Frontmatter reads like "when to use" guide
- First 10 lines provide actionable guidance
- Expert would nod "yes, that's how I think"
- Explicit constraints on what it does NOT handle
Warning Signs
50% reference tables or field definitions
- No mention of "when NOT to use"
- Generic language for any domain
- Body exceeds 600 lines
References
CLI Tool
references/getting-started.md - Installation, setup, auth
references/slash-commands.md - Complete command catalog
references/mcp-integration.md - MCP server configuration
references/hooks-and-plugins.md - Hook types, plugin structure
references/configuration.md - Settings hierarchy
references/enterprise-features.md - IAM, SSO, sandboxing
references/cicd-integration.md - GitHub Actions, GitLab CI
references/ide-integration.md - VS Code, JetBrains
references/advanced-features.md - Extended thinking, caching
references/troubleshooting.md - Common issues
references/api-reference.md - Admin, Messages, Skills APIs
references/best-practices.md - Project organization, security
references/agent-skills.md - Creating skills via CLI
Extensibility
references/agent-development.md - Full YAML structure, system prompts
references/skill-development.md - Structure, triggers, hooks
references/skill-creation-workflow.md - End-to-end skill creation process
references/skill-writing-guide.md - Writing principles and mental models
references/skill-description-guide.md - Description optimization and triggers
CLAUDE.md
references/initialization-workflow.md - Creating new CLAUDE.md
references/optimization-patterns.md - Token reduction techniques
references/integration-strategies.md - Global config, MCP tools
references/output-templates.md - Standard output formats
Skill Routing
| Task |
Where |
What it handles |
| Skill/agent prompt content (soul, tensions, mental models, anti-patterns) |
Skill("prompt-architect") |
Content quality, dialectic design, freedom calibration |
| Skill structure (frontmatter, directory, progressive disclosure, description) |
This skill |
Architecture, triggering strategy, token budgeting |
| CLAUDE.md creation/optimization |
This skill |
Initialization workflow, token reduction |
When creating or editing skills/agents: this skill for structure → prompt-architect for body content.
Documentation:
1---2name: claude-ecosystem3description: ALWAYS invoke this skill when the user asks about Claude Code features, configuration, extensibility, or project setup. ALWAYS invoke when the user wants to create, improve, or refine a Claude Agent Skill — including 'make this a skill', 'turn this into a skill', 'create a skill for X', or asks about SKILL.md authoring, frontmatter, description optimization, progressive disclosure, or triggering strategy. Modules: CLI tool (setup, slash commands, MCP servers, hooks, plugins, CI/CD), extensibility (agents, skills, output styles), CLAUDE.md (project instructions, optimization). Keywords: Claude Code, skill, SKILL.md, agent, hook, plugin, MCP, CLAUDE.md, skill architecture, description optimization, progressive disclosure. For skill body content quality (soul, tensions, mental models), also invoke prompt-architect. Do NOT use for general prompt engineering without a Claude Code context.4---56# Claude Ecosystem78Comprehensive guide for Claude Code CLI tool, extensibility (agents/skills/output styles), and CLAUDE.md architecture.910## Module Selection1112| Need | Module | Reference |13|------|--------|-----------|14| **Setup/Configuration** | CLI | `references/getting-started.md`, `references/configuration.md` |15| **Slash Commands** | CLI | `references/slash-commands.md` |16| **MCP Servers** | CLI | `references/mcp-integration.md` |17| **Hooks & Plugins** | CLI | `references/hooks-and-plugins.md` |18| **Create Agents** | Extensibility | `references/agent-development.md` |19| **Create/Refine Skills** | Extensibility | `references/skill-creation-workflow.md`, `references/skill-writing-guide.md`, `references/skill-description-guide.md` |20| **Output Styles** | Extensibility | `references/skill-development.md` |21| **Init CLAUDE.md** | Architecture | `references/initialization-workflow.md` |22| **Optimize CLAUDE.md** | Architecture | `references/optimization-patterns.md` |23| **Enterprise/CI-CD** | CLI | `references/enterprise-features.md`, `references/cicd-integration.md` |24| **Troubleshooting** | CLI | `references/troubleshooting.md` |2526---2728## Quick Reference2930### Extension Types3132| Type | Invocation | Purpose | Location |33|------|------------|---------|----------|34| **Agents** | Task tool | Specialized sub-processes | `.claude/agents/` |35| **Skills** | Model-invoked | Domain knowledge | `.claude/skills/{name}/` |36| **Output Styles** | `/output-style` | Modify main agent | `.claude/output-styles/` |3738### Model Selection (Agents)3940| Model | Use When | Target Time |41|-------|----------|-------------|42| `haiku` | Fast tasks, exploration | < 3s |43| `sonnet` | Balanced, most use cases | < 10s |44| `opus` | Complex reasoning | < 30s |4546### CLAUDE.md Token Budget4748| Complexity | Target Tokens |49|-----------|---------------|50| Simple | 100-200 |51| Medium | 200-400 |52| Complex | 400-800 |53| Maximum | 1000 |5455---5657## Extensibility Principles5859### Core Truths6061| Truth | Meaning |62|-------|---------|63| **Expertise Transfer** | Make Claude *think* like expert, not follow steps |64| **Flow, Not Friction** | Produce output, not intermediate work |65| **Voice Matches Domain** | Sound like practitioner, not documentation |66| **Focused Beats Comprehensive** | Constrain ruthlessly |6768### Decision Heuristics6970| Rule | Guidance |71|------|----------|72| **3-File Rule** | 3+ files → agent. Enhances YOUR work → skill. |73| **Delegation Test** | Runs independently? Agent. Guides you? Skill. |74| **Activation Breadth** | Trigger on 80% of relevant requests |75| **Tool Constraint** | Start with 2-3 essential tools |7677### Activation Keywords7879**The description field is your activation gate.** Include:801. Task verbs: create, build, debug, fix, deploy812. Problem descriptions: slow, broken, failing823. Artifact types: component, API, database834. Casual synonyms: "make it faster" → optimize8485---8687## Common Workflows8889### Create Agent9091For the agent's prompt content (soul, tensions, mental models, thinking approaches), invoke `Skill("prompt-architect")` — it handles expertise transfer and dialectic design. This skill handles structure and frontmatter.9293```yaml94---95name: agent-name96description: "Use when [use case]. PROACTIVELY for [triggers].\n\nExamples:\n<example>\nContext: [situation]\nuser: [request]\nassistant: [response]\n</example>"97tools: Grep, Glob, Read, Bash98model: haiku99---100101# Agent Name102103Mission statement.104105## Strategy106[Approach]107108## Does NOT Do109- [boundary] (use X instead)110```111112### Create Skill113114Each skill is a context engineering problem: what information does Claude need, when should it load, and how much freedom should the instructions leave?115116For body content (soul, tensions, mental models, anti-patterns), invoke `Skill("prompt-architect")` — it handles expertise transfer and dialectic design.117118#### Key Principles1191201. **Claude is smart** — only add what Claude doesn't already know1212. **Explain WHY** — reasoning beats commands; reframe ALWAYS/NEVER as consequences1223. **Be pushy in descriptions** — Claude undertriggers by default; use directive language ("ALWAYS invoke")1234. **Match freedom to fragility** — exact scripts for dangerous ops, principles for judgment tasks1245. **Generalize from examples** — skills run millions of times; don't overfit125126#### Architecture127128```129skill-name/130├── SKILL.md # Required: YAML frontmatter + instructions (<500 lines)131├── scripts/ # Optional: deterministic operations (execute without loading)132├── references/ # Optional: domain docs loaded as needed133└── assets/ # Optional: templates, fonts, icons for output134```135136#### Creation Workflow1371381. **Capture Intent** — mine conversation for workflow, tools, corrections before asking questions1392. **Research Domain** — best practices, failure modes, decision heuristics, similar skills1403. **Draft SKILL.md** — quick orientation → core workflow → patterns → edge cases → reference routing → frontmatter (LAST)1414. **Review** — token audit, freedom calibration, generalization, trigger check, "Rationalizations to Reject", "When NOT to Use"1425. **Test Cases** — 2-3 realistic messy prompts as users actually type1436. **Iterate** — generalize from feedback, keep lean, reframe don't restrict144145**Detailed workflow:** `references/skill-creation-workflow.md`146**Writing principles:** `references/skill-writing-guide.md`147**Description optimization:** `references/skill-description-guide.md`148149#### Deliverables1501511. Complete SKILL.md with frontmatter and body1522. Directory structure with any bundled scripts/references/assets1533. 2-3 test prompts — realistic, messy, user-style1544. Description rationale — brief triggering strategy explanation155156### Initialize CLAUDE.md1571581. Analyze codebase (language, framework, structure)1592. Extract code style, commands, patterns1603. Generate with template, customize1614. Validate commands, check token count1625. Target <400 lines, prefer <250163164**Detailed:** `references/initialization-workflow.md`165166### Optimize CLAUDE.md1671681. Evaluate token efficiency1692. Find redundancy, outdated info1703. Apply token reduction techniques1714. Target 40%+ reduction1725. Verify critical info retained173174**Detailed:** `references/optimization-patterns.md`175176---177178## Anti-Patterns179180| Pattern | Problem | Fix |181|---------|---------|-----|182| **Kitchen Sink Agent** | 10+ tools, handles "everything" | Constrain to 3-5 tools |183| **Echo Skill** | Restates docs without insight | Add expert layer |184| **Invisible Trigger** | Description uses only formal terms | Include user language |185| **Procedure Manual** | Step 1, 2, 3... | Teach patterns, not steps |186| **Over-Documentation** | CLAUDE.md > 400 lines | Document project-specific only |187188---189190## Quality Signals191192### Good Signs193- Frontmatter reads like "when to use" guide194- First 10 lines provide actionable guidance195- Expert would nod "yes, that's how I think"196- Explicit constraints on what it does NOT handle197198### Warning Signs199- >50% reference tables or field definitions200- No mention of "when NOT to use"201- Generic language for any domain202- Body exceeds 600 lines203204---205206## References207208### CLI Tool209- `references/getting-started.md` - Installation, setup, auth210- `references/slash-commands.md` - Complete command catalog211- `references/mcp-integration.md` - MCP server configuration212- `references/hooks-and-plugins.md` - Hook types, plugin structure213- `references/configuration.md` - Settings hierarchy214- `references/enterprise-features.md` - IAM, SSO, sandboxing215- `references/cicd-integration.md` - GitHub Actions, GitLab CI216- `references/ide-integration.md` - VS Code, JetBrains217- `references/advanced-features.md` - Extended thinking, caching218- `references/troubleshooting.md` - Common issues219- `references/api-reference.md` - Admin, Messages, Skills APIs220- `references/best-practices.md` - Project organization, security221- `references/agent-skills.md` - Creating skills via CLI222223### Extensibility224- `references/agent-development.md` - Full YAML structure, system prompts225- `references/skill-development.md` - Structure, triggers, hooks226- `references/skill-creation-workflow.md` - End-to-end skill creation process227- `references/skill-writing-guide.md` - Writing principles and mental models228- `references/skill-description-guide.md` - Description optimization and triggers229230### CLAUDE.md231- `references/initialization-workflow.md` - Creating new CLAUDE.md232- `references/optimization-patterns.md` - Token reduction techniques233- `references/integration-strategies.md` - Global config, MCP tools234- `references/output-templates.md` - Standard output formats235236---237238## Skill Routing239240| Task | Where | What it handles |241|------|-------|-----------------|242| Skill/agent **prompt content** (soul, tensions, mental models, anti-patterns) | `Skill("prompt-architect")` | Content quality, dialectic design, freedom calibration |243| Skill **structure** (frontmatter, directory, progressive disclosure, description) | This skill | Architecture, triggering strategy, token budgeting |244| CLAUDE.md creation/optimization | This skill | Initialization workflow, token reduction |245246When creating or editing skills/agents: this skill for structure → `prompt-architect` for body content.247248---249250**Documentation:**251- llms.txt: https://context7.com/websites/code_claude/llms.txt?tokens=10000252- Main docs: https://code.claude.com/docs/en/253- GitHub: https://github.com/anthropics/claude-code