Agent skill

Writing Agents

by aaddrick in aaddrick/claude-pipeline

A skill your agent uses when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

MITAuto-check passedAgent Workflows

Install Writing Agents

skills CLI
$ npx skills add aaddrick/claude-pipeline --skill writing-agents -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aaddrick/claude-pipeline writing-agents --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aaddrick/claude-pipeline.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/writing-agents .claude/skills/writing-agents && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
writing-agents
GitHub stars
130
Used in
1 other repo
Token cost
~3.3k tokens
SKILL.md length
838 words
Files
2
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

  • Works in 9 steps: Research Domain Best Practices → Gather Codebase Context → Write the Agent → …
  • Creating new agents
  • SKILL.md covers Overview, Agents vs Skills, Agent File Structure and Agent Creation Workflow, plus 6 more sections
  • Calls composer and php

What it does

Writing Agents is an agent skill from aaddrick/claude-pipeline. Use when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `agent-templates.md`).

It sits in Agent Workflows, covering Subagents. The repository describes itself as: Portable Claude Code multi-agent pipeline - skills, agents, hooks, orchestration scripts, and quality gates. The licence is MIT.

When your agent uses it

  • Creating new agents
  • Editing existing agents
  • Defining specialized subagent roles for the Task tool

Example prompts

  • “/writing-agents”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Research Domain Best Practices
  2. Gather Codebase Context
  3. Write the Agent
  4. Session Restart
  5. Clear Persona Definition
  6. Explicit Scope Boundaries
  7. Anti-Patterns Section
  8. Coordination Protocols
  9. Project Context

What it can do on your machine

Read from SKILL.md and the folder at commit 402eac7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • composer
    • php

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • prompthub.us
    • theagentarchitect.substack.com
    • datablist.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Writing Agents loads about 3.3k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 838 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aaddrick/claude-pipeline at commit 402eac7, republished under its MIT licence (© aaddrick). 838 words, ~3,311 tokens.

Download SKILL.mdSave it as .claude/skills/writing-agents/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
writing-agents
description
Use when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool

Writing Agents

Overview

Writing agents IS Test-Driven Development applied to role definitions.

Agents are specialized subagents invoked via the Task tool. They receive full conversation context and execute autonomously with a defined persona, tools, and behavioral guidelines.

Core principle: If you didn't test the agent on representative tasks, you don't know if it performs correctly.

REQUIRED BACKGROUND: Understand test-driven-development and writing-skills before using this skill. Same RED-GREEN-REFACTOR cycle applies.

Agents vs Skills

AspectAgentsSkills
InvocationTask tool with subagent_typeSkill tool with skill name
ContextFull conversation historyLoaded on-demand
ExecutionAutonomous, multi-turnSingle response guidance
PersonaExplicit role/identityReference documentation
Location.claude/agents/.claude/skills/
Use forComplex, autonomous tasksReusable patterns/techniques

Agent File Structure

Agents are PROJECT-LEVEL. They live in the project's .claude/agents/ directory, not personal directories.

.claude/agents/
  agent-name.md    # Single file with frontmatter + persona

Frontmatter (YAML):

yaml
---
name: agent-name
description: Role description. Use for [specific task types].
model: opus  # Optional: opus, sonnet, haiku (defaults to parent)
---

IMPORTANT: After creating or modifying an agent, prompt the user to restart their Claude Code session. Agents are loaded at session start and won't be available until restart.

Agent Creation Workflow

Before writing the agent, gather domain knowledge and project context:

Step 1: Research Domain Best Practices

Use WebSearch to find domain-specific guidance. Search for:

  • Best practices for [domain] development
  • Common [domain] mistakes/anti-patterns
  • [Domain] code review checklist
  • [Technology] security considerations

Example searches by domain:

# Laravel backend agent
"Laravel best practices 2026"
"Laravel anti-patterns to avoid"
"Eloquent ORM performance mistakes"
"PHP security vulnerabilities OWASP"

