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.

referencessplitting-criteria.md

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

Splitting Criteria

Guide for deciding when to escalate complexity (Prompt → Agent → Multi-Agent) and when to split into sub-agents.

Key Principle: See design-principles.md > Simplicity First for Anthropic's recommendation.

Evidence Levels

Icon Meaning
✅ Official source (Anthropic, OpenAI)
⚠️ Indirect evidence / best practice
📊 Community-verified (empirical)

Note on Thresholds: Specific numeric thresholds (50 lines, 70%, etc.) are practical guidelines derived from community experience. Adjust based on your project needs. See Part 5 for customization.


Part 1: Escalation Ladder

When a simple approach isn't working, escalate to the next level.

Primitive Gate

Before escalating into agent design, confirm that the ask is not better served by another primitive.

If the need is... Prefer...
One slash-invoked task Prompt
Always-on guidance Instruction
Reusable packaged workflow Skill
Persona or delegation Agent
Deterministic enforcement Hook

Only continue with the ladder below if an Agent is truly required.

Levels

Level Configuration When to Use Escalation Triggers (Observable Signals) Evidence
L0 Single Prompt Simple Q&A, single response completes task Same request retried 3+ times, output format unstable ⚠️
L1 Prompt + Instructions Repeated use, consistency needed Steps > 5, complex branching, repeated "missed" or "overlooked" errors ⚠️
L2 Single Agent Dynamic decisions, tool use required Multiple responsibilities, context > 70%, phase transitions needed ✅ [^1]
L3 Multi-Agent Complex workflows, parallel processing Independent subtasks, context isolation required ✅ [^2]

Context Rot: Research shows LLM performance degrades as context length increases, even on simple tasks. This supports the "context > 70%" threshold as a safety margin. [^3]

Observable Escalation Signals

L0 → L1 (Add Instructions)

  • Same request retried 3+ times with different phrasing
  • Output format varies between runs
  • Need to repeat the same constraints every time

L1 → L2 (Create Agent)

  • Agent says "I missed that" or "I overlooked" something
  • Later instructions in long prompts are ignored
  • Need dynamic tool selection based on input
  • Steps exceed 5-7 and require conditional branching
  • User frequently needs to correct/redirect mid-task

L2 → L3 (Multi-Agent)

  • Single agent context exceeds 70%
  • Multiple independent responsibilities that could run in parallel
  • Detailed exploration pollutes main task context
  • Clear phase boundaries (Plan → Implement → Review)

Decision Flowchart

Task received
│
├─ Single LLM call sufficient?
│   ├─ YES → L0: Single Prompt
│   └─ NO ↓
│
├─ Repeated use / consistency needed?
│   ├─ NO → L0: Single Prompt
│   └─ YES ↓
│
├─ Steps ≤ 5 AND no complex branching?
│   ├─ YES → L1: Prompt + Instructions
│   └─ NO ↓
│
├─ Dynamic decisions / tool use needed?
│   ├─ NO → L1: Prompt + Instructions
│   └─ YES ↓
│
├─ Single responsibility AND context < 70%?
│   ├─ YES → L2: Single Agent
│   └─ NO → L3: Multi-Agent

Part 2: Sub-agent Splitting Criteria

Once at L2/L3, use these criteria to decide sub-agent boundaries.

Quantitative Triggers

Metric Threshold Action Evidence
Prompt line count > 50 lines Consider splitting ⚠️
Step count > 5-7 sequential steps Consider phase splitting ⚠️
Context usage > 70% Mandatory: use sub-agents or compaction ⚠️ [^3]
Session duration > 30 min Selective sub-agent use ⚠️
Session duration > 2 hours Sub-agents mandatory ⚠️
Files to process > 3-5 files File-per-subagent pattern 📊 [^4]
Tool calls expected > 15-20 calls Consider task splitting ✅ [^2]
Subtask count Dynamic/unknown Orchestrator-Workers pattern ✅ [^1]

Qualitative Triggers

Signal Description Recommended Action
Responsibility overlap One prompt has multiple independent responsibilities Split by SRP
Context pollution Detailed exploration pollutes main task Isolate in sub-agent
Parallelizable Tasks can run independently Parallelization or Orchestrator-Workers
Phase transitions Clear Plan → Implement → Review flow Use Handoffs
Quality loop needed "Until good enough" iteration required Evaluator-Optimizer
Dynamic task count Subtask count depends on input Orchestrator-Workers
Input branching Processing varies by input type Routing

Complexity Scaling ✅

Source: Anthropic Multi-Agent Research System [^2]

Query Complexity Sub-agent Count Tool Calls per Agent
Simple fact check 1 3-10
Direct comparison 2-4 10-15 each
Complex research 10+ Clear responsibility split

Part 3: Quick Split Check

5-Item Checklist

Run this check when creating or reviewing prompts/agents:

## Quick Split Check

- [ ] Does this need an agent at all?
- [ ] Prompt > 50 lines of instructions?
- [ ] More than 5-7 sequential steps?
- [ ] Multiple independent responsibilities? (SRP violation)
- [ ] Expected context usage > 70%?
- [ ] Quality loop ("until good enough") needed?

→ If the first item is **NO**, use a simpler primitive
→ Otherwise, **Any YES = Consider splitting** (See Part 2 for pattern selection)
→ **2+ YES = Splitting recommended**
→ **3+ YES = Splitting mandatory**

Pattern Selection Guide

Condition Recommended Pattern
Tasks have clear ordering Prompt Chaining
Tasks are independent Parallelization
Number of tasks is dynamic Orchestrator-Workers
Repeat until quality criteria met Evaluator-Optimizer
Processing varies by input type Routing

Part 4: When NOT to Split

Sub-agents have overhead. Avoid when: ✅ [^1] 📊 [^4]

Empirical Data: Sub-agent overhead can be significant. In one test, sub-agents reduced main session tokens by 70% but increased total tokens by 2.4x and execution time by 6.6x. [^4]

Scenario Reason Alternative
Single file, short task Overhead > benefit Direct processing
Simple Q&A Overkill L0 prompt
Need follow-up conversation Sub-agents are stateless Keep in main context
Context accumulation needed Previous details lost in sub-agent return Single agent with compaction
Task < 5 min expected Setup overhead dominates Direct processing

Splitting Decision Matrix

Condition Use Sub-agent? Reason
Single file, < 5 min ❌ Overhead > benefit
Multiple files, > 30 min ✅ Context isolation value
Research + Implement + Review ✅ Phase separation
Simple Q&A ❌ Single call sufficient
Log analysis (1000+ lines) ✅ Return only conclusions
Dynamic subtask discovery ✅ Orchestrator-Workers

Part 5: Customizing Thresholds

Default thresholds can be overridden in .github/copilot-instructions.md:

## Splitting Criteria Overrides

<!-- Customize thresholds for this project -->

| Metric                       | Default | Project Override |
| ---------------------------- | ------- | ---------------- |
| Prompt line threshold        | 50      | 80               |
| Step count threshold         | 5-7     | 10               |
| Context usage threshold      | 70%     | 60%              |
| Session duration (selective) | 30 min  | 45 min           |

References

Official Sources

[^1]: Building Effective Agents - Anthropic — 5 workflow patterns, when to use agents

[^2]: How We Built Our Multi-Agent Research System - Anthropic — Complexity scaling, sub-agent counts

[^3]: Context Rot - Chroma Research — LLM performance degrades with context length

Community / Empirical

[^4]: GitHub Copilot Chat サブエージェント検証 - Zenn — Overhead measurements

Internal References

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 yesterday.

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