Skip to main content

A streamlined TDD framework for Claude Code hooks with real-time feedback

Project description

QuickHooks

Python Version UV UV Build Backend License: MIT Code style: Ruff Type Checked: mypy Tests: pytest

A streamlined TDD framework for Claude Code hooks with intelligent agent analysis, discovery, and Agent OS integration. Built with Python 3.12+ and modern UV package management, featuring automatic agent detection from your ~/.claude/agents directory, smart prompt modification for optimal AI collaboration, and seamless Agent OS workflow execution for spec-driven agentic development.

๐Ÿš€ UV-Powered Development

QuickHooks leverages the blazing-fast UV package manager for 10-100x faster dependency resolution and installation. Our development workflow is optimized for UV's modern Python project management.

Features

๐Ÿง  Intelligent Agent Analysis

  • AI-powered prompt analysis using Groq and Pydantic AI
  • Automatic agent discovery from ~/.claude/agents directory
  • Semantic similarity matching with Chroma vector database
  • Smart prompt modification for guaranteed agent usage
  • Context-aware chunking for large inputs (up to 128K tokens)

๐Ÿค– Agent OS Integration

  • Spec-driven agentic development with Agent OS workflows
  • Instruction execution directly from QuickHooks CLI
  • Workflow management with state persistence and resumption
  • Claude Code integration with automatic intent detection
  • Pre/post-execution hooks for comprehensive workflow support

๐Ÿ”ง Development Tools

  • Hot-reload development server with watchfiles
  • Test-driven development workflow
  • Fast and efficient file watching
  • Modern Python with type hints and async/await
  • Developer-friendly CLI with rich output

๐Ÿ”— Claude Code Integration

  • Seamless hook integration with Claude Code settings
  • Automatic prompt interception and modification
  • Environment-based configuration
  • Verbose logging and debugging support

๐Ÿ“ฆ Installation

Quick Start (PyPI)

# Install via pip (when published)
pip install quickhooks[agent-analysis,agent_os]
export GROQ_API_KEY=your_groq_api_key_here

# Agent Analysis
quickhooks agents analyze "Write a Python function"

# Agent OS (requires Agent OS installation)
quickhooks agent-os list-instructions
quickhooks agent-os execute-instruction plan-product

๐Ÿ› ๏ธ Development Installation with UV

  1. Install UV (if not already installed):

    # macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Windows PowerShell
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. Clone and setup:

    git clone https://github.com/kivo360/quickhooks.git
    cd quickhooks
    
  3. Install with UV (recommended):

    uv sync --all-extras  # Install all dependencies including dev extras
    
  4. Alternative: Classic installation:

    make install  # Uses UV under the hood
    

๐Ÿ”ง UV Project Workflow

graph TD
    A["๐Ÿš€ uv init"] --> B["๐Ÿ“ฆ uv add dependency"]
    B --> C["๐Ÿƒ uv run command"]
    C --> D["๐Ÿ”’ uv lock"]
    D --> E["๐Ÿ”„ uv sync"]
    E --> F["๐Ÿ—๏ธ uv build"]
    F --> G["๐Ÿ“ค uv publish"]
    
    style A fill:#e1f5fe
    style B fill:#f3e5f5
    style C fill:#e8f5e8
    style D fill:#fff3e0
    style E fill:#fce4ec
    style F fill:#f1f8e9
    style G fill:#e3f2fd

๐Ÿ”— Claude Code Integration Setup

Option 1: PEP 723 Self-Contained Hooks (Recommended)

Self-contained hooks with inline dependencies using PEP 723:

# Install PEP 723 hooks to your project
uv run -s scripts/setup_pep723_hooks.py install