# React frontend agent
"React component best practices 2026"
"React performance anti-patterns"
"React accessibility checklist"

# DevOps/infrastructure agent
"AWS Lambda best practices"
"Infrastructure as Code anti-patterns"
"Cloud security common mistakes"

# Database agent
"PostgreSQL query optimization"
"Database schema anti-patterns"
"SQL injection prevention"

Incorporate findings into:

  • Anti-patterns section (domain-specific mistakes)
  • Best practices (positive patterns to follow)
  • Security considerations (if applicable)
Step 2: Gather Codebase Context

Explore the project to make the agent project-specific:

  1. Read CLAUDE.md and README.md for project conventions
  2. Identify existing patterns using Glob/Grep:
    • Directory structure relevant to agent's domain
    • Existing services, controllers, models the agent will work with
    • Testing patterns and conventions
  3. Check existing agents in .claude/agents/ for:
    • Coordination protocols to follow
    • Deferral relationships to establish
    • Naming conventions

Example exploration:

bash
# Find project structure for a backend agent
Glob: "app/**/*.php"
Grep: "class.*Service"
Read: "CLAUDE.md", "README.md"

# Find existing agent patterns
Glob: ".claude/agents/*.md"
Step 3: Write the Agent

Combine research + codebase context into the agent definition:

  • Persona grounded in project specifics
  • Anti-patterns from both research AND project history
  • Project structure and commands the agent needs
  • Coordination with existing agents
Step 4: Session Restart

After writing the agent file, inform the user:

Agent created: .claude/agents/[agent-name].md

**ACTION REQUIRED:** Please restart your Claude Code session for the new agent to be available. Agents are loaded at session start.

To use the agent after restart:
- It will appear in the Task tool's available agents
- Invoke with: Task tool, subagent_type="[agent-name]"

Anatomy of an Effective Agent

1. Clear Persona Definition

The persona is the agent's DNA. A well-defined persona produces consistent behavior across interactions.

markdown
You are a [specific role] with expertise in [domains]. You specialize in [specific capabilities] for [context/project].

Good persona:

markdown
You are a senior PHP/Laravel backend developer with deep expertise in Laravel, PHP, and server-side architecture. You specialize in building robust, scalable backend systems with clean architecture and secure coding practices for the [Project Name] platform.

Bad persona:

markdown
You are a helpful assistant that can help with code.
2. Explicit Scope Boundaries

Define what the agent DOES and DOES NOT handle. Prevents scope creep and enables deferral to specialists.

markdown
## CORE COMPETENCIES
- [Domain 1]: Specific capabilities
- [Domain 2]: Specific capabilities

**Not in scope** (defer to [other-agent]):
- [Excluded domain 1]
- [Excluded domain 2]
3. Anti-Patterns Section

List specific mistakes to avoid. More effective than generic guidelines.

markdown
## Anti-Patterns to Avoid

- **N+1 query prevention** -- always eager load relationships with `with()`
- **Never use `Model::all()`** on large tables -- use pagination
- **Use `config()` not `env()`** -- never call `env()` outside config files
4. Coordination Protocols

Define how the agent coordinates with others. Essential for multi-agent workflows.

markdown
## Coordination with [Other Agent]

**When delegated work:**
1. Acknowledge the task
2. Implement following their requirements
3. Report completion with specific details

**Report format:**
- Issue/task reference
- Changes made (files, methods)
- Testing performed
- Explicit "ready for next step" statement
5. Project Context

Provide relevant project structure and conventions. Enables autonomous operation.

markdown
## PROJECT CONTEXT

### Project Structure

project/ ├── app/Controllers/ # HTTP handlers ├── app/Services/ # Business logic └── app/Models/ # Database models


