agentleFS
AnmarHaniAnmarHani/SwarmVault/skills/swarm-design-deep/SKILL.md

swarm-design-deep

Skill5 starsChanged 4 months agoMITView on GitHub

The developer-driven design lane — the user commits to each approach before anything is written, then the design goes to pseudocode, algorithms, invariants, sequence diagrams and test vectors in their chosen design language. Use when the user wants to own the system rather than receive it: "developer mode", deep/detailed design, designing algorithms or data structures, writing pseudocode or sequence diagrams during design, or human-driven planning after the SRS.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat the design session as the agent, and apply six of the 12 factors to it:

    line 18
  2. Very specific:

    Write docs/design/profile.md, then never ask again:

    line 35
  3. Distinctive:

    If the user asks for algorithmic depth on something mechanical: say what it costs and what it buys, once, then do as they decide.

    line 59
  4. Distinctive:

    Do not treat silence, a "sounds good", or a question as a commitment.

    line 72
  5. Distinctive:

    Draft: Write the unit file against *their* approach, not your preferred one.

    line 73
  6. Distinctive:

    Check: Ask 2–3 questions about consequences, not content: "what happens if the queue is empty when the timer fires?" Aim them at the parts …

    line 75
  7. Distinctive:

    When a committed approach proves wrong while drafting: stop, show the conflict with evidence, and return to step 1 for that unit.

    line 85
  8. Distinctive:

    If more than half were delegated, say it in one plain line — the lane was chosen for ownership, and that is how much of it they hold.

    line 91
  9. Very specific:

    Every Must-priority FR maps to ≥1 unit (traceability table in overview.md).

    line 122
  10. Distinctive:

    Every unit closed, or deferred with a stated reason.

    line 123
  11. Distinctive:

    Every algorithmic unit has a test-vector table.

    line 124

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

swarm-design-deep — the developer-driven design lane

Gate: requires a validated SRS. This lane replaces swarm-design for the phase — do not run both; one skill owns the design artifacts.

The standard lane (swarm-design) is agent-driven: it proposes an architecture and the user validates it. That is the right trade for most projects. This lane exists for the other case — a developer who must hold the system in their head afterwards. It is slower and costs more tokens on purpose, and it pays for itself only if implementation comes out mechanical.

The contract

Treat the design session as the agent, and apply six of the 12 factors to it:

applied here
8 own your control flowThe user decides what is designed next. Never advance the unit list yourself.
7 contact humans with tool callsEvery unresolved choice is an explicit question. No assumption reaches the doc silently.
3 own your context windowDesign lives in per-unit files, not the transcript. This is what makes the depth affordable.
6 launch/pause/resumeOne unit per session, closed and dropped. A cold session resumes from the unit table.
12 stateless reducerEach session = (files so far + one decision) → updated files.
10 small, focused agentsOne unit designed to the bottom beats the whole system designed halfway.

Awareness is caused by producing, not by reading. Forty pages of excellent design gets a rubber stamp. The commit step below is the whole point of the lane; without it this is just swarm-design with more words.

Setup — the design profile (ask once)

Write docs/design/profile.md, then never ask again:

  • design language — what algorithms and signatures are written in. Independent of the implementation language: designing in Java and building in Python is normal. Language-neutral pseudocode is a valid answer. Say this out loud when asking, because users assume it's the build language.
  • granularity — what one unit is here (module / service / endpoint / algorithm).
  • diagram formats — see references/diagrams.md.
  • standing depth override, if any.

Units and depth triage

Decompose into units and give each a class. Propose the triage, get it confirmed. Depth is allocated, not applied — this is the primary token control.

classsignalsowes
algorithmicnovel logic, ordering/state/concurrency, performance-sensitive, non-obvious data structurepseudocode, data structures, invariants, complexity, edge-case table, test-vector table
integrationcrosses a boundary — network, process, third party, filesystem, usersequence diagram, contract (types in/out), failure modes with timeout/retry/idempotency stance
mechanicalCRUD, config, glue, framework-shaped, fully determined by its contractsignature + one line of intent. No pseudocode.

Level-0 units are the standard lane's deliverables — stack, decomposition, data model, milestone boundaries — run through the same loop. Level-1 units are the modules themselves.

If the user asks for algorithmic depth on something mechanical: say what it costs and what it buys, once, then do as they decide. Pseudocode for a CRUD handler is waterfall with extra steps, and saying so is part of the job — arguing twice is not.

The unit loop

Per unit, in order. Steps 1–2 are the lane; skip step 2 and you are running swarm-design.

  1. Frame. What must this unit do (FR refs), what constrains it (NFR refs), what goes in and out, and 2–3 candidate approaches with real trade-offs. Write no implementation detail yet. Read the relevant FR spec, not the whole SRS.
  2. Commit. The user states the approach in their own words, or picks one and says why. Wait for it. If they delegate — "you pick" — decide, and record decided-by: agent (delegated). Do not treat silence, a "sounds good", or a question as a commitment.
  3. Draft. Write the unit file against their approach, not your preferred one. Include whatever the depth class owes.
  4. Check. Ask 2–3 questions about consequences, not content: "what happens if the queue is empty when the timer fires?" Aim them at the parts most likely to be wrong. A wrong answer means the design or the explanation is wrong — fix it, don't re-explain harder. This is not a quiz and must not read as one.
  5. Close. Record status and attribution in the unit table, drop the unit from context, and report units remaining.

The user may write any part themselves — a signature, the control flow, the whole unit. Complete and critique it rather than replacing it, and record that they wrote it.

When a committed approach proves wrong while drafting: stop, show the conflict with evidence, and return to step 1 for that unit. Never quietly design something else.

Ownership accounting

Each unit carries decided-by: user | agent (delegated). At the exit summary, report the ratio. If more than half were delegated, say it in one plain line — the lane was chosen for ownership, and that is how much of it they hold. State it and move on; it does not block.

Files

docs/design/
  profile.md              design language, granularity, diagram formats, depth policy
  overview.md             system map · unit table (class · status · decided-by) · FR traceability
  units/NN-<slug>.md      one file per unit  (template: references/unit-template.md)
  diagrams/               .drawio.svg / .excalidraw.md sources

ADRs still go to 50 Decisions/<P>/ADR-NNN-<slug>.md. Sync mirrors everything. Per-unit files are for context economy, not tidiness: load overview.md plus the one live unit, never the closed ones.

Without a vault, write to docs/design/ and skip the mirroring — the lane works standalone.

Token economy

The lane is expensive by construction, so make the controls visible:

  • Triage honestly. Most units are mechanical, and mechanical units cost a signature.
  • One unit per session where practical; checkpoint and compact at unit boundaries — they are safe states by definition (see swarm-orchestrate).
  • Report units remaining at every close, so the user can stop, downgrade the remaining triage, or switch lanes with real information.

Exit gate

  • Every Must-priority FR maps to ≥1 unit (traceability table in overview.md).
  • Every unit closed, or deferred with a stated reason.
  • Every algorithmic unit has a test-vector table.
  • The handoff test: swarm-implement can write tickets from these units without asking how — only in what order. If it can't, the lane didn't pay for itself; name the units that fail and finish them.

Then flow-state → phase: design-ui (if the SRS declares an interface) or phase: tickets. Record design-lane: deep so a cold session resumes here.


Influences: humanlayer's 12-factor-agents (Apache-2.0) — factors 3, 6, 7, 8, 10, 12, applied to the design session rather than a runtime agent. See CREDITS.md.

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.