Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hooks/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"hooks": [
{
"type": "command",
"command": "node -e \"const fs=require('fs');let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';if(/\\.(md|txt)$/.test(p)&&!/(README|CLAUDE|AGENTS|CONTRIBUTING)\\.md$/.test(p)&&!/\\.claude\\/plans\\//.test(p)){console.error('[Hook] BLOCKED: Unnecessary documentation file creation');console.error('[Hook] File: '+p);console.error('[Hook] Use README.md for documentation instead');process.exit(2)}}catch{}console.log(d)})\""
"command": "node -e \"let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>{try{const i=JSON.parse(d);const p=i.tool_input?.file_path||'';const n=p.replace(/\\\\\\\\/g,'/');const b=n.split('/').pop()||'';if(/\\.(md|txt)$/i.test(n)&&/^(NOTES|TODO|SCRATCH|TEMP|DRAFT|BRAINSTORM|SPIKE|DEBUG|WIP)\\.(md|txt)$/.test(b)&&!/(^|\\/)(docs|\\.claude|\\.github|commands|skills|benchmarks|templates)(\\/|$)/i.test(n)){console.error('[Hook] BLOCKED: Ad-hoc documentation filename');console.error('[Hook] File: '+p);console.error('[Hook] Use structured paths: docs/specs/, docs/adr/, commands/, skills/');process.exit(2)}}catch{}console.log(d)})\""
}
],
"description": "Block creation of random .md files - keeps docs consolidated"
"description": "Block ad-hoc doc filenames (NOTES, TODO, SCRATCH, etc.) unless in structured paths"
},
{
"matcher": "Edit|Write",
Expand Down