agentleFS
reddygopalkrishnareddygopalkrishna/developer-agent-skills/skills/design-docs/SKILL.md

design-docs

Skill8 starsChanged 9 days agoMITView on GitHub

Writes and reviews technical design documents (RFCs) and Architecture Decision Records (ADRs) with goals and non-goals, real alternatives, risks, security, rollout, rollback and observability. Use when planning a new system, service or major feature, choosing between architectures or technologies, recording an architectural decision, writing an RFC or ADR, or reviewing someone else's design doc. Not for user-facing documentation or API reference docs.

8 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

10 rules. 0 are common, 8 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 8

    Distinctive

    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. Very specific:

    Follow local conventions first: Search the repo for existing docs and templates: docs/adr/, doc/adr/, docs/decisions/, …

    line 26
  2. Distinctive:

    Gather context before writing: Read the relevant code, existing ADRs, related incidents and metrics.

    line 27
  3. Distinctive:

    Write the problem, goals and non-goals before any solution: If you cannot state the problem in three sentences with evidence, stop and ask.

    line 28
  4. Distinctive:

    Hand the draft to the user: Do not post it, share it, or request reviewers on their behalf without asking.

    line 33
  5. Distinctive:

    Use references/rfc-template.md for the full fill-in template.

    line 54
  6. Distinctive:

    Record rejected decisions too: when the debate was significant.

    line 100
  7. Very specific:

    If the repo uses adr-tools, adr new "Title" creates the next numbered file and adr new -s 7 "Title" supersedes ADR 7.

    line 101
  8. Distinctive:

    Use references/adr-template.md for the template and a worked example.

    line 103
  9. Distinctive:

    When asked to review, check in this order and label every comment blocking, should fix, or nit:

    line 107
  10. Distinctive:

    Do the capacity and cost numbers survive a sanity check?

    line 116

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “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

Design Docs and ADRs

A design doc exists to get the right decision made before code is written, and to record why it was made. Lead with the decision, show the alternatives you rejected and why, and make every claim checkable by a reviewer.

When to use

SituationArtifact
New service or system, cross-team API, shared data model change, work over ~2 engineer-weeksDesign doc (RFC)
Hard-to-reverse choice: new database, new infrastructure, new language or frameworkDesign doc, then an ADR for the decision
Security, privacy or compliance-sensitive changeDesign doc with a real security section
One significant decision with limited scope (adopt a library, change a protocol, deprecate something)ADR only
Small, local, easily reverted changeA good PR description is enough
Bug fixNo doc. Link the issue.

Rule of thumb: write a doc when the decision is expensive to reverse or affects people outside the team.

Workflow

  1. Follow local conventions first. Search the repo for existing docs and templates: docs/adr/, doc/adr/, docs/decisions/, docs/architecture/decisions/, docs/rfcs/, rfcs/, files named *adr* or *rfc*. Reuse the existing template, numbering and status values if they exist.
  2. Gather context before writing. Read the relevant code, existing ADRs, related incidents and metrics. Ask the user for what you cannot find: deadline, SLOs, expected load, budget, owning team, compliance needs. Do not invent numbers.
  3. Write the problem, goals and non-goals before any solution. If you cannot state the problem in three sentences with evidence, stop and ask.
  4. Generate real alternatives. At least two credible options plus "do nothing". Compare all of them against the same criteria (see the table pattern below).
  5. Write the proposal with enough detail to review: components, interfaces, data model, key flows, failure handling, capacity numbers.
  6. Fill in the operational sections: risks, security and privacy, rollout and rollback, observability, cost, open questions with owners.
  7. Self-review against the checklist in "Done when".
  8. Hand the draft to the user. Do not post it, share it, or request reviewers on their behalf without asking.
  9. After the decision: set the status, record ADRs for the key decisions, and link the doc from the code or README it affects.

Design doc sections

SectionWhat goes in itCommon failure
HeaderTitle, author, status (Draft / In review / Accepted / Rejected / Superseded), date, reviewers, decision makerNo named decision maker, so the doc never closes
Summary3-5 sentences: the problem, the proposed decision, the costSummary describes the problem but hides the decision
ContextCurrent state, why now, evidence (metrics, incidents, user requests)"Everyone knows" context that new readers lack
GoalsMeasurable outcomes ("p99 under 300 ms at 2k req/s")Vague words: scalable, robust, seamless
Non-goalsThings a reasonable reader might expect that you will not doMissing, so scope creeps during review
ProposalDiagram, components, APIs, data model, flows, failure modes, capacity mathCode-level detail instead of design
AlternativesEach option with honest pros, cons and why rejectedStrawman options set up to lose
RisksEach risk with likelihood, impact and mitigationOnly technical risks; no people or schedule risks
Security and privacyData classification, authn/authz, PII flows, threat highlights, compliance"N/A" with no reason
Rollout and migrationPhases, feature flags, backward compatibility, data migration, rollback planNo way back once started
Observability and operationsMetrics, alerts, SLOs, dashboards, runbooks, on-call owner"We'll add monitoring later"
CostInfrastructure and people cost, ongoing maintenanceOnly build cost, never run cost
Open questionsEach with an owner and a dateQuestions that silently become assumptions

