agent-system-design
Skill1 starsChanged 50 days agoMITView on GitHub
Design an AI agent system's orchestration, memory/state architecture, tool-use boundaries, and cost/runaway-loop guards — the upstream design layer, before any code exists to audit. Use when designing a new single-agent or multi-agent system, or when an existing agent system is unpredictable, expensive, or hard to debug. Distinct from `ml-security-audit`, which audits code for prompt-injection risk after the fact — this designs the boundaries so that risk is scoped in from the start.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- shali10/awesome-agent-skillstheir own version, first seen Sep 1, 2026
- antonioneto11/agent-dev-frameworktheir own version, first seen Jul 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- shali10/awesome-agent-skills★ 1same name
- antonioneto11/agent-dev-framework★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository32 other files it gives its agents.
- api-contract-designSkill
- architecture-designSkill
- architecture-optimizationSkill
- ci-speedupSkill
- code-handoffSkill
- cross-ai-handoffSkill
- crypto-storage-auditSkill
- database-designSkill
- dataset-sourcingSkill
- distributed-debuggerSkill
- embedded-constrained-codingSkill
- freedom-to-operate-analysisSkill
- frontend-architectureSkill
- github-masterSkill
- idea-finderSkill
- ieee-paper-drafterSkill
- memory-leak-hunterSkill
- ml-model-selectionSkill
- ml-security-auditSkill
- mobile-platform-architectureSkill
- observability-designSkill
- patent-drafterSkill
- patent-novelty-evaluatorSkill
- performance-optimizationSkill
- project-scaffoldingSkill
- researcher-evaluatorSkill
- researcherSkill
- safety-compliance-scopingSkill
- scale-refactorSkill
- secure-code-reviewSkill
- slow-query-optimizerSkill
- test-architectSkill
The file
Files
Agent System Design
An agent system without explicit boundaries doesn't fail loudly — it fails by quietly running longer, costing more, or taking an action nobody would have approved if asked directly. This skill puts the boundaries in before that happens, not after an incident.
Step 1 — Justify the architecture, don't default to it
Decide single-agent-with-tools versus multi-agent orchestration based on an actual reason: genuine parallelism need, real specialization (different agents needing different tool access or context), or isolation (one agent's failure shouldn't corrupt another's state). Multi-agent orchestration adds real coordination complexity and failure modes — "it seemed like the more sophisticated choice" is not a justification, and a single well-scoped agent is often the right answer.
Step 2 — Design memory/state explicitly
State plainly: what's short-term (lives only in the current context window and disappears), what's long-term (persisted across sessions), what's shared across agents versus private to one, and — for shared state — what happens when two agents read stale or conflicting state. An agent system with no stated answer to "what does this agent remember and for how long" will produce behavior nobody can reason about after the fact.
Step 3 — Scope tool access to least privilege, explicitly
Every tool an agent can call should be an explicit allow-list decision, not blanket access to everything available. This is also the seam where the highest-consequence security risk actually enters: validate tool outputs before they re-enter the agent's context, since unvalidated tool output (a fetched page, a file's contents, another agent's output) is exactly how an attacker-controlled instruction gets read as a command instead of data. Run ml-security-audit's prompt-injection check against this specific boundary once code exists.
Step 4 — Put runaway and cost guards in from the start, not as a patch later
- A maximum iteration/step count, not "the agent decides when it's done" as the only stopping condition.
- A maximum cost/token budget per task, enforced, not just estimated.
- A timeout on every individual tool call — a single hanging tool call shouldn't be able to stall the whole task indefinitely.
- Explicit termination conditions stated up front, not inferred from behavior after the fact.
Step 5 — Design the failure and escalation path
State what happens when an agent gets stuck in a loop, when a tool call fails repeatedly, or when the agent's own confidence in a result is low: is there a defined escalation to a human, a safe-fallback action, or does the design currently just retry silently forever? An agent system with no answer here will find out the answer in production, at the worst possible time.
Step 6 — Design for reconstructable reasoning
Tie into observability-design: can the agent's actual decision path be reconstructed after the fact (what it saw, what it decided, why), or only the final output? Without this, debugging an unexpected agent action is guesswork.
Output
# Agent system design: [system]
## Orchestration choice and justification
## Memory/state architecture (short-term / long-term / shared / private)
## Tool allow-list and output-validation points
## Runaway/cost guards (iteration cap, budget, timeouts, termination conditions)
## Failure/escalation path
## Reasoning observability approachDoes 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.

