[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6H8ZFTZJ3DAYJ22T0PRA8AD":3,"skill-same:01M6H8ZFTZJ3DAYJ22T0PRA8AD":92},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":14,"repositoryHtmlUrl":55,"repositoryHomepageUrl":6,"ownerHtmlUrl":56,"ownerBlogUrl":6,"ownerDescription":57,"updatedAt":58,"install":59,"resources":71},"01M6H8ZFTZJ3DAYJ22T0PRA8AD","compound-docs",null,"Capture solved problems as categorized documentation with YAML frontmatter for fast lookup","drhazemibclc\u002Fplate","drhazemibclc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153584232?v=4","01M6H8X67MYG903V4N92MKWKYK","Hazem Ali Abd Elraouf","01M6H8X6C5TSX21P7HJVZVNFNQ",0,"MIT","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"compound docs","docs","compound","write","frontmatter","for","verified","true","with","problem","progress","as","read","capture","grep","Bash","lookup","fast","yaml","documentation","2026-11-10 10:12:30",false,"---\nname: compound-docs\ndescription: Capture solved problems as categorized documentation with YAML frontmatter for fast lookup\ndisable-model-invocation: true\nallowed-tools:\n  - Read\n  - Write\n  - Bash\n  - Grep\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":44,"preconditions":48,"disable-model-invocation":51},[45,46,34,47],"Read","Write","Grep",[49,50],"Problem has been solved (not in-progress)","Solution has been verified working",true,"main","2af107c35457ccaaa2c99d5478745496095d3cf7",".codex\u002Fskills\u002Fcompound-docs","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc","Certified Pediatrician and IBCLC","2026-03-22 21:33:09",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":51},[61,64,67],{"tool":62,"command":63},"npx","npx skills add drhazemibclc\u002Fplate --skill compound-docs",{"tool":65,"command":66},"bunx","bunx skills add drhazemibclc\u002Fplate --skill compound-docs",{"tool":68,"command":69},"pnpm","pnpm dlx skills add drhazemibclc\u002Fplate --skill compound-docs","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002FSKILL.md",[72,78,82,88],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"assets\u002Fcritical-pattern-template.md","ASSET","资产文件",875,"https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002Fassets\u002Fcritical-pattern-template.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"assets\u002Fresolution-template.md",3162,"https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002Fassets\u002Fresolution-template.md",{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fyaml-schema.md","REFERENCE","参考文档",3104,"https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002Freferences\u002Fyaml-schema.md",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"schema.yaml",6902,"https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fcompound-docs\u002Fschema.yaml",[93,110,126,140,152,162],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":39},"01M6H97EF29WFNJJJH91670GQ1","workflows-work","[DEPRECATED] Use \u002Fce:work instead — renamed for clarity.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fworkflows-work\u002FSKILL.md",[],[100,101,102,103,24,104,26,105,106,107,108,109],"workflows","work","workflows work","file","path","todo","specification","use","clarity","plan",{"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":39},"01M6H97C6CZMYST83WEJN87CVS","workflows-review","[DEPRECATED] Use \u002Fce:review instead — renamed for clarity.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fworkflows-review\u002FSKILL.md",[],[117,118,100,108,119,120,121,24,122,26,123,124,125,107],"workflows review","review","pr","github","branch","latest","number","URL","name",{"skillNo":127,"name":128,"nameZh":6,"description":129,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":39},"01M6H97A2P4ZE58BKMVQBYAK3M","workflows-plan","[DEPRECATED] Use \u002Fce:plan instead — renamed for clarity.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fworkflows-plan\u002FSKILL.md",[],[100,133,109,134,135,24,26,136,137,108,138,139,107],"workflows plan","bug","improvement","feature","idea","report","bug report",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":39},"01M6H9780WX39EB980F69WFHEQ","workflows-compound","[DEPRECATED] Use \u002Fce:compound instead — renamed for clarity.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fworkflows-compound\u002FSKILL.md",[],[147,21,100,26,148,24,149,107,150,108,151],"workflows compound","context","about","fix","brief",{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":39},"01M6H9761C1HS173TW6P4ZMCY2","workflows-brainstorm","[DEPRECATED] Use \u002Fce:brainstorm instead — renamed for clarity.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fworkflows-brainstorm\u002FSKILL.md",[],[159,100,160,108,161,107,24,26,28,136,137],"brainstorm","workflows brainstorm","explore",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":39},"01M6H971R100F94DW8NGC93KQ6","vercel-react-best-practices","React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React\u002FNext.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.","https:\u002F\u002Fgithub.com\u002Fdrhazemibclc\u002Fplate\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002Fvercel-react-best-practices\u002FSKILL.md",[],[169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188],"vercel","react best practices","best practices","vercel react best practices","react","Next.js","data fetching","triggers","pages","next","performance optimization","refactoring","Optimization","code","tasks","guidelines","react components","components","performance","writing"]