[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NTJ2MBD1QQYXMN0VCTG5BA":3,"skill-same:01M6NTJ2MBD1QQYXMN0VCTG5BA":67},{"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":23,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6NTJ2MBD1QQYXMN0VCTG5BA","debug-hooks",null,"Systematic hook debugging workflow. Use when hooks aren't firing, producing wrong output, or behaving unexpectedly.","rubicanjr\u002FFinCognis","rubicanjr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234912519?v=4","01M6NT156NND8J474G34SB3923","Rubi","01M6NT15B70RWXE1N3YV0BZY8A",0,"MIT","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fdebug-hooks\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[24,25,26,27,28,29,30,31,32,33,34,35,36],"debug","hooks","debug hooks","workflow","debugging","Bash","grep","read","use","systematic","output","hook","Wrong","2026-11-10 10:12:30",false,"---\nname: debug-hooks\ndescription: Systematic hook debugging workflow. Use when hooks aren't firing, producing wrong output, or behaving unexpectedly.\nallowed-tools: [Bash, Read, Grep]\n---\n\n# Debug Hooks\n\nSystematic workflow for debugging Claude Code hooks.\n\n## When to Use\n\n- \"Hook isn't firing\"\n- \"Hook produces wrong output\"\n- \"SessionEnd not working\"\n- \"PostToolUse hook not triggering\"\n- \"Why didn't my hook run?\"\n\n## Workflow\n\n### 1. Check Outputs First (Observe Before Editing)\n\n```bash\n# Check project cache\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002F\n\n# Check specific outputs\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002Flearnings\u002F\n\n# Check for debug logs\ntail $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002F*.log 2>\u002Fdev\u002Fnull\n\n# Also check global (common mistake: wrong path)\nls -la ~\u002F.claude\u002Fcache\u002F 2>\u002Fdev\u002Fnull\n```\n\n### 2. Verify Hook Registration\n\n```bash\n# Project settings\ncat $CLAUDE_PROJECT_DIR\u002F.claude\u002Fsettings.json | grep -A 20 '\"SessionEnd\"\\|\"PostToolUse\"\\|\"UserPromptSubmit\"'\n\n# Global settings (hooks merge from both)\ncat ~\u002F.claude\u002Fsettings.json | grep -A 20 '\"SessionEnd\"\\|\"PostToolUse\"\\|\"UserPromptSubmit\"'\n```\n\n### 3. Check Hook Files Exist\n\n```bash\n# Shell wrappers\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002F*.sh\n\n# Compiled bundles (if using TypeScript)\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fdist\u002F*.mjs\n```\n\n### 4. Test Hook Manually\n\n```bash\n# SessionEnd hook\necho '{\"session_id\": \"test-123\", \"reason\": \"clear\", \"transcript_path\": \"\u002Ftmp\u002Ftest\"}' | \\\n  $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fsession-end-cleanup.sh\n\n# PostToolUse hook (Write tool example)\necho '{\"tool_name\": \"Write\", \"tool_input\": {\"file_path\": \"test.md\"}, \"session_id\": \"test-123\"}' | \\\n  $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fhandoff-index.sh\n```\n\n### 5. Check for Silent Failures\n\nIf using detached spawn with `stdio: 'ignore'`:\n\n```typescript\n\u002F\u002F This pattern hides errors!\nspawn(cmd, args, { detached: true, stdio: 'ignore' })\n```\n\n**Fix:** Add temporary logging:\n\n```typescript\nconst logFile = fs.openSync('.claude\u002Fcache\u002Fdebug.log', 'a');\nspawn(cmd, args, {\n  detached: true,\n  stdio: ['ignore', logFile, logFile]  \u002F\u002F capture stdout\u002Fstderr\n});\n```\n\n### 6. Rebuild After Edits\n\nIf you edited TypeScript source, you MUST rebuild:\n\n```bash\ncd $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\nnpx esbuild src\u002Fsession-end-cleanup.ts \\\n  --bundle --platform=node --format=esm \\\n  --outfile=dist\u002Fsession-end-cleanup.mjs\n```\n\nSource edits alone don't take effect - the shell wrapper runs the bundled `.mjs`.\n\n## Common Issues\n\n| Symptom | Likely Cause | Fix |\n|---------|--------------|-----|\n| Hook never runs | Not registered in settings.json | Add to correct event in settings |\n| Hook runs but no output | Detached spawn hiding errors | Add logging, check manually |\n| Wrong session ID | Using \"most recent\" query | Pass ID explicitly |\n| Works locally, not in CI | Missing dependencies | Check npx\u002Fnode availability |\n| Runs twice | Registered in both global + project | Remove duplicate |\n\n## Debug Checklist\n\n- [ ] Outputs exist? (`ls -la .claude\u002Fcache\u002F`)\n- [ ] Registered? (`grep -A10 '\"hooks\"' .claude\u002Fsettings.json`)\n- [ ] Files exist? (`ls .claude\u002Fhooks\u002F*.sh`)\n- [ ] Bundle current? (`ls -la .claude\u002Fhooks\u002Fdist\u002F`)\n- [ ] Manual test works? (`echo '{}' | .\u002Fhook.sh`)\n- [ ] No silent failures? (check for `stdio: 'ignore'`)\n\n## Source Sessions\n\nDerived from 10 sessions (83% of all learnings):\n- a541f08a, 1c21e6c8, 6a9f2d7a, a8bd5cea, 2ca1a178, 657ce0b2, 3998f3a2, 2a829f12, 0b46cfd7, 862f6e2c\n","# Debug Hooks\n\nSystematic workflow for debugging Claude Code hooks.\n\n## When to Use\n\n- \"Hook isn't firing\"\n- \"Hook produces wrong output\"\n- \"SessionEnd not working\"\n- \"PostToolUse hook not triggering\"\n- \"Why didn't my hook run?\"\n\n## Workflow\n\n### 1. Check Outputs First (Observe Before Editing)\n\n```bash\n# Check project cache\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002F\n\n# Check specific outputs\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002Flearnings\u002F\n\n# Check for debug logs\ntail $CLAUDE_PROJECT_DIR\u002F.claude\u002Fcache\u002F*.log 2>\u002Fdev\u002Fnull\n\n# Also check global (common mistake: wrong path)\nls -la ~\u002F.claude\u002Fcache\u002F 2>\u002Fdev\u002Fnull\n```\n\n### 2. Verify Hook Registration\n\n```bash\n# Project settings\ncat $CLAUDE_PROJECT_DIR\u002F.claude\u002Fsettings.json | grep -A 20 '\"SessionEnd\"\\|\"PostToolUse\"\\|\"UserPromptSubmit\"'\n\n# Global settings (hooks merge from both)\ncat ~\u002F.claude\u002Fsettings.json | grep -A 20 '\"SessionEnd\"\\|\"PostToolUse\"\\|\"UserPromptSubmit\"'\n```\n\n### 3. Check Hook Files Exist\n\n```bash\n# Shell wrappers\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002F*.sh\n\n# Compiled bundles (if using TypeScript)\nls -la $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fdist\u002F*.mjs\n```\n\n### 4. Test Hook Manually\n\n```bash\n# SessionEnd hook\necho '{\"session_id\": \"test-123\", \"reason\": \"clear\", \"transcript_path\": \"\u002Ftmp\u002Ftest\"}' | \\\n  $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fsession-end-cleanup.sh\n\n# PostToolUse hook (Write tool example)\necho '{\"tool_name\": \"Write\", \"tool_input\": {\"file_path\": \"test.md\"}, \"session_id\": \"test-123\"}' | \\\n  $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\u002Fhandoff-index.sh\n```\n\n### 5. Check for Silent Failures\n\nIf using detached spawn with `stdio: 'ignore'`:\n\n```typescript\n\u002F\u002F This pattern hides errors!\nspawn(cmd, args, { detached: true, stdio: 'ignore' })\n```\n\n**Fix:** Add temporary logging:\n\n```typescript\nconst logFile = fs.openSync('.claude\u002Fcache\u002Fdebug.log', 'a');\nspawn(cmd, args, {\n  detached: true,\n  stdio: ['ignore', logFile, logFile]  \u002F\u002F capture stdout\u002Fstderr\n});\n```\n\n### 6. Rebuild After Edits\n\nIf you edited TypeScript source, you MUST rebuild:\n\n```bash\ncd $CLAUDE_PROJECT_DIR\u002F.claude\u002Fhooks\nnpx esbuild src\u002Fsession-end-cleanup.ts \\\n  --bundle --platform=node --format=esm \\\n  --outfile=dist\u002Fsession-end-cleanup.mjs\n```\n\nSource edits alone don't take effect - the shell wrapper runs the bundled `.mjs`.\n\n## Common Issues\n\n| Symptom | Likely Cause | Fix |\n|---------|--------------|-----|\n| Hook never runs | Not registered in settings.json | Add to correct event in settings |\n| Hook runs but no output | Detached spawn hiding errors | Add logging, check manually |\n| Wrong session ID | Using \"most recent\" query | Pass ID explicitly |\n| Works locally, not in CI | Missing dependencies | Check npx\u002Fnode availability |\n| Runs twice | Registered in both global + project | Remove duplicate |\n\n## Debug Checklist\n\n- [ ] Outputs exist? (`ls -la .claude\u002Fcache\u002F`)\n- [ ] Registered? (`grep -A10 '\"hooks\"' .claude\u002Fsettings.json`)\n- [ ] Files exist? (`ls .claude\u002Fhooks\u002F*.sh`)\n- [ ] Bundle current? (`ls -la .claude\u002Fhooks\u002Fdist\u002F`)\n- [ ] Manual test works? (`echo '{}' | .\u002Fhook.sh`)\n- [ ] No silent failures? (check for `stdio: 'ignore'`)\n\n## Source Sessions\n\nDerived from 10 sessions (83% of all learnings):\n- a541f08a, 1c21e6c8, 6a9f2d7a, a8bd5cea, 2ca1a178, 657ce0b2, 3998f3a2, 2a829f12, 0b46cfd7, 862f6e2c\n",{"name":5,"description":7,"allowed-tools":42},[29,43,44],"Read","Grep","main","70e1c350500ee750987420bbae48837afa906b7e","skills\u002Fdebug-hooks","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis","https:\u002F\u002Fgithub.com\u002Frubicanjr","linktr.ee\u002Ffinanskodu","Industrial Engineer & CIO @FinansKodu. Architecting AI-driven financial agents and autonomous workflows. 🏗️ Building systems, not just prompts.","2026-06-09 13:50:15",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add rubicanjr\u002FFinCognis --skill debug-hooks",{"tool":59,"command":60},"bunx","bunx skills add rubicanjr\u002FFinCognis --skill debug-hooks",{"tool":62,"command":63},"pnpm","pnpm dlx skills add rubicanjr\u002FFinCognis --skill debug-hooks","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fdebug-hooks\u002FSKILL.md",true,[],[68,88,97,117,146,165],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":79,"publishedAt":37},"01M6NWS9DAXJTADT4T5MB49X8W","workflow-router","Goal-based workflow orchestration - routes tasks to specialist agents based on user goals","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-router\u002FSKILL.md",[74],{"categoryNo":75,"categoryName":76,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[80,27,81,82,83,84,85,86,87],"workflow router","router","orchestration","goals","goal","user","workflow orchestration","tasks",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":37},"01M6NWS3RETSC0SHP16HP66E14","wiring","Wiring Verification","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwiring\u002FSKILL.md",[],[90,95,96],"verification","false",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":106,"publishedAt":37},"01M6NWS0XW9CVQZBDA1EGW0TWC","websocket-patterns","Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwebsocket-patterns\u002Fskill.md",[103],{"categoryNo":104,"categoryName":105,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000015","视觉设计",[107,108,109,110,111,112,113,114,115,116],"websocket","patterns","websocket patterns","design","protocol","management","message","strategies","binary","connection",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":127,"publishedAt":37},"01M6NWRDQDX9ZNETAWRRMQWV52","visual-verdict","Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS\u002FREVISE\u002FFAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-verdict\u002FSKILL.md",[123,126],{"categoryNo":124,"categoryName":125,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":75,"categoryName":76,"taxonomyType":77,"taxonomyTypeDesc":78},[128,129,130,131,132,133,134,135,136,137,138,139,140,110,141,142,143,144,32,145],"visual","verdict","visual verdict","ui","across","revise","comparison","correctness","implementing","for","fixes","dimensions","frontend","development","qa","screenshot","returns","frontend development",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":37},"01M6NWR8HSNRS7MNDK2J02QYMN","verification-loop","Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[153,154,95,155,156,157,158,159,160,161,162,163,164],"verification loop","loop","lint","review","security","pr","system","diff","build","tests","diff review","types",{"skillNo":166,"name":167,"nameZh":6,"description":168,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":169,"categories":170,"keywords":171,"publishedAt":37},"01M6NWR4HHSFR0VR5EXFRWA747","vector-db-patterns","Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvector-db-patterns\u002Fskill.md",[],[172,173,174,175,108,176,177,178,179,114,180,181,182,183,184,137,185,186],"vector db patterns","vector db","db","vector","semantic search","search","embedding strategies","algorithms","chunking","semantic","retrieval","embedding","Hybrid Search","hybrid","rag"]