本文へ移動
cccskills
無料GitHub で公開

agentic-patterns

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md12.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

/agentic-patterns — Fundamentals of Effective Agent Behavior

You are teaching effective agentic patterns. These are model-agnostic principles — they work for Claude, GPT, Gemini, or any LLM acting as an agent. The goal: agents that decompose well, use tools precisely, recover from errors, manage their context budget, assess their own quality, and know when to stop.


When to Use

Use for:

  • Designing the control flow of a multi-step agent
  • Choosing between sequential, parallel, and hierarchical agent architectures
  • Implementing error recovery and graceful degradation
  • Managing context window budget across long agent runs
  • Building quality self-assessment into agent outputs
  • Deciding when an agent should halt vs continue

NOT for:

  • Building agent infrastructure or frameworks (use agent-creator)
  • Designing DAG topologies (use windags-architect)
  • Implementing specific tools (use the domain-specific skill)
  • Prompt optimization (use prompt-engineer)

The Five Pillars

Every effective agent embodies five capabilities:

1. DECOMPOSE  — Break the problem into steps before acting
2. ORCHESTRATE — Choose and sequence tools with purpose
3. RECOVER    — Handle failures without catastrophe
4. MANAGE     — Spend context tokens like a budget
5. ASSESS     — Know how well you did, and when to stop

Pillar 1: Decomposition

The Rule of Three Passes

Before acting, make three passes over the task:

Pass 1 — Scope: What does "done" look like? Define the exit condition first.

Pass 2 — Subtasks: What are the 3-7 concrete steps to reach "done"? Each step should be achievable with a single tool call or a small chain of tool calls.

Pass 3 — Dependencies: Which steps depend on which? Independent steps can parallelize. Dependent steps must serialize.

Decomposition Anti-Patterns

Anti-PatternWhy It FailsFix
Acting before decomposingWasted tool calls, wrong directionAlways plan first, even briefly
One giant subtaskNo parallelism, no checkpointsSplit until each subtask is one tool call
20+ subtasksCognitive overhead, lost contextMerge related steps, aim for 3-7
No exit conditionAgent runs foreverDefine "done" before starting
Static planCan't adapt to discoveriesReplan after each wave of results

When to Re-Decompose

Replan when:

  • A tool call returns unexpected results
  • You discover the problem is different from what you assumed
  • A dependency fails and the downstream plan is invalid
  • You're 50% through and confidence in the remaining plan drops below 0.5

Pillar 2: Tool Orchestration

The Minimum Tool Principle

Use the fewest tools with the narrowest scope to accomplish each subtask. Every tool call has costs:

  • Tokens consumed (input + output)
  • Latency added
  • Error surface increased
  • Context budget spent

Wrong: Read 20 files to understand a codebase. Right: Grep for the specific symbol, read the 2-3 files that contain it.

Tool Selection Heuristics

NeedPreferred ToolWhy
Find a file by nameGlobDirect pattern match, no content scanning
Find content in filesGrepTargeted search, returns locations
Understand a specific fileReadFull context for one file
Understand a codebaseTask (explore agent)Delegates exploration, protects context
Make a small changeEditMinimal diff, preserves surrounding code
Create something newWriteFresh file, no edit conflicts
Run a commandBashSystem interaction, build/test
Complex sub-problemTask (subagent)Isolates context, parallelizable

Sequential vs Parallel

Sequential (use when outputs feed into inputs):

Read file → understand structure → Edit specific section → Run tests

Parallel (use when tasks are independent):

[Grep for pattern A] + [Grep for pattern B] + [Read config file]
→ all complete → synthesize findings

Rule: If two tool calls don't share data, run them in parallel. If one needs the other's output, serialize them.

The Subagent Decision

Spawn a subagent (Task tool) when:

  • The sub-problem would consume >30% of your remaining context
  • The work is independent and can be described in one paragraph
  • You need to explore broadly (many files, web search) without polluting your context
  • The sub-problem maps to a known skill (code review, testing, research)

Do NOT spawn a subagent when:

  • The task is a single tool call
  • You need the result immediately for your next sentence
  • The overhead of describing the task exceeds the overhead of doing it

Pillar 3: Error Recovery

The Recovery Ladder

When a tool call fails, escalate through four levels:

Level 1 — Retry with adjustment: Fix the obvious issue (typo, wrong path, missing arg) and retry once.

Level 2 — Alternative approach: Use a different tool or strategy to achieve the same goal. If Edit fails, try a different Edit. If Grep finds nothing, try Glob with a different pattern.

Level 3 — Reduce scope: If the full task can't be completed, identify the largest subset that can. Deliver partial results with a clear note about what's missing.

Level 4 — Escalate to user: If you've tried levels 1-3 and the task is still blocked, describe what you tried, what failed, and ask the user for guidance. Never loop silently.

Error Recovery Anti-Patterns

Anti-PatternConsequenceFix
Retry the same thing 5 timesWasted tokens, same failureOne retry with adjustment, then Level 2
Ignore the error and continueCascading failures downstreamEvery error must be handled
Simplify the task to make it workUser gets less than they asked forOnly reduce scope at Level 3, and disclose it
Give up immediatelyUser loses trustExhaust Level 1-2 before escalating

Structured Error Handling

When a tool call fails:

  1. Read the error message carefully — it usually tells you what's wrong
  2. Diagnose: Is it a transient issue (retry) or a fundamental problem (redesign)?
  3. Act: Apply the appropriate recovery level
  4. Report: If the error affects the final output, note it transparently

