When creating custom agent files in `.claude/agents/`, the YAML frontmatter format
Use when creating custom AI agents for Claude Code, writing agent files, or configuring YAML frontmatter with proper triggers and model selection.
/plugin marketplace add TechNickAI/ai-coding-config/plugin install ai-coding-config@ai-coding-configWhen creating custom agent files in .claude/agents/, the YAML frontmatter format
matters.
---
name: agent-name
# prettier-ignore
description: "Use when reviewing for X, checking Y, or verifying Z - include all semantic triggers"
model: opus
---
Critical constraints:
> or |) correctly# prettier-ignore - Add before description to allow longer, richer triggersAgents are LLM-triggered. Descriptions should match against user requests to enable Claude Code to auto-select the right agent. Use "Use when..." format with rich semantic triggers.
Do: Match user language
Think about what users will say:
Include those exact phrases in your descriptions.
Do: Include variations
# prettier-ignore
description: "Use when reviewing for production readiness, fragile code, error handling, resilience, reliability, or catching bugs before deployment"
This triggers on: "review for production", "check fragile code", "error handling review", "catch bugs", etc.
Don't: Describe what it does
Bad: "A code reviewer that analyzes production readiness and error handling patterns"
This is technical documentation, not a semantic trigger.
---
name: test-runner
# prettier-ignore
description: "Use when running tests, checking test results, or verifying tests pass before committing"
model: haiku
---
I run tests using the specified test runner (bun, pnpm, pytest, etc) and return a terse
summary with pass count and failure details only. This preserves your context by
filtering verbose test output to just what's needed for fixes.
[Rest of agent prompt...]
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.