agentleFS
antonioneto11antonioneto11/agent-dev-framework/skills/system-design/SKILL.md

agent-system-design

Skill0 starsChanged 4 months agoMITView on GitHub

Design the high-level system architecture for an AI agent product — the agent loop, its tools, control flow, where state lives, and the observability/tracing layer. Use whenever the user wants to architect or design the shape of an agent system, decide how components fit together, plan the agent's control flow, or figure out how to make agent runs observable. Trigger on "system design", "architecture", "how should this be structured", "design the agent", even without those exact words. This is the system-design step of the agent-dev-framework pipeline.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Follow _conventions.md (read-first order, docs/ vs artifacts/, don't-clobber guard).

    line 14
  2. Very specific:

    Read PROJECT.md, artifacts/prd.md, and artifacts/competitive.md.

    line 17
  3. Distinctive:

    Stop conditions and max steps (agents that don't bound their loops burn money and hang).

    line 34
  4. Very specific:

    Write artifacts/system-design.md (apply the don't-clobber guard):

    line 60

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Agent System Design

This step defines the shape of the system — components and how they talk — not implementation detail (that's the tech spec). For an agent product, the design has one non-negotiable that ordinary apps lack: the tracing/observability layer is part of the architecture, not an add-on. You cannot debug or eval an agent run you didn't capture.

Conventions

Follow _conventions.md (read-first order, docs/ vs artifacts/, don't-clobber guard).

Before you start

Read PROJECT.md, artifacts/prd.md, and artifacts/competitive.md. Pull the core task, autonomy level, tools, model, and constraints from there. The PRD's monitoring requirements section directly drives the tracing design below.

Bias toward simplicity

A solo founder is almost always better served by "works and is changeable" than "scales to millions." Design for the current stage. If you find yourself adding a queue, a cache, or a microservice the MVP doesn't need, name it as gold-plating and cut it. Flag over-engineering out loud.

What to design

1. The agent loop

The heart of it. Spell out:

  • Trigger → how a run starts (user message, event, schedule).
  • The control flow: single LLM call, or a loop of reason → call tool → observe → repeat? Planner/executor? Keep it the simplest thing that does the job.
  • Stop conditions and max steps (agents that don't bound their loops burn money and hang).
  • Where the escape hatch is: when the agent is unsure, does it stop and ask, or proceed? (This must match the autonomy decision in the PRD.)

2. Tools / actions

For each tool the agent can call: what it does, its inputs/outputs, and — critically — whether it's read-only or state-changing. Per PROJECT.md, if the agent takes real-world actions (sends, writes, spends), those tools need guardrails called out here: confirmation steps, dry-run modes, spend limits, idempotency.

3. State & memory

What the agent needs to remember within a run vs. across runs. Where conversation/session state lives. Keep persistent state minimal at this stage.

4. The observability layer (MANDATORY)

Design how every run is traced. A run's trace must capture: inputs, each tool call + its result, intermediate reasoning/decisions, the final output, and tokens/latency/cost per run. Decide where traces are written (even a simple append-only log or a table is fine to start) and how a single run is identified (a run_id threaded through everything). This feeds the data-and-evals and monitoring steps directly — design it now so it isn't bolted on later.

5. Failure modes

What happens when a tool errors, the model returns garbage, or a run exceeds its step budget? Define fallbacks and the safe-default behavior.

Output

Write artifacts/system-design.md (apply the don't-clobber guard):

# System design — [product]
## Overview (one paragraph + a simple component sketch in text/ASCII)
## The agent loop (control flow, stop conditions, escape hatch)
## Tools / actions (each: purpose · read-only or state-changing · guardrails)
## State & memory
## Observability layer (what a trace captures, where it's stored, run_id)
## Failure modes & fallbacks
## Deliberately NOT building yet (anti-gold-plating list)
## Open questions

A diagram helps here. If a visual would make the architecture clearer, offer to render one.

End by naming the single riskiest part of the architecture and the cheapest way to validate it before writing the full tech spec.

Download now (ZIP)

Does 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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.