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.

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

Source material given with the request

Tidewell platform sync, 2026-10-21. Present: Lena Hoffmann, Marco Bianchi, Ade Oyelaran, Sun Park. - Background jobs (rent reminders, statement PDFs, bank-feed imports) run today as cron scripts on one VM. Two missed runs last month; no retries, no visibility. - Load: ~400 jobs/min at the 1st-of-month peak. Sales forecast says ~1,200 jobs/min by end of 2027. - Options discussed: Kafka, Amazon SQS, a queue inside our existing PostgreSQL 16 database. - Kafka: nobody on the team has run it in production. Managed cluster quote ~$1,800/month. Lena: "massive overkill for 400 jobs a minute." - SQS: cheap and managed. But we need to enqueue a job in the same transaction as the row write (e.g. statement row + "render PDF" job) and SQS can't join a Postgres transaction, so we'd need an outbox table anyway. Marco still prefers SQS; agreed to disagree and commit. - Postgres queue using the pg-boss library (SKIP LOCKED under the hood). Transactional enqueue for free, one less system, retries and scheduling built in. - Risk: adds load to the primary DB. Ade: revisit if we sustain more than 3,000 jobs/min or if DB CPU stays above 60% at peak. - DECISION: go with pg-boss on the existing Postgres. Lena to spike it by Nov 13; cron scripts retired after all jobs are migrated.
with the skill
Here's the ADR, using the repo's standard format. I left the number as `NNNN`, so assign the next free one (or run `adr new`) and add it to the index. **Suggested path:** `docs/adr/NNNN-use-pg-boss-for-background-jobs.md` ```markdown # ADR-NNNN: Use pg-boss on Existing PostgreSQL for Background Jobs ## Status Accepted **Date**: 2026-10-21 **Deciders**: Lena Hoffmann, Marco Bianchi, Ade Oyelaran, Sun Park ## Context Background jobs (rent reminders, statement PDFs, bank-feed imports) currently run as cron scripts on a single VM. Last month there were two missed runs. There are no retries and no visibility into job state.
Show the rest (92 more lines)
Load today is ~400 jobs/min at the 1st-of-month peak. The sales forecast projects ~1,200 jobs/min by end of 2027. A key requirement is **transactional enqueue**: a job must be enqueued in the same transaction as the row write that triggers it (e.g. a statement row plus its "render PDF" job), so neither can exist without the other. ## Decision Drivers - Reliability: retries and visibility into failed or missed jobs - Transactional enqueue with Postgres writes - Operational simplicity; the team is small - Headroom for the ~3x growth forecast through 2027 - Cost ## Considered Options ### Option 1: Kafka - **Pros**: Very high throughput ceiling. - **Cons**: Nobody on the team has run it in production. A managed cluster was quoted at ~$1,800/month. Far beyond the needed scale (400 jobs/min today, ~1,200 forecast). It also cannot join a Postgres transaction. ### Option 2: Amazon SQS - **Pros**: Cheap and fully managed. - **Cons**: Cannot participate in a Postgres transaction, so we would need an outbox table and a relay process anyway, which adds a moving part and recreates part of what a Postgres-backed queue gives us directly. ### Option 3: Queue in existing PostgreSQL 16 via pg-boss - **Pros**: Transactional enqueue comes for free. No new system to operate. Retries and scheduling are built in. pg-boss uses `SKIP LOCKED` for job claiming. - **Cons**: Adds load to the primary database (see Risks). ## Decision We will use **pg-boss on the existing PostgreSQL 16 database** for background jobs. Once all jobs are migrated, the cron scripts will be retired. ## Consequences ### Positive - Job enqueue is atomic with the originating write, with no outbox needed - One less system to run, monitor, and pay for - Retries and scheduling replace the current no-retry cron behavior - Job state lives in the database, which gives the visibility we lack today ### Negative - Job traffic shares capacity with the primary database - Tied to Postgres; moving to a dedicated broker later means migrating the job layer - Marco preferred SQS. The disagreement was noted and he agreed to commit to this decision. ### Risks - **Primary DB load.** Mitigation: revisit this decision if sustained throughput exceeds **3,000 jobs/min**, or if **DB CPU stays above 60% at peak**. (Forecast peak of ~1,200 jobs/min is well under the throughput trigger.) ## Implementation Notes - Lena Hoffmann to spike pg-boss by **2026-11-13** - Migrate jobs from cron to pg-boss: rent reminders, statement PDFs, bank-feed imports - Retire cron scripts and the VM's job duties after all jobs are migrated - Monitor job throughput and DB CPU at peak against the revisit thresholds ## Related Decisions - None yet ## References - Tidewell platform sync meeting notes, 2026-10-21 - [pg-boss](https://github.com/timgit/pg-boss) ``` Some points to check before merging: 1. **Spike outcome:** The notes say Lena spikes by Nov 13 but don't say whether the decision is contingent on it. I marked it Accepted. If the spike could reverse the decision, use Proposed until it lands. 2. **Migration timeline:** The notes give no dates or order for migrating jobs, so I left them out. You may want to add them. 3. **Monitoring owner:** The notes don't say who watches the 3,000 jobs/min and 60% CPU triggers or where those metrics live. Adding that would make the revisit criteria enforceable. 4. **SQS cost:** The notes only quote Kafka. I described SQS as "cheap" as stated, without a number. 5. **Marco's dissent:** I recorded it neutrally under Consequences. Check that he's comfortable with the wording.
without
```markdown # ADR-XXXX: Use pg-boss on PostgreSQL for background job processing - **Status:** Accepted - **Date:** 2026-10-21 - **Deciders:** Lena Hoffmann, Marco Bianchi, Ade Oyelaran, Sun Park - **Source:** Tidewell platform sync, 2026-10-21 ## Context Background jobs (rent reminders, statement PDFs, bank-feed imports) currently run as cron scripts on a single VM. Last month this caused two missed runs. There are no retries and no visibility into job status or failures. Current load peaks at about 400 jobs/min on the 1st of the month. The sales forecast projects about 1,200 jobs/min by the end of 2027. A key requirement is that a job can be enqueued in the same transaction as the database write that triggers it (e.g., inserting a statement row and its "render PDF" job together). ## Options considered ### 1. Apache Kafka - No one on the team has run Kafka in production.
Show the rest (47 more lines)
- A managed cluster was quoted at about $1,800/month. - Judged to be massive overkill for the current and projected load (400 to 1,200 jobs/min). ### 2. Amazon SQS - Cheap and fully managed. - Cannot participate in a PostgreSQL transaction, so we would still need an outbox table and a relay process to get reliable transactional enqueue. That adds a component on top of SQS itself. ### 3. Queue inside the existing PostgreSQL 16 database (pg-boss) - pg-boss uses `SKIP LOCKED` under the hood. - Transactional enqueue comes for free, since jobs are rows in the same database. - One less system to operate. - Retries and scheduling are built in. - Risk: adds load to the primary database. ## Decision We will use **pg-boss on our existing PostgreSQL database** for background jobs. The cron scripts will be retired once all jobs have been migrated. ## Consequences **Positive** - Jobs can be enqueued atomically with the writes that trigger them, with no outbox table. - Retries and scheduling replace the current fire-and-forget cron behavior, addressing the missed-run problem. - No new infrastructure to buy, learn, or operate. **Negative / risks** - Queue traffic runs on the primary database and competes with application workload. - We are coupling job throughput to database capacity. - Marco preferred SQS. The disagreement was acknowledged, and the team agreed to disagree and commit. ## Revisit triggers Reconsider this decision if either of the following occurs: - Sustained throughput above **3,000 jobs/min**, or - Database CPU stays above **60% at peak**. ## Next steps - **Lena Hoffmann:** spike pg-boss by **2026-11-13**. - Migrate all existing cron jobs to pg-boss, then retire the cron scripts. ``` A few things the notes didn't cover, which you may want to fill in: - **ADR number:** I left `XXXX` as a placeholder. - **Spike criteria:** the notes don't say what the spike must show for the decision to hold. - **Migration timeline:** there's no target date for retiring the cron scripts. - **Monitoring:** the revisit triggers imply tracking jobs/min and DB CPU, but no owner or alerting was mentioned.

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.