### Key Commands
```bash
composer run dev       # Start development
php artisan test      # Run tests

## Agent Description Best Practices

The description field is critical for Task tool routing. Claude uses it to select the right agent.

**Format:** `[Role statement]. Use for [specific task types].`

**Good descriptions:**
```yaml
# Specific role + clear triggers
description: Senior PHP/Laravel backend developer. Use for controllers, models, services, middleware, Eloquent ORM, database migrations, API endpoints, authentication, and PHPUnit testing.

# Clear scope + deferral
description: Frontend CSS/HTML craftsman specializing in bulletproof interfaces. Use for CSS architecture, responsive design, Blade templates. Defers to laravel-backend-developer for PHP.

# Domain-specific expertise
description: AWS infrastructure engineer. Use for Cognito, RDS, Lambda, VPC, IAM, SES, SNS, Secrets Manager, EventBridge, CloudWatch, and boto3 operations.

Bad descriptions:

yaml
# Too vague
description: Helps with code

# No trigger conditions
description: A senior developer

# Process summary (causes shortcut behavior)
description: Reviews code by checking style, then logic, then tests

Model Selection

Choose the right model for the task complexity:

ModelUse WhenCost
haikuQuick, straightforward tasksLow
sonnetBalanced complexity (default)Medium
opusDeep reasoning, architecture decisionsHigh
yaml
# Example: Code simplification needs deep judgment
model: opus

# Example: Documentation generation is straightforward
model: haiku

Omit model to inherit from parent conversation.

Common Agent Patterns

Specialist Agent

Focused on a single domain with clear boundaries and deferral rules.

markdown
You are a [specialist role] focused on [specific domain].

**Your scope:**
- [Capability 1]
- [Capability 2]

**Defer to [other-agent] for:**
- [Out-of-scope area 1]
- [Out-of-scope area 2]
Orchestrator Agent

Coordinates other agents, manages workflow, doesn't do implementation.

markdown
You orchestrate [workflow type]. You delegate to specialist agents and track progress.

**You manage:**
- Task breakdown and assignment
- Progress tracking
- Integration of results

**You do NOT:**
- Write code directly
- Make implementation decisions
- Deploy without approval
Reviewer Agent

Evaluates work against criteria, provides structured feedback.

markdown
You review [artifact type] against [criteria].

**Review process:**
1. [Step 1]
2. [Step 2]
3. [Step 3]

**Output format:**
- Status: [PASS/FAIL/NEEDS_CHANGES]
- Issues: [List]
- Recommendations: [List]
Show full SKILL.md (333 more words)Show less

Testing Agents

RED: Baseline Without Agent

Run representative tasks with a generic prompt. Document:

  • What mistakes does it make?
  • What context does it lack?
  • Where does it go wrong?
GREEN: Write Minimal Agent

Address specific baseline failures:

  • Add persona for role consistency
  • Add anti-patterns for common mistakes
  • Add project context for autonomy
REFACTOR: Close Loopholes

Test edge cases:

  • Does it stay in scope?
  • Does it defer correctly?
  • Does it follow coordination protocols?

Agent Creation Checklist

Research Phase:

  • WebSearch for "[domain] best practices [current year]"
  • WebSearch for "[domain] anti-patterns" or "[domain] common mistakes"
  • WebSearch for "[technology] security considerations" (if applicable)
  • Document key findings for anti-patterns section

Context Phase:

  • Read CLAUDE.md and README.md for project conventions
  • Explore codebase structure relevant to agent's domain
  • Check existing agents in .claude/agents/ for patterns
  • Identify coordination/deferral relationships needed

RED Phase:

  • Identify the specialized task type
  • Test baseline behavior without agent
  • Document specific failures and gaps

