- name
- claude-craft
- description
- Claude Code extensibility — agents, commands, hooks, skills, rules, and configuration. Use when creating, configuring, or troubleshooting Claude Code components, or when agent.md, /command, hooks.json, SKILL.md, .claude/rules, settings.json, MCP server, PreToolUse, or create agent/command/hook are mentioned.
- metadata
- {"version":"1.0.2","related-skills":["skillcraft","claude-plugins"]}
- allowed-tools
- Read, Write, Edit, Grep, Glob, Bash, TaskCreate, TaskUpdate, TaskList, TaskGet
# Claude Code Extensibility
Create and configure the six Claude Code extension points: agents, commands, hooks, skills, rules, and configuration.
## Component Map
| Component | Purpose | Location | Invocation |
| ------------ | --------------------- | ------------------------------------- | --------------------------- |
| **Agents** | Specialized subagents | `agents/*.md` | Task tool (`subagent_type`) |
| **Commands** | Reusable prompts | `commands/*.md` | User: `/command-name` |
| **Hooks** | Event handlers | `settings.json` or `hooks/hooks.json` | Automatic on events |
| **Skills** | Capability packages | `skills/*/SKILL.md` | Auto-triggered by context |
| **Rules** | Convention files | `.claude/rules/*.md` | Loaded on demand |
| **Config** | Settings & MCP | `settings.json`, `.mcp.json` | Loaded at startup |
### Scope Hierarchy
| Scope | Location | Visibility |
| -------- | ------------------ | ------------ |
| Personal | `~/.claude/` | You only |
| Project | `.claude/` or root | Team via git |
| Plugin | `<plugin>/` | Plugin users |
## Routing
| Task | Use |
| ----------------------------------------------- | --------------------------------------- |
| Creating agents, commands, hooks, rules, config | This skill |
| Creating skills (Claude-specific features) | This skill + `skillcraft` for base spec |
| Creating skills (cross-platform spec) | `skillcraft` |
| Packaging/distributing plugins | `claude-plugins` |
---
## Agents
Specialized subagents with focused expertise, invoked via the Task tool.
### Frontmatter
```yaml
---
name: security-reviewer # Required: kebab-case, matches filename
description: | # Required: triggers + examples
Use this agent for security vulnerability detection.
Triggers on security audits, OWASP, injection, XSS.
<example>
Context: User wants security review.
user: "Review auth code for vulnerabilities"
assistant: "I'll use the security-reviewer agent."
</example>
model: inherit # Optional: inherit(default)|haiku|sonnet|opus
tools: Glob, Grep, Read # Optional: comma-separated (default: inherit all)
disallowedTools: Write, Edit # Optional: deny specific tools
skills: tdd-fieldguide, debugging # Optional: auto-load skills (NOT inherited)
maxTurns: 50 # Optional: max agentic turns
memory: user # Optional: user|project|local — persistent memory
hooks: # Optional: lifecycle hooks scoped to this agent
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate.sh"
---
```
See [agents/frontmatter.md](references/agents/frontmatter.md) for complete schema.
### Archetypes
| Type | Purpose | Typical Tools |
| --------------- | ------------------------- | -------------------------------------------------------------------------- |
| **Analyzer** | Examine without modifying | `Glob, Grep, Read, Skill, Task, TaskCreate, TaskUpdate, TaskList, TaskGet` |
| **Implementer** | Build and modify code | Full access (inherit) |
| **Reviewer** | Provide feedback | Read-only + Skill + Task tools |
| **Tester** | Create and manage tests | Read, Write, Edit, Bash, ... |
| **Researcher** | Find and synthesize info | ..., WebSearch, WebFetch |
See [agents/types.md](references/agents/types.md) for details.
### Model Selection
| Model | When to Use |
| --------- | ---------------------------------------------- |
| `inherit` | Recommended default — adapts to parent context |
| `haiku` | Fast exploration, simple tasks, low-latency |
| `sonnet` | Balanced cost/capability (default if omitted) |
| `opus` | Nuanced judgment, security/architecture review |
### Tool Configuration
**Baseline** (always include when restricting):
```yaml
tools: Glob, Grep, Read, Skill, Task, TaskCreate, TaskUpdate, TaskList, TaskGet
```
Only restrict tools when there's a specific safety reason. See [agents/tools.md](references/agents/tools.md).
### Agent Body Structure
```markdown
# Agent Name
You are a [role] specializing in [expertise].
## Process
### Step 1: [Stage]
- Action items
## Output Format
Structured output spec.
## Constraints
**Always:** Required behaviors
**Never:** Prohibited actions
```
### Validation Checklist
- [ ] `name` matches filename (kebab-case, 1-3 words)
- [ ] `description` has WHAT, WHEN, triggers, 2-3 examples
- [ ] `tools` uses comma-separated valid names (case-sensitive)
- [ ] Body has clear role, process, output format, constraints
### References
| Reference | Content |
| --------------------------------------------------------------------- | ------------------------------------ |
| [agents/frontmatter.md](references/agents/frontmatter.md) | YAML schema and fields |
| [agents/types.md](references/agents/types.md) | Archetypes and patterns |
| [agents/tools.md](references/agents/tools.md) | Tool configuration patterns |
| [agents/discovery.md](references/agents/discovery.md) | How agents are found and loaded |
| [agents/patterns.md](references/agents/patterns.md) | Best practices, multi-agent patterns |
| [agents/tasks.md](references/agents/tasks.md) | Task tool patterns |
| [agents/task-tool.md](references/agents/task-tool.md) | Task tool integration |
| [agents/performance.md](references/agents/performance.md) | Performance optimization |
| [agents/advanced-features.md](references/agents/advanced-features.md) | Resumable agents, CLI config |
| [agents/agent-vs-skill.md](references/agents/agent-vs-skill.md) | Agents vs Skills distinction |
---
## Commands
Custom slash commands — reusable prompts invoked by users.
### Frontmatter
```yaml
---
description: Deploy to environment with validation # Required
argument-hint: <environment> [--skip-tests] # Shown in autocomplete
allowed-tools: Bash(*), Read # Restrict tool access
model: claude-3-5-haiku-20241022 # Override model
---
```
See [commands/frontmatter.md](references/commands/frontmatter.md) for complete schema.
### Core Features
<!-- <bang> = exclamation mark; used as stand-in to avoid triggering preprocessing -->
| Feature | Syntax | Purpose |
| ----------------- | ------------------------ | ------------------------------- |
| Arguments | `$1`, `$2`, `$ARGUMENTS` | Dynamic input from user |
| Bash execution | `` <bang>`command` `` | Include shell output in context |
| File references | `@path/to/file` | Include file contents |
| Tool restrictions | `allowed-tools:` | Limit Claude's capabilities |
### Quick Example
```markdown
---
description: Fix a specific GitHub issue
argument-hint: <issue-number>
---
Fix issue #$1 following our coding standards.
Review the issue, implement a fix, add tests, and create a commit.
```
Usage: `/fix-issue 123`
### Argument Patterns
- **Positional**: `$1`, `$2`, `$3` — `/compare old.ts new.ts`
- **All arguments**: `$ARGUMENTS` — `/fix memory leak in auth`
- **With file refs**: `@$1` — `/analyze src/main.ts`
See [commands/arguments.md](references/commands/arguments.md) for advanced patterns.
### Scopes
| Scope | Location | Shows in /help |
| -------- | --------------------- | -------------- |
| Project | `.claude/commands/` | "(project)" |
| Personal | `~/.claude/commands/` | "(user)" |
| Plugin | `<plugin>/commands/` | Plugin name |
Subdirectories create namespaces: `commands/frontend/component.md` → `/component`.
### Validation Checklist
- [ ] Filename is kebab-case `.md` (verb-noun pattern preferred)
- [ ] `description` is action-oriented, under 80 chars
- [ ] `argument-hint` uses `<required>` and `[optional]` syntax
- [ ] `allowed-tools` uses correct case-sensitive names
- [ ] Bash commands tested in terminal first
### References
| Reference | Content |
| --------------------------------------------------------------------- | --------------------------- |
| [commands/frontmatter.md](references/commands/frontmatter.md) | Complete frontmatter schema |
| [commands/arguments.md](references/commands/arguments.md) | Argument handling patterns |
| [commands/bash-execution.md](references/commands/bash-execution.md) | Shell command execution |
Auf GitHub ansehen