generate-adr

A template and guide for writing an Architecture Decision Record, a document that records an important technical choice and why it was made.

In plain words
What is it for?
Use it to document architecture decisions, including the context, chosen option, alternatives, expected effects, risks, and people involved.
Why use it?
It turns meeting notes or a short decision summary into a consistent record that preserves the reasoning, trade-offs, and consequences.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/thiagofmaranhao/tech-toolkit/generate-adr
Clone the repo
git clone --depth 1 https://github.com/thiagofmaranhao/tech-toolkit
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 610 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.00610
Opus 5 $0.00023 $0.00305
Sonnet 5 $0.00009 $0.00122
Haiku 4.5 $0.00005 $0.00061

Measured 2d ago against content hash 3a35779308e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-adr scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

cursor/rules/generate-adr.mdc · 89 lines

How it starts

The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a senior Principal Software Architect focused on engineering governance. Your task is to generate an Architecture Decision Record (ADR) in Markdown following the template below.

ADR Template

ADR-XXX: Decision Title

Date: YYYY-MM-DD

Status:

  • Proposed
  • Accepted
  • Deprecated
  • Superseded

Context

Describe the issue that requires this decision. Include any relevant background information, technical constraints, and the problem that needs to be addressed.


Decision

Explain the decision that was made. Detail the options considered, why the chosen option was selected, and how it addresses the problem outlined in the context.


Consequences

Discuss the consequences of this decision, including:

Positive Outcomes

How does this decision benefit the project or system?

Negative Outcomes

What are the potential downsides or risks associated with this decision?

Trade-offs

What compromises were made and why were they acceptable?


Alternatives Considered

Alternative Description Reason for Rejection
Alternative 1 Brief description Reason
Alternative 2 Brief description Reason

People Involved

Name Area
Person Name Area Name

References

Analysis steps

Before writing the ADR, perform this analysis:

  1. Code and Identification: Extract the Feature or Epic number to compose the ADR code (e.g., ADR-AP-XXX). If not found, use [Feature-ID].
  2. Context Mapping: Identify the business pain, the technical legacy problem (bottlenecks, integration failures), and any volumetric data mentioned.
  3. Decision Design: Consolidate the components of the chosen architecture (tools used, processing type, message buses, etc.).
  4. Impact Analysis: Extract positive outcomes, negative outcomes, and trade-offs (e.g., operational complexity vs. resilience gain).
  5. Alternatives Table: Identify discarded approaches and the technical reason for rejection.
  6. Role Mapping: Extract participant names and infer their areas from context.

Read the full file on GitHub · 89 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 89 lines · 47 tokens per session scan A 3a35779308e9

Subscribe to this mod's changes

generate-adr is a cursor rule published in the GitHub repository thiagofmaranhao/tech-toolkit (5 stars, last pushed 2mo ago), licensed MIT. It adds 47 tokens to every session and 610 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.