Agent skill

enhance-hooks

Use when reviewing hooks for safety, timeouts, and correct frontmatter.

agent-sh404★ · +29/wk · 2 repos on radarProfile →
claude-codecodexcursorMIT
Install
npx skills add agent-sh/agentsys --skill enhance-hooks --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 13 KB
Bundled scripts: none
Version: 5.1.0
Path: .kiro/skills/enhance-hooks/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 923
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# enhance-hooks Analyze hook definitions and scripts for safety, correctness, and best practices. ## Parse Arguments ```javascript const args = '$ARGUMENTS'.split(' ').filter(Boolean); const targetPath = args.find(a => !a.startsWith('--')) || '.'; const fix = args.includes('--fix'); ``` ## Workflow 1. **Discover** - Find hook files (.md, .sh, .json) 2. **Classify** - Identify hook type and event 3. **Parse** - Extract frontmatter and script content 4. **Check** - Run all pattern checks against knowledge below 5. **Filter** - Apply certainty filtering 6. **Report** - Generate markdown output 7. **Fix** - Apply auto-fixes if --fix flag present --- ## Hook Knowledge Reference ### What Are Hooks Hooks are automated actions triggered at specific points in a Claude Code session. They enable validation, monitoring, and control of Claude's actions through bash commands or LLM-based evaluation. ### Hook Lifecycle (Complete Reference) Hooks fire in this sequence: | Order | Event | Description | Matcher Required | |-------|-------|-------------|------------------| | 1 | `SessionStart` | Session begins or resumes | No | | 2 | `UserPromptSubmit` | User submits a prompt | No | | 3 | `PreToolUse`

What's inside
Steps it walks through
  1. Parse Arguments
  2. Workflow
  3. Hook Knowledge Reference
  4. What Are Hooks
  5. Hook Lifecycle (Complete Reference)
  6. Hook Types
  7. Configuration Locations
  8. Configuration Structure
  9. Matcher Syntax
  10. Input Schema (JSON via stdin)
  11. Exit Codes
  12. Output Schemas
  13. Environment Variables
  14. Practical Hook Examples
Commands it runs
set -euo pipefail
Block dangerous patterns
if echo "$cmd" | grep -qE 'rm -rf|git reset --hard|curl.*\|.*sh'; then
echo '{"decision": "block", "reason": "Dangerous command blocked"}' >&2
exit 2
fi
exit 0
for file in $files; do
case "$file" in
esac
More from agentsys
All skills →
About this skill
What does the enhance-hooks skill do?

Use when reviewing hooks for safety, timeouts, and correct frontmatter.

How do I install it?

Run `npx skills add agent-sh/agentsys --skill enhance-hooks --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From agent-sh/agentsys, a repository with 923 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going