agentsclimarketplace

Architecture decision records

Skill kinhluan/skills/.agent-skills/architecture-decision-records

πŸš€ Professional Multi-Agent Skills

Install
npx -y skills add kinhluan/skills --skill architecture-decision-records

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Create and manage Architecture Decision Records (ADRs) using MADR 4.0.0 format. Use this skill when evaluating technology choices, documenting design decisions, or reviewing past architectural choices.

SKILL.md

11.9 KB, as published. Nobody here has run it

Architecture Decision Records (ADR)

An Architecture Decision Record captures the context, decision, and consequences of significant technical choices. ADRs prevent re-litigating settled decisions and preserve institutional knowledge.

"Architecture is the stuff that's hard to change. Document why you chose it." β€” Michael Nygard


🎯 When to Write an ADR

SituationWrite ADR?Template
Choosing a database (PostgreSQL vs MongoDB)βœ… YesMADR Full
Adopting a framework (React vs Vue)βœ… YesMADR Full
REST vs GraphQL vs gRPCβœ… YesMADR Full
Adding a new microserviceβœ… YesMADR Full
Choosing a cloud providerβœ… YesMADR Full
Fixing a typo in config❌ Noβ€”
Adding a linter rule⚠️ MaybeMADR Minimal
Updating a dependency version⚠️ MaybeY-Statement

Rule of thumb: If the decision will affect the team for >6 months, write an ADR.


πŸ“ MADR 4.0.0 Template (Full)

MADR (Markdown Architectural Decision Records) is the industry standard. Version 4.0.0 was released September 2024.

---
status: proposed | accepted | rejected | deprecated | superseded by ADR-0012
date: 2024-01-15
decision-makers: [@alice, @bob]
consulted: [@charlie, @diana]
informed: [@team-backend]
---

# Use PostgreSQL as Primary Database

## Context and Problem Statement

We need a relational database for our e-commerce platform. The database must:
- Support ACID transactions for order processing
- Handle complex queries for reporting
- Scale to 10M+ products
- Have strong community support and tooling

## Decision Drivers

- **Data consistency:** Orders and payments require ACID guarantees
- **Query complexity:** Product search, order history, analytics need JOINs
- **Team expertise:** Team has 5+ years PostgreSQL experience
- **Operational cost:** Managed service availability (AWS RDS, GCP Cloud SQL)
- **Ecosystem:** ORM support, migration tools, monitoring

## Considered Options

- PostgreSQL
- MySQL
- MongoDB
- CockroachDB

## Decision Outcome

Chosen option: **"PostgreSQL"**, because it best satisfies our decision drivers:
- Full ACID compliance for financial transactions
- Advanced JSON support for flexible product attributes
- Excellent query planner for complex analytics
- Managed services available on AWS, GCP, Azure
- Team already proficient

### Consequences

- **Good**, because ACID transactions prevent data corruption in order processing
- **Good**, because JSONB columns allow flexible schema for product attributes without full NoSQL
- **Good**, because AWS RDS provides automated backups, failover, and patching
- **Bad**, because horizontal scaling requires read replicas or sharding (more complex than DynamoDB)
- **Bad**, because schema migrations require downtime or complex blue/green deployment

### Confirmation

- Validate: Run load test with 10M products + concurrent orders
- Revisit if: Write throughput exceeds 10K TPS or horizontal scaling becomes critical

## Pros and Cons of the Options

### PostgreSQL

- **Good**, because full ACID compliance and advanced SQL features
- **Good**, because JSONB provides document-like flexibility within relational structure
- **Good**, because mature ecosystem (PostGIS, full-text search, partitioning)
- **Bad**, because vertical scaling limits on single-node writes
- **Bad**, because schema changes require migration planning

### MySQL

- **Good**, because widely used, good performance for simple queries
- **Good**, because AWS Aurora provides excellent managed service
- **Bad**, because less advanced query planner for complex analytics
- **Bad**, because JSON support less mature than PostgreSQL JSONB

### MongoDB

- **Good**, because schema flexibility for rapidly changing product attributes
- **Good**, because horizontal scaling via sharding is native
- **Bad**, because eventual consistency unacceptable for financial transactions
- **Bad**, because team lacks operational experience
- **Bad**, because complex JOINs require application-level processing

### CockroachDB

- **Good**, because distributed SQL with horizontal scaling
- **Good**, because PostgreSQL-compatible wire protocol
- **Bad**, because higher operational complexity
- **Bad**, because smaller community, fewer managed service options
- **Bad**, because overkill for current scale (premature optimization)

## More Information

