#601

Global Rank · of 601 Skills

agent-patterns AI Agent Skill

View Source: oakoss/agent-skills

Medium

Installation

npx skills add oakoss/agent-skills --skill agent-patterns

38

Installs

Agent Patterns

Multi-agent design, delegation, and orchestration in Claude Code and AI-assisted development. Default to fungible agents for large-scale software dev; use specialized agents only for peer review or discourse-based workflows.

Subagents in Claude Code are specialized AI assistants that run in isolated context windows with custom system prompts, specific tool access, and independent permissions. They preserve main conversation context by keeping exploration, test runs, and verbose operations out of the primary thread.

Key constraint: subagents cannot spawn other subagents. Multi-step orchestration requires chaining subagents from the main conversation.

Quick Reference

Pattern Description When to Use
Fungible swarm Identical agents pick tasks from a shared board Large-scale software dev, resilient systems
Sequential pipeline Each agent builds on previous output Multi-step workflows with clear dependencies
Hierarchical Manager decomposes, workers execute in parallel Complex tasks with independent subtasks
Peer collaboration Agents iterate until consensus Code review, quality-critical outputs
Orchestrator delegation Main conversation chains subagents Multi-phase workflows, parallel specialists
Two-stage review Spec compliance check, then code quality check High-stakes code, complex requirements
Question-first delegation Agent asks clarifying questions before proceeding Ambiguous tasks, expensive-to-redo work
Review loop enforcement Fix-review cycle with max iteration escalation Any review workflow needing convergence
Built-in Subagent Model Tools Purpose
Explore Haiku Read-only File discovery, code search, codebase exploration
Plan Inherits Read-only Codebase research during plan mode
General-purpose Inherits All tools Complex research, multi-step operations
Bash Inherits Terminal Running terminal commands in separate context
Claude Code Guide Haiku Read-only Answering questions about Claude Code features
Configuration Value
Custom agent location .claude/agents/*.md (project), ~/.claude/agents/*.md (user)
CLI agents --agents '{...}' (session only, JSON format)
Plugin agents Plugin agents/ directory (lowest priority)
Required fields name, description
Optional fields tools, disallowedTools, model, permissionMode, skills, hooks, color
Model values sonnet, opus, haiku, inherit (default)
Permission modes default, acceptEdits, dontAsk, bypassPermissions, plan
Nesting limit Subagents cannot spawn other subagents (one level only)
Foreground vs background Foreground blocks main conversation; background runs concurrently
Batch size 5-8 items per agent (standard tasks)
Parallel agents 2-4 simultaneously

When to Use Subagents vs Main Conversation

Use Subagents When Use Main Conversation When
Task produces verbose output (test suites, logs, API responses) Task needs frequent back-and-forth or iterative refinement
Enforcing specific tool restrictions or permissions Multiple phases share significant context
Work is self-contained and can return a summary Making a quick, targeted change
Parallel independent research paths Latency matters (subagents start fresh and gather context)

Tool Access Patterns

Agent Role Recommended Tools Rationale
Read-only reviewer Read, Grep, Glob Cannot modify code; safe for audits
File creator Read, Write, Edit, Glob, Grep NO Bash; avoids heredoc approval spam
Script runner Read, Write, Edit, Glob, Grep, Bash Full access for build/deploy tasks
Research agent Read, Grep, Glob, WebFetch, WebSearch External data access for documentation lookup

Subagents inherit all tools by default (including MCP tools). Use tools as an allowlist or disallowedTools as a denylist to restrict access. MCP tools are not available in background subagents.

Common Mistakes

Mistake Correct Pattern
Expecting subagents to spawn sub-subagents Subagents cannot nest; chain subagents from the main conversation instead
Giving Bash tool to agents that only create files Use Write and Edit tools only; Bash causes approval spam from heredoc usage
Omitting disallowedTools for sensitive operations Use disallowedTools to explicitly deny dangerous tools even when inheriting
Spawning too many agents (5+) for a small task Start with 2-3 agents; coordination overhead outweighs benefit at higher counts
Burying critical instructions past line 300 of agent prompt Put critical rules immediately after frontmatter; models deprioritize late instructions
Using specialized agents for large-scale software dev Use fungible agents with a shared task board; specialized agents create single points of failure
Not including "FIX issues found" in delegation prompts Without explicit action directive, agents only report problems without making changes
Setting model to Haiku for content generation Default to Sonnet; Haiku only for script execution, fast lookups, or pass/fail checks
Not writing clear descriptions for custom agents Claude uses the description field to decide when to auto-delegate; vague descriptions prevent delegation
Using MCP tools in background subagents MCP tools are not available in background subagents; run in foreground instead
Not preloading skills into subagents Subagents do not inherit skills from the parent; list them explicitly in the skills field

Delegation

  • Explore codebase before designing agent prompts: Claude auto-delegates to the built-in Explore subagent (Haiku, read-only) for file discovery and code search; supports quick, medium, and very thorough modes
  • Plan multi-agent architecture for complex projects: Use plan mode; Claude delegates research to the Plan subagent before presenting a plan
  • Execute batch operations across many files: Chain General-purpose subagents from the main conversation with identical prompts and non-overlapping item lists
  • Isolate high-volume operations: Delegate test runs, log processing, or doc fetching to subagents to keep verbose output out of your main context
  • Run parallel research: Spawn multiple subagents simultaneously for independent investigations; Claude synthesizes findings when all complete
  • Resume interrupted work: Ask Claude to continue a previous subagent; resumed agents retain full conversation history including tool calls and reasoning

For project-level workflow sequencing, phase-gate validation, goal decomposition, and capability scoring, use the orchestration skill.

References

Installs

Installs 38
Global Rank #601 of 601

Security Audit

ath Safe
socket Safe
Alerts: 0 Score: 90
snyk Medium
EU EU-Hosted Inference API

Power your AI Agents with the best open-source models.

Drop-in OpenAI-compatible API. No data leaves Europe.

Explore Inference API

GLM

GLM 5

$1.00 / $3.20

per M tokens

Kimi

Kimi K2.5

$0.60 / $2.80

per M tokens

MiniMax

MiniMax M2.5

$0.30 / $1.20

per M tokens

Qwen

Qwen3.5 122B

$0.40 / $3.00

per M tokens

How to use this skill

1

Install agent-patterns by running npx skills add oakoss/agent-skills --skill agent-patterns in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.

2

No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.

3

The skill enhances your agent's understanding of agent-patterns, helping it follow established patterns, avoid common mistakes, and produce production-ready output.

What you get

Skills are plain-text instruction files — not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.

Compatibility

This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level — the content inside determines which language or framework it applies to.

Data sourced from the skills.sh registry and GitHub. Install counts and security audits are updated regularly.

EU Made in Europe

Chat with 100+ AI Models in one App.

Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.

Customer Support