Skip to content

Commit 8e43293

Browse files
sjnimsclaude
andcommitted
docs(hook-development): remove duplicated temporarily active hooks section
Remove the "Temporarily Active Hooks" section from SKILL.md as it duplicates content already in references/patterns.md (Pattern 9 and Pattern 10). This follows the skill-development best practice of keeping SKILL.md lean by moving detailed content to references files. Word count reduced from 2,125 to 1,979 words, now within the 1,500-2,000 word target for progressive disclosure. Fixes #65 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9c869df commit 8e43293

File tree

1 file changed

+1
-50
lines changed
  • plugins/plugin-dev/skills/hook-development

1 file changed

+1
-50
lines changed

plugins/plugin-dev/skills/hook-development/SKILL.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -528,55 +528,6 @@ All matching hooks run **in parallel**:
528528
3. Cache validation results in temp files
529529
4. Minimize I/O in hot paths
530530

531-
## Temporarily Active Hooks
532-
533-
Create hooks that activate conditionally by checking for a flag file or configuration:
534-
535-
### Pattern: Flag file activation
536-
537-
```bash
538-
#!/bin/bash
539-
# Only active when flag file exists
540-
FLAG_FILE="$CLAUDE_PROJECT_DIR/.enable-strict-validation"
541-
542-
if [ ! -f "$FLAG_FILE" ]; then
543-
# Flag not present, skip validation
544-
exit 0
545-
fi
546-
547-
# Flag present, run validation
548-
input=$(cat)
549-
# ... validation logic ...
550-
```
551-
552-
### Pattern: Configuration-based activation
553-
554-
```bash
555-
#!/bin/bash
556-
# Check configuration for activation
557-
CONFIG_FILE="$CLAUDE_PROJECT_DIR/.claude/plugin-config.json"
558-
559-
if [ -f "$CONFIG_FILE" ]; then
560-
enabled=$(jq -r '.strictMode // false' "$CONFIG_FILE")
561-
if [ "$enabled" != "true" ]; then
562-
exit 0 # Not enabled, skip
563-
fi
564-
fi
565-
566-
# Enabled, run hook logic
567-
input=$(cat)
568-
# ... hook logic ...
569-
```
570-
571-
**Use cases:**
572-
573-
- Enable strict validation only when needed
574-
- Temporary debugging hooks
575-
- Project-specific hook behavior
576-
- Feature flags for hooks
577-
578-
**Best practice:** Document activation mechanism in plugin README so users know how to enable/disable temporary hooks.
579-
580531
## Hook Lifecycle and Limitations
581532

582533
### Hooks Load at Session Start
@@ -681,7 +632,7 @@ echo "$output" | jq .
681632

682633
For detailed patterns and advanced techniques, consult:
683634

684-
- **`references/patterns.md`** - Common hook patterns (8+ proven patterns)
635+
- **`references/patterns.md`** - 10 proven patterns including temporarily active and configuration-driven hooks
685636
- **`references/migration.md`** - Migrating from basic to advanced hooks
686637
- **`references/advanced.md`** - Advanced use cases and techniques
687638

0 commit comments

Comments
 (0)