All skills
aktsmm avatar

/agentic-workflow-guide

@fb34748
by yamapanaktsmm/agent-skills26 stars
4

Design, review, and debug agent workflows, and decide when a request should use a prompt, instruction, skill, agent, or hook before escalating to multi-agent design. Use for .agent.md / .instructions.md / .prompt.md / AGENTS.md work, workflow architecture, orchestration planning, scheduled automation model allocation, or when agent workflows may be overkill. Triggers on 'agent workflow', 'create agent', 'automation models', 'ワークフロー設計', 'orchestrator'.

Use this Skill: https://skilld.dev/gh/aktsmm/agent-skills/agentic-workflow-guide

This session only. Nothing lands on disk.

referenceshandoffs-guide.md

≈3.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Handoffs Guide

Guided sequential workflows with human-in-the-loop control between agents.

Table of Contents

VS Code Version: Handoffs are available in VS Code 1.106+ (January 2026)


What are Handoffs?

Handoffs enable guided sequential workflows that transition between agents with suggested next steps. After a chat response completes, handoff buttons appear that let users move to the next agent with relevant context and a pre-filled prompt.

Key Characteristics

Aspect Description
User Control Human approves each transition (button click)
Context Passing Relevant context passed via pre-filled prompt
Visibility User can review/edit prompt before submitting
Auto-submit Optional: send: true for automatic execution

Visual Flow

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   Plan Agent    │     │ Implementation   │     │  Review Agent   │
│                 │     │     Agent        │     │                 │
│  📋 Generate    │ ──► │  🔨 Execute      │ ──► │  ✅ Verify      │
│     plan        │     │     code changes │     │     quality     │
└─────────────────┘     └──────────────────┘     └─────────────────┘
         │                       │                       │
         ▼                       ▼                       ▼
   [Start Implementation]  [Start Review]          [Done]
        button                button

When to Use

✅ Effective Scenarios

Scenario Example
Plan → Implement → Review TDD workflow, feature development
Research → Write Gather info, then produce document
Analyze → Fix Identify issues, then apply fixes
Write Tests → Implement TDD: failing tests first, then code
Draft → Edit → Publish Content creation workflow

❌ When NOT to Use

Scenario Use Instead
Automated background tasks agent (no human approval)
Parallel processing Parallelization pattern
Context isolation needed agent (clean context)
Simple single-step tasks Single agent

Configuration

YAML Syntax

---
name: <agent-name>
description: <description>
tools: [...]
handoffs:
  - label: <button-text>
    agent: <target-agent-name>
    prompt: <pre-filled-prompt>
    send: <true|false>
---

Properties

Property Required Type Description
label ✅ string Button text displayed to user
agent ✅ string Target agent identifier (filename without .md)
prompt ❌ string Pre-filled prompt for target agent
send ❌ boolean Auto-submit prompt (default: false)

Complete Example

---
name: Planner
description: Generate implementation plans for features
tools: ['textSearch', 'fetch', 'readFile']
handoffs:
  - label: Start Implementation
    agent: implementer
    prompt: |
      Implement the plan outlined above.
      Follow the step-by-step instructions.
    send: false
  - label: Request Review
    agent: reviewer
    prompt: Review the plan for completeness.
    send: false
---

# Planner Agent

## Role

Generate detailed implementation plans for new features.

## Goals

- Analyze requirements
- Break down into actionable steps
- Define acceptance criteria

## Done Criteria

- [ ] Plan document created
- [ ] Steps are specific and actionable
- [ ] Acceptance criteria defined

## Workflow

1. Analyze the feature request
2. Research existing codebase patterns
3. Create step-by-step implementation plan
4. Define test cases and acceptance criteria

Workflow Examples

Example 1: TDD Workflow

┌─────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│  Test Writer    │ ──► │   Implementer    │ ──► │    Reviewer     │
│                 │     │                  │     │                 │
│ Write failing   │     │ Make tests pass  │     │ Check quality   │
│ tests first     │     │                  │     │                 │
└─────────────────┘     └──────────────────┘     └─────────────────┘

test-writer.agent.md:

---
name: test-writer
description: Write failing tests first (TDD)
tools: ["readFile", "edit/editFiles", "execute/runInTerminal"]
handoffs:
  - label: Make Tests Pass
    agent: implementer
    prompt: Implement the code to make the failing tests pass.
    send: false
---

implementer.agent.md:

---
name: implementer
description: Implement code to pass tests
tools: ["readFile", "edit/editFiles", "execute/runInTerminal"]
handoffs:
  - label: Request Code Review
    agent: reviewer
    prompt: Review the implementation for quality and best practices.
    send: false
---

Example 2: Research → Document

---
name: researcher
description: Research a topic thoroughly
tools: ["web/fetch", "textSearch", "readFile"]
handoffs:
  - label: Write Document
    agent: writer
    prompt: |
      Based on the research above, write a comprehensive document.
      Include all key findings and recommendations.
    send: false
