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
Suggested file: `docs/adr/NNNN-use-pg-boss-for-background-jobs.md` Replace `NNNN` with the next available ADR number. # ADR-NNNN: Use pg-boss on PostgreSQL for Background Jobs - **Status:** Accepted - **Date:** 2026-10-21 - **Participants:** Lena Hoffmann, Marco Bianchi, Ade Oyelaran, Sun Park - **Source:** Tidewell platform sync ## Context Background jobs—including rent reminders, statement PDF generation, and bank-feed imports—currently run as cron scripts on a single VM. Two runs were missed last month. The current setup provides neither retries nor visibility into job execution. Peak volume is approximately 400 jobs per minute at the start of each month. Sales forecasts project approximately 1,200 jobs per minute by the end of 2027. Some jobs must be enqueued atomically with application data changes. For example, creating a statement row and enqueuing its PDF-rendering job must succeed or fail together. ## Decision Drivers
Show the rest (61 more lines)
- Atomic enqueue alongside application writes in PostgreSQL. - Retries, scheduling, and visibility into job execution. - Capacity for current and forecast job volumes. - Low operational complexity and cost. - Protection of primary database performance. ## Considered Options | Option | Benefits | Drawbacks | | --- | --- | --- | | Kafka | Separates job infrastructure from the primary database. | No team production experience; managed cluster quoted at approximately $1,800/month; considered excessive for the current workload. Atomic enqueue with PostgreSQL writes would require an additional coordination pattern. | | Amazon SQS | Low-cost, managed service; separates queue storage from the primary database. | Cannot participate in a PostgreSQL transaction. Would require an outbox table and a mechanism to publish its entries to SQS. | | pg-boss on existing PostgreSQL 16 | Supports transactional enqueue, built-in retries and scheduling, and avoids introducing another infrastructure service. Uses PostgreSQL `SKIP LOCKED` for job claiming. | Adds queue-related load to the primary database and couples job processing capacity to database capacity. | ## Decision Use **pg-boss on the existing PostgreSQL 16 database** for background jobs. Where a job depends on an application write, enqueue it within the same database transaction so that the write and enqueue commit or roll back together. Migrate the existing background jobs to pg-boss and retire the cron scripts after all jobs have been migrated. ## Rationale pg-boss meets the transactional enqueue requirement without introducing an outbox publishing mechanism or another infrastructure service. Its built-in retries and scheduling address key gaps in the current cron-based approach. The team judged Kafka disproportionate to the current workload, cost, and available operational experience. SQS remains a viable alternative, but its operational benefits did not outweigh the additional outbox and publishing mechanism required for transactional consistency. Marco Bianchi preferred SQS but agreed to commit to the pg-boss decision. ## Consequences ### Positive - Application writes and dependent job enqueue operations can be atomic. - Built-in retries and scheduling replace capabilities missing from the current setup. - No additional queue infrastructure service is required. - The team avoids the quoted Kafka cluster cost and the need to develop Kafka operational expertise. ### Negative and Risks - Queue operations add load to the primary PostgreSQL database. - Background processing and application database workloads share capacity and a failure domain. - Migrating the existing scripts requires implementation and validation work. - Job execution visibility must be implemented and verified during rollout; adopting the library alone does not establish operational monitoring. ## Implementation and Follow-up - **Lena Hoffmann:** Complete a pg-boss spike by **2026-11-13**. - Migrate rent reminders, statement PDF generation, and bank-feed imports. - Retire the cron scripts after all jobs have been migrated. - Monitor job throughput and primary database CPU to support the review criteria below. ## Review Triggers Revisit this decision if either condition occurs: - Sustained throughput exceeds **3,000 jobs per minute**. - Primary database CPU remains above **60% at peak**. The measurement windows for “sustained” throughput and persistent peak CPU were not specified in the meeting and need to be defined for monitoring.
without
# ADR: Use pg-boss for background jobs - **Status:** Accepted - **Date:** 2026-10-21 - **Participants:** Lena Hoffmann, Marco Bianchi, Ade Oyelaran, Sun Park - **Source:** Tidewell platform sync ## Context Background jobs—including rent reminders, statement PDF generation, and bank-feed imports—currently run as cron scripts on a single VM. Two runs were missed last month. The current setup provides neither retries nor operational visibility. Peak volume is approximately 400 jobs per minute at the start of each month. Sales forecasts project approximately 1,200 jobs per minute by the end of 2027. Some jobs must be enqueued atomically with application data changes. For example, creating a statement row and enqueueing its PDF-rendering job must occur in the same database transaction. ## Decision Use **pg-boss on the existing PostgreSQL 16 database** for background job processing. pg-boss uses PostgreSQL’s `SKIP LOCKED` mechanism and supports transactional enqueueing, retries, and scheduling. This meets our current requirements without introducing another infrastructure system.
Show the rest (59 more lines)
Retire the existing cron scripts after all jobs have been migrated. ## Options considered ### Kafka **Advantages** - A separate messaging platform rather than adding queue workload to the primary database. **Disadvantages** - No team member has operated Kafka in production. - A managed cluster was quoted at approximately $1,800 per month. - Considered excessive for the current workload of 400 jobs per minute. **Outcome:** Rejected due to operational complexity and cost relative to current needs. ### Amazon SQS **Advantages** - Low-cost, managed service. **Disadvantages** - Cannot participate in a PostgreSQL transaction. - Would require an outbox table and associated delivery mechanism to keep application writes and job enqueueing atomic. **Outcome:** Not selected. Marco preferred SQS but agreed to disagree and commit to the pg-boss decision. ### pg-boss on PostgreSQL **Advantages** - Supports enqueueing jobs in the same transaction as application writes. - Uses the existing PostgreSQL deployment. - Provides built-in retries and scheduling. - Avoids introducing another infrastructure system. **Disadvantages** - Adds queue-processing load to the primary database. **Outcome:** Selected. ## Consequences - Background job processing will share database resources with application workloads. - Transactional enqueueing avoids the separate outbox-to-external-queue delivery mechanism that SQS would require. - Built-in retries and scheduling replace capabilities missing from the current cron setup. - Database load and job throughput must be monitored to determine when to revisit this choice. ## Revisit criteria Revisit this decision if either condition occurs: - Sustained throughput exceeds **3,000 jobs per minute**. - Primary database CPU remains above **60% during peak periods**. ## Implementation and migration - **Lena Hoffmann** will complete a pg-boss spike by **2026-11-13**. - Migrate the existing background jobs to pg-boss. - Retire the cron scripts once all jobs have been migrated.

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.