context-engineering
Comprehensive toolkit for creating production-ready Claude Code resources: agents, skills, plugins, commands, hooks, and patterns. Expert guidance with templates, examples, and best practices following Anthropic specifications.
View on GitHubTable of content
Comprehensive toolkit for creating production-ready Claude Code resources: agents, skills, plugins, commands, hooks, and patterns. Expert guidance with templates, examples, and best practices following Anthropic specifications.
Installation
npx claude-plugins install @andisab/swe-marketplace/context-engineering
Contents
Folders: agents, patterns, skills, templates
Files: README.md
Documentation
๐ฏ Expert toolkit for creating production-ready Claude Code resources
A comprehensive Claude Code plugin that helps you design and implement high-quality agents, skills, plugins, commands, hooks, and other Claude SDK components following Anthropic’s official specifications and best practices.
Features
๐ค Expert Agent
context-engineer - Your context engineering specialist that:
- Designs sub-agents with discovery-optimized descriptions
- Creates autonomous skills with proper activation triggers
- Structures complete plugins with proper distribution
- Crafts slash commands with argument handling
- Configures lifecycle hooks for automation
- Uses conventions-mcp to find proven patterns
- Implements progressive disclosure for token efficiency
๐ Five Specialized Skills
Auto-activated skills provide detailed guidance for each resource type:
- agent-definition-creation - Creating sub-agents with proper YAML frontmatter, system prompts, tool access, and example-driven descriptions
- skill-creation - Designing model-invoked capabilities with discovery optimization and supporting file structures
- plugin-development - Building plugin bundles with proper directory structure, metadata, and distribution
- command-creation - Crafting slash commands with arguments, file references, and bash execution
- hook-configuration - Setting up lifecycle event handlers for automation and workflow control
๐ Complete Templates
Ready-to-use starting points for every resource type:
- subagent-template.md - Agent structure with frontmatter and system prompt
- skill-template.md - Skill structure with activation triggers and supporting files
- plugin-structure.md - Complete plugin directory layout and configuration
- slash-command-template.md - Command patterns with 10 real-world examples
- hook-configuration-template.md - 20+ hook configurations for common scenarios
๐จ Best Practice Patterns
Documentation of proven architectural patterns:
- progressive-disclosure.md - Token management with three disclosure levels (saves 80%+ tokens)
- multi-agent-orchestration.md - Coordinating multiple agents for complex workflows
- tool-restriction-patterns.md - Security-focused tool access control
Installation
Quick Install
/plugin install context-engineering@swe-marketplace
For Team Projects
Add to .claude/settings.json:
{
"plugins": {
"context-engineering": {
"source": "context-engineering@swe-marketplace",
"enabled": true
}
}
}
Usage
Creating a Sub-Agent
Simply ask Claude:
User: "Create an agent for PostgreSQL database optimization"
Claude: I'll use the context-engineer agent to design a comprehensive
PostgreSQL expert with query optimization, schema design, and performance
tuning capabilities.
The agent will:
- Ask clarifying questions about domain and capabilities
- Search conventions-mcp for similar agents
- Use the agent-definition-creation skill automatically
- Create proper YAML frontmatter and system prompt
- Include discovery-optimized examples
- Select appropriate tools and model
Creating a Skill
User: "I want Claude to automatically process PDF files when I mention them"
Claude: I'll create a skill that activates when you mention PDF processing...
The skill-creation skill automatically activates to:
- Design activation triggers and keywords
- Structure supporting files (examples/, templates/, references/)
- Write clear usage instructions
- Implement progressive disclosure
Creating a Plugin
User: "Help me create a plugin for our deployment workflow with agents, commands, and hooks"
Claude: I'll design a deployment plugin with proper structure...
The plugin-development skill handles:
- Directory organization
- plugin.json configuration
- Component coordination
- Distribution strategy
- README and documentation
Creating a Slash Command
User: "Make a command that runs tests with different environments"
Claude: I'll create a /run-tests command with environment arguments...
The command-creation skill creates:
- Argument handling ($1, $2, defaults)
- File references (@file)
- Bash execution (!command)
- Tool permissions
- Help documentation
Creating Hooks
User: "Automatically format Python files after I edit them"
Claude: I'll configure a PostToolUse hook that runs Black and isort...
The hook-configuration skill sets up:
- Event selection (PreToolUse, PostToolUse, etc.)
- Matchers (tool, file patterns)
- Shell commands
- Security validation
Components
Agent
- context-engineer - Main orchestrator for all resource creation
- Model: opus (complex reasoning for design decisions)
- Tools: Read, Write, Edit, Grep, Glob, Bash, MCP (conventions search)
- Proactive usage for any resource creation request
Skills
| Skill | Activation Triggers | Pur
…(truncated)
Included Skills
This plugin includes 5 skill definitions:
agent-definition-creation
View skill definition
Agent Definition Creation Skill
This skill helps create production-ready Claude Code sub-agent definitions following Anthropic’s official specifications and best practices.
Core Principles
1. Single Responsibility
Each agent should have ONE clear purpose. Avoid creating multipurpose agents that try to do everything.
Good: postgres-expert - PostgreSQL database management and optimization
Bad: database-expert - All databases (too broad)
2. Discovery-Optimized Descriptions
The description field is critical for Claude to discover when to use your agent. Include:
- What: Clear statement of capabilities
- When: Specific scenarios that trigger usage
- Examples: Concrete usage patterns with user/assistant dialogue
- Trigger terms: Keywords users might mention
3. Tool Restriction Strategy
Grant only necessary tools following principle of least privilege:
- Omit
toolsfield: Inherits all tools from main conversation (use for general-purpose agents) - Specify tools list: Grant specific tools (use for focused/security-sensitive agents)
4. Model Selection
Choose the right model for the task:
sonnet: Default choice for most agents (balanced performance/cost)opus: Complex reasoning, architecture decisions, critical taskshaiku: Simple, repetitive tasks with clear patternsinherit: Match parent conversation’s model
Agent Structure
---
name: agent-identifier
description: >
Prima
...(truncated)
</details>
### command-creation
> >
<details>
<summary>View skill definition</summary>
# Command Creation Skill
This skill helps create production-ready custom slash commands following Anthropic's official specifications.
## What is a Slash Command?
A **slash command** is a user-invoked reusable prompt stored as a Markdown file. Unlike skills (model-invoked) or agents (complex AI assistants), slash commands are:
- **User-triggered**: Explicitly invoked with `/command-name`
- **Template-based**: Expand to prompts with placeholders
- **Lightweight**: Simple Markdown files with optional frontmatter
- **Quick access**: Fast way to reuse common instructions
## Commands vs Skills vs Agents
| Feature | Command | Skill | Agent |
|---------|---------|-------|-------|
| **Invocation** | User (`/name`) | Model (automatic) | User or Task tool |
| **Complexity** | Simple prompt template | Capability with logic | Full AI assistant |
| **Arguments** | Yes ($1, $2, $ARGUMENTS) | N/A | N/A |
| **File access** | Yes (@file) | Via tools | Via tools |
| **Bash exec** | Yes (!command) | Via tools | Via tools |
| **Use case** | Quick prompts, workflows | Autonomous features | Domain expertise |
**When to use Commands**: Reusable prompts, quick text expansion, parametrized instructions, file processing workflows
## Command Structure
### Basic Command (Prompt only)
```markdown
Please review this code for security vulnerabilities and provide
specific recommendations for improvement.
File: .claude/commands/security-review.md
Usage: /security-review
Command with F
…(truncated)
hook-configuration
View skill definition
Hook Configuration Skill
This skill helps create production-ready Claude Code hooks following Anthropic’s official specifications.
What are Hooks?
Hooks are user-defined shell commands that execute at various points in Claude Code’s lifecycle. They provide:
- Deterministic control: Ensure actions happen automatically, not relying on LLM decisions
- Workflow automation: Format code, run linters, log commands
- Custom notifications: Alert when Claude needs input
- Permission systems: Block sensitive file modifications
- Feedback loops: Validate code changes against conventions
Hook vs Skill vs Command
| Feature | Hook | Skill | Command |
|---|---|---|---|
| Trigger | Lifecycle event | Context match | User invocation |
| Type | Shell command | AI capability | Prompt template |
| Use case | Automation, validation | Autonomous features | Reusable prompts |
| Control | Deterministic | LLM-driven | User-initiated |
When to use Hooks: Automatic formatting, logging, notifications, permission control, code validation
Hook Events
Ten lifecycle events trigger hooks:
1. PreToolUse
Executes after Claude creates tool parameters but before processing.
Use cases:
- Block edits to sensitive files (.env, production configs)
- Validate bash commands before execution
- Request confirmation for destructive operations
- Log all tool usage for auditing
- Modify tool inputs programmatically
**Blocking ca
…(truncated)
plugin-development
View skill definition
Plugin Development Skill
This skill helps create production-ready Claude Code plugins following Anthropic’s official plugin specifications.
What is a Plugin?
A plugin is a bundled collection of Claude Code components that work together to provide cohesive functionality. Plugins enable:
- Modular distribution: Package related capabilities together
- Team sharing: Install once across multiple projects
- Version management: Track plugin versions independently
- Marketplace discovery: Publish for community use
- Automatic updates: Keep components synchronized
Plugin vs Individual Components
| Approach | When to Use |
|---|---|
| Individual Components | Single capability, personal use, experimental |
| Plugin | Multiple related components, team distribution, reusable across projects |
Example - Individual approach:
.claude/agents/postgres-expert.md(one file).claude/commands/test.md(one file)
Example - Plugin approach:
database-toolkit/plugin containing:- Agents: postgres-expert, mongodb-expert, sql-expert
- Skills: migration-management, query-optimization
- Commands: /migrate, /db-status
- Templates: schema templates
Plugin Structure
plugin-name/
โโโ .claude-plugin/
โ โโโ plugin.json # Required: Plugin metadata
โโโ agents/ # Optional: Sub-agent definitions
โ โโโ agent-one.md
โ โโโ agent-two.md
โโโ skills/ # Optional
...(truncated)
</details>
### skill-creation
> >
<details>
<summary>View skill definition</summary>
# Skill Creation Skill
This skill helps create production-ready Claude Code skills following Anthropic's official specifications and best practices.
## Skills vs Agents: Key Differences
| Aspect | Skills | Sub-agents |
|--------|--------|------------|
| **Invocation** | Model-invoked (automatic) | User-invoked (explicit) or Task tool |
| **Scope** | Single capability | Multiple capabilities |
| **File** | Directory with SKILL.md | Single .md file |
| **Supporting files** | Can include templates, scripts | System prompt only |
| **Discovery** | Description matching | Description + explicit invocation |
| **Use case** | Reusable patterns, tools, workflows | Specialized AI assistants |
**When to use Skills**: Create autonomous capabilities that Claude should invoke automatically when context matches (e.g., PDF processing, form filling, specific workflows)
**When to use Agents**: Create specialized AI assistants for complex domains requiring multi-step reasoning (e.g., database expert, security auditor)
## Skill Structure
skill-name/ โโโ SKILL.md # Required: Skill definition and content โโโ examples/ # Optional: Example usage โ โโโ basic-usage.md โ โโโ advanced-patterns.md โโโ templates/ # Optional: Code templates โ โโโ template-file.py โโโ references/ # Optional: Reference materials โ โโโ api-docs.md โโโ scripts/ # Optional: Helper scripts โโโ helper.py
## SKILL.m
...(truncated)
</details>
## Source
[View on GitHub](https://github.com/andisab/swe-marketplace)