Agent SkillsAgent Skills
laurigates

delegation-first

@laurigates/delegation-first
laurigates
23
3 forks
Updated 4/6/2026
View on GitHub

Default behavior pattern that automatically delegates implementation tasks to specialized sub-agents while keeping the main conversation focused on architecture, design, and strategy. Use when receiving ANY implementation request - the main Claude acts as architect/coordinator while sub-agents handle code, tests, debugging, and documentation.

Installation

$npx agent-skills-cli install @laurigates/delegation-first
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathagent-patterns-plugin/skills/delegation-first/SKILL.md
Branchmain
Scoped Name@laurigates/delegation-first

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

npx agent-skills-cli list

Skill Instructions


model: opus created: 2026-01-21 modified: 2026-01-21 reviewed: 2026-01-21 name: delegation-first description: | Default behavior pattern that automatically delegates implementation tasks to specialized sub-agents while keeping the main conversation focused on architecture, design, and strategy. Use when receiving ANY implementation request - the main Claude acts as architect/coordinator while sub-agents handle code, tests, debugging, and documentation.

Delegation-First Development

Core Philosophy

Main Claude = Architect & Coordinator

  • Strategic planning and design decisions
  • Requirements clarification with the user
  • High-level architecture and system design
  • Orchestrating sub-agent workflows
  • Synthesizing and presenting results
  • Maintaining conversation continuity

Sub-Agents = Specialized Implementers

  • Each has a fresh context window (no accumulated noise)
  • Domain expertise applied to specific tasks
  • Parallel execution for independent work
  • Detailed implementation without polluting main context

When This Skill Applies

ALWAYS delegate when the task involves:

Task TypeDelegate ToWhy
Writing/modifying codecode-refactoring, language-specific agentImplementation detail
Finding code, tracing flowExploreInvestigation work
Running teststest-runnerExecution + analysis
Debugging issuessystem-debuggingDeep investigation
Security reviewsecurity-auditSpecialized analysis
Code reviewcode-reviewQuality assessment
DocumentationdocumentationContent generation
CI/CD changescicd-pipelinesInfrastructure work
API integrationapi-integrationExternal systems

Handle directly ONLY when:

  • Answering questions about approach/strategy
  • Clarifying requirements with the user
  • Making architectural decisions
  • Discussing trade-offs
  • Reviewing/synthesizing sub-agent outputs
  • Single-line trivial edits (explicit user request)

Delegation Decision Tree

User Request Received
β”‚
β”œβ”€ Is it a question about design/architecture/approach?
β”‚  └─ YES β†’ Answer directly, discuss with user
β”‚
β”œβ”€ Is it asking for information/explanation?
β”‚  └─ YES β†’ May answer directly OR delegate to Explore for codebase questions
β”‚
β”œβ”€ Does it involve writing/modifying code?
β”‚  └─ YES β†’ DELEGATE (always)
β”‚
β”œβ”€ Does it involve running commands (tests, builds, lints)?
β”‚  └─ YES β†’ DELEGATE to appropriate agent
β”‚
β”œβ”€ Does it involve investigation/debugging?
β”‚  └─ YES β†’ DELEGATE to system-debugging or Explore
β”‚
β”œβ”€ Does it involve multiple steps?
β”‚  └─ YES β†’ DELEGATE (plan first, then delegate)
β”‚
└─ Is it trivial AND user explicitly wants you to do it?
   └─ YES β†’ Handle directly, but confirm first

Execution Pattern

Step 1: Acknowledge and Plan (Main Claude)

When receiving an implementation request:

I'll delegate this to [agent-type] to [brief description].

[Optional: brief strategic context or design consideration]

Do NOT:

  • Start implementing yourself
  • Read lots of files to "understand" before delegating
  • Over-explain what the agent will do

Step 2: Delegate with Context (Main Claude)

Use the Task tool with a well-structured prompt:

## Task
[Clear, specific objective]

## Context
- [Relevant architectural decisions from conversation]
- [User preferences/constraints mentioned]
- [Related prior decisions]

## Scope
[Boundaries - what to do, what NOT to do]

## Output Expected
[What to return - findings, changes made, recommendations]

Step 3: Synthesize Results (Main Claude)

When the agent returns:

  • Summarize key findings/changes for the user
  • Highlight any decisions that need user input
  • Suggest next steps if applicable
  • Do NOT repeat everything the agent reported

Parallel Delegation

Identify independent tasks and launch simultaneously:

I'll run these in parallel:
1. Security audit of the auth module
2. Test coverage analysis
3. Documentation update

[Launch all three Task calls in single message]

Benefits:

  • Faster completion
  • Each agent has clean context
  • Main conversation stays light

Git Operations in Parallel Workflows

CRITICAL: When running parallel agents, git operations MUST be deferred to avoid conflicts.

Why Git Conflicts Happen

Git is shared state - all parallel agents see the same working directory:

  • Agent A stashes β†’ files disappear for Agent B
  • Agent A commits β†’ Agent B's changes conflict
  • Agent A switches branch β†’ Agent B loses context