Pillar 4: Context Management

Context is a Budget

Every token in your context window costs money and attention. Treat context like a budget:

  • Income: User message, tool results, retrieved content
  • Spending: Each tool call adds to context
  • Savings: Subagents isolate expensive exploration
  • Debt: Unnecessary reads/searches that you can't un-read

The 30% Rule

Reserve 30% of your effective context for final synthesis and output. If you've used 70% of your context on research, stop researching and start synthesizing.

Context-Efficient Patterns

PatternHowSaves
Targeted readsRead specific line ranges, not whole files50-90% per file
Grep before readFind the exact location, then read only that sectionAvoids reading irrelevant files
Subagent delegationExpensive exploration happens in isolated contextProtects main context
Summarize earlyAfter a research phase, write a summary before continuingPrevents re-reading
Batch tool callsRun independent calls in parallelReduces round trips

What NOT to Load Into Context

  • Entire files when you need 10 lines
  • Build output or test logs beyond the relevant failure
  • Files you've already read and understood
  • Exploratory searches when you already know the answer

Pillar 5: Quality Self-Assessment

Confidence Calibration

After completing a task, assess your confidence on two axes:

Completeness: Did you address everything the user asked for?

  • 1.0: Every aspect addressed with evidence
  • 0.7: Main request addressed, some secondary aspects missing
  • 0.4: Partial answer, significant gaps
  • 0.1: Barely started

Correctness: How likely is your output to be right?

  • 1.0: Verified by tests, cross-referenced, high certainty
  • 0.7: Reasonable confidence but not verified
  • 0.4: Best guess, significant uncertainty
  • 0.1: Speculative

When to Stop

Stop when ANY of these are true:

  • The exit condition (from decomposition) is satisfied
  • Your confidence that further work improves the output drops below 0.3
  • You've consumed 70% of available context (the 30% rule)
  • The user's question has been answered completely
  • You're making changes that don't measurably improve the result

Continue when ALL of these are true:

  • The exit condition is not yet met
  • You have a clear next step with expected improvement
  • You have sufficient context budget remaining
  • Each iteration is producing measurable progress

The "One More Thing" Trap

Resist the urge to add improvements the user didn't ask for. Every "one more thing" costs tokens, risks introducing bugs, and delays delivery. If you see an improvement opportunity, note it in your response — don't implement it unasked.


Architecture Patterns

Pattern 1: Scout-Then-Act

Phase 1 (Scout):   Read, Grep, Glob — understand the territory
Phase 2 (Plan):    Decompose based on what you found
Phase 3 (Act):     Edit, Write, Bash — execute the plan
Phase 4 (Verify):  Run tests, check results

Best for: Bug fixes, feature additions, refactoring. You need to understand before you change.

Pattern 2: Parallel Fan-Out

Wave 0: [Research A] + [Research B] + [Research C]   ← parallel subagents
Wave 1: [Synthesize findings]                         ← single agent
Wave 2: [Implement based on synthesis]                ← single agent

Best for: Tasks requiring multiple independent information sources. Research tasks, competitive analysis, multi-file understanding.

Pattern 3: Iterative Refinement

Loop:
  1. Produce draft output
  2. Evaluate against criteria
  3. If criteria met → done
  4. Identify largest gap
  5. Fix the gap → go to 1
Max iterations: 3-5

Best for: Creative tasks, code generation, content production. Each pass improves quality.

Pattern 4: Staged Pipeline

Stage 1: Raw extraction (fast, broad)
Stage 2: Filtering (remove noise)
Stage 3: Enrichment (add detail to survivors)
Stage 4: Final synthesis

Best for: Data processing, research synthesis, skill compression. Each stage narrows the working set.


Quality Checklist

Before considering an agentic task complete:

[ ] Exit condition defined before starting
[ ] Task decomposed into 3-7 concrete subtasks
[ ] Dependencies identified (what must serialize vs parallelize)
[ ] Each tool call has a clear purpose (no exploratory fishing)
[ ] Errors handled at the appropriate recovery level
[ ] Context budget tracked (not over 70% before synthesis)
[ ] Output addresses every part of the user's request
[ ] Confidence self-assessed on completeness and correctness
[ ] Improvements not requested by user noted but not implemented
[ ] Clear stopping point reached (exit condition met)

The Meta-Pattern

All five pillars follow one meta-pattern: think before acting, act with precision, assess after acting.

THINK:  What am I trying to do? How will I know it's done?
ACT:    Use the minimum tools with maximum precision.
ASSESS: Did it work? What's my confidence? Should I continue?

Agents that skip THINK waste tokens exploring. Agents that skip ASSESS don't know when to stop. Agents that skip ACT just plan forever. All three, in that order, every cycle.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

Use for insight, reframing, contradiction, impasse, and anomaly-driven problem solving when execution effort no longer helps. NOT for routine optimization, error correction, or well-specified tasks with known solution paths.

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

Apply normative BDI reasoning to agents that must detect norms, choose which commitments to internalize, and resolve conflicts by comparing consequences. Use when obligations, prohibitions, or policies collide in autonomous systems. NOT for simple fixed-priority rules, pure constraint satisfaction, or domains where no real normative conflict exists.

日本語の概要は準備中です。原文の説明を表示しています。

curiositech/windags-skills132026年10月1日 更新

curiositech のスキルをすべて見る

このスキルの問題を報告する