skills / code

architecture-decision-records

what it does

Write and maintain Architecture Decision Records (ADRs) following best practices for technical decision documentation. Use when documenting significant technical decisions, reviewing past architectural choices, or establishing decision processes.

Verified Before and after: 2 models 1 try per case View source Download .zip

Compare the answers

Answers from Claude Sonnet 5.5 and GPT-6.1 Sol · try 1 of 1

Same request, same model, once with the skill and once without. Read both and judge for yourself.

“We're reversing the decision below. Can you write up the changes we need in our docs/adr folder?”

Source material given with the request

Existing file docs/adr/0007-mongodb-for-audit-log.md: # ADR-0007: Use MongoDB for the audit log Status: Accepted (2024-03-12) Context: Audit events have varied shapes per feature. Postgres schema changes were slow to get through review at the time. Decision: Store audit events in a dedicated MongoDB Atlas cluster. Consequences: Flexible schema; a second database to operate. What changed (agreed in architecture review, 2026-10-19): - Compliance now needs 7-year retention; Atlas storage at that volume is quoted at $4,100/month. - Finance needs to join audit events to invoices for disputes; today that is a manual export. - Event shapes have settled into 11 types with a common envelope. - New decision: write audit events to a monthly-partitioned PostgreSQL table; move partitions older than 13 months to S3 as Parquet. Backfill from Atlas, then decommission the cluster by 2027-03-31. Owner: Ines Duarte.
with the skill
There are three changes. I can't see your folder, so the new ADR number is a placeholder (`NNNN`). Use the next free number, or run `adr new -s 7 "Move audit log from MongoDB to PostgreSQL"`, which sets the numbering and the supersede links for you. ## 1. Edit `docs/adr/0007-mongodb-for-audit-log.md` (status line only) Accepted ADRs aren't rewritten. Only the status changes, and the rest of the file stays as is. ```diff # ADR-0007: Use MongoDB for the audit log -Status: Accepted (2024-03-12) +Status: Superseded by [ADR-NNNN](NNNN-audit-log-to-postgresql.md) (2026-10-19) ``` ## 2. New file `docs/adr/NNNN-audit-log-to-postgresql.md` ```markdown # ADR-NNNN: Move the audit log from MongoDB to partitioned PostgreSQL ## Status Accepted (2026-10-19). Supersedes [ADR-0007](0007-mongodb-for-audit-log.md).
Show the rest (84 more lines)
**Owner**: Ines Duarte ## Context ADR-0007 (2024-03-12) put audit events in a dedicated MongoDB Atlas cluster. The reasons were that event shapes varied per feature and that Postgres schema changes were slow to get through review. Several of those conditions have changed: - **Retention**: Compliance now requires 7-year retention. Atlas storage at that volume is quoted at $4,100/month. - **Joins**: Finance needs to join audit events to invoices for disputes. Today this is a manual export. - **Schema stability**: Event shapes have settled into 11 types with a common envelope, so the flexibility we chose Mongo for is no longer needed. ## Considered Options ### Option 1: Keep MongoDB Atlas (status quo) - **Pros**: No migration work; flexible schema retained. - **Cons**: Quoted at $4,100/month for 7-year retention; joins to invoices stay a manual export; a second database remains to operate. ### Option 2: Monthly-partitioned PostgreSQL, with older partitions archived to S3 as Parquet - **Pros**: Audit events can be joined to invoices directly; one fewer database to operate; cold data moves to cheaper storage. - **Cons**: Migration effort; Postgres schema changes go back through review; data older than 13 months is no longer in the primary database. <!-- Add any other options discussed in the 2026-10-19 review. --> ## Decision Write audit events to a monthly-partitioned PostgreSQL table. Move partitions older than 13 months to S3 as Parquet. Backfill existing events from Atlas, then decommission the Atlas cluster by **2027-03-31**. ## Consequences ### Positive - Finance can join audit events to invoices in SQL, replacing the manual export. - Removes the Atlas cost and one database from operations. - Retention of 7 years is met through the S3 archive tier. ### Negative - Adding or changing an event type now needs a Postgres schema change, which was the original pain behind ADR-0007. This is acceptable because the shapes have settled into 11 types with a common envelope. - Events older than 13 months can't be queried alongside live data without separate tooling. - Backfill and cut-over carry a risk of data loss or inconsistency. ## Implementation Notes - Backfill from Atlas, validate completeness, then decommission the cluster by 2027-03-31. - Automate monthly partition creation and the 13-month archive job. ## Open Questions - [ ] Table design: typed columns for the common envelope plus JSONB for per-type payloads, or something else? - [ ] How will archived Parquet data be queried (and by whom) for compliance requests? - [ ] Cut-over approach: dual-write period or a single switch? - [ ] Verifying that S3 retention and immutability meet the compliance requirements. ## Related Decisions - Supersedes [ADR-0007](0007-mongodb-for-audit-log.md) ``` ## 3. Update `docs/adr/README.md` index ```markdown | [0007](0007-mongodb-for-audit-log.md) | Use MongoDB for the audit log | Superseded | 2024-03-12 | | [NNNN](NNNN-audit-log-to-postgresql.md) | Move audit log from MongoDB to partitioned PostgreSQL | Accepted | 2026-10-19 | ``` ## Things to check - I only used facts from your message. The Open Questions and the Negative consequences about archived-data access and schema review are my inferences, so please confirm or trim them. - If the review considered other options (e.g. Atlas-side archiving), add them to Considered Options. A fair record of rejected alternatives is valuable here. - Once the ADR is merged, create tickets for the backfill, the cut-over, and the Atlas decommission (due 2027-03-31).
without
Two changes: mark ADR-0007 as superseded, and add a new ADR for the replacement decision. I assumed the new ADR is **0015**, so please change the number in both files if that's not the next free one. ## 1. Edit `docs/adr/0007-mongodb-for-audit-log.md` Only the status line changes. The rest of the record stays as written. ```markdown # ADR-0007: Use MongoDB for the audit log Status: Superseded by [ADR-0015](0015-postgres-partitioned-audit-log.md) (2026-10-19). Originally accepted 2024-03-12. Context: Audit events have varied shapes per feature. Postgres schema changes were slow to get through review at the time. Decision: Store audit events in a dedicated MongoDB Atlas cluster. Consequences: Flexible schema; a second database to operate. ``` ## 2. Add `docs/adr/0015-postgres-partitioned-audit-log.md` ```markdown # ADR-0015: Store the audit log in partitioned PostgreSQL with S3 archival Status: Accepted (2026-10-19)
Show the rest (35 more lines)
Supersedes: [ADR-0007](0007-mongodb-for-audit-log.md) Owner: Ines Duarte Context: ADR-0007 chose MongoDB Atlas because audit events varied in shape per feature and Postgres schema changes were slow to get through review. Since then: - Compliance requires 7-year retention. Atlas storage at that volume is quoted at $4,100/month. - Finance needs to join audit events to invoices for disputes. Today this is a manual export. - Event shapes have settled into 11 types with a common envelope, so the flexible schema is no longer buying us much. Decision: - Write audit events to a monthly-partitioned PostgreSQL table. - Move partitions older than 13 months to S3 as Parquet. - Backfill existing events from Atlas into the new store. - Decommission the Atlas cluster by 2027-03-31. Consequences: - Audit events can be joined to invoices in SQL, which removes the manual export. - Long-term retention moves to S3/Parquet instead of Atlas storage, which addresses the cost of the 7-year requirement. - One fewer database to operate once Atlas is decommissioned. - We give up schema flexibility. New event types or envelope changes now need a Postgres migration and review. - Events older than 13 months are no longer in Postgres. Queries that span the archive boundary, such as old invoice disputes, must read from S3. - The backfill and the Atlas decommission are migration work with a hard deadline (2027-03-31). ``` ## Things to check - **ADR index:** if you keep a README or index in `docs/adr/`, add 0015 and update 0007's status there. - **Open questions:** the review notes don't say how the cutover works (dual-write or hard switch), how archived data will be queried, or what the Postgres and S3 cost estimate is. I left these out rather than guess. You may want to add them to Consequences, or put the migration plan in a separate doc linked from the ADR.

Answers are shown exactly as the model wrote them, from the first try, and nothing is picked by hand.

The models

2 models

Claude Sonnet 5.5

made by Anthropic

claude-sonnet-5-5 · revision not reported by the provider

1 try per case · tested 3 Nov 2026

GPT-6.1 Sol

made by OpenAI

gpt-6.1-sol · revision not reported by the provider

1 try per case · tested 3 Nov 2026

The tasks

written by Carte Blanche
queue-decision-from-notes

“Can you turn these meeting notes into an ADR for our repo?”

review-vague-microservices-adr

“Can you review this ADR before I merge it?”

short-pnpm-adr

“Write a one-page ADR for switching our monorepo from npm to pnpm.”

supersede-mongodb-audit-log

“We're reversing the decision below. Can you write up the changes we need in our docs/adr folder?”

which-changes-need-adrs

“Which of these upcoming changes actually need an ADR? Keep it brief.”

Install

Download the .zip and unzip it. Put its files, in a folder named architecture-decision-records, here:

Claude Code~/.claude/skills/Every project. For one project only, use .claude/skills/ inside it.
Codex~/.agents/skills/Every project. For one repository only, use .agents/skills/ inside it.
Cursor~/.cursor/skills/Cursor also reads the Claude Code and Codex folders above.

Then start a new session and ask for what the skill does. Other agents that read SKILL.md have their own skills folder; check their docs.

Coming after launch: get skills from inside your agent, no download needed.