From agent-almanac
Evolves existing agent definitions by refining persona/skills/tools in-place or creating advanced variants, assessing best practices, updating metadata, and syncing registry. Use for outdated skills, feedback gaps, tool changes, or scope sharpening.
npx claudepluginhub pjt222/agent-almanacThis skill is limited to using the following tools:
Improve, extend, or create an advanced variant of an agent that was originally authored with `create-agent`. This procedure covers the maintenance side of the agent lifecycle: assessing gaps against best practices, applying targeted improvements to the persona definition, bumping versions, and keeping the registry and cross-references in sync.
Creates new Claude Code agent definition files using agent-almanac templates and registry conventions. Covers persona design, tool/skill selection, model choice, frontmatter schema, and symlink verification. Use for specialized subagents or library additions.
Audits Claude Code agents for violations, gaps, and improvements across 7 dimensions like description quality and frontmatter, outputting structured repair plans.
Creates Claude Code agents from scratch or by adapting templates. Guides requirements gathering, template selection, and file generation following Anthropic best practices (v2.1.63+).
Share bugs, ideas, or general feedback.
Improve, extend, or create an advanced variant of an agent that was originally authored with create-agent. This procedure covers the maintenance side of the agent lifecycle: assessing gaps against best practices, applying targeted improvements to the persona definition, bumping versions, and keeping the registry and cross-references in sync.
r-developer and r-developer-advanced)agents/r-developer.md)Read the existing agent file and evaluate each section against the quality checklist from guides/agent-best-practices.md:
| Section | What to Check | Common Issues |
|---|---|---|
| Frontmatter | All required fields present (name, description, tools, model, version, author) | Missing tags, stale version, wrong priority |
| Purpose | Specific problem statement, not generic "helps with X" | Vague or overlapping with another agent |
| Capabilities | Concrete, verifiable capabilities with bold lead-ins | Generic ("handles development"), no grouping |
| Available Skills | Matches frontmatter skills list, all IDs exist in registry | Stale IDs, missing new skills, lists default skills unnecessarily |
| Usage Scenarios | 2-3 realistic scenarios with invocation patterns | Placeholder text, unrealistic examples |
| Examples | Shows user request and agent behavior | Missing or trivial examples |
| Limitations | 3-5 honest constraints | Too few, too vague, or missing entirely |
| See Also | Valid cross-references to agents, guides, teams | Stale links to renamed or removed files |
# Read the agent file
cat agents/<agent-name>.md
# Check frontmatter parses
head -20 agents/<agent-name>.md
# Verify skills in frontmatter exist in registry
grep "skills:" -A 20 agents/<agent-name>.md
# Check if agent is referenced by any team
grep -r "<agent-name>" teams/*.md
Expected: A list of specific gaps, weaknesses, or improvement opportunities organized by section.
On failure: If the agent file does not exist or has no frontmatter, this skill does not apply — use create-agent instead to author it from scratch.
Identify and categorize what triggered the evolution:
| Trigger | Example | Typical Scope |
|---|---|---|
| User feedback | "Agent missed XSS in review" | Add skill or capability |
| New skills available | Library gained analyze-api-security | Update skills list |
| Tool change | New MCP server available | Add to tools/mcp_servers |
| Scope overlap | Two agents both claim "code review" | Sharpen purpose and limitations |
| Team integration | Agent added to a new team | Update See Also, verify capabilities |
| Model upgrade | Task requires deeper reasoning | Change model field |
| Privilege reduction | Agent has Bash but only reads files | Remove unnecessary tools |
Document the specific changes needed before editing. List each change with its target section:
- Frontmatter: add `new-skill-id` to skills list
- Capabilities: add "API Security Analysis" capability
- Available Skills: add `new-skill-id` with description
- Limitations: remove outdated limitation about missing skill
- See Also: add link to new team that includes this agent
Expected: A concrete list of changes, each mapped to a specific section of the agent file.
On failure: If the changes are unclear, consult the user for clarification before proceeding. Vague evolution goals produce vague improvements.
Use this decision matrix to determine whether to refine in-place or create a variant:
| Criteria | Refinement (in-place) | Advanced Variant (new agent) |
|---|---|---|
| Agent ID | Unchanged | New ID: <agent>-advanced or <agent>-<specialty> |
| File path | Same .md file | New file in agents/ |
| Version bump | Patch or minor | Starts at 1.0.0 |
| Model | May change | Often higher (e.g., sonnet → opus) |
| Registry | Update existing entry | New entry added |
| Original agent | Modified directly | Left intact, gains See Also cross-reference |
Refinement: Choose when updating skills, fixing documentation, sharpening scope, or adjusting tools. The agent keeps its identity.
Variant: Choose when the evolved version would serve a substantially different audience, require a different model, or add capabilities that would make the original too broad. The original stays as-is for simpler use cases.
Expected: A clear decision — refinement or variant — with rationale.
On failure: If unsure, default to refinement. You can always extract a variant later; it is harder to merge one back.
Edit the existing agent file directly:
skills, tools, tags, model, priority, mcp_servers as neededFollow these editing rules:
skills listmeditate, heal) to frontmatter unless they are core to the agent's methodologygrep "id: skill-name" skills/_registry.yml# Copy the original as a starting point
cp agents/<agent-name>.md agents/<agent-name>-advanced.md
# Edit the variant:
# - Change `name` to `<agent-name>-advanced`
# - Update `description` to reflect the advanced scope
# - Raise `model` if needed (e.g., sonnet → opus)
# - Reset `version` to "1.0.0"
# - Expand skills, capabilities, and examples for the advanced use case
# - Reference the original in See Also as a simpler alternative
Expected: The agent file (refined or new variant) passes the assessment checklist from Step 1.
On failure: If an edit breaks the document structure, use git diff to review changes and revert partial edits with git checkout -- <file>.
Required when translations exist. This step applies to both human authors and AI agents following this procedure. Do not skip — stale
source_commitvalues causenpm run validate:translationsto report false staleness warnings across all locales.
Check whether translations exist for the evolved agent and update them to reflect the new source state:
# Check for existing translations
ls i18n/*/agents/<agent-name>.md 2>/dev/null
SOURCE_COMMIT=$(git rev-parse HEAD)
source_commit in each translated file's frontmatter:for locale_file in i18n/*/agents/<agent-name>.md; do
sed -i "s/^source_commit: .*/source_commit: $SOURCE_COMMIT/" "$locale_file"
done
evolve(<agent-name>): <description of changes>
Translations flagged for re-sync: de, zh-CN, ja, es
Changed sections: <list sections that changed>
npm run translation:status
No action needed. Proceed to Step 5.
Defer translation of new variants until the variant stabilizes (1-2 versions). Add translations after the variant has been refined at least once.
Expected: All translated files have source_commit updated to the current commit. npm run translation:status exits 0.
On failure: If sed fails to match the frontmatter field, open the translated file manually and verify it has source_commit in its YAML frontmatter. If the field is missing, re-scaffold with npm run translate:scaffold -- agents <agent-name> <locale>.
Bump the version field in frontmatter following semantic versioning:
| Change Type | Version Bump | Example |
|---|---|---|
| Typo fix, wording clarification | Patch: 1.0.0 → 1.0.1 | Fixed unclear limitation |
| New skills added, capability expanded | Minor: 1.0.0 → 1.1.0 | Added 3 new skills from library |
| Restructured purpose, changed model | Major: 1.0.0 → 2.0.0 | Narrowed scope, upgraded to opus |
Also update:
updated date to the current datetags if the agent's domain coverage changeddescription if the purpose is materially differentpriority if the agent's importance relative to others changedExpected: Frontmatter version and updated reflect the magnitude and date of changes. New variants start at "1.0.0".
On failure: If you forget to bump the version, the next evolution will have no way to distinguish the current state from the previous one. Always bump before committing.
Update the existing entry in agents/_registry.yml to match the revised frontmatter:
# Find the agent's registry entry
grep -A 10 "id: <agent-name>" agents/_registry.yml
Update description, tags, tools, and skills fields to match the agent file. No count change is needed.
Update cross-references in other files if the agent's capabilities or name changed:
# Check if any team references this agent
grep -r "<agent-name>" teams/*.md
# Check if any guide references this agent
grep -r "<agent-name>" guides/*.md
Add the new agent to agents/_registry.yml in alphabetical position:
- id: <agent-name>-advanced
path: agents/<agent-name>-advanced.md
description: One-line description of the advanced variant
tags: [domain, specialty, advanced]
priority: normal
tools: [Read, Write, Edit, Bash, Grep, Glob]
skills:
- skill-id-one
- skill-id-two
Then:
total_agents at the top of the registry.claude/agents/ symlink to agents/ means the variant is automatically discoverableExpected: Registry entry matches the agent file frontmatter. For variants, total_agents equals the actual number of agent entries.
On failure: Count entries with grep -c "^ - id:" agents/_registry.yml and verify it matches total_agents.
Run the full validation checklist:
version was bumped (refinement) or set to "1.0.0" (variant)updated date reflects todayskills/_registry.ymlmeditate, heal) are not listed unless core to methodologytotal_agents count matches actual count on diskgit diff shows no accidental deletions from the original content# Verify frontmatter
head -20 agents/<agent-name>.md
# Check skills exist
for skill in skill-a skill-b; do
grep "id: $skill" skills/_registry.yml
done
# Count agents on disk vs registry
ls agents/*.md | grep -v template | wc -l
grep total_agents agents/_registry.yml
# Review all changes
git diff
Expected: All checklist items pass. The evolved agent is ready to commit.
On failure: Address each failing item individually. The most common post-evolution issues are stale skill IDs in the Available Skills section and a forgotten updated date.
version field reflects the changes madeupdated date is currentskills array matches the Available Skills sectionskills/_registry.ymlagents/_registry.yml with correct pathtotal_agents count updatedsource_commit updated in all locale filesgit diff confirms no accidental content removalversion and updated in frontmatter before committing.ls i18n/*/agents/<agent-name>.md and update source_commit in each, or flag them for re-translation in the commit message.skills array and the ## Available Skills section must stay in sync. Updating one without the other creates confusion for both humans and tooling.meditate or heal to the frontmatter when they are already inherited from the registry. Only list them if they are core to the agent's methodology (e.g., mystic, alchemist).Bash or WebFetch during an evolution "just in case." Every tool addition should be justified by a specific new capability.agents/_registry.yml entry must be updated to match. Stale registry entries cause discovery and tooling failures.create-agent — foundation for authoring new agents; evolve-agent assumes this was followed originallyevolve-skill — the parallel procedure for evolving SKILL.md filescommit-changes — commit the evolved agent with a descriptive message