---

Example 3: Multi-Path Handoffs

Single agent with multiple possible next steps:

---
name: analyzer
description: Analyze issues and suggest next steps
tools: ["readFile", "textSearch", "problems"]
handoffs:
  - label: Fix Issues
    agent: fixer
    prompt: Fix the issues identified above.
    send: false
  - label: Create PR
    agent: pr-creator
    prompt: Create a PR with the analysis summary.
    send: false
  - label: Get More Info
    agent: researcher
    prompt: Research the root cause of these issues.
    send: false
---

Handoffs vs agent

Feature Handoffs agent
Execution User clicks button Automatic
Context Shared via prompt Isolated (clean window)
User Control ✅ Human-in-the-loop ❌ Automatic
Visibility User sees/edits prompt Results only
Use Case Phase transitions Context-heavy tasks
Nesting ✅ Sequential chain ❌ No nesting allowed

Decision Matrix

Need Use Handoffs Use agent
Human approval between phases ✅
Automatic execution ✅
Context isolation ✅
Sequential workflow orchestration ✅
Log/data analysis (large data) ✅
Plan → Implement → Review workflow ✅
Research during implementation ✅

Best Practices

1. Clear Prompt Context

❌ Bad:

handoffs:
  - label: Next
    agent: implementer
    prompt: Continue.

✅ Good:

handoffs:
  - label: Start Implementation
    agent: implementer
    prompt: |
      Implement the plan outlined above.
      Follow these steps:
      1. Create the new file structure
      2. Implement core logic
      3. Add tests for each function

2. Descriptive Labels

❌ Bad: label: Next, label: Go

✅ Good: label: Start Implementation, label: Request Code Review

3. Use send: false by Default

Let users review and modify prompts before submitting. Use send: true only for well-tested, predictable workflows.

4. Define Clear Phase Boundaries

Each agent should have distinct responsibility:

  • Planner: Creates plan only, no implementation
  • Implementer: Executes plan, no review
  • Reviewer: Reviews only, no fixing

5. Include Context References

Reference what was done in current phase:

prompt: |
  Review the implementation above.
  Focus on:
  - Adherence to the original plan
  - Code quality and best practices
  - Test coverage

Troubleshooting

Handoff Button Not Appearing

Causes:

  1. handoffs not in YAML frontmatter
  2. Target agent file doesn't exist
  3. VS Code version < 1.106

Solution:

# Check VS Code version
code --version

# Verify target agent exists
ls .github/agents/implementer.agent.md

Wrong Agent Invoked

Cause: Agent name mismatch

Solution: Ensure agent: matches the target agent's filename (without .agent.md):

File: .github/agents/implementer.agent.md
Agent name in handoffs: agent: implementer  ✅

Prompt Too Long

Cause: Large prompt causes UI issues

Solution: Keep prompts concise; reference previous output instead of duplicating:

prompt: |
  Implement based on the plan above.
  See the requirements in the previous response.

References


Context-Based Handoff (No agent tool)

Not all agent-to-agent communication uses agent. Some patterns use chat context for data passing.

When to Use Context-Based Handoff

Scenario Method Reason
Router → Orchestrator Chat context Router makes decisions, doesn't spawn workers
Same-level coordination Chat context Agents share conversation, not parent-child
Decision passing JSON in context Structured data without sub-agent overhead

Implementation Pattern

## Router Agent (Decision Maker)

- Makes routing decision
- Outputs RouterDecision JSON to chat context
- Does NOT use agent

## Orchestrator Agent (Executor)

- Receives RouterDecision from chat context (NOT as agent input)
- Uses agent for actual worker delegation
- Logs decision to .logs/ for traceability

RouterDecision JSON Example

{
  "flow": "full_ir",
  "normalized_question": "...",
  "manifest": { "applied": true, "name": "..." },
  "decision_reason": "...",
  "timestamp": "ISO8601"
}

Key Distinction

Handoff Type Tool Used Parent-Child? Use Case
agent agent / Task Yes Worker delegation
Context-based None (chat) No Decision passing, coordination

Source: SKILL.md on GitHub

2 warnings4mo4 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    This skill is a professional development toolkit for designing, reviewing, and managing AI agent workflows. It provides structured templates, architectural guidance, and utility scripts to help users build efficient multi-agent systems following best practices like Single Responsibility and Single Source of Truth.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    15/58 files flagged

Signed by skilld at fb34748. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 14 hours ago.

Activeupdated last week
user-invocable
true
metadata
{
  "author": "yamapan (https://github.com/aktsmm)"
}
Other metadata
argument-hint
作りたい .agent.md / .instructions.md / .prompt.md / AGENTS.md、設計したい workflow、または困っている症状

README badge

README badge for aktsmm/agent-skills/agentic-workflow-guide