- [PostgreSQL vs MySQL comparison](https://www.postgresql.org/about/)
- [AWS RDS PostgreSQL](https://aws.amazon.com/rds/postgresql/)
- Related: ADR-0005 (Read Replica Strategy)

πŸ“ MADR Minimal Template

For smaller decisions, use the minimal template:

---
status: accepted
date: 2024-01-15
---

# Adopt Ruff for Python Linting

## Context

We currently use flake8 + black + isort. Three tools with separate configs.

## Decision

Replace with Ruff β€” one tool, faster, compatible.

## Consequences

- **Good**: Single config file, 10-100x faster
- **Bad**: Team needs to learn new rule codes
- **Mitigation**: Migration guide in docs/python-tooling.md

πŸ“ Y-Statement Template

For the fastest documentation (one sentence):

# Y-Statement: API Gateway Selection

In the context of **building a microservices architecture**,
facing **the need for centralized API management, authentication, and rate limiting**,
we decided for **Kong Gateway**
and against **AWS API Gateway and custom Nginx solution**,
to achieve **vendor independence, plugin extensibility, and team familiarity with Lua**,
accepting that **we need to manage Kong infrastructure ourselves**.

πŸ—οΈ ADR Directory Structure

docs/
β”œβ”€β”€ adr/
β”‚   β”œβ”€β”€ README.md              # Index and guidelines
β”‚   β”œβ”€β”€ template.md            # Your team's MADR template
β”‚   β”œβ”€β”€ 0001-record-architecture-decisions.md
β”‚   β”œβ”€β”€ 0002-use-postgresql.md
β”‚   β”œβ”€β”€ 0003-caching-strategy.md
β”‚   β”œβ”€β”€ 0004-microservices-vs-monolith.md
β”‚   β”œβ”€β”€ 0005-read-replica-strategy.md
β”‚   β”œβ”€β”€ 0006-graphql-api.md
β”‚   β”œβ”€β”€ 0007-event-driven-architecture.md
β”‚   β”œβ”€β”€ 0015-adopt-kubernetes.md
β”‚   β”œβ”€β”€ 0016-container-orchestration.md  # [SUPERSEDED by 0015]
β”‚   └── 0020-deprecate-rest-v1.md        # Supersedes implicit earlier decision

ADR Index (README.md)

# Architecture Decision Records

## Index

| ADR | Title | Status | Date | Supersedes |
|-----|-------|--------|------|------------|
| 0001 | Record Architecture Decisions | Accepted | 2024-01-10 | β€” |
| 0002 | Use PostgreSQL as Primary Database | Accepted | 2024-01-15 | β€” |
| 0003 | Caching Strategy with Redis | Accepted | 2024-01-20 | β€” |
| 0004 | Start with Modular Monolith | Accepted | 2024-02-01 | β€” |
| 0005 | Read Replica Strategy | Accepted | 2024-02-15 | β€” |
| 0006 | GraphQL for Mobile API | Accepted | 2024-03-01 | β€” |
| 0007 | Event-Driven Architecture | Accepted | 2024-03-15 | β€” |
| 0015 | Adopt Kubernetes | Accepted | 2024-06-01 | 0016 |
| 0016 | Container Orchestration with Docker Swarm | Deprecated | 2024-01-30 | β€” |
| 0020 | Deprecate REST API v1 | Accepted | 2024-08-01 | β€” |

## Status Definitions

- **Proposed**: Under discussion, seeking feedback
- **Accepted**: Decision made, being implemented
- **Rejected**: Considered but not adopted
- **Deprecated**: No longer relevant, but was accepted
- **Superseded**: Replaced by a newer ADR

## Creating a New ADR

1. Copy `template.md` to `NNNN-title-with-dashes.md`
2. Fill in all sections
3. Submit PR for team review
4. Update this index after merge

πŸ”„ ADR Lifecycle

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PROPOSED │───▢│ ACCEPTED │───▢│DEPRECATEDβ”‚    β”‚ REJECTED β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚               β”‚
                     β”‚         β”Œβ”€β”€β”€β”€β”€β”˜
                     β”‚         β–Ό
                     β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     └───▢│SUPERSEDEDβ”‚
                          β”‚ by ADR-X β”‚
                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

State Transitions

FromToTrigger
ProposedAcceptedTeam consensus in PR review
ProposedRejectedBetter alternative found
AcceptedDeprecatedTechnology no longer used
AcceptedSupersededNew ADR replaces this decision
Deprecatedβ€”Historical reference only

πŸ› οΈ Automation with adr-tools

# Install
brew install adr-tools

# Initialize ADR directory
adr init docs/adr

# Create new ADR (auto-numbers)
adr new "Use PostgreSQL as Primary Database"
# Creates: docs/adr/0002-use-postgresql-as-primary-database.md

# Supersede an ADR
adr new -s 3 "Use Redis Cluster for Caching"
# Creates new ADR that supersedes ADR-0003

# Link related ADRs
adr link 5 "Enables" 6 "Is enabled by"

# Generate table of contents
adr generate toc > docs/adr/README.md

🎯 Decision Quality Checklist

Before accepting an ADR, verify:

  • Context is clear: Someone reading this in 2 years understands the problem
  • Drivers are explicit: Criteria for evaluating options are stated
  • Options are comprehensive: At least 3 alternatives considered (including "do nothing")
  • Trade-offs are honest: Both good and bad consequences documented
  • Decision is reversible: How hard to undo? (should be stated)
  • Confirmation defined: How will we know this decision was correct?
  • Stakeholders consulted: Decision-makers, consulted, informed listed
  • Related ADRs linked: Dependencies and superseded decisions referenced

🚫 ADR Anti-Patterns

Anti-PatternSymptomFix
Decision Without Context"We chose X" with no explanationAlways include "why this problem matters"
One Option OnlyOnly the chosen option documentedDocument all considered options with pros/cons
No ConsequencesOnly positive outcomes listedBe honest about negative consequences
Perpetual ProposedADR stays "proposed" for monthsSet decision deadline (e.g., 2 weeks)
Editing Accepted ADRsChanging ADR-0002 after acceptanceCreate ADR-0020 that supersedes it
ADR for EverythingADR for linter rule changesUse minimal template or skip for trivial decisions
Missing LinksRelated decisions not connectedUse adr link or manual references

πŸ”— Integration with Other Skills

SkillIntegration
c4-modelADRs document "why" behind C4 L2 container choices
ddd-coreADRs capture subdomain classification decisions
why-strategic-rationaleADR = technical implementation of WHY statement
evolutionary-architectureADRs track architectural dimension decisions

πŸ“š References

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.