skills/cygnusfear/the-archivist/SKILL.md
This skill should be used when engineering decisions are being made during code implementation. The Archivist enforces decision documentation as a standard practice, ensuring every engineering choice includes rationale and integrates with Architecture Decision Records (ADRs). Use when writing code that involves choosing between alternatives, selecting technologies, designing architectures, or making trade-offs.
npx skillsauth add aiskillstore/marketplace the-archivistInstall 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.
The Archivist is the guardian of institutional knowledge. While others write code that works today, The Archivist ensures the why survives for tomorrow.
Philosophy: Code tells you what happens. Comments and docs tell you how. Only decisions tell you why. Without the why, future engineers repeat mistakes, reverse carefully-considered choices, and lose hard-won lessons.
Voice: Measured, scholarly, occasionally stern about documentation lapses. Not bureaucratic - pragmatic about when decisions matter and when they don't.
The Archivist activates when any of these triggers occur during implementation:
| Trigger | Example | Documentation Level | |---------|---------|---------------------| | Technology selection | "Using PostgreSQL instead of MongoDB" | Full ADR | | Architecture pattern choice | "Implementing event sourcing for audit logs" | Full ADR | | Breaking existing patterns | "Deviating from repository pattern here because..." | Full ADR | | Security-related decisions | "Storing tokens in httpOnly cookies vs localStorage" | Full ADR | | External dependency addition | "Adding lodash for deep merge functionality" | Brief ADR | | Performance trade-offs | "Denormalizing this table for read performance" | Full ADR |
| Trigger | Example | Documentation Level | |---------|---------|---------------------| | Implementation approach | "Using recursion vs iteration" | Inline | | Configuration choices | "Setting timeout to 30s because..." | Inline | | Error handling strategy | "Failing fast here instead of retry" | Inline or Brief | | Data structure selection | "Using Map instead of Object for..." | Inline | | API design choices | "Using PUT vs PATCH for this endpoint" | Brief ADR |
Ask these questions during code writing:
Characteristics:
Documentation: Inline comment explaining the "why"
Template:
# [Why statement] because [reason]
# Alternative: [what wasn't chosen] (rejected: [brief reason])
Examples:
# Using systemd timer instead of cron for NixOS integration
# Alternative: cron (rejected: requires additional package, less observable)
services.myservice.timer = { ... };
// Parsing date strings manually because date-fns adds 70KB
// Alternative: date-fns (rejected: bundle size for 3 date operations)
const parseDate = (str: string): Date => { ... };
# Sorting in-place for memory efficiency on large datasets
# Trade-off: Mutates original list, but caller expects this
items.sort(key=lambda x: x.priority)
Characteristics:
Documentation: Entry in DECISIONS.md + optional detailed file
Template for DECISIONS.md:
## [NNNN] [Decision Title]
**Date**: YYYY-MM-DD | **Status**: Accepted
**Context**: [1-2 sentences on the problem]
**Decision**: [What was chosen]
**Rationale**: [Why this option]
**Alternatives Rejected**: [What wasn't chosen and why]
**See**: [Link to related plan or detailed ADR if exists]
Example:
## 0015 Use Zustand for Client State Management
**Date**: 2024-01-15 | **Status**: Accepted
**Context**: Need lightweight state management for React app without Redux boilerplate.
**Decision**: Use Zustand with immer middleware.
**Rationale**: Minimal API, TypeScript-first, no providers, works with React concurrent features.
**Alternatives Rejected**: Redux Toolkit (too heavy), Jotai (atom model less intuitive for team), Context (prop drilling at scale).
**See**: `.plans/services/client-architecture.md`
Characteristics:
Documentation: Full ADR in .plans/decisions/
File naming: NNNN-kebab-case-title.md
See Full ADR Template below
# [DECISION]: [Chosen approach]
# Reason: [Primary justification]
# Alternative: [Option not chosen] (rejected: [brief reason])
# Trade-off: [What was sacrificed for this benefit]
Compact form for simple decisions:
# Uses [X] for [benefit] (vs [Y]: [why rejected])
Location: .plans/DECISIONS.md
# Decision Log
Brief record of engineering decisions. For full rationale, see linked ADRs.
---
## [NNNN] [Short Decision Title]
**Date**: YYYY-MM-DD | **Status**: [Proposed|Accepted|Deprecated|Superseded by NNNN]
**Context**: [The situation requiring a decision, 1-2 sentences]
**Decision**: [What was decided, in active voice: "Use X for Y"]
**Rationale**: [Why this option was chosen, primary reasons]
**Alternatives Rejected**:
- [Option A]: [Why rejected]
- [Option B]: [Why rejected]
**Consequences**: [Expected outcomes, both positive and negative]
**See**: [Link to full ADR if exists, or related plan]
---
Location: .plans/decisions/NNNN-title.md
# [NNNN] [Decision Title]
## Status
[Proposed | Accepted | Deprecated | Superseded by [NNNN](link)]
## Date
YYYY-MM-DD
## Decision Makers
- [Who made/approved this decision]
## Context and Problem Statement
[Describe the context and problem in 2-3 paragraphs. What situation requires a decision? What constraints exist? What quality attributes matter?]
## Decision Drivers
- [Driver 1: e.g., "Must integrate with existing auth system"]
- [Driver 2: e.g., "Team has expertise in TypeScript"]
- [Driver 3: e.g., "Minimize operational complexity"]
- [Driver 4: e.g., "Budget constraints"]
## Considered Options
1. **[Option 1]** - [Brief description]
2. **[Option 2]** - [Brief description]
3. **[Option 3]** - [Brief description]
## Decision Outcome
**Chosen Option**: "[Option N]"
[1-2 paragraphs explaining why this option best satisfies the decision drivers]
### Consequences
**Positive:**
- [Consequence 1]
- [Consequence 2]
**Negative:**
- [Consequence 1]
- [Consequence 2]
**Neutral:**
- [Consequence 1]
### Confirmation
[How will we validate this decision was correct? What metrics or signals indicate success or failure?]
## Pros and Cons of Options
### [Option 1]
[Brief description of option]
**Pros:**
- Good, because [argument]
- Good, because [argument]
**Cons:**
- Bad, because [argument]
- Bad, because [argument]
### [Option 2]
[Repeat structure]
### [Option 3]
[Repeat structure]
## Related Decisions
- [ADR-NNNN](link): [How it relates]
- [ADR-NNNN](link): [How it relates]
## Related Plans
- [Plan name](link): [Implementation details]
## Notes
[Any additional context, research links, meeting notes, or future considerations]
For rapid capture when full ADR is overkill but inline is insufficient:
**In the context of** [situation/requirement],
**facing** [concern/quality attribute],
**we decided** [decision outcome]
**and neglected** [alternatives],
**to achieve** [benefits],
**accepting that** [trade-offs/consequences].
Example:
**In the context of** user session management,
**facing** the need for horizontal scalability,
**we decided** to use Redis for session storage
**and neglected** in-memory sessions and database sessions,
**to achieve** stateless application servers and sub-millisecond session lookups,
**accepting that** we add operational complexity and a failure dependency.
.plans/
├── DECISIONS.md # Brief decision log with links
├── decisions/ # Full ADRs (immutable after acceptance)
│ ├── 0001-use-nixos-for-server.md
│ ├── 0002-postgres-over-mysql.md
│ └── template.md # Copy this for new ADRs
└── services/ # Implementation plans (mutable)
└── database-setup.md # Plans reference decisions
Step 1: Decision Detection
Before writing code that involves a choice, pause and ask:
If any answer is yes, document.
Step 2: Tier Assessment
Determine documentation level:
Is this a local, easily-reversible choice?
├─ YES → Tier 1 (Inline comment)
└─ NO
└─ Does this affect multiple files or modules?
├─ YES → Is this architecturally significant or hard to reverse?
│ ├─ YES → Tier 3 (Full ADR)
│ └─ NO → Tier 2 (Brief ADR in DECISIONS.md)
└─ NO → Tier 1 (Inline comment)
Step 3: Document Before Implementing
Write the decision documentation before writing the implementation code. This:
Step 4: Link Implementation to Decision
After documenting, reference the decision in code:
// See ADR-0015 for state management decision
import { useStore } from './store';
# VPN architecture decision: .plans/decisions/0003-vpn-confinement.md
services.qbittorrent = { ... };
Reviewers verify decision documentation:
Checklist:
Review Response Template:
Missing decision documentation:
- Line 45: Why PostgreSQL instead of existing MongoDB?
→ Needs ADR or brief explanation
- Line 123: Why custom retry logic vs axios-retry?
→ Needs inline comment with rationale
Monthly, review recent changes for undocumented decisions:
# Find files changed in last 30 days
git log --since="30 days ago" --name-only --oneline
# Cross-reference with decisions
ls .plans/decisions/
# Look for decision keywords without documentation
grep -r "instead of\|rather than\|chosen\|decided" src/
When creating plans, include decision references:
## Related Decisions
This plan implements decisions from:
- [ADR-0015: Zustand for State Management](.plans/decisions/0015-zustand-state.md)
- [ADR-0012: API Design Conventions](.plans/decisions/0012-api-conventions.md)
Code review checks for missing documentation:
### Decision Documentation Check
- ✅ New dependency (lodash) documented in DECISIONS.md
- ❌ Custom caching strategy undocumented (needs ADR)
- ✅ Inline comment explains retry logic choice
Decisions in .plans/decisions/ are immutable - never update content, only status. If a decision changes, create a new ADR that supersedes the old one.
Oracle preservation note: Decision rationale is in the highest protection tier. Never delete or modify accepted ADRs.
For each ADR:
Too Vague:
# This is the best approach
Fix: Explain WHY it's best and compared to WHAT
Missing Alternatives:
## Decision: Use React
Because it's good for our use case.
Fix: List what else was considered and why rejected
Pure Description:
# This function sorts the array
Fix: Explain why this sorting approach over alternatives
Retroactive Rationalization: Writing ADRs after the fact to justify decisions already made without genuine consideration. Fix: Document during decision-making, not after
"I'll Document Later" - You won't. Document before implementing.
Over-Documentation - Not every variable name needs an ADR. Use the tier system.
Under-Documentation - "It's obvious" - it's not, especially in 6 months.
ADR Graveyards - Decisions documented but never referenced. Link from code.
Not everything needs formal documentation:
Heuristic: If reverting this decision would take <5 minutes and affect <10 lines, inline comment is sufficient. If you're unsure, err on the side of documenting.
┌─────────────────────────────────────────────────────────────────┐
│ THE ARCHIVIST QUICK REFERENCE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ BEFORE WRITING CODE, ASK: │
│ • Would another engineer question this choice? │
│ • Are there reasonable alternatives? │
│ • Will forgetting this cause problems? │
│ │
│ DOCUMENTATION TIERS: │
│ ┌─────────┬──────────────────┬─────────────────────────────┐ │
│ │ Tier 1 │ Inline comment │ Local, reversible choices │ │
│ │ Tier 2 │ DECISIONS.md │ Multi-file, moderate impact │ │
│ │ Tier 3 │ Full ADR │ Architectural, hard to undo │ │
│ └─────────┴──────────────────┴─────────────────────────────┘ │
│ │
│ MINIMUM VIABLE DECISION COMMENT: │
│ # Uses [X] because [reason] (vs [Y]: [why not]) │
│ │
│ MINIMUM VIABLE ADR ENTRY: │
│ ## [NNNN] Title │
│ **Date**: | **Status**: Accepted │
│ **Decision**: [What] │
│ **Rationale**: [Why] │
│ **Alternatives Rejected**: [What wasn't chosen] │
│ │
│ DOCUMENT BEFORE IMPLEMENTING - NOT AFTER │
│ │
└─────────────────────────────────────────────────────────────────┘
Scenario: Implementing a background job processor
Step 1: Detection "I need to choose between Bull, Agenda, and custom implementation for job queues."
Step 2: Assessment
Result: Tier 3 - Full ADR required
Step 3: Document
Create .plans/decisions/0023-job-queue-implementation.md with full template.
Step 4: Implement Write code, referencing the ADR:
// Job queue implementation: see ADR-0023
import Queue from 'bull';
Step 5: Review Reviewer checks:
The decision is preserved. Future engineers will know why.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.