plugins/architecture-docs/skills/arch-doc-patterns/SKILL.md
# Architecture Documentation Patterns ## C4 Model Patterns ### Level selection guide | Audience | Level | Format | |----------|-------|--------| | Executive sponsor, non-technical stakeholders | L1 Context | One diagram, one page | | Product managers, frontend developers, DevOps | L2 Container | 1-2 diagrams with tech annotations | | Backend developers maintaining a service | L3 Component | Per-service, updated when structure changes | | Code reviewers | L4 Code | Auto-generate from IDE; rare
npx skillsauth add hermeticormus/librecopy-claude-code plugins/architecture-docs/skills/arch-doc-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Audience | Level | Format | |----------|-------|--------| | Executive sponsor, non-technical stakeholders | L1 Context | One diagram, one page | | Product managers, frontend developers, DevOps | L2 Container | 1-2 diagrams with tech annotations | | Backend developers maintaining a service | L3 Component | Per-service, updated when structure changes | | Code reviewers | L4 Code | Auto-generate from IDE; rarely hand-authored |
# Bad: names a technology
"Express.js Server"
"React Frontend"
"Redis"
# Good: names the capability, technology as annotation
"API Gateway [Node.js/Express]" - Routes and authenticates all client requests
"Customer Portal [React SPA]" - Self-service account and billing management
"Session Cache [Redis]" - Stores active user sessions with 30-min TTL
Always label relationships with the communication mechanism:
Rel(spa, api, "Calls", "HTTPS/REST")
Rel(api, orders, "Publishes events to", "AMQP")
Rel(orders, db, "Persists to", "PostgreSQL wire protocol")
Rel(worker, queue, "Consumes from", "SQS long-poll")
System boundary = what your team owns and can change. External = everything else.
System_Boundary(platform, "Payments Platform") {
Container(api, "Payments API", "Go", "Charge, refund, dispute")
Container(worker, "Settlement Worker", "Go", "Daily batch reconciliation")
ContainerDb(db, "Payments DB", "PostgreSQL")
}
# These are external - your team does not change them:
System_Ext(stripe, "Stripe", "Card network processing")
System_Ext(bank, "Banking Partner", "ACH transfers")
# Bad
**Negative:**
- May have performance implications
- Could increase complexity
# Good
**Negative:**
- Read model lags writes by ~500ms; dashboards will not show real-time data
- Two additional services to monitor (projection worker, read model store)
- Schema changes require updating both write model migration AND read model projection
Template: "In the context of [situation], facing [concern], we decided for [option], to achieve [quality], accepting [downside]."
In the context of choosing a caching strategy for product catalog data,
facing read throughput of 5,000 requests/second exceeding PostgreSQL capacity,
we decided for Redis with a write-through cache pattern,
to achieve sub-10ms read latency for catalog queries,
accepting that cache invalidation logic adds complexity to the write path.
Every ADR should include a comparison table. Minimum columns: option, key benefit, key cost, reason accepted/rejected.
| Option | Benefit | Cost | Verdict |
|--------|---------|------|---------|
| Redis write-through | Sub-10ms reads | Cache invalidation complexity | **Chosen** |
| Read replicas | Simple, PostgreSQL-native | 50-100ms replication lag | Rejected: latency too high |
| In-memory (application) | Zero network hops | No shared state across instances | Rejected: stale data risk |
| CDN edge caching | Global distribution | Cache headers complexity, 60s staleness | Deferred to v2 |
Not every project needs all 12 arc42 sections. Prioritize:
Always write:
Write when relevant:
Skip or defer:
sequenceDiagram
participant Client
participant Gateway as API Gateway
participant Auth as Auth Service
participant Orders as Order Service
participant DB as PostgreSQL
Client->>Gateway: POST /orders (Bearer token)
Gateway->>Auth: Validate token
Auth-->>Gateway: {user_id, scopes}
Gateway->>Orders: createOrder(user_id, items)
Orders->>DB: BEGIN; INSERT order; COMMIT
DB-->>Orders: order_id
Orders-->>Gateway: 201 Created {order_id}
Gateway-->>Client: 201 Created {order_id}
erDiagram
ORDER {
uuid id PK
uuid user_id FK
string status
integer total_cents
timestamp created_at
}
ORDER_ITEM {
uuid id PK
uuid order_id FK
uuid product_id FK
integer quantity
integer unit_price_cents
}
ORDER ||--o{ ORDER_ITEM : "contains"
Diagrams that were accurate 18 months ago but no longer reflect reality. Solution: tie diagram updates to architectural change tasks, not documentation sprints.
Using only L1 context diagrams for developers, or only L3 component diagrams for executives. Match diagram detail to audience.
Naming containers by technology ("MongoDB cluster", "Lambda function") instead of capability ("User Profile Store", "Image Resize Worker"). Technologies change; capabilities persist.
Writing an ADR that presents only the chosen option without alternatives. If no alternatives are considered, it is not a decision record.
Including architecture diagrams in documentation that nobody maintains. Either automate generation (Structurizr from code) or commit to a review cadence.
tools
# User Doc Patterns > Patterns for writing clear, accessible end-user documentation. ## Knowledge Base ### User Documentation vs Developer Documentation | User Docs | Developer Docs | |-----------|---------------| | Task-oriented ("How do I...") | Concept-oriented ("How does it work...") | | Plain language | Technical language | | Screenshots and visual aids | Code examples | | Step-by-step procedures | API references | | Feature names and UI labels | Function signatures and parameters | | A
tools
# Tutorial Structures > Pedagogical patterns and frameworks for creating effective technical tutorials. ## Knowledge Base ### The Tutorial Spectrum Tutorials exist on a spectrum between two extremes: | Recipe | Concept Guide | |--------|--------------| | "Do exactly this" | "Understand this idea" | | Step-by-step | Explanation-heavy | | Fast to complete | Deep understanding | | Low retention | High retention | The best tutorials blend both: steps for doing, explanations for understanding.
tools
# Tutorial Patterns ## Tutorial vs. How-to Guide: The Critical Distinction Before writing, identify which document is actually needed: | Tutorial | How-to Guide | |----------|-------------| | "Build a REST API in Node.js" | "Add JWT authentication to your Express API" | | For someone new to this | For someone who knows the domain | | Explains why each step is done | Steps are efficient, minimal explanation | | Has checkpoints, explores | Numbered steps, no detours | | Learner reaches a comple
tools
# Tech Blogging Patterns ## The Developer Reading Pattern Developers do not read technical posts linearly. They scan in this order: 1. Headline (is this relevant to me?) 2. Code blocks (is this real code I can use?) 3. Headers (what does this cover?) 4. First paragraph (what's the point?) 5. Key takeaways / conclusion (is it worth reading fully?) Design for scanning first, reading second. Put real code within the first 25% of the post. ## The Before/After Pattern The contrast between a pain