aggregate-logs
Generate LEARNINGS.md from skill execution logs over a configurable time window.
Create hooks with brainstorming and security-first design
> /plugin marketplace add athola/claude-night-marketHow it fires
How this command gets triggered: by you, by Claude, or both.
/create-hookContext preview
What this command does when you run it.
Create hooks with brainstorming and security-first design
name: create-hook description: Create hooks with brainstorming and security-first design usage: /create-hook [hook-description] [--skip-brainstorm] [--plugin <name>] [--event <type>]
Creates new hooks through a structured workflow: **iron-law → brainstorm → design → scaffold → validate**. Uses Socratic questioning to refine rough ideas into well-designed, secure hooks before generating any files.
Use this command when you need to:
Avoid this command if:
# Start with brainstorming (recommended) /create-hook "detect when user shares sensitive files" # Skip brainstorming if design is clear /create-hook secret-detector --skip-brainstorm --event PreToolUse # Create in specific plugin /create-hook "auto-format on save" --plugin sanctum --event PostToolUse
| Event | When It Fires | Common Use Cases | |-------|---------------|------------------| | `UserPromptSubmit` | User submits a prompt | Input validation, context injection | | `PreToolUse` | Before tool execution | Security checks, blocking dangerous ops | | `PostToolUse` | After tool completes | Logging, post-processing, notifications | | `Notification` | Claude sends notification | Custom alerts, sound effects | | `Stop` | Session/task ends | Cleanup, summaries, checkpoints | | `SubagentStop` | Subagent completes | Aggregation, reporting | | `TeammateIdle` | Teammate agent becomes idle | Work assignment, load balancing | | `TaskCompleted` | Task finishes execution | Coordination, chaining, reporting | | `PreCompact` | Before context compaction | Backup, preservation | | `SessionStart` | Session begins | Context loading, initialization |
**This phase is required and cannot be skipped.**
1. **Create test file FIRST**: `tests/hooks/test_${hook_name}.py` 2. **Write structural tests**: Hook file exists, valid JSON/Python, registered correctly 3. **Run tests - capture RED state**:
pytest tests/hooks/test_${hook_name}.py -v
# Expected: FAILED (hook does not exist)4. **Capture evidence**:
[E1] Command: pytest tests/hooks/test_${hook_name}.py -v
Output: FAILED - FileNotFoundError
Status: RED - Interlock satisfied**Only after completing Phase -1 may you proceed.**
---
Before creating any files, refine the hook concept through collaborative dialogue.
**Invoke the brainstorming skill:**
Use superpowers:brainstorming to refine this hook idea before scaffolding.
The brainstorming phase will:
1. **Understand the purpose** - One question at a time:
2. **Explore security implications**:
3. **Design the implementation**:
4. **Validate the design** - Present in sections:
5. **Document the design**:
**Skip brainstorming** with `--skip-brainstorm` only when:
After brainstorming (or with `--skip-brainstorm`), the command prompts for:
1. **Hook name** (if not provided)
2. **Hook event type**:
3. **Hook type**:
4. **Matcher pattern** (for PreToolUse/PostToolUse):
5. **Timeout** (for scripts):
Before scaffolding, validate security considerations:
Security Checklist: [ ] Input validation for all payload fields [ ] No shell injection vulnerabilities [ ] No path traversal vulnerabilities [ ] Timeout configured appropriately [ ] Error handling doesn't leak secrets [ ] Logging doesn't capture sensitive data
**For declarative hooks:**
hooks/
├── hooks.json # Add hook configuration
└── ${hook_name}.json # Or inline in hooks.json**For script hooks:**
hooks/
├── hooks.json # Hook registration
├── ${hook_name}.py # Main hook script
└── shared/ # Optional shared utilities
├── __init__.py
└── ${utility}.py**hooks.json entry:**
> **Important**: Use string matchers (regex patterns), not object matchers. > - Correct: `
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Generate LEARNINGS.md from skill execution logs over a configurable time window.
Analyze skill file complexity metrics and generate modularization recommendations for splitting or progressive loading.
Scaffold new Claude Code skills with brainstorming, TDD methodology, and proper frontmatter and module structure.
Manually evaluate a recent skill execution to record qualitative feedback.