AGENT SKILL

agentic-topology-design

Choose a multi-agent topology and enforce structured contracts between sub-agents. Use when designing a flow with two or more sub-agents (code-review pipeline, deep research, incident triage, batch refactor), replacing a monolithic prompt agent showing attention dilution, or drafting an ADR for an agentic feature.

License 许可
MIT
所属仓库
muratovv/ai-hats
最近更新
2026-11-05
Stars
★ 3
Forks
1

01 前言 Front Matter

name
agentic-topology-design
license
MIT
description
Choose a multi-agent topology and enforce structured contracts between sub-agents. Use when designing a flow with two or more sub-agents (code-review pipeline, deep research, incident triage, batch refactor), replacing a monolithic prompt agent showing attention dilution, or drafting an ADR for an agentic feature.

03 SKILL.md 正文

Agentic Topology Design

Pick the right multi-agent shape for a given task and enforce machine-parseable contracts between sub-agents. Treat sub-agents as microservices with tightly scoped prompts; coordination is the architect's responsibility.

When to Use

Owns the shape of a multi-agent flow — how many agents, how they hand off, what contract passes between them. The orthogonal concern is the trust surface of those agents (where agent output crosses into privileged action) → that's trust-boundary-mapping. Design the topology here, then map its guardrails there; an agentic feature that touches production needs both.

Topology Decision Matrix

Topology Coordination Use when Failure mode it prevents
Sequential (Pipeline) Output of step N → input of step N+1 Deterministic order, each step narrows focus (requirements → schema → code → tests) Hallucinations from over-broad single prompt
Parallel (Coordinator/Workers) Coordinator fans out independent tasks, aggregates JSON Latency-critical or independent perspectives (multi-critic review, parallel log scan) Single-agent code review with hundreds of nitpicks and missed real issues
Hierarchical Decomposition Top agent plans abstract DAG; leaf agents call concrete tools (MCP) Open-ended research, multi-stage incidents, dynamic scope Premature commitment to a fixed plan

Conventions

  • Structured Outputs Mandate. Every sub-agent emits JSON Schema-validated output. No free-form natural-language hand-offs between agents — that path leads to brittle parsing and silent corruption.
  • Tightly-Scoped Sub-Agent Prompts. Each sub-agent owns one responsibility (search bugs / audit error handling / check security / lint corporate rules). Resist bundling.
  • Supervisor Owns the DAG. One coordinator agent forms and mutates the execution graph; workers do not call other workers directly.
  • Bounded Concurrency. Cap parallel sub-agents (Brooks/Ringelmann projection — see context-handoff); coordination overhead grows superlinearly past ~4–6 workers on the same artifact.
  • Idempotent Re-runs. Sub-agent contracts must support replay with the same input → same output for cache-friendly recovery.

Anti-Patterns

  • One mega-prompt that "routes, formats, queries DB, and styles output" — instructions interfere; safety bullets get crowded out
  • Free-text contracts ("write a paragraph the next agent will understand") — debug it once and you'll never repeat
  • Workers calling workers ad-hoc — the DAG becomes implicit and unmonitorable
  • Picking Hierarchical for a deterministic 4-step flow — over-engineering; Sequential wins

04 同仓库更多 Skills

muratovv
muratovv/ai-hats

tool-evaluation-protocol

Time-bounded protocol for evaluating new tools, libraries, or methodologies before adoption. Use when evaluating a candidate dependency for the project, researching a methodology (e.g. ML/LLM frameworks, testing approaches), or following up on a hype-driven recommendation.

★ 3
muratovv
muratovv/ai-hats

systematic-debugging

4-phase bug-fix protocol (evidence, pattern, hypothesis, verify). Use when investigating any error, failure, or unexpected behavior, handling bug reports from users or monitoring, or diagnosing test failures with non-obvious causes.

★ 3
muratovv
muratovv/ai-hats

skill-template

Canonical template and validation guide for ai-hats skills. Use when creating a new skill, reviewing an existing one for structural compliance, or deciding which pattern fits a new behavior.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

skill-optimization

Audit and refactor library components to eliminate redundancy and staleness. Use during periodic library maintenance, after adding multiple new skills or rules, when a role's token budget is too high, or after retrospectives identify component issues.

Skill与智能体开发
★ 3
muratovv
muratovv/ai-hats

silent-fallback-gate

PreToolUse hook — refuses an Edit or Write that adds an inert broad except. Use when a Python edit was blocked for a silent fallback.

★ 3
muratovv
muratovv/ai-hats

retro-to-framework

Convert an observation about agent behavior — from a retrospective or from a single incident — into a framework-level change (hook, rule, skill, skill update). Use after a retrospective identifies problems that are not project-specific, after an incident where an agent misapplied a component it had read, when CLAUDE.md band-aids accumulate (more than 3 per-project rules that could be generic), or when the same problem recurs across multiple projects.

Skill与智能体开发
★ 3