retrofit-decision
Document an existing decision from code as an ADR or DES
What this skill does
# Retrofit Decision
Document an existing architectural decision or design pattern from the codebase.
## Input
Topic or pattern: $ARGUMENTS
## Context
**You must load the following skills and read the following files before proceeding.**
### Skills
- `katachi:retrofit-existing` - Retrofit workflow
### Decision indexes
- `docs/architecture/README.md` - Architecture decisions (ADRs)
- `docs/design/README.md` - Design patterns (DES)
### Vision (if present)
- `docs/planning/VISION.md` - Project context for inference
### Reference Guides
- `${CLAUDE_PLUGIN_ROOT}/skills/framework-core/references/code-examples.md` - Code snippet guidance (especially for DES)
- `${CLAUDE_PLUGIN_ROOT}/skills/framework-core/references/technical-diagrams.md` - Technical diagram guidance
## Pre-Check
Verify:
- The docs/architecture/ and docs/design/ directories exist
- User understands this documents existing choices, not new decisions
## Process
### 1. Understand the Topic
If topic is vague, ask for clarification:
```
"You mentioned: [topic]
Can you point me to:
- A specific file or module that uses this pattern?
- Or describe how this decision manifests in the code?"
```
### 2. Read Relevant Code
Read files that demonstrate the decision:
- Look for patterns in the code
- Check comments for rationale
- Examine git history if helpful
### 3. Dispatch Codebase Analyzer
```python
Task(
subagent_type="katachi:codebase-analyzer",
prompt=f"""
Analyze the codebase to document this decision.
## Analysis Type
decision
## Topic
{topic_description}
## Relevant Code
{code_content}
## Project Context
{vision_content if exists else "Infer from code"}
"""
)
```
### 4. Determine Document Type
Based on analysis, present recommendation:
```
"Based on the code analysis, this appears to be a [ADR/DES]:
[If ADR]:
This is an architectural decision - a one-time choice that would be expensive
to change. Examples: database choice, framework, authentication approach.
[If DES]:
This is a design pattern - a repeatable approach used in multiple places.
Examples: error handling, logging conventions, test structure.
Do you agree with this classification, or should it be the other type?"
```
### 5. Present Draft Document
Show the agent's draft:
```
## Draft [ADR/DES]
[Draft content]
---
### Notes from Analysis
- Context inferred from: [source]
- Alternatives inferred because: [reasoning]
- Consequences observed in: [locations]
What needs adjustment?
```
### 6. Iterate on Document
User provides corrections:
- Clarify context
- Add known alternatives
- Correct consequences
- Add details
Continue until user approves.
### 7. Assign ID
Check existing documents:
For ADR:
```bash
ls docs/architecture/ADR-*.md
# Determine next number: ADR-NNN
```
For DES:
```bash
ls docs/design/DES-*.md
# Determine next number: DES-NNN
```
### 8. Update Index
**For ADR:**
Update `docs/architecture/README.md`:
- Add to ADR table
- Add to quick reference if applicable
- Note what areas it affects
**For DES:**
Update `docs/design/README.md`:
- Add to DES table
- Add to quick reference if applicable
- Note when to use this pattern
### 9. Save Document
Write to appropriate location:
For ADR:
```markdown
# ADR-NNN: [Title]
## Retrofit Note
This ADR documents an existing decision discovered in the codebase.
Decision likely made: [date from git history or "Unknown"]
---
[Rest of ADR content with status: Accepted]
```
For DES:
```markdown
# DES-NNN: [Pattern Name]
## Retrofit Note
This DES documents an existing pattern discovered in the codebase.
Pattern established in: [files where first used]
---
[Rest of DES content]
```
### 10. Identify Affected Features
Ask:
```
"Which existing features use this [decision/pattern]?
I'll update their specs/designs to reference this document."
```
For each affected feature, note to update:
- Design document (reference the ADR/DES)
- Plan (add to pre-implementation checklist for future features)
### 11. Summary and Next Steps
```
"Decision documented:
File: docs/[architecture/design]/[ADR/DES]-NNN-title.md
Type: [ADR/DES]
Status: Accepted
The [decision/pattern] is now part of the documented framework.
Future features should:
- Reference this in their designs
- Follow this [decision/pattern] unless superseding
Would you like to:
- Retrofit another decision: /katachi:retrofit-decision <topic>
- Update a feature design to reference this decision
- Retrofit a spec: /katachi:retrofit-spec <path>"
```
## Workflow
This is a collaborative process:
- Understand the topic
- Read relevant code
- Agent creates draft
- Determine ADR vs DES
- Iterate with user corrections
- Assign ID and save
- Update indexes
- Identify affected features
- Offer next steps
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.