skills/decision-logging/SKILL.md
# Decision Logging Skill When commands make architecture decisions (choosing tech stacks, patterns, frameworks, databases, etc.), they MUST log those decisions to `_state.json.decisions[]` for auditability and future reference. ## When to Log a Decision Log a decision whenever your command: 1. **Chooses a technology** (database, framework, language, messaging system, auth provider) 2. **Selects an architectural pattern** (monolith vs. microservices, clean vs. modular, etc.) 3. **Determines a
npx skillsauth add navraj007in/architecture-cowork-plugin skills/decision-loggingInstall 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.
When commands make architecture decisions (choosing tech stacks, patterns, frameworks, databases, etc.), they MUST log those decisions to _state.json.decisions[] for auditability and future reference.
Log a decision whenever your command:
Do NOT log:
Examples of decisions to log:
Each decision is a JSON object in the decisions[] array:
{
"id": "D-NNN",
"title": "Choose PostgreSQL for primary database",
"rationale": "ACID compliance for order consistency. Team has PostgreSQL expertise. Query flexibility for future analytics features.",
"alternatives_rejected": [
"MongoDB (weak multi-document transactions, overkill for relational data)",
"DynamoDB (cost scales poorly with joins, limited query flexibility)"
],
"trade_offs": "Higher operational complexity than managed cloud DBs. Team must maintain backups. Cold-start slower than serverless options.",
"made_by_command": "blueprint",
"timestamp": "2026-04-24T14:32:10Z"
}
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| id | string | Yes | Unique decision ID (e.g., "D-001", "D-002"). Increment sequentially within a project. |
| title | string | Yes | Brief decision title (3-10 words). E.g., "PostgreSQL for primary database" |
| rationale | string | Yes | Why this choice? What does it enable? What problem does it solve? (2-5 sentences or bullets) |
| alternatives_rejected | array of strings | Yes | What were the runner-up options and why did they lose? Makes future reconsideration easier. At least 2 alternatives. |
| trade_offs | string | Yes | What are you giving up? What becomes harder or more expensive? (1-3 sentences) |
| made_by_command | string | Yes | Which command made this decision? (e.g., "blueprint", "sdl", "scaffold") |
| timestamp | string | Yes | ISO-8601 timestamp when decision was made (e.g., "2026-04-24T14:32:10Z") |
1. Read current _state.json (if exists)
2. Read SDL and extract/determine tech choices
3. For each decision (e.g., database choice):
a. Create decision object with all 7 fields
b. Append to _state.json.decisions[] array
4. Write _state.json back to disk
# Read existing state
import json
from datetime import datetime
state = json.load(open('architecture-output/_state.json')) if os.path.exists(...) else {"decisions": []}
# Make a decision
new_decision = {
"id": f"D-{len(state.get('decisions', [])) + 1:03d}",
"title": "PostgreSQL for primary database",
"rationale": "ACID compliance for order consistency. Team has expertise. Query flexibility for analytics.",
"alternatives_rejected": [
"MongoDB (weak transactions, overkill for relational data)",
"DynamoDB (cost scales poorly, limited queries)"
],
"trade_offs": "Higher ops complexity. Team maintains backups. Cold-start slower than serverless.",
"made_by_command": "blueprint",
"timestamp": datetime.utcnow().isoformat() + "Z"
}
# Append to decisions array
state.setdefault("decisions", []).append(new_decision)
# Write back
json.dump(state, open('architecture-output/_state.json', 'w'))
// JavaScript equivalent
const fs = require('fs');
const path = require('path');
const stateFile = 'architecture-output/_state.json';
const state = fs.existsSync(stateFile)
? JSON.parse(fs.readFileSync(stateFile, 'utf8'))
: { decisions: [] };
const newDecision = {
id: `D-${String(state.decisions.length + 1).padStart(3, '0')}`,
title: "PostgreSQL for primary database",
rationale: "ACID compliance for order consistency. Team has expertise. Query flexibility for analytics.",
alternatives_rejected: [
"MongoDB (weak transactions, overkill for relational data)",
"DynamoDB (cost scales poorly, limited queries)"
],
trade_offs: "Higher ops complexity. Team maintains backups. Cold-start slower than serverless.",
made_by_command: "blueprint",
timestamp: new Date().toISOString().replace('Z', 'Z') // Ensure Z suffix
};
state.decisions.push(newDecision);
fs.writeFileSync(stateFile, JSON.stringify(state, null, 2));
Decision IDs are per-project (not global). Start at D-001 for the first decision:
D-001D-002D-003 (continues sequence, not restart)ID format: D-NNN where NNN is zero-padded 3-digit number.
If your command makes multiple decisions, create one object per decision:
{
"decisions": [
{
"id": "D-001",
"title": "PostgreSQL for primary database",
"rationale": "...",
"alternatives_rejected": ["..."],
"trade_offs": "...",
"made_by_command": "blueprint",
"timestamp": "2026-04-24T14:32:10Z"
},
{
"id": "D-002",
"title": "React for frontend framework",
"rationale": "...",
"alternatives_rejected": ["..."],
"trade_offs": "...",
"made_by_command": "blueprint",
"timestamp": "2026-04-24T14:32:15Z"
}
]
}
Each decision gets its own ID and timestamp (even if made seconds apart).
When ADRs are generated, they should reference decision IDs:
# ADR-001: Database Choice
**Decision ID:** D-001
## Status
Accepted
## Context
[Rationale from decisions[0].rationale]
## Decision
PostgreSQL
## Consequences
[Trade-offs from decisions[0].trade_offs]
## Alternatives Considered
- MongoDB: [from decisions[0].alternatives_rejected[0]]
- DynamoDB: [from decisions[0].alternatives_rejected[1]]
Users can analyze decisions via:
jq '.decisions' architecture-output/_state.json/architect:decisions-linked (Phase 1.5 command) generates markdown mapping decisions to ADRs/architect:check-state validates decision logging compliance/architect:check-state — Validates decisions array/architect:decisions-linked (Phase 1.5) — Maps decisions to ADRs/architect:generate-docs — Includes decision log in documentation{
"id": "D-001",
"title": "Next.js App Router for frontend",
"rationale": "Server components reduce client-side complexity. File-based routing matches team's experience. Excellent TypeScript support.",
"alternatives_rejected": [
"React SPA + Express (more configuration, fewer conventions)",
"Remix (smaller ecosystem, steeper learning curve)"
],
"trade_offs": "Tied to Vercel deployment for optimal performance. Vendor lock-in risk.",
"made_by_command": "blueprint",
"timestamp": "2026-04-24T10:00:00Z"
}
{
"id": "D-001",
"title": "Monolithic architecture for MVP",
"rationale": "Faster time-to-market. Simpler deployment. Team of 2 engineers. Can split to microservices later if needed.",
"alternatives_rejected": [
"Microservices (overkill complexity for MVP, ops overhead)",
"Serverless (unpredictable cold starts for user-facing APIs)"
],
"trade_offs": "Will need refactoring when scaling to 10+ services. Single point of failure. Database scaling limited.",
"made_by_command": "blueprint",
"timestamp": "2026-04-20T14:32:10Z"
}
If your command makes a tech choice but doesn't log it:
/architect:check-state may flag missing decisionsAlways log decisions. It's cheap, and it pays dividends.
development
# Trade-Off Analysis Skill Quantifies exact trade-offs when switching between architecture options. Shows users precisely what they gain and lose when choosing Option A over Option B. ## When to Use Use this skill to help users decide between options by showing: 1. **Cost difference** — how much more/less per month? 2. **Performance difference** — how much faster/slower? 3. **Complexity difference** — how much harder to build/maintain? 4. **Scalability difference** — when does this option hit
testing
# Stage Detection Skill Detects the current project stage (concept → mvp → growth → enterprise) based on `_state.json` field presence and completeness. Used by `/architect:next-steps`, `/architect:check-state`, and roadmap commands. ## When to Use Invoke this skill when you need to determine what stage a project is at based on its state file. Stage detection drives: - Command recommendations (what to run next) - Required fields validation (what should exist at this stage) - Risk assessment (w
development
# Stack Swap Simulator Skill Estimates cost and effort to switch from one tech stack to another. Helps answer: "Can we migrate later if needed?" ## When to Use Use this skill to understand: 1. **Cost of switching stacks** — engineer weeks + downtime risk 2. **Timeline to switch** — how long is the project? 3. **Risk of switching** — what can go wrong? 4. **ROI of switching** — does it save money long-term? 5. **Backwards compatibility** — can we do a gradual migration? ## Input Provide sour
tools
# Stack Compatibility Skill Verifies that chosen technologies integrate well together. Prevents "I picked these tools and they don't work well together" regrets. ## When to Use Use this skill to verify: 1. **Chosen tools work together** — React + Node + MongoDB = good? 2. **No hidden incompatibilities** — will I hit issues in production? 3. **Team can support it** — do we have expertise for this combo? 4. **Licenses compatible** — can we use these together commercially? 5. **Performance assum