[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758ZWRPWTEH97S3P847KCQC":3,"skill-same:01M758ZWRPWTEH97S3P847KCQC":74},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":32,"commitSha":33,"skillDirectory":34,"forksCount":14,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M758ZWRPWTEH97S3P847KCQC","compound-docs",null,"Capture solved problems as categorized documentation with YAML frontmatter for fast lookup","hemory\u002Famp","hemory","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F21179881?v=4","01M6D31HFJ391DN8N0JP8AQGFE","Hemory Phifer","01M758Z6KK3NGD8654Y5CT668C",0,"MIT","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: compound-docs\ndescription: Capture solved problems as categorized documentation with YAML frontmatter for fast lookup\nallowed-tools:\n  - Read # Parse conversation context\n  - Write # Create resolution docs\n  - Bash # Create directories\n  - Grep # Search existing docs\npreconditions:\n  - Problem has been solved (not in-progress)\n  - Solution has been verified working\n---\n\n# compound-docs Skill\n\n**Purpose:** Automatically document solved problems to build searchable institutional knowledge with category-based organization (enum-validated problem types).\n\n## Overview\n\nThis skill captures problem solutions immediately after confirmation, creating structured documentation that serves as a searchable knowledge base for future sessions.\n\n**Organization:** Single-file architecture - each problem documented as one markdown file in its symptom category directory (e.g., `docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-briefs.md`). Files use YAML frontmatter for metadata and searchability.\n\n---\n\n\u003Ccritical_sequence name=\"documentation-capture\" enforce_order=\"strict\">\n\n## 7-Step Process\n\n\u003Cstep number=\"1\" required=\"true\">\n### Step 1: Detect Confirmation\n\n**Auto-invoke after phrases:**\n\n- \"that worked\"\n- \"it's fixed\"\n- \"working now\"\n- \"problem solved\"\n- \"that did it\"\n\n**OR manual:** `\u002Fdoc-fix` command\n\n**Non-trivial problems only:**\n\n- Multiple investigation attempts needed\n- Tricky debugging that took time\n- Non-obvious solution\n- Future sessions would benefit\n\n**Skip documentation for:**\n\n- Simple typos\n- Obvious syntax errors\n- Trivial fixes immediately corrected\n\u003C\u002Fstep>\n\n\u003Cstep number=\"2\" required=\"true\" depends_on=\"1\">\n### Step 2: Gather Context\n\nExtract from conversation history:\n\n**Required information:**\n\n- **Module name**: Which module or component had the problem\n- **Symptom**: Observable error\u002Fbehavior (exact error messages)\n- **Investigation attempts**: What didn't work and why\n- **Root cause**: Technical explanation of actual problem\n- **Solution**: What fixed it (code\u002Fconfig changes)\n- **Prevention**: How to avoid in future\n\n**Environment details:**\n\n- Rails version\n- Stage (0-6 or post-implementation)\n- OS version\n- File\u002Fline references\n\n**BLOCKING REQUIREMENT:** If critical context is missing (module name, exact error, stage, or resolution steps), ask user and WAIT for response before proceeding to Step 3:\n\n```\nI need a few details to document this properly:\n\n1. Which module had this issue? [ModuleName]\n2. What was the exact error message or symptom?\n3. What stage were you in? (0-6 or post-implementation)\n\n[Continue after user provides details]\n```\n\u003C\u002Fstep>\n\n\u003Cstep number=\"3\" required=\"false\" depends_on=\"2\">\n### Step 3: Check Existing Docs\n\nSearch docs\u002Fsolutions\u002F for similar issues:\n\n```bash\n# Search by error message keywords\ngrep -r \"exact error phrase\" docs\u002Fsolutions\u002F\n\n# Search by symptom category\nls docs\u002Fsolutions\u002F[category]\u002F\n```\n\n**IF similar issue found:**\n\nTHEN present decision options:\n\n```\nFound similar issue: docs\u002Fsolutions\u002F[path]\n\nWhat's next?\n1. Create new doc with cross-reference (recommended)\n2. Update existing doc (only if same root cause)\n3. Other\n\nChoose (1-3): _\n```\n\nWAIT for user response, then execute chosen action.\n\n**ELSE** (no similar issue found):\n\nProceed directly to Step 4 (no user interaction needed).\n\u003C\u002Fstep>\n\n\u003Cstep number=\"4\" required=\"true\" depends_on=\"2\">\n### Step 4: Generate Filename\n\nFormat: `[sanitized-symptom]-[module]-[YYYYMMDD].md`\n\n**Sanitization rules:**\n\n- Lowercase\n- Replace spaces with hyphens\n- Remove special characters except hyphens\n- Truncate to reasonable length (\u003C 80 chars)\n\n**Examples:**\n\n- `missing-include-BriefSystem-20251110.md`\n- `parameter-not-saving-state-EmailProcessing-20251110.md`\n- `webview-crash-on-resize-Assistant-20251110.md`\n\u003C\u002Fstep>\n\n\u003Cstep number=\"5\" required=\"true\" depends_on=\"4\" blocking=\"true\">\n### Step 5: Validate YAML Schema\n\n**CRITICAL:** All docs require validated YAML frontmatter with enum validation.\n\n\u003Cvalidation_gate name=\"yaml-schema\" blocking=\"true\">\n\n**Validate against schema:**\nLoad `schema.yaml` and classify the problem against the enum values defined in [yaml-schema.md](.\u002Freferences\u002Fyaml-schema.md). Ensure all required fields are present and match allowed values exactly.\n\n**BLOCK if validation fails:**\n\n```\n❌ YAML validation failed\n\nErrors:\n- problem_type: must be one of schema enums, got \"compilation_error\"\n- severity: must be one of [critical, high, medium, low], got \"invalid\"\n- symptoms: must be array with 1-5 items, got string\n\nPlease provide corrected values.\n```\n\n**GATE ENFORCEMENT:** Do NOT proceed to Step 6 (Create Documentation) until YAML frontmatter passes all validation rules defined in `schema.yaml`.\n\n\u003C\u002Fvalidation_gate>\n\u003C\u002Fstep>\n\n\u003Cstep number=\"6\" required=\"true\" depends_on=\"5\">\n### Step 6: Create Documentation\n\n**Determine category from problem_type:** Use the category mapping defined in [yaml-schema.md](.\u002Freferences\u002Fyaml-schema.md) (lines 49-61).\n\n**Create documentation file:**\n\n```bash\nPROBLEM_TYPE=\"[from validated YAML]\"\nCATEGORY=\"[mapped from problem_type]\"\nFILENAME=\"[generated-filename].md\"\nDOC_PATH=\"docs\u002Fsolutions\u002F${CATEGORY}\u002F${FILENAME}\"\n\n# Create directory if needed\nmkdir -p \"docs\u002Fsolutions\u002F${CATEGORY}\"\n\n# Write documentation using template from assets\u002Fresolution-template.md\n# (Content populated with Step 2 context and validated YAML frontmatter)\n```\n\n**Result:**\n- Single file in category directory\n- Enum validation ensures consistent categorization\n\n**Create documentation:** Populate the structure from `assets\u002Fresolution-template.md` with context gathered in Step 2 and validated YAML frontmatter from Step 5.\n\u003C\u002Fstep>\n\n\u003Cstep number=\"7\" required=\"false\" depends_on=\"6\">\n### Step 7: Cross-Reference & Critical Pattern Detection\n\nIf similar issues found in Step 3:\n\n**Update existing doc:**\n\n```bash\n# Add Related Issues link to similar doc\necho \"- See also: [$FILENAME]($REAL_FILE)\" >> [similar-doc.md]\n```\n\n**Update new doc:**\nAlready includes cross-reference from Step 6.\n\n**Update patterns if applicable:**\n\nIf this represents a common pattern (3+ similar issues):\n\n```bash\n# Add to docs\u002Fsolutions\u002Fpatterns\u002Fcommon-solutions.md\ncat >> docs\u002Fsolutions\u002Fpatterns\u002Fcommon-solutions.md \u003C\u003C 'EOF'\n\n## [Pattern Name]\n\n**Common symptom:** [Description]\n**Root cause:** [Technical explanation]\n**Solution pattern:** [General approach]\n\n**Examples:**\n- [Link to doc 1]\n- [Link to doc 2]\n- [Link to doc 3]\nEOF\n```\n\n**Critical Pattern Detection (Optional Proactive Suggestion):**\n\nIf this issue has automatic indicators suggesting it might be critical:\n- Severity: `critical` in YAML\n- Affects multiple modules OR foundational stage (Stage 2 or 3)\n- Non-obvious solution\n\nThen in the decision menu (Step 8), add a note:\n```\n💡 This might be worth adding to Required Reading (Option 2)\n```\n\nBut **NEVER auto-promote**. User decides via decision menu (Option 2).\n\n**Template for critical pattern addition:**\n\nWhen user selects Option 2 (Add to Required Reading), use the template from `assets\u002Fcritical-pattern-template.md` to structure the pattern entry. Number it sequentially based on existing patterns in `docs\u002Fsolutions\u002Fpatterns\u002Fcritical-patterns.md`.\n\u003C\u002Fstep>\n\n\u003C\u002Fcritical_sequence>\n\n---\n\n\u003Cdecision_gate name=\"post-documentation\" wait_for_user=\"true\">\n\n## Decision Menu After Capture\n\nAfter successful documentation, present options and WAIT for user response:\n\n```\n✓ Solution documented\n\nFile created:\n- docs\u002Fsolutions\u002F[category]\u002F[filename].md\n\nWhat's next?\n1. Continue workflow (recommended)\n2. Add to Required Reading - Promote to critical patterns (critical-patterns.md)\n3. Link related issues - Connect to similar problems\n4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)\n5. Create new skill - Extract into new learning skill\n6. View documentation - See what was captured\n7. Other\n```\n\n**Handle responses:**\n\n**Option 1: Continue workflow**\n\n- Return to calling skill\u002Fworkflow\n- Documentation is complete\n\n**Option 2: Add to Required Reading** ⭐ PRIMARY PATH FOR CRITICAL PATTERNS\n\nUser selects this when:\n- System made this mistake multiple times across different modules\n- Solution is non-obvious but must be followed every time\n- Foundational requirement (Rails, Rails API, threading, etc.)\n\nAction:\n1. Extract pattern from the documentation\n2. Format as ❌ WRONG vs ✅ CORRECT with code examples\n3. Add to `docs\u002Fsolutions\u002Fpatterns\u002Fcritical-patterns.md`\n4. Add cross-reference back to this doc\n5. Confirm: \"✓ Added to Required Reading. All subagents will see this pattern before code generation.\"\n\n**Option 3: Link related issues**\n\n- Prompt: \"Which doc to link? (provide filename or describe)\"\n- Search docs\u002Fsolutions\u002F for the doc\n- Add cross-reference to both docs\n- Confirm: \"✓ Cross-reference added\"\n\n**Option 4: Add to existing skill**\n\nUser selects this when the documented solution relates to an existing learning skill:\n\nAction:\n1. Prompt: \"Which skill? (hotwire-native, etc.)\"\n2. Determine which reference file to update (resources.md, patterns.md, or examples.md)\n3. Add link and brief description to appropriate section\n4. Confirm: \"✓ Added to [skill-name] skill in [file]\"\n\nExample: For Hotwire Native Tailwind variants solution:\n- Add to `hotwire-native\u002Freferences\u002Fresources.md` under \"Project-Specific Resources\"\n- Add to `hotwire-native\u002Freferences\u002Fexamples.md` with link to solution doc\n\n**Option 5: Create new skill**\n\nUser selects this when the solution represents the start of a new learning domain:\n\nAction:\n1. Prompt: \"What should the new skill be called? (e.g., stripe-billing, email-processing)\"\n2. Run `python3 .claude\u002Fskills\u002Fskill-creator\u002Fscripts\u002Finit_skill.py [skill-name]`\n3. Create initial reference files with this solution as first example\n4. Confirm: \"✓ Created new [skill-name] skill with this solution as first example\"\n\n**Option 6: View documentation**\n\n- Display the created documentation\n- Present decision menu again\n\n**Option 7: Other**\n\n- Ask what they'd like to do\n\n\u003C\u002Fdecision_gate>\n\n---\n\n\u003Cintegration_protocol>\n\n## Integration Points\n\n**Invoked by:**\n- \u002Fcompound command (primary interface)\n- Manual invocation in conversation after solution confirmed\n- Can be triggered by detecting confirmation phrases like \"that worked\", \"it's fixed\", etc.\n\n**Invokes:**\n- None (terminal skill - does not delegate to other skills)\n\n**Handoff expectations:**\nAll context needed for documentation should be present in conversation history before invocation.\n\n\u003C\u002Fintegration_protocol>\n\n---\n\n\u003Csuccess_criteria>\n\n## Success Criteria\n\nDocumentation is successful when ALL of the following are true:\n\n- ✅ YAML frontmatter validated (all required fields, correct formats)\n- ✅ File created in docs\u002Fsolutions\u002F[category]\u002F[filename].md\n- ✅ Enum values match schema.yaml exactly\n- ✅ Code examples included in solution section\n- ✅ Cross-references added if related issues found\n- ✅ User presented with decision menu and action confirmed\n\n\u003C\u002Fsuccess_criteria>\n\n---\n\n## Error Handling\n\n**Missing context:**\n\n- Ask user for missing details\n- Don't proceed until critical info provided\n\n**YAML validation failure:**\n\n- Show specific errors\n- Present retry with corrected values\n- BLOCK until valid\n\n**Similar issue ambiguity:**\n\n- Present multiple matches\n- Let user choose: new doc, update existing, or link as duplicate\n\n**Module not in modules documentation:**\n\n- Warn but don't block\n- Proceed with documentation\n- Suggest: \"Add [Module] to modules documentation if not there\"\n\n---\n\n## Execution Guidelines\n\n**MUST do:**\n- Validate YAML frontmatter (BLOCK if invalid per Step 5 validation gate)\n- Extract exact error messages from conversation\n- Include code examples in solution section\n- Create directories before writing files (`mkdir -p`)\n- Ask user and WAIT if critical context missing\n\n**MUST NOT do:**\n- Skip YAML validation (validation gate is blocking)\n- Use vague descriptions (not searchable)\n- Omit code examples or cross-references\n\n---\n\n## Quality Guidelines\n\n**Good documentation has:**\n\n- ✅ Exact error messages (copy-paste from output)\n- ✅ Specific file:line references\n- ✅ Observable symptoms (what you saw, not interpretations)\n- ✅ Failed attempts documented (helps avoid wrong paths)\n- ✅ Technical explanation (not just \"what\" but \"why\")\n- ✅ Code examples (before\u002Fafter if applicable)\n- ✅ Prevention guidance (how to catch early)\n- ✅ Cross-references (related issues)\n\n**Avoid:**\n\n- ❌ Vague descriptions (\"something was wrong\")\n- ❌ Missing technical details (\"fixed the code\")\n- ❌ No context (which version? which file?)\n- ❌ Just code dumps (explain why it works)\n- ❌ No prevention guidance\n- ❌ No cross-references\n\n---\n\n## Example Scenario\n\n**User:** \"That worked! The N+1 query is fixed.\"\n\n**Skill activates:**\n\n1. **Detect confirmation:** \"That worked!\" triggers auto-invoke\n2. **Gather context:**\n   - Module: Brief System\n   - Symptom: Brief generation taking >5 seconds, N+1 query when loading email threads\n   - Failed attempts: Added pagination (didn't help), checked background job performance\n   - Solution: Added eager loading with `includes(:emails)` on Brief model\n   - Root cause: Missing eager loading causing separate database query per email thread\n3. **Check existing:** No similar issue found\n4. **Generate filename:** `n-plus-one-brief-generation-BriefSystem-20251110.md`\n5. **Validate YAML:**\n   ```yaml\n   module: Brief System\n   date: 2025-11-10\n   problem_type: performance_issue\n   component: rails_model\n   symptoms:\n     - \"N+1 query when loading email threads\"\n     - \"Brief generation taking >5 seconds\"\n   root_cause: missing_include\n   severity: high\n   tags: [n-plus-one, eager-loading, performance]\n   ```\n   ✅ Valid\n6. **Create documentation:**\n   - `docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-brief-generation-BriefSystem-20251110.md`\n7. **Cross-reference:** None needed (no similar issues)\n\n**Output:**\n\n```\n✓ Solution documented\n\nFile created:\n- docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-brief-generation-BriefSystem-20251110.md\n\nWhat's next?\n1. Continue workflow (recommended)\n2. Add to Required Reading - Promote to critical patterns (critical-patterns.md)\n3. Link related issues - Connect to similar problems\n4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)\n5. Create new skill - Extract into new learning skill\n6. View documentation - See what was captured\n7. Other\n```\n\n---\n\n## Future Enhancements\n\n**Not in Phase 7 scope, but potential:**\n\n- Search by date range\n- Filter by severity\n- Tag-based search interface\n- Metrics (most common issues, resolution time)\n- Export to shareable format (community knowledge sharing)\n- Import community solutions\n","# compound-docs Skill\n\n**Purpose:** Automatically document solved problems to build searchable institutional knowledge with category-based organization (enum-validated problem types).\n\n## Overview\n\nThis skill captures problem solutions immediately after confirmation, creating structured documentation that serves as a searchable knowledge base for future sessions.\n\n**Organization:** Single-file architecture - each problem documented as one markdown file in its symptom category directory (e.g., `docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-briefs.md`). Files use YAML frontmatter for metadata and searchability.\n\n---\n\n\u003Ccritical_sequence name=\"documentation-capture\" enforce_order=\"strict\">\n\n## 7-Step Process\n\n\u003Cstep number=\"1\" required=\"true\">\n### Step 1: Detect Confirmation\n\n**Auto-invoke after phrases:**\n\n- \"that worked\"\n- \"it's fixed\"\n- \"working now\"\n- \"problem solved\"\n- \"that did it\"\n\n**OR manual:** `\u002Fdoc-fix` command\n\n**Non-trivial problems only:**\n\n- Multiple investigation attempts needed\n- Tricky debugging that took time\n- Non-obvious solution\n- Future sessions would benefit\n\n**Skip documentation for:**\n\n- Simple typos\n- Obvious syntax errors\n- Trivial fixes immediately corrected\n\u003C\u002Fstep>\n\n\u003Cstep number=\"2\" required=\"true\" depends_on=\"1\">\n### Step 2: Gather Context\n\nExtract from conversation history:\n\n**Required information:**\n\n- **Module name**: Which module or component had the problem\n- **Symptom**: Observable error\u002Fbehavior (exact error messages)\n- **Investigation attempts**: What didn't work and why\n- **Root cause**: Technical explanation of actual problem\n- **Solution**: What fixed it (code\u002Fconfig changes)\n- **Prevention**: How to avoid in future\n\n**Environment details:**\n\n- Rails version\n- Stage (0-6 or post-implementation)\n- OS version\n- File\u002Fline references\n\n**BLOCKING REQUIREMENT:** If critical context is missing (module name, exact error, stage, or resolution steps), ask user and WAIT for response before proceeding to Step 3:\n\n```\nI need a few details to document this properly:\n\n1. Which module had this issue? [ModuleName]\n2. What was the exact error message or symptom?\n3. What stage were you in? (0-6 or post-implementation)\n\n[Continue after user provides details]\n```\n\u003C\u002Fstep>\n\n\u003Cstep number=\"3\" required=\"false\" depends_on=\"2\">\n### Step 3: Check Existing Docs\n\nSearch docs\u002Fsolutions\u002F for similar issues:\n\n```bash\n# Search by error message keywords\ngrep -r \"exact error phrase\" docs\u002Fsolutions\u002F\n\n# Search by symptom category\nls docs\u002Fsolutions\u002F[category]\u002F\n```\n\n**IF similar issue found:**\n\nTHEN present decision options:\n\n```\nFound similar issue: docs\u002Fsolutions\u002F[path]\n\nWhat's next?\n1. Create new doc with cross-reference (recommended)\n2. Update existing doc (only if same root cause)\n3. Other\n\nChoose (1-3): _\n```\n\nWAIT for user response, then execute chosen action.\n\n**ELSE** (no similar issue found):\n\nProceed directly to Step 4 (no user interaction needed).\n\u003C\u002Fstep>\n\n\u003Cstep number=\"4\" required=\"true\" depends_on=\"2\">\n### Step 4: Generate Filename\n\nFormat: `[sanitized-symptom]-[module]-[YYYYMMDD].md`\n\n**Sanitization rules:**\n\n- Lowercase\n- Replace spaces with hyphens\n- Remove special characters except hyphens\n- Truncate to reasonable length (\u003C 80 chars)\n\n**Examples:**\n\n- `missing-include-BriefSystem-20251110.md`\n- `parameter-not-saving-state-EmailProcessing-20251110.md`\n- `webview-crash-on-resize-Assistant-20251110.md`\n\u003C\u002Fstep>\n\n\u003Cstep number=\"5\" required=\"true\" depends_on=\"4\" blocking=\"true\">\n### Step 5: Validate YAML Schema\n\n**CRITICAL:** All docs require validated YAML frontmatter with enum validation.\n\n\u003Cvalidation_gate name=\"yaml-schema\" blocking=\"true\">\n\n**Validate against schema:**\nLoad `schema.yaml` and classify the problem against the enum values defined in [yaml-schema.md](.\u002Freferences\u002Fyaml-schema.md). Ensure all required fields are present and match allowed values exactly.\n\n**BLOCK if validation fails:**\n\n```\n❌ YAML validation failed\n\nErrors:\n- problem_type: must be one of schema enums, got \"compilation_error\"\n- severity: must be one of [critical, high, medium, low], got \"invalid\"\n- symptoms: must be array with 1-5 items, got string\n\nPlease provide corrected values.\n```\n\n**GATE ENFORCEMENT:** Do NOT proceed to Step 6 (Create Documentation) until YAML frontmatter passes all validation rules defined in `schema.yaml`.\n\n\u003C\u002Fvalidation_gate>\n\u003C\u002Fstep>\n\n\u003Cstep number=\"6\" required=\"true\" depends_on=\"5\">\n### Step 6: Create Documentation\n\n**Determine category from problem_type:** Use the category mapping defined in [yaml-schema.md](.\u002Freferences\u002Fyaml-schema.md) (lines 49-61).\n\n**Create documentation file:**\n\n```bash\nPROBLEM_TYPE=\"[from validated YAML]\"\nCATEGORY=\"[mapped from problem_type]\"\nFILENAME=\"[generated-filename].md\"\nDOC_PATH=\"docs\u002Fsolutions\u002F${CATEGORY}\u002F${FILENAME}\"\n\n# Create directory if needed\nmkdir -p \"docs\u002Fsolutions\u002F${CATEGORY}\"\n\n# Write documentation using template from assets\u002Fresolution-template.md\n# (Content populated with Step 2 context and validated YAML frontmatter)\n```\n\n**Result:**\n- Single file in category directory\n- Enum validation ensures consistent categorization\n\n**Create documentation:** Populate the structure from `assets\u002Fresolution-template.md` with context gathered in Step 2 and validated YAML frontmatter from Step 5.\n\u003C\u002Fstep>\n\n\u003Cstep number=\"7\" required=\"false\" depends_on=\"6\">\n### Step 7: Cross-Reference & Critical Pattern Detection\n\nIf similar issues found in Step 3:\n\n**Update existing doc:**\n\n```bash\n# Add Related Issues link to similar doc\necho \"- See also: [$FILENAME]($REAL_FILE)\" >> [similar-doc.md]\n```\n\n**Update new doc:**\nAlready includes cross-reference from Step 6.\n\n**Update patterns if applicable:**\n\nIf this represents a common pattern (3+ similar issues):\n\n```bash\n# Add to docs\u002Fsolutions\u002Fpatterns\u002Fcommon-solutions.md\ncat >> docs\u002Fsolutions\u002Fpatterns\u002Fcommon-solutions.md \u003C\u003C 'EOF'\n\n## [Pattern Name]\n\n**Common symptom:** [Description]\n**Root cause:** [Technical explanation]\n**Solution pattern:** [General approach]\n\n**Examples:**\n- [Link to doc 1]\n- [Link to doc 2]\n- [Link to doc 3]\nEOF\n```\n\n**Critical Pattern Detection (Optional Proactive Suggestion):**\n\nIf this issue has automatic indicators suggesting it might be critical:\n- Severity: `critical` in YAML\n- Affects multiple modules OR foundational stage (Stage 2 or 3)\n- Non-obvious solution\n\nThen in the decision menu (Step 8), add a note:\n```\n💡 This might be worth adding to Required Reading (Option 2)\n```\n\nBut **NEVER auto-promote**. User decides via decision menu (Option 2).\n\n**Template for critical pattern addition:**\n\nWhen user selects Option 2 (Add to Required Reading), use the template from `assets\u002Fcritical-pattern-template.md` to structure the pattern entry. Number it sequentially based on existing patterns in `docs\u002Fsolutions\u002Fpatterns\u002Fcritical-patterns.md`.\n\u003C\u002Fstep>\n\n\u003C\u002Fcritical_sequence>\n\n---\n\n\u003Cdecision_gate name=\"post-documentation\" wait_for_user=\"true\">\n\n## Decision Menu After Capture\n\nAfter successful documentation, present options and WAIT for user response:\n\n```\n✓ Solution documented\n\nFile created:\n- docs\u002Fsolutions\u002F[category]\u002F[filename].md\n\nWhat's next?\n1. Continue workflow (recommended)\n2. Add to Required Reading - Promote to critical patterns (critical-patterns.md)\n3. Link related issues - Connect to similar problems\n4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)\n5. Create new skill - Extract into new learning skill\n6. View documentation - See what was captured\n7. Other\n```\n\n**Handle responses:**\n\n**Option 1: Continue workflow**\n\n- Return to calling skill\u002Fworkflow\n- Documentation is complete\n\n**Option 2: Add to Required Reading** ⭐ PRIMARY PATH FOR CRITICAL PATTERNS\n\nUser selects this when:\n- System made this mistake multiple times across different modules\n- Solution is non-obvious but must be followed every time\n- Foundational requirement (Rails, Rails API, threading, etc.)\n\nAction:\n1. Extract pattern from the documentation\n2. Format as ❌ WRONG vs ✅ CORRECT with code examples\n3. Add to `docs\u002Fsolutions\u002Fpatterns\u002Fcritical-patterns.md`\n4. Add cross-reference back to this doc\n5. Confirm: \"✓ Added to Required Reading. All subagents will see this pattern before code generation.\"\n\n**Option 3: Link related issues**\n\n- Prompt: \"Which doc to link? (provide filename or describe)\"\n- Search docs\u002Fsolutions\u002F for the doc\n- Add cross-reference to both docs\n- Confirm: \"✓ Cross-reference added\"\n\n**Option 4: Add to existing skill**\n\nUser selects this when the documented solution relates to an existing learning skill:\n\nAction:\n1. Prompt: \"Which skill? (hotwire-native, etc.)\"\n2. Determine which reference file to update (resources.md, patterns.md, or examples.md)\n3. Add link and brief description to appropriate section\n4. Confirm: \"✓ Added to [skill-name] skill in [file]\"\n\nExample: For Hotwire Native Tailwind variants solution:\n- Add to `hotwire-native\u002Freferences\u002Fresources.md` under \"Project-Specific Resources\"\n- Add to `hotwire-native\u002Freferences\u002Fexamples.md` with link to solution doc\n\n**Option 5: Create new skill**\n\nUser selects this when the solution represents the start of a new learning domain:\n\nAction:\n1. Prompt: \"What should the new skill be called? (e.g., stripe-billing, email-processing)\"\n2. Run `python3 .claude\u002Fskills\u002Fskill-creator\u002Fscripts\u002Finit_skill.py [skill-name]`\n3. Create initial reference files with this solution as first example\n4. Confirm: \"✓ Created new [skill-name] skill with this solution as first example\"\n\n**Option 6: View documentation**\n\n- Display the created documentation\n- Present decision menu again\n\n**Option 7: Other**\n\n- Ask what they'd like to do\n\n\u003C\u002Fdecision_gate>\n\n---\n\n\u003Cintegration_protocol>\n\n## Integration Points\n\n**Invoked by:**\n- \u002Fcompound command (primary interface)\n- Manual invocation in conversation after solution confirmed\n- Can be triggered by detecting confirmation phrases like \"that worked\", \"it's fixed\", etc.\n\n**Invokes:**\n- None (terminal skill - does not delegate to other skills)\n\n**Handoff expectations:**\nAll context needed for documentation should be present in conversation history before invocation.\n\n\u003C\u002Fintegration_protocol>\n\n---\n\n\u003Csuccess_criteria>\n\n## Success Criteria\n\nDocumentation is successful when ALL of the following are true:\n\n- ✅ YAML frontmatter validated (all required fields, correct formats)\n- ✅ File created in docs\u002Fsolutions\u002F[category]\u002F[filename].md\n- ✅ Enum values match schema.yaml exactly\n- ✅ Code examples included in solution section\n- ✅ Cross-references added if related issues found\n- ✅ User presented with decision menu and action confirmed\n\n\u003C\u002Fsuccess_criteria>\n\n---\n\n## Error Handling\n\n**Missing context:**\n\n- Ask user for missing details\n- Don't proceed until critical info provided\n\n**YAML validation failure:**\n\n- Show specific errors\n- Present retry with corrected values\n- BLOCK until valid\n\n**Similar issue ambiguity:**\n\n- Present multiple matches\n- Let user choose: new doc, update existing, or link as duplicate\n\n**Module not in modules documentation:**\n\n- Warn but don't block\n- Proceed with documentation\n- Suggest: \"Add [Module] to modules documentation if not there\"\n\n---\n\n## Execution Guidelines\n\n**MUST do:**\n- Validate YAML frontmatter (BLOCK if invalid per Step 5 validation gate)\n- Extract exact error messages from conversation\n- Include code examples in solution section\n- Create directories before writing files (`mkdir -p`)\n- Ask user and WAIT if critical context missing\n\n**MUST NOT do:**\n- Skip YAML validation (validation gate is blocking)\n- Use vague descriptions (not searchable)\n- Omit code examples or cross-references\n\n---\n\n## Quality Guidelines\n\n**Good documentation has:**\n\n- ✅ Exact error messages (copy-paste from output)\n- ✅ Specific file:line references\n- ✅ Observable symptoms (what you saw, not interpretations)\n- ✅ Failed attempts documented (helps avoid wrong paths)\n- ✅ Technical explanation (not just \"what\" but \"why\")\n- ✅ Code examples (before\u002Fafter if applicable)\n- ✅ Prevention guidance (how to catch early)\n- ✅ Cross-references (related issues)\n\n**Avoid:**\n\n- ❌ Vague descriptions (\"something was wrong\")\n- ❌ Missing technical details (\"fixed the code\")\n- ❌ No context (which version? which file?)\n- ❌ Just code dumps (explain why it works)\n- ❌ No prevention guidance\n- ❌ No cross-references\n\n---\n\n## Example Scenario\n\n**User:** \"That worked! The N+1 query is fixed.\"\n\n**Skill activates:**\n\n1. **Detect confirmation:** \"That worked!\" triggers auto-invoke\n2. **Gather context:**\n   - Module: Brief System\n   - Symptom: Brief generation taking >5 seconds, N+1 query when loading email threads\n   - Failed attempts: Added pagination (didn't help), checked background job performance\n   - Solution: Added eager loading with `includes(:emails)` on Brief model\n   - Root cause: Missing eager loading causing separate database query per email thread\n3. **Check existing:** No similar issue found\n4. **Generate filename:** `n-plus-one-brief-generation-BriefSystem-20251110.md`\n5. **Validate YAML:**\n   ```yaml\n   module: Brief System\n   date: 2025-11-10\n   problem_type: performance_issue\n   component: rails_model\n   symptoms:\n     - \"N+1 query when loading email threads\"\n     - \"Brief generation taking >5 seconds\"\n   root_cause: missing_include\n   severity: high\n   tags: [n-plus-one, eager-loading, performance]\n   ```\n   ✅ Valid\n6. **Create documentation:**\n   - `docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-brief-generation-BriefSystem-20251110.md`\n7. **Cross-reference:** None needed (no similar issues)\n\n**Output:**\n\n```\n✓ Solution documented\n\nFile created:\n- docs\u002Fsolutions\u002Fperformance-issues\u002Fn-plus-one-brief-generation-BriefSystem-20251110.md\n\nWhat's next?\n1. Continue workflow (recommended)\n2. Add to Required Reading - Promote to critical patterns (critical-patterns.md)\n3. Link related issues - Connect to similar problems\n4. Add to existing skill - Add to a learning skill (e.g., hotwire-native)\n5. Create new skill - Extract into new learning skill\n6. View documentation - See what was captured\n7. Other\n```\n\n---\n\n## Future Enhancements\n\n**Not in Phase 7 scope, but potential:**\n\n- Search by date range\n- Filter by severity\n- Tag-based search interface\n- Metrics (most common issues, resolution time)\n- Export to shareable format (community knowledge sharing)\n- Import community solutions\n",{"name":5,"description":7,"allowed-tools":24,"preconditions":29},[25,26,27,28],"Read","Write","Bash","Grep",[30,31],"Problem has been solved (not in-progress)","Solution has been verified working","main","6a447b9ff35eed7bda9e12399bcd373dd31e0a53",".claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp","https:\u002F\u002Fgithub.com\u002Fhemory","https:\u002F\u002Fwww.heminthehat.com\u002F","The People Developer | L&D Program Manager | Software Engineer","2026-06-09 00:20:04",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add hemory\u002Famp --skill compound-docs",{"tool":46,"command":47},"bunx","bunx skills add hemory\u002Famp --skill compound-docs",{"tool":49,"command":50},"pnpm","pnpm dlx skills add hemory\u002Famp --skill compound-docs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002FSKILL.md",true,[54,60,64,70],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"assets\u002Fcritical-pattern-template.md","ASSET","资产文件",875,"https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002Fassets\u002Fcritical-pattern-template.md",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"assets\u002Fresolution-template.md",3162,"https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002Fassets\u002Fresolution-template.md",{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fyaml-schema.md","REFERENCE","参考文档",3104,"https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002Freferences\u002Fyaml-schema.md",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"schema.yaml",6902,"https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fplugins\u002Fcompound-engineering\u002Fskills\u002Fcompound-docs\u002Fschema.yaml",[75,82,89,96,103,110],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M76W5GGTP0YHZQQJ4G2ZPSZE","zoom-setup","Connect Zoom to Amp for meeting recordings, scheduling, and transcript context","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fzoom-setup\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M76W5CWR8MABE0XPZVRXFMDK","xray","Understand what just happened under the hood - learn AI by seeing it in action","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fxray\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M76W582J6PD3TTXZXFA2HVQJ","week-review","Review week's progress with concrete accomplishments (not fake percentages), pattern detection, and goal tracking.","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fweek-review\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M76W54EY8D8Y55DEPYPJ9YBV","week-plan","Set weekly priorities and plan the week ahead with intelligent suggestions based on goals, calendar shape, and task effort.","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fweek-plan\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":19},"01M76W527EJ43YXBN0CE9SRAYT","triage","Strategically route orphaned files and extract scattered tasks","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftriage\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":19},"01M76W4ZYRDVHZ3SS8W5WZ53Q8","trello-setup","Connect Trello to Amp for visual Kanban task sync","https:\u002F\u002Fgithub.com\u002Fhemory\u002Famp\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftrello-setup\u002FSKILL.md",[],[]]