Canonical Claude Code authoring kit covering Skills, sub-agents, plugins, slash commands, hooks, memory, settings, sandboxing, headless mode, and advanced agent patterns. Use when creating Claude Code extensions or configuring Claude Code features.
Hooks: Events in settings.json. PreToolUse, PostToolUse, SessionStart, SessionEnd, PreCompact, Notification.
Memory: CLAUDE.md files + .claude/rules/*.md. Enterprise to Project to User hierarchy. @import syntax.
Settings: 6-level hierarchy. Managed to file-managed to CLI to local to shared to user.
Sandboxing: OS-level isolation. Filesystem and network restrictions. Auto-allow safe operations.
Headless: -p flag for non-interactive. --allowedTools, --json-schema, --agents for automation.
Skill Creation
Progressive Disclosure Architecture
Level 1 (Metadata): Name and description loaded at startup, approximately 100 tokens per Skill
Level 2 (Instructions): SKILL.md body loaded when triggered, under 5K tokens recommended
Level 3 (Resources): Additional files loaded on demand, effectively unlimited
Required Format
Create a SKILL.md file with YAML frontmatter containing name in kebab-case and description explaining what it does and when to use it in third person. Maximum 1024 characters for description. After the frontmatter, include a heading with the skill name, a Quick Start section with brief instructions, and a Details section referencing REFERENCE.md for more information.
Best Practices
Third person descriptions (does not I do)
Include trigger terms users mention
Keep under 500 lines
One level deep references
Test with Haiku, Sonnet, Opus
Sub-agent Creation
Using /agents Command
Type /agents, select Create New Agent, define purpose and tools, press e to edit prompt.
File Format
Create a markdown file with YAML frontmatter containing name, description explaining when to invoke (use PROACTIVELY for auto-delegation), tools as comma-separated list (Read, Write, Bash), and model specification (sonnet). After frontmatter, include the system prompt.
Critical Rules
Cannot spawn other sub-agents
Cannot use AskUserQuestion effectively
All user interaction before delegation
Each gets own 200K context
Plugin Creation
Directory Structure
Create my-plugin directory with .claude-plugin/plugin.json, commands directory, agents directory, skills directory, hooks/hooks.json, and .mcp.json file.
Manifest (plugin.json)
Create a JSON object with name, description explaining plugin purpose, version as 1.0.0, and author object containing name field.
Commands
Use /plugin install owner/repo to install from GitHub.
Use /plugin validate . to validate current directory.
Use /plugin enable plugin-name to enable a plugin.
Advanced Agent Patterns
Two-Agent Pattern for Long Tasks
Initializer agent: Sets up environment, feature registry, progress docs
Executor agent: Works single features, updates registry, maintains progress
See reference/advanced-agent-patterns.md for details.
Orchestrator-Worker Architecture
Lead agent: Decomposes tasks, spawns workers, synthesizes results