Development Guide

June 5, 2025 ยท View on GitHub

Quick Start

# Clone the repository
git clone https://github.com/Veraticus/claude-code-ntfy
cd claude-code-ntfy

# Install required tools (one-time setup)
make install-tools

# Build and test
make test
make build

# Run the binary
./build/claude-code-ntfy -help

Development Workflow

1. Make changes

Edit code as needed. The project structure:

  • cmd/ - Entry point
  • pkg/ - Core packages
  • scripts/ - Helper scripts

2. Test your changes

make test    # Quick - runs tests with race detection

3. Before committing

make fix     # Auto-fix formatting and common issues
make verify  # Run all checks (tests, linting, etc.)

Common Tasks

TaskCommandDescription
Buildmake buildBuild the binary
Testmake testRun tests with race detection
Formatmake fmtFormat code
Lintmake lintRun linters
Coveragemake coverGenerate coverage report
Cleanmake cleanRemove build artifacts

Writing Tests

  • Use table-driven tests for multiple scenarios
  • Mock external dependencies
  • Run tests with race detection (automatic with make test)
  • Check coverage with make cover

Code Standards

The project enforces:

  • Standard Go formatting (gofmt)
  • Clean, idiomatic Go code
  • Comprehensive error handling
  • No race conditions
  • Security best practices

These are automatically checked by make verify.