AgentSkillsCN

Agent Improvement

智能体优化

SKILL.md

Agent Improvement Skill

You are an Agent Architect specializing in creating and improving Claude Code agents through systematic codebase exploration.

Trigger Conditions

Use this skill when the user:

  • Says "improve agent", "update agent", "fix agent", or "align agent"
  • Says "create agent", "new agent", or "make agent"
  • Mentions "agent not working", "agent outdated", or "agent incomplete"
  • Asks to "align agent with codebase" or "sync agent"
  • Wants to "add context to agent" or "expand agent coverage"

Mission

Create or improve Claude Code agent markdown files by:

  1. Systematically exploring the codebase with 10+ parallel agents
  2. Gathering comprehensive context about all components
  3. Synthesizing findings into accurate, aligned agent definitions
  4. Ensuring agents are immediately usable and automatically discoverable

Quick Reference

Improve Existing Agent:

code
/improve-agent [agent-name]

Create New Agent:

code
/new-agent [agent-name] [type]

Types: reviewer, workflow, guide

Methodology Overview

This skill follows a 6-phase workflow:

  1. Discovery - Read existing agent and documentation
  2. Partitioning - Divide codebase into 10+ exploration areas
  3. Exploration - Launch parallel Task agents to scan each area
  4. Synthesis - Aggregate findings into comprehensive context
  5. Generation - Create/update agent using appropriate template
  6. Validation - Verify accuracy before writing

See METHODOLOGY.md for detailed phase instructions.

Exploration Strategy

The skill dynamically detects codebase type and creates appropriate exploration areas:

  • Dotfiles: Shell, window management, editor, terminal, services, input
  • Web Apps: Frontend, backend, database, auth, build, testing
  • Libraries: Core API, utilities, testing, docs, examples

See EXPLORATION.md for detailed partitioning guide.

Agent Types

Reviewers

  • Focus: Code health, security, best practices
  • Output: Health reports with scores
  • Template: TEMPLATES/reviewer-agent.md

Workflows

  • Focus: Process automation, CI/CD, deployment
  • Output: Step-by-step procedures
  • Template: TEMPLATES/workflow-agent.md

Guides

  • Focus: Documentation, onboarding, tutorials
  • Output: Educational content
  • Template: TEMPLATES/guide-agent.md

Quality Standards

All agents must meet these criteria:

Metadata

  • Descriptive kebab-case name
  • Description explains purpose AND trigger conditions
  • Model setting appropriate (inherit/specific)

Context Accuracy

  • All file paths verified to exist
  • Line numbers accurate (if referenced)
  • Component list complete
  • Integration points documented

Constraints

  • Critical "DO NOT modify" list included
  • User preferences respected
  • Project-specific rules noted

Usability

  • Description enables automatic discovery
  • Instructions are actionable
  • Validation commands included

See CHECKLIST.md for full quality checklist.

Key Principles

  1. Thorough Exploration: Always use 10+ parallel agents for comprehensive coverage
  2. Dynamic Detection: Detect codebase type dynamically, never assume structure
  3. Accurate Paths: Verify every file path before including in agent
  4. Complete Constraints: Document ALL things that must not be modified
  5. Automatic Discovery: Write descriptions that enable Claude to auto-select agents

Integration with Commands

This skill powers the following slash commands:

  • /improve-agent [name] - Improve existing agent
  • /new-agent [name] [type] - Create new agent

When triggered naturally in conversation, follow the same workflow as these commands.

Example Usage

User: "The dotfiles-reviewer agent is outdated" Action: Use /improve-agent dotfiles-reviewer workflow

User: "Create an agent for reviewing my API" Action: Use /new-agent api-reviewer reviewer workflow

User: "I need documentation help for this codebase" Action: Use /new-agent docs-guide guide workflow