# Create Hook

Create and configure git hooks with intelligent project analysis, suggestions, and...

- Repository: https://github.com/NeoLabHQ/context-engineering-kit (1797 stars)
- Category: Testing
- License: GPL-3.0
- Last updated: 2026-08-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -g -a claude-code -y`
Codex: `npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -g -a codex -y`
Cursor: `npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -g -a cursor -y`
Gemini CLI: `npx skills add NeoLabHQ/context-engineering-kit --skill create-hook -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add NeoLabHQ/context-engineering-kit`

## Description

Create and configure git hooks with intelligent project analysis, suggestions, and automated testing

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Create Hook Command

Analyze the project, suggest practical hooks, and create them with proper testing.

## Your Task (/create-hook)

1. **Analyze environment** - Detect tooling and existing hooks
2. **Suggest hooks** - Based on your project configuration
3. **Configure hook** - Ask targeted questions and create the script
4. **Test & validate** - Ensure the hook works correctly

## Your Workflow

### 1. Environment Analysis & Suggestions

Automatically detect the project tooling and suggest relevant hooks:

**When TypeScript is detected (`tsconfig.json`):**

- PostToolUse hook: "Type-check files after editing"
- PreToolUse hook: "Block edits with type errors"

**When Prettier is detected (`.prettierrc`, `prettier.config.js`):**

- PostToolUse hook: "Auto-format files after editing"
- PreToolUse hook: "Require formatted code"

**When ESLint is detected (`.eslintrc.*`):**

- PostToolUse hook: "Lint and auto-fix after editing"
- PreToolUse hook: "Block commits with linting errors"

**When package.json has scripts:**

- `test` script → "Run tests before commits"
- `build` script → "Validate build before commits"

**When a git repository is detected:**

- PreToolUse/Bash hook: "Prevent commits with secrets"
- PostToolUse hook: "Security scan on file changes"

**Decision Tree:**

```
Project has TypeScript? → Suggest type checking hooks
Project has formatter? → Suggest formatting hooks
Project has tests? → Suggest test validation hooks
Security sensitive? → Suggest security hooks
+ Scan for additional patterns and suggest custom hooks based on:
  - Custom scripts in package.json
  - Unique file patterns or extensions
  - Development workflow indicators
  - Project-specific tooling configurations
```

### 2. Hook Configuration

Start by asking: **"What should this hook do?"** and offer relevant suggestions from your analysis.

Then understand the context from the user's description and **only ask about details you're unsure about**:

The rest: https://github.com/NeoLabHQ/context-engineering-kit/blob/HEAD/antigravity/skills/create-hook/SKILL.md