GREEN Phase:

  • Clear persona with specific expertise AND project context
  • Explicit scope boundaries (does/doesn't)
  • Anti-patterns from BOTH research AND project experience
  • Project structure and commands included
  • Coordination protocols if multi-agent
  • Model selection appropriate for complexity

REFACTOR Phase:

  • Test on representative tasks
  • Verify scope boundaries respected
  • Verify deferral works correctly
  • Verify coordination protocols followed

Quality Checks:

  • Description under 500 chars, includes triggers
  • Persona is specific, not generic
  • Anti-patterns are actionable, not vague
  • No process summary in description

Deployment:

  • Agent file written to .claude/agents/[name].md
  • User prompted to restart session

Anti-Patterns to Avoid

Generic Persona
markdown
# BAD: Could be anyone
You are a helpful assistant.

# GOOD: Specific expertise and context
You are a senior PHP/Laravel backend developer with deep expertise in Laravel 11, PHP 8.2, and PostgreSQL for the [Project Name] platform.
Missing Scope Boundaries
markdown
# BAD: No limits
You can help with anything.

# GOOD: Clear boundaries with deferral
**Not in scope** (defer to bulletproof-frontend-developer):
- CSS, Tailwind, styling
- JavaScript, Alpine.js
- Blade template layout
Vague Anti-Patterns
markdown
# BAD: Too general
- Write good code
- Follow best practices

# GOOD: Specific and actionable
- **N+1 prevention** -- always use `with()` for relationships
- **Never use `env()`** outside config files -- use `config()` helper
Process in Description
markdown
# BAD: Claude may follow description instead of reading agent
description: Reviews code by first checking style, then logic, then tests, finally creating report

# GOOD: Just triggers, no process
description: Code quality reviewer. Use after completing features to check against standards.

The Bottom Line

Agents are autonomous specialists. They need:

  1. Clear identity - Who they are, what they know
  2. Explicit scope - What they do and don't do
  3. Actionable guidelines - Specific anti-patterns, not vague advice
  4. Coordination protocols - How they work with others

Test your agents on real tasks. A well-defined persona produces consistent, reliable behavior. A vague persona produces unpredictable results.

References

© aaddrick, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/writing-agents of aaddrick/claude-pipeline.

  • SKILL.md
  • agent-templates.md

Open the folder on GitHubat commit 402eac7

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in aaddrick/claude-pipeline, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Writing Agents next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Writing Agents compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Writing Agents this skillaaddrick/claude-pipeline1301 repos~3.3kAutomated safety check: PassMIT
Claude Code Agent Developmentanthropics/claude-plugins-official38k8 repos~2.8kAutomated safety check: PassApache-2.0
Subagent Driven DevelopmentAsvarox/allkaraoke26138 repos~1.2kAutomated safety check: PassNone
Dispatching Parallel Agentsultralisp/ultralisp25841 repos~1.5kAutomated safety check: PassNone
Paseo Advisor Second Opiniongetpaseo/paseo20k1 repos~756Automated safety check: PassCustom licence
Task Observerrebelytics/one-skill-to-rule-them-all3.2k1 repos~12kAutomated safety check: PassCC-BY-4.0

Similar skills

  • Claude Code Agent Development

    anthropics/claude-plugins-official

    Official

    Explains how to write agents for Claude Code plugins: the markdown file with YAML frontmatter, trigger descriptions, model and color settings, and system prompt design.

    38k GitHub starsUsed in 8 repos~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Subagent Driven Development

    Asvarox/allkaraoke

    A skill your agent uses when executing implementation plans with independent tasks in the current session

    261 GitHub starsUsed in 38 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • Dispatching Parallel Agents

    ultralisp/ultralisp

    A skill your agent uses when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

    258 GitHub starsUsed in 41 repos~1.5k tokens
    Agent WorkflowsAuto-check passed
  • Launches one separate agent through Paseo to give a second opinion on the current task, with a self-contained briefing and no permission to edit files.

    20k GitHub starsUsed in 1 repo~756 tokens
    Agent WorkflowsAuto-check passed
  • Task Observer

    rebelytics/one-skill-to-rule-them-all

    Monitors task execution for skill improvement opportunities.

    3.2k GitHub starsUsed in 1 repo~12k tokens
    Agent WorkflowsAuto-check passed
  • O2 Review Loop

    openobserve/openobserve

    Splits a change into planner, coder and independent reviewer roles: you confirm a spec, a subagent implements it, and a separate reviewer checks each round's local WIP commit.

    22k GitHub stars~3.7k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from aaddrick/claude-pipeline

All 12 skills in this repo
  • Adapting Claude Pipeline

    aaddrick/claude-pipeline

    A skill your agent uses when adapting the generic .claude pipeline folder to a specific codebase - adjusting skills, agents, hooks, scripts, prompts, and settings for the target project's tech stack…

    130 GitHub stars~2.8k tokensUpdated 7 mo ago
    Auto-check passed
  • A skill your agent uses when asked to create user stories from a codebase, document existing features as stories, or reverse-engineer requirements from code

    130 GitHub stars~2.2k tokensUpdated 7 mo ago
    Auto-check passed
  • Review UI

    aaddrick/claude-pipeline

    Comprehensive UI/CSS review using parallel agents. An agent skill from aaddrick/claude-pipeline.

    130 GitHub stars~2.5k tokensUpdated 7 mo ago
    Auto-check passed
  • Using Git Worktrees

    aaddrick/claude-pipeline

    A skill your agent uses when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees in .worktrees/

    130 GitHub stars~1.3k tokensUpdated 7 mo ago
    Auto-check passed
  • Implement Issue

    aaddrick/claude-pipeline

    A skill your agent uses when given a GitHub issue number and base branch to implement end-to-end

    130 GitHub starsUsed in 1 repo~889 tokens
    Auto-check passed
  • Write Docblocks

    aaddrick/claude-pipeline

    A skill your agent uses when documentation coverage is low, after composer docs:coverage shows gaps, or when asked to batch-write PHPDoc blocks across multiple files

    130 GitHub stars~956 tokensUpdated 7 mo ago
    Auto-check passed

Categories

Questions about Writing Agents

What does Writing Agents do?

A skill your agent uses when creating new agents, editing existing agents, or defining specialized subagent roles for the Task tool. Writing Agents is an agent skill from aaddrick/claude-pipeline.

When should I use Writing Agents?

Writing Agents fits situations like: creating new agents; editing existing agents; defining specialized subagent roles for the Task tool.

How do I install Writing Agents in Claude Code?

Run `npx skills add aaddrick/claude-pipeline --skill writing-agents -a claude-code`. Or copy the skill folder (.claude/skills/writing-agents in aaddrick/claude-pipeline) into .claude/skills/writing-agents in your project. Claude Code loads it when a task matches its description.

How do I install Writing Agents in Codex?

Run `npx skills add aaddrick/claude-pipeline --skill writing-agents -a codex`. Or copy the skill folder (.claude/skills/writing-agents in aaddrick/claude-pipeline) into .agents/skills/writing-agents in your project. Codex loads it when a task matches its description.

Can I use Writing Agents in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aaddrick/claude-pipeline --skill writing-agents -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/writing-agents, .gemini/skills/writing-agents, .github/skills/writing-agents and .opencode/skills/writing-agents in your project.

What does Writing Agents need to run?

Going by SKILL.md and its folder, Writing Agents needs the command-line tools its instructions call (composer and php).

Does Writing Agents access the network?

SKILL.md names 3 domains. As links in the text: prompthub.us, theagentarchitect.substack.com and datablist.com. This is read from the text; nothing was executed.

Is Writing Agents safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Writing Agents use?

Writing Agents is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Writing Agents use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Writing Agents?

Skills that share tags, products or a category with Writing Agents: Claude Code Agent Development (anthropics/claude-plugins-official, 38k stars), Subagent Driven Development (Asvarox/allkaraoke, 261 stars), Dispatching Parallel Agents (ultralisp/ultralisp, 258 stars) and Paseo Advisor Second Opinion (getpaseo/paseo, 20k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Writing Agents?

aaddrick (a GitHub user) maintains it in aaddrick/claude-pipeline, which has 130 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on February 25, 2026.

Source: aaddrick/claude-pipeline on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.