# Version 0.1.6 - Awesome-Hooks Integration

Released: October 15, 2025

## Overview

This release integrates PreToolUse hooks from the awesome-hooks repository and adds project vs user-level hook installation support. It introduces three new hook types for enforcing development standards and best practices.

## New Features

### Awesome-Hooks Integration

Added PreToolUse hooks from [boxabirds/awesome-hooks](https://github.com/boxabirds/awesome-hooks):

1. **bundler-standard** - Enforces Bun usage instead of npm/pnpm/yarn
   - Intercepts npm, pnpm, yarn, and npx commands
   - Provides Bun equivalent suggestions
   - Requires: Bun runtime

2. **file-name-consistency** - Ensures consistent file naming conventions
   - Uses AI (Gemini) to analyze project naming patterns
   - Blocks files with inconsistent naming
   - Requires: GEMINI_API_KEY environment variable

3. **uv-standard** (custom) - Enforces uv usage instead of pip/pip3
   - Intercepts pip, pip3, and python -m pip commands
   - Provides uv equivalent suggestions
   - Handles edge cases: quotes, comments, sudo, piped commands
   - Requires: uv package installer

### Project vs User-Level Hooks

Added `--user` flag for flexible hook installation:

```bash
# Project-level (default) - applies to current project only
ccg setup-hooks uv-standard

# User-level - applies to all projects
ccg setup-hooks uv-standard --user
```

**Installation paths:**
- Project: `.claude/hooks/` and `.claude/settings.json`
- User: `~/.claude/awesome-hooks/` and `~/.claude/settings.json`

## Commands

### Setup Hooks

```bash
ccg setup-hooks <hook-name> [--user]
```

Available hooks:
- `uv-standard` - Enforce uv for Python packages
- `bundler-standard` - Enforce Bun for JS packages
- `file-name-consistency` - Enforce consistent file naming

### Remove Hooks

```bash
ccg remove-hooks <hook-name> [--user]
```

Hook removal is safe and preserves custom hooks - only removes hooks with specific claude-goblin command signatures.

## Technical Improvements

### Hook Robustness

The `uv-standard` hook includes comprehensive edge case handling:

✓ Blocks actual pip execution: `pip install`, `sudo pip install`, `python3 -m pip`
✓ Allows pip in strings: `echo 'pip install'`, `"pip install"`
✓ Allows pip in comments: `# pip install later`
✓ Allows pip as argument: `grep pip`, `which pip`, `echo pip`
✓ Allows pip in variables: `export PIP_INDEX_URL=...`

All 17 test cases passing with proper command context detection.

### Module Structure

- `src/hooks/awesome_hooks.py` - PreToolUse hook management
- `src/hooks_data/` - Hook scripts (bundler-standard.ts, file-name-consistency.sh, uv-standard.py)
- `docs/attributions.md` - Full attribution to awesome-hooks and dependencies

## Attribution

Hooks from [awesome-hooks](https://github.com/boxabirds/awesome-hooks) by [@boxabirds](https://github.com/boxabirds) (Apache-2.0 license).

The `uv-standard` hook was inspired by `bundler-standard.ts` and reimplemented in Python for the Python ecosystem.

## Upgrading

```bash
pip install --upgrade claude-goblin
```

Existing hooks are unaffected. To use new hooks:

```bash
ccg setup-hooks uv-standard        # Project-level
ccg setup-hooks uv-standard --user # User-level
```

## Documentation

- Full documentation in README.md
- Attribution details in docs/attributions.md
- Hook usage examples and requirements included