Use references/rfc-template.md for the full fill-in template.

Writing for reviewers

  • Lead with the decision. A reviewer should know what is being asked of them after the first paragraph.
  • Use concrete numbers. Show back-of-envelope math for load, storage growth and cost. Example: "40M events/day ≈ 460/s average; assume 5x peak ≈ 2,300/s; at 1 KB each ≈ 40 GB/day before replication."
  • Mark estimates as estimates and say where every other number came from.
  • State assumptions explicitly so reviewers can attack them.
  • Separate facts, opinions and decisions. "Measured", "we believe", "we will".
  • Compare alternatives in one table using the same criteria:

    CriterionOption A: PostgresOption B: DynamoDBDo nothing
    Fits access pattern.........
    Operational cost.........
    Team experience.........
    Migration effort.........
    Reversibility.........
  • Draw diagrams as code so they live in version control. Mermaid renders natively on GitHub and GitLab. Use C4 levels: a context diagram (system and its users and neighbours) and a container diagram (deployable units and data stores) cover most docs. Add a sequence diagram for any non-trivial flow.

    sequenceDiagram
      Client->>API: POST /orders
      API->>DB: insert order (status=pending)
      API->>Queue: publish OrderCreated
      API-->>Client: 202 Accepted
  • Keep it short. Most design docs fit in 2-6 pages. Move detail to appendices.

ADRs

An ADR records one decision, its context and its consequences. Default to the Michael Nygard format unless the repo already uses another (MADR is a common alternative that adds explicit "Considered options").

  • Title: numbered short noun phrase, e.g. ADR-0007: Use PostgreSQL for the orders service.
  • Status: Proposed, Accepted, Deprecated, or Superseded by ADR-NNNN.
  • Context: the forces at play, written neutrally.
  • Decision: "We will ..." in active voice.
  • Consequences: what becomes easier, what becomes harder, what we now must do.

Rules:

  • One decision per ADR. About one page.
  • File naming: docs/adr/0007-use-postgresql-for-orders.md (or the repo's existing pattern). Numbers increase and are never reused.
  • Accepted ADRs are immutable. To change a decision, write a new ADR that supersedes the old one, and change only the old one's status line to Superseded by ADR-0012.
  • Record rejected decisions too when the debate was significant; it stops the same argument from restarting.
  • If the repo uses adr-tools, adr new "Title" creates the next numbered file and adr new -s 7 "Title" supersedes ADR 7.

Use references/adr-template.md for the template and a worked example.

Reviewing a design doc

When asked to review, check in this order and label every comment blocking, should fix, or nit:

  1. Is the problem real and backed by evidence? Is "do nothing" seriously considered?
  2. Are goals measurable and non-goals stated?
  3. Are the alternatives genuine, compared on the same criteria?
  4. Failure modes: what happens when each dependency is slow, down, or returns bad data?
  5. Is there a rollout plan with a working rollback, including for data changes?
  6. Security and privacy: who can access what, where PII flows, what is logged.
  7. Observability: which metric or alert tells us it is broken?
  8. Do the capacity and cost numbers survive a sanity check?
  9. Is there a named owner for building and for operating it?

Give the author the top three issues first, then the rest.

Anti-patterns

  • Solution looking for a problem — the doc starts from a technology, not from a need. Rewrite from the problem.
  • Strawman alternatives — options nobody would pick, listed to make the proposal look good. Reviewers stop trusting the doc.
  • Implementation spec disguised as design — class diagrams and method signatures instead of decisions. Keep code detail out.
  • Retro-justification — doc written after the code to approve it. If that is what it is, label it as a record, not a proposal.
  • No non-goals — scope grows with every review comment.
  • No rollback — especially for data migrations and protocol changes.
  • Editing an accepted ADR to change the decision — write a superseding ADR instead.
  • Invented numbers — an agent filling gaps with plausible figures. Ask, or mark as an estimate with the reasoning.

Done when

  • The summary states the proposed decision in the first paragraph.
  • Goals are measurable; non-goals are listed.
  • At least two real alternatives plus "do nothing" are compared on the same criteria.
  • Failure modes, rollout and rollback are covered, including data.
  • Security and privacy are addressed, or marked not applicable with a reason.
  • Observability names concrete metrics and alerts and an operating owner.
  • Every number is sourced or marked as an estimate.
  • Open questions each have an owner.
  • Once accepted, each key decision is recorded as an ADR.

References

  • references/rfc-template.md — read when writing a new design doc or RFC from scratch.
  • references/adr-template.md — read when recording or superseding an architectural decision.

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.