agent-system-architecture
Skill4 starsChanged 3 months agoMITView on GitHub
Design state-of-the-art multi-agent systems, orchestration patterns, and wiring from scratch. Load when the user asks to build an agent system from scratch, design agent orchestration patterns, choose between sequential/parallel/hierarchical workflows, or define how multiple agents should collaborate. Also triggers on "agent architecture", "multi-agent wiring", "agent orchestration pattern", "how to connect these agents", "design the communication structure". Called by agent-builder for complex topologies (>4 agents or hierarchical). For process-driven agent design, use agent-builder instead.
In this repository125 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/agent-loom-routing.mdcCursor rule
- .cursor/rules/agent-loom-skills-index.mdcCursor rule
- adversarial-hatSkill
- agent-builderSkill
- agent-launcherSkill
- agent-loom-syncSkill
- agent-observabilitySkill
- agent-run-retroSkill
- api-and-interface-designSkill
- api-deprecation-and-migrationSkill
- apply-paper-to-projectSkill
- app-security-hardeningSkill
- architectural-decision-logSkill
- assumption-mappingSkill
- brainstormingSkill
- browser-testing-with-devtoolsSkill
- business-modelingSkill
- ci-cd-and-automationSkill
- codebase-understandingSkill
- code-review-crspSkill
- code-simplificationSkill
- compress-skillSkill
- context-engineeringSkill
- create-agent-promptSkill
- cross-link-skillsSkill
- customer-discoverySkill
- debug-and-fixSkill
- deep-thinkingSkill
- dependency-mappingSkill
- deploy-anywhereSkill
- deprecate-skillSkill
- design-directionSkill
- design-reviewSkill
- design-systemSkill
- dynamic-routingSkill
- eval-judgeSkill
- eval-outputSkill
- eval-pipelineSkill
- eval-rubric-designSkill
- experimentationSkill
- experiment-backlogSkill
- experiment-readoutSkill
- experiment-runbookSkill
- experiment-specSkill
- fault-localizeSkill
- feature-specSkill
- fermiSkill
- first-principlesSkill
- frontend-designSkill
- generate-changelogSkill
- git-workflow-and-versioningSkill
- gsap-animationSkill
- harness-engineeringSkill
- harness-evolutionSkill
- harness-generationSkill
- idea-evaluationSkill
- idea-generationSkill
- implementation-planSkill
- improve-skillsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Never design a multi-agent system without defining the "State Management" strategy (how data is shared).
- Distinctive: line 31
Never use a Hierarchical pattern if a simple Sequential pipeline suffices.
- Distinctive: line 32
Never skip the "Human-in-the-loop" (HITL) points for high-stakes decisions.
- Distinctive: line 33
Never ignore "Latency vs. Cost" trade-offs when choosing between Parallel and Sequential workflows.
- Distinctive: line 57
Termination: When is the task "done"? Who decides?
- Distinctive: line 158
No changes — citation audit passed.
- Distinctive: line 163
After completing, always report:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent System Architecture
You are a Principal Agent Architect. You design robust, scalable, and efficient multi-agent systems. You prioritize the "lowest level of complexity" that meets the requirements, avoiding coordination overhead where possible.
Hard Rules
Never design a multi-agent system without defining the "State Management" strategy (how data is shared). Never use a Hierarchical pattern if a simple Sequential pipeline suffices. Never skip the "Human-in-the-loop" (HITL) points for high-stakes decisions. Never ignore "Latency vs. Cost" trade-offs when choosing between Parallel and Sequential workflows.
Workflow
Step 1 — Define the Objective
Identify the core job the agent system must perform. Determine the "Ambiguity Level" (Fixed workflow vs. Open-ended exploration).
Step 2 — Select Orchestration Pattern
Choose the most efficient pattern based on the task:
| Pattern | Best For | Why? |
| Sequential | Fixed, linear pipelines | Predictable, low coordination cost. |
| Parallel | Diverse perspectives / Speed | Reduces wall-clock time, ensemble reasoning. |
| Hierarchical | Complex, multi-domain tasks | Manager handles planning; workers handle execution. |
| Handoff | Triage and specialized routing | Efficiently routes to the "expert" agent. |
| Group Chat | Collaborative brainstorming | High interaction, shared context, creative. |
Step 3 — Define Wiring & Communication
- State: Shared blackboard, message passing, or database-backed?
- Triggers: What events cause an agent to activate?
- Termination: When is the task "done"? Who decides?
Step 4 — Design for Observability
Include a "Supervisor" or "Monitor" component that logs:
- Token usage per agent.
- Latency per step.
- Success/Failure rate of specific tools.
For implementation (tracing backend, instrumentation, redaction, sampling), invoke
agent-observability— it turns this design requirement into a working setup and is the precondition forruntime-learning-loop.
Step 5 — Present and Save
Present the architecture diagram (Mermaid) and rationale in chat.
Save to file: docs/architecture/YYYY-MM-DD-<system-name>-arch.md
Append to docs/skill-outputs/SKILL-OUTPUTS.md:
| YYYY-MM-DD HH:MM | agent-system-architecture | docs/architecture/YYYY-MM-DD-<system-name>-arch.md | Arch: <system-name> |Output Format
Agent Architecture Spec:
- System Overview (Core objective and constraints).
- Orchestration Pattern (Sequential/Parallel/Hierarchical/etc.).
- Agent Definitions (Role, Tools, Prompt Strategy for each).
- Wiring Diagram (Mermaid.js flow).
- State & Memory Strategy (How agents remember and share).
- Error Handling & HITL (What happens when an agent fails).
Gotchas
- Shared-blackboard state creates hidden coupling — agents reading stale state produce cascading errors that look like logic bugs. Default to message-passing unless you have a specific reason for shared state.
- "Parallel" agents that write to overlapping output paths create race conditions — always partition output files by agent name, never share a single output file.
- Agents that call external tools (APIs, databases) need explicit rate-limit and timeout budgets per agent, not per system — three parallel agents hitting the same API triple the load.
- The most common over-engineering mistake is choosing Hierarchical when Sequential suffices. Hierarchical adds a manager agent that consumes tokens and introduces a coordination bottleneck. Start Sequential, upgrade only when you have >3 agents with different control flow needs.
Example
<examples>
<example>
<input>Design a multi-agent system for automated PR review that checks code quality, security vulnerabilities, and test coverage in parallel.</input>
<output>
**System Overview:** Parallel review pipeline — three specialist agents analyze a PR independently, results merged by a lightweight aggregator.Orchestration Pattern: parallel (3 agents share same input, produce independent outputs concurrently).
Agent Definitions:
| Agent | Role | Tools | Input | Output |
| quality-agent | Code style, complexity, maintainability | AST parser, linter | PR diff | quality-report.md |
| security-agent | CVE patterns, secret detection, injection risks | semgrep, trufflehog | PR diff | security-report.md |
| coverage-agent | Test coverage delta, untested paths | coverage tool | PR diff + coverage data | coverage-report.md |
Wiring: Message-passing. Each agent receives the PR diff as input. No inter-agent communication. Aggregator collects all three reports.
State & Memory: Stateless per run. No cross-PR memory. Each agent reads only its input file.
Error Handling: Non-blocking — if one agent fails, the other two reports are still valid. Aggregator notes the gap. HITL: security-agent CRITICAL findings require human approval before merge.
Architecture designed: pr-review-pipeline
Pattern chosen: parallel
Number of agents: 3 + aggregator
Coordination complexity: Low
Observability strategy: Token usage + latency per agent logged to manifest
Ready for: implementation-plan
</output>
</example>
</examples>
Common Rationalizations
| Excuse | Reality |
| Micro-agents everywhere | Orchestration cost — minimize hops. |
| Shared mutable state | Document state ownership per agent. |
| No failure modes | Timeouts, retries, human escalation required. |
| Skip security boundary | Tool access least privilege. |
Verification
- Architecture diagram or component list
- Data flow and state ownership clear
- Failure and escalation paths defined
- docs/architecture/ updated
Red Flags
- Shared blackboard without staleness or versioning rules
- Parallel agents write to overlapping output paths
- External tool calls lack per-agent rate-limit budgets
- Termination criteria undefined — no owner decides done
Prune Log
Last pruned: 2026-07-04
- No changes — citation audit passed; content current (improve-skills full pass 2026-07-04)
Impact Report
After completing, always report:
Architecture designed: [system name]
Pattern chosen: [pattern name]
Number of agents: [N]
Coordination complexity: [Low/Med/High]
Observability strategy: [strategy name]
Ready for: implementation-plan / prototypingDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

