compound-docs
This skill should be used when a problem has been solved and needs to be captured as categorized documentation with YAML frontmatter for searchable institutional knowledge.
What this skill does
# compound-docs
Automatically document solved problems to build searchable institutional knowledge with category-based organization and enum-validated problem types.
## Overview
This skill captures problem solutions immediately after confirmation, creating structured documentation that serves as a searchable knowledge base for future sessions.
**Organization:** Single-file architecture -- each problem documented as one markdown file in its symptom category directory (e.g., `docs/solutions/performance-issues/n-plus-one-briefs.md`). Files use YAML frontmatter for metadata and searchability.
## 7-Step Process
### Step 1: Detect Confirmation
Auto-invoke after phrases like "that worked", "it's fixed", "working now", "problem solved", "that did it". Also invocable via `/doc-fix` command.
**Non-trivial problems only** -- document when multiple investigation attempts were needed, debugging was tricky, the solution was non-obvious, or future sessions would benefit. Skip simple typos, obvious syntax errors, and trivial fixes.
### Step 2: Gather Context
Extract from conversation history:
- **Module name**: Which module had the problem
- **Symptom**: Observable error/behavior (exact error messages)
- **Investigation attempts**: What didn't work and why
- **Root cause**: Technical explanation of actual problem
- **Solution**: What fixed it (code/config changes)
- **Prevention**: How to avoid in future
- **Environment details**: Rails version, stage (0-6 or post-implementation), file/line references
**Blocking requirement:** If critical context is missing (module name, exact error, stage, or resolution steps), request the missing details and wait for a response before proceeding.
### Step 3: Check Existing Docs
Search `docs/solutions/` for similar issues by error message keywords and symptom category.
**If a similar issue is found:** Present options -- create new doc with cross-reference (recommended), update existing doc (only if same root cause), or other. Wait for user response.
**If no similar issue found:** Proceed directly to Step 4.
### Step 4: Generate Filename
Format: `[sanitized-symptom]-[module]-[YYYYMMDD].md`
Sanitization: lowercase, replace spaces with hyphens, remove special characters except hyphens, truncate to < 80 chars.
### Step 5: Validate YAML Schema
All docs require validated YAML frontmatter. Load [references/schema.yaml](./references/schema.yaml) and classify the problem against the enum values defined in [yaml-schema.md](./references/yaml-schema.md). Ensure all required fields are present and match allowed values exactly.
**Block if validation fails** -- show specific errors, present retry with corrected values, do not proceed until valid.
### Step 6: Create Documentation
Determine category from `problem_type` using the category mapping in [yaml-schema.md](./references/yaml-schema.md).
Create the documentation file using the template from [assets/resolution-template.md](./assets/resolution-template.md), populated with context from Step 2 and validated YAML frontmatter from Step 5.
```bash
mkdir -p "docs/solutions/${CATEGORY}"
# Write documentation to docs/solutions/${CATEGORY}/${FILENAME}
```
### Step 7: Cross-Reference and Critical Pattern Detection
If similar issues were found in Step 3, add cross-references to both documents.
If this represents a common pattern (3+ similar issues), add an entry to `docs/solutions/patterns/common-solutions.md`.
**Critical pattern detection:** If the issue has severity `critical`, affects multiple modules or foundational stages, and has a non-obvious solution, suggest adding to Required Reading in the decision menu. Do not auto-promote -- the user decides.
When the user selects "Add to Required Reading", use the template from [assets/critical-pattern-template.md](./assets/critical-pattern-template.md) to structure the pattern entry.
## Decision Menu After Capture
After successful documentation, present options and wait for user response:
1. **Continue workflow** -- return to calling skill/workflow
2. **Add to Required Reading** -- promote to critical patterns (for patterns that must be followed every time)
3. **Link related issues** -- connect to similar problems
4. **Add to existing skill** -- add to a learning skill
5. **Create new skill** -- extract into new learning skill
6. **View documentation** -- display what was captured
7. **Other**
## Integration Points
- **Invoked by:** `/compound` command, manual invocation, or auto-detection of confirmation phrases
- **Invokes:** None (terminal skill)
- **Prerequisite:** All context needed for documentation should be present in conversation history
## Success Criteria
- YAML frontmatter validated against [references/schema.yaml](./references/schema.yaml)
- File created in `docs/solutions/[category]/[filename].md`
- Enum values match schema exactly
- Code examples included in solution section
- Cross-references added if related issues found
- User presented with decision menu
## References
- [references/schema.yaml](./references/schema.yaml) -- authoritative YAML schema definition
- [references/yaml-schema.md](./references/yaml-schema.md) -- schema documentation with category mapping
- [references/quality-guidelines.md](./references/quality-guidelines.md) -- documentation quality standards
- [references/example-scenario.md](./references/example-scenario.md) -- walkthrough of the full 7-step process
- [assets/resolution-template.md](./assets/resolution-template.md) -- documentation file template
- [assets/critical-pattern-template.md](./assets/critical-pattern-template.md) -- critical pattern entry template
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.