writing-agents

Create and validate Claude Code agent definitions with YAML frontmatter.

Updated Feb 11, 2026
One-click install
npx skills add https://github.com/knguyen0125/claude-plugin --skill writing-agents-knguyen0125
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-agents
Source: https://github.com/knguyen0125/claude-plugin/tree/main/plugins/general/skills/writing-agents
Command: npx skills add https://github.com/knguyen0125/claude-plugin --skill writing-agents-knguyen0125

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when creating or editing agent definition files (.md with YAML frontmatter) for Claude Code plugins, multi-agent systems, or custom agent types. Helps avoid bloat, scope creep, and misuse of agent vs skill boundaries.

Core Features & Use Cases

  • Guides on creating and editing agent definitions
  • Emphasizes single-responsibility and boundary management
  • Helps decide whether to use an agent, skill, or orchestrator logic

Quick Start

Create a new agent file as kebab-case name with YAML frontmatter and four sections (Purpose, Instructions, Workflow, Report) following the five rules.

Frequently Asked Questions about writing-agents

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a multi-agent definition file with clear boundaries for Claude Code?

To create a multi-agent definition, write a kebab-case Markdown file with YAML frontmatter. Structure the body using four sections: Purpose, Instructions, Workflow, and Report, while strictly following the five rules to enforce single-responsibility and prevent scope creep.

When should I use a custom agent versus a skill or orchestrator logic?

Use a custom agent when a task requires a distinct, single-responsibility role within a multi-agent system. Opt for a skill for shared capabilities, or orchestrator logic for workflow coordination, to avoid misuse of agent boundaries and prevent bloat.

What is the required structure for an agent definition file in Claude Code plugins?

An agent definition file requires YAML frontmatter for metadata and a body containing four specific sections: Purpose, Instructions, Workflow, and Report. Adhering to this structure ensures safety and proper validation within multi-agent systems.

How do I prevent scope creep when building multi-agent systems?

Prevent scope creep in multi-agent systems by enforcing the single-responsibility principle through boundary management. Validate that each agent definition strictly adheres to the five rules and only operates within its defined Purpose and Workflow sections.

Does Claude Code validate the YAML frontmatter in agent definition files?

Yes, validating YAML frontmatter is a core part of creating Claude Code agents. The frontmatter guides the structure and safety of the agent, ensuring the file meets the required format before being integrated into a multi-agent system or plugin.

What are the limitations of using compact agent definitions for multi-agent systems?

Compact agent definitions require strict adherence to four body sections and five rules, limiting flexibility. They should not be used when a task crosses boundaries or lacks single-responsibility, as this causes scope creep and agent boundary misuse.