# Or copy to current directory manually
cp -r .claude/ your-project/
chmod +x your-project/.claude/hooks/*.py

# Configure settings
edit .claude/settings.json  # Set GROQ_API_KEY and enable hooks

# Test hooks
uv run -s scripts/setup_pep723_hooks.py test

Benefits:

  • โœ… Self-contained scripts with inline dependencies
  • โœ… No global installation required
  • โœ… Dependencies auto-install from PyPI via PEP 723
  • โœ… Fast execution with UV dependency caching
  • โœ… Portable across projects

See PEP 723 Hooks Guide for complete documentation.

Option 2: Global Installation

# Install globally for Claude Code integration
uv run python -m quickhooks install install-global

# OR setup via script
uv run python scripts/setup_claude_code_integration.py

# Verify integration
quickhooks agents analyze "Write a Python function"

๐Ÿ› ๏ธ Development Workflow

๐Ÿƒ Start Development Server

# UV-native approach (recommended)
uv run quickhooks-dev run src/ --delay 0.5

# Using Makefile (UV under the hood)
make dev

This starts the development server with hot-reload enabled. The server automatically restarts when you make changes.

๐Ÿงช Run Tests

# UV-native testing
uv run pytest tests/ -v --cov=quickhooks

# Using Makefile
make test

๐ŸŽจ Code Quality

# Format code
uv run ruff format src/ tests/  # or: make format

# Lint code  
uv run ruff check src/ tests/   # or: make lint

# Type checking
uv run mypy src/quickhooks       # or: make typecheck

# All quality checks
uv run make check               # or: make check

๐Ÿ“‹ UV Command Reference

Task UV Command Makefile Equivalent
Install deps uv sync --all-extras make install
Dev server uv run quickhooks-dev run src/ make dev
Run tests uv run pytest make test
Format code uv run ruff format make format
Type check uv run mypy src/ make typecheck
Add dependency uv add package-name N/A
Lock deps uv lock N/A
Build package uv build --no-sources N/A

Project Structure

quickhooks/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ quickhooks/          # Main package
โ”‚       โ”œโ”€โ”€ __init__.py      # Package initialization
โ”‚       โ”œโ”€โ”€ cli/             # CLI commands
โ”‚       โ”œโ”€โ”€ agent_analysis/  # Agent analysis system
โ”‚       โ”‚   โ”œโ”€โ”€ analyzer.py  # Core analysis engine
โ”‚       โ”‚   โ”œโ”€โ”€ agent_discovery.py # Local agent discovery
โ”‚       โ”‚   โ”œโ”€โ”€ context_manager.py # Context chunking
โ”‚       โ”‚   โ”œโ”€โ”€ command.py   # CLI commands
โ”‚       โ”‚   โ””โ”€โ”€ types.py     # Type definitions
โ”‚       โ”œโ”€โ”€ dev.py           # Development server
โ”‚       โ””โ”€โ”€ ...
โ”œโ”€โ”€ hooks/                   # Claude Code hooks
โ”‚   โ””โ”€โ”€ agent_analysis_hook.py # Main integration hook
โ”œโ”€โ”€ examples/                # Example configurations
โ”‚   โ”œโ”€โ”€ claude_code_settings.json
โ”‚   โ””โ”€โ”€ agent_analysis_demo.py
โ”œโ”€โ”€ scripts/                 # Setup and utility scripts
โ”‚   โ””โ”€โ”€ setup_claude_code_integration.py
โ”œโ”€โ”€ tests/                   # Test files
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ Makefile                 # Development commands
โ”œโ”€โ”€ pyproject.toml          # Project configuration
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ AGENT_ANALYSIS_README.md # Detailed agent analysis docs

Development Server

The development server provides a smooth development experience with:

  • Automatic reload on file changes
  • Rich console output
  • Clean error reporting
  • Configurable watch paths and reload delay

Usage

# Start the development server
python -m quickhooks.dev run src/

# With custom reload delay (in seconds)
python -m quickhooks.dev run src/ --delay 1.0

Or using the CLI:

quickhooks-dev run src/

CLI Commands

Agent Analysis

# Analyze a prompt for agent recommendations
quickhooks agents analyze "Write a Python function that sorts a list"

# With context file
quickhooks agents analyze "Review this code for security issues" --context code.py

# Custom configuration
quickhooks agents analyze "Debug this error" \
    --model qwen/qwen3-32b \
    --threshold 0.8 \
    --format rich

Agent OS Commands

# List available Agent OS instructions
quickhooks agent-os list-instructions
quickhooks agent-os list-instructions --category core

# Execute Agent OS instructions
quickhooks agent-os execute-instruction plan-product
quickhooks agent-os execute-instruction create-spec --verbose

# Workflow management
quickhooks agent-os list-workflows
quickhooks agent-os init-workflows
quickhooks agent-os create-workflow my-workflow \
  --description "Custom development workflow" \
  --instructions "plan-product,create-spec,analyze-product"
quickhooks agent-os execute-workflow product-planning

# Show instruction details
quickhooks agent-os show-instruction plan-product

Development Commands

# Show version
quickhooks version

# Say hello
quickhooks hello
quickhooks hello --name "Your Name"

# Development server
quickhooks-dev run src/

๐Ÿ“š Documentation

๐Ÿค– Agent Analysis System

For detailed documentation on the AI-powered agent analysis system, see AGENT_ANALYSIS_README.md.

Key Topics:

  • ๐Ÿ“„ Complete API Reference - All classes, methods, and types
  • ๐Ÿ“ Agent File Formats - Python, Markdown, JSON examples
  • ๐Ÿ”— Claude Code Integration - Step-by-step setup guide
  • ๐Ÿ”ง Troubleshooting - Common issues and solutions
  • ๐Ÿ Performance Optimization - Tips for faster analysis

๐Ÿค– Agent OS Integration

For comprehensive documentation on the Agent OS integration, see docs/agent-os-integration.md.

Key Topics:

  • ๐Ÿ”„ Workflow Execution - Execute predefined and custom workflows
  • ๐Ÿ“‹ Instruction Management - List and execute Agent OS instructions
  • ๐Ÿ”— Claude Code Integration - Automatic intent detection and hook setup
  • โš™๏ธ Configuration - Environment variables and customization options
  • ๐Ÿ—๏ธ API Reference - Complete Python API for programmatic usage

๐Ÿš€ UV Package Management

Comprehensive guides for modern Python development with UV:

๐Ÿ“Š Workflow Diagrams

Visual documentation with Mermaid charts:

  • ๐Ÿ”„ Development lifecycle workflows
  • ๐Ÿ“ฆ Dependency management flows
  • ๐Ÿ—๏ธ Build and distribution pipelines
  • ๐Ÿ—‚ CI/CD integration patterns

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for detailed information about our UV-based development workflow.

๐Ÿƒ Quick Start for Contributors

  1. Fork & Clone:

    git clone https://github.com/YOUR_USERNAME/quickhooks.git
    cd quickhooks
    
  2. Setup Development Environment:

    uv sync --all-extras  # Install all dependencies
    
  3. Create Feature Branch:

    git checkout -b feature/your-amazing-feature
    
  4. Develop & Test:

    uv run pytest tests/ -v        # Run tests
    uv run ruff format src/ tests/  # Format code
    uv run mypy src/quickhooks      # Type check
    
  5. Submit PR:

    git push origin feature/your-amazing-feature
    # Create Pull Request on GitHub
    

๐Ÿ“Š Development Commands

# Core development workflow
uv sync --dev                    # Sync dev environment
uv run pytest tests/ -v         # Run comprehensive tests
uv run pytest tests/test_agent_analysis.py -v  # Specific tests
uv run make check               # Run all quality checks
uv build --no-sources          # Test build

# Code quality
uv run ruff format src/ tests/  # Format code
uv run ruff check src/ tests/   # Check linting
uv run mypy src/quickhooks      # Type checking

See our UV Guide for detailed development practices and workflow diagrams for visual references.

License

MIT

๐Ÿ“Š Project Stats

  • ๐Ÿ”ฅ UV-Powered: 10-100x faster dependency management
  • ๐Ÿง  AI-Enhanced: Intelligent agent analysis with Groq + Pydantic AI
  • ๐Ÿ”„ Hot-Reload: Development server with instant feedback
  • ๐Ÿงช Well-Tested: Comprehensive test suite with 90%+ coverage
  • ๐Ÿ“„ Type-Safe: Full type annotations with mypy validation
  • ๐ŸŽจ Modern Code: Ruff formatting and linting
  • ๐Ÿš€ Production-Ready: Docker support and CI/CD pipelines

Made with โค๏ธ and โšก UV for the Claude Code community
Powered by Rust-speed dependency management and AI-driven development

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quickhooks-0.2.0.tar.gz (982.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quickhooks-0.2.0-py3-none-any.whl (131.9 kB view details)

Uploaded Python 3

File details

Details for the file quickhooks-0.2.0.tar.gz.

File metadata

  • Download URL: quickhooks-0.2.0.tar.gz
  • Upload date:
  • Size: 982.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for quickhooks-0.2.0.tar.gz
Algorithm Hash digest
SHA256 39ae93167150f3b554e2c01f1a67d7de8dac18efae3c68c86f5a20b36a5b4c1c
MD5 be1afaab87ff46eb41c20f8c83eee5e6
BLAKE2b-256 6cc98cc7e16034b7ad04701aff41a257deb052a309e85a7fdef8755ca93a1b4f

See more details on using hashes here.

File details

Details for the file quickhooks-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: quickhooks-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 131.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for quickhooks-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ff5f0de6bcaa488a41928bc5b685c1f5140cce5925542b875d1368f5dc2fcf9
MD5 ba2c5d862593a8562d733973c2f429c0
BLAKE2b-256 3253ea58cf11fb6195ad2b14c874a4bb2012811cc38cce6f05438ce6c2c8cbe5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page