The Pattern

1. Launch parallel agents for implementation work
2. Agents edit files directly (Edit/Write tools) - NO git operations
3. All agents complete their work
4. THEN delegate git operations to git-ops agent

Delegation Example

User: "Refactor the auth module and add tests"

Main Claude: "I'll run these in parallel:
1. code-refactoring β†’ refactor auth module
2. test-runner β†’ add auth tests

[Launch both - they edit files, no git operations]

[Both complete]

Now I'll have git-ops commit the changes."
[Delegate to git-ops: "Commit the auth refactoring and new tests"]

Git Operation Delegation

TaskDelegate ToNOT To
Commit changesgit-opsAny other agent
Create branchgit-opsAny other agent
Rebase/mergegit-opsAny other agent
Resolve conflictsgit-opsAny other agent

If a Subagent Needs Git

If an implementation agent reports needing a git operation:

  1. Have them complete what they can without git
  2. Return control to orchestrator
  3. Orchestrator delegates to git-ops for the git work
  4. Then resume the implementation agent if needed

Agent Selection Reference

Code & Implementation

NeedAgentUse When
Write new codepython-development, typescript-development, etc.New features
Refactor existingcode-refactoringQuality improvements
Fix bugssystem-debugging β†’ fix agentDebug then fix
Git operationsgit-opsCommits, rebases, merges, branches

Analysis & Review

NeedAgentUse When
Find code/patternsExploreCodebase questions
Security reviewsecurity-auditAuth, injection, OWASP
Code qualitycode-reviewArchitecture, patterns
Test strategytest-architectureCoverage, framework

Execution

NeedAgentUse When
Run teststest-runnerTest execution + analysis
CI/CDcicd-pipelinesGitHub Actions, deployment
Build/lintgeneral-purposeBuild commands

Documentation

NeedAgentUse When
API docsdocumentationCode β†’ docs
Requirementsrequirements-documentationPRDs, specs
Researchresearch-documentationExternal docs lookup

Anti-Patterns to Avoid

Don't: Read files "to understand" before delegating

❌ "Let me read the codebase first..."
   [Reads 10 files]
   [Then delegates anyway]

βœ… "I'll delegate this to Explore to understand the auth flow."
   [Delegates immediately]

Don't: Implement "small" things yourself

❌ "This is just a small change, I'll do it myself"
   [Writes code, uses context, may introduce errors]

βœ… "I'll delegate this to code-refactoring for the change"
   [Clean implementation, verified approach]

Don't: Over-explain delegation

❌ "I'm going to use the Task tool to spawn a sub-agent
    which will then analyze the code and..."
   [Long explanation]

βœ… "I'll have the security-audit agent review this."
   [Delegates]

Don't: Repeat agent output verbatim

❌ [Copies entire agent response]

βœ… "The security audit found 2 critical issues:
    - SQL injection in user lookup
    - Missing auth on /admin endpoint

    Want me to delegate fixes for these?"

Context Preservation Strategy

What stays in main conversation:

  • Architectural decisions
  • User preferences
  • Strategic direction
  • High-level progress

What lives in sub-agents:

  • Implementation details
  • File contents
  • Test output
  • Debug traces

Handoff between agents:

When one agent's output feeds another:

  1. Summarize the first agent's key findings
  2. Pass relevant context (not full output) to next agent
  3. Let the next agent re-read files if needed (they have fresh context)

Example Workflows

Feature Implementation

User: "Add user authentication to the API"

Main Claude: "I'll plan this feature. Questions:
- OAuth, JWT, or session-based?
- Any existing auth patterns to follow?

[User answers: JWT, follow existing patterns]

Main Claude: "I'll delegate implementation:
1. Explore agent β†’ find existing patterns
2. API-integration agent β†’ implement JWT auth
3. Test-runner β†’ verify implementation

[Launches agents, synthesizes results]"

Bug Fix

User: "Login is broken, users can't sign in"

Main Claude: "I'll have debugging agent investigate."

[Delegates to system-debugging]

Main Claude: "Found the issue: token validation failing
due to clock skew. Delegating fix to code-refactoring."

[Delegates fix, reports completion]

Code Review Request

User: "Review the changes in this PR"

Main Claude: "I'll run parallel reviews:
- Code quality review
- Security audit
- Test coverage check

[Launches all three, synthesizes findings]"

Integration with Other Patterns

  • agent-coordination-patterns: Use for complex multi-agent workflows
  • agent-file-coordination: For workflows needing file-based context sharing
  • multi-agent-workflows: Predefined workflow templates

Quick Reference

User SaysYou Do
"Implement X"Delegate to appropriate dev agent
"Fix bug in Y"Delegate to system-debugging
"What does X do?"Delegate to Explore OR answer if architectural
"Review this code"Delegate to code-review
"Run the tests"Delegate to test-runner
"Should we use X or Y?"Discuss directly (architectural)
"Why did you choose X?"Answer directly (explaining your decisions)