Best practices and quality guidelines for writing effective agent definitions. Use this before or during agent creation to ensure the agent is well-designed, maintainable, and useful.
How this skill is triggered — by the user, by Claude, or both
Slash command
/puzzle9900-claude-plugin:generic-agent-best-practicesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides quality and design guidance for writing agent definitions. It complements `generic-agent-creator-structure`, which covers file format and naming. This skill covers what makes an agent actually effective: clear identity, smart knowledge design, runtime behaviors, and long-term maintainability.
This skill provides quality and design guidance for writing agent definitions. It complements generic-agent-creator-structure, which covers file format and naming. This skill covers what makes an agent actually effective: clear identity, smart knowledge design, runtime behaviors, and long-term maintainability.
Use this skill when:
Apply these best practices when creating, reviewing, or improving any agent definition. Each practice addresses a specific failure mode observed in real agent usage. When reviewing an existing agent, check each practice and flag violations.
Each agent should own a single, well-defined domain or feature. An agent that tries to cover multiple concerns becomes a generalist that adds little value over the base model.
mobile-android-push-notifications-expert — owns one feature completelymobile-android-expert — too broad to provide meaningful expertiseIf you find yourself listing more than two unrelated areas in the Identity section, split into multiple agents.
The Identity section should answer three questions in this order:
Avoid aspirational language. State what the agent does, not what it aspires to be.
The Knowledge section is where most agents fail. Follow the "thin agent, thick context" principle:
Include:
src/feature/**/*.ts), directory paths, doc URLs, ticket project keysDo not include:
Why: Static knowledge snapshots go stale as the codebase evolves. Pointers to where the data lives remain accurate. An agent that reads current state at runtime is always correct; one with embedded summaries gives false confidence after the first code change.
Every Knowledge section should include a "Context Sources" subsection listing where the agent should look at runtime:
### Context Sources
- Code: `src/feature-name/**/*.ts`, `src/shared/feature-name-*`
- Tests: `tests/feature-name/`
- Docs: `docs/feature-name/` or external doc URL
- Tickets: Project key `FEAT`, epic `FEAT-100`
These are the agent's "refresh points" — it reads them before answering to ensure its responses reflect the current codebase.
The Instructions section must include behaviors that keep the agent honest at runtime:
An agent without runtime verification is just a static document with extra formatting.
The Output Format section should specify response structure by request type. Common patterns:
Consistency in output format makes agents predictable and trustworthy. Users learn what to expect.
Use the model frontmatter field intentionally:
| Model | Use when | Example agents |
|---|---|---|
haiku | Fast, low-complexity tasks — formatting, simple lookups, routing | Triage agents, format checkers |
sonnet | Balanced tasks — code review, implementation guidance, feature work | Feature experts, reviewers (default) |
opus | Deep reasoning — architecture decisions, complex debugging, cross-system analysis | Architecture agents, root-cause analyzers |
Omitting model defaults to the parent model, which is correct for most agents. Only override when you have a clear reason.
If an agent has access to tools, only provision the ones it actually needs. An agent with access to every tool is an agent that can cause unexpected side effects.
State tool expectations in the Constraints section so consumers know what the agent requires.
This is the highest-value content in any agent. It captures what a new developer would get wrong — the things that are not obvious from reading the code.
Examples of high-value gotchas:
If you cannot identify at least two non-obvious constraints, the agent may not have enough domain expertise to justify its existence.
Include last_reviewed: YYYY-MM-DD in the agent's frontmatter. This enables consumers to know when the agent's knowledge was last verified against the codebase.
An agent that has not been reviewed in 90 days should be treated as potentially stale. The generic-skill-tester agent can be used to validate agents periodically.
A new agent should go through at least one testing cycle before being considered reliable:
Use the generic-skill-tester skill to automate this process when possible.
generic-agent-creator-structure — that skill covers format and naming; this skill covers quality and designnpx claudepluginhub puzzle9900/puzzle9900-claude-plugin --plugin puzzle9900-claude-pluginCreates and validates production-grade agent .md files for Anthropic 2026 16-field spec. Use for custom subagents, agent quality review, or orchestrator architectures. Triggers: /agent-creator, 'create an agent'.
Generates markdown agent files with YAML frontmatter for Claude Code, configuring system prompts, tools, and isolation for autonomous task delegation in plugins.
Creates a new agent definition file following the agent-almanac template and registry conventions. Covers persona design, tool selection, skill assignment, and verification.