How to Set Up a Development Environment for no-mistakes
To set up a development environment for no-mistakes, clone the repository, ensure Go 1.22+ is installed, run go mod tidy, and use make build to compile the binary.
no-mistakes is a Go-based CLI tool that intercepts Git push operations to run an AI-driven validation pipeline. The source code is organized under an internal/ package hierarchy and uses a conventional Makefile for build automation.
Prerequisites
Before compiling the project, verify your system meets the following requirements:
- Go 1.22 or higher – The project uses modern Go features and requires version 1.22 minimum.
- Git – Required for worktree manipulation and subcommand execution.
- Make – Used to invoke build targets defined in the repository root.
You can check your Go version with:
go version
Repository Structure
Understanding the package layout helps navigate the codebase effectively. The project follows a standard Go structure with internal packages:
internal/cli– Parses user commands and launches the TUI. Entry point iscmd/no-mistakes/main.go.internal/daemon– Runs the long-lived daemon that owns the gate lock and manages worktrees. Core logic resides ininternal/daemon/daemon.go.internal/pipeline– Implements the step-wise validation pipeline (review, test, docs, lint, push, PR). Orchestrated viainternal/pipeline/executor.go.internal/git– Thin wrapper around Git commands handling bare repositories and worktrees safely. Implementation is ininternal/git/git.go.internal/shellenv– Spawns subprocesses with proper cancellation and cleanup. Seeinternal/shellenv/shell_command.go.internal/config– Loads global and repository-specific configuration. Defined ininternal/config/config.go.internal/telemetry– Sends anonymized usage metrics while respecting privacy guarantees. Located ininternal/telemetry/track.go.cmd/genskill– Generates the/no-mistakesskill file used by AI agents. Source is incmd/genskill/main.go.
Build System Overview
The project uses a Makefile to coordinate compilation, testing, and code generation. Key targets include:
make build– Compiles the binary tobin/no-mistakeswith version information baked in.make test– Runs all unit tests with race detection enabled (go test -race ./...).make e2e– Executes the end-to-end suite (agents + pipeline) behind thee2ebuild tag.make lint– Verifies generated skill files are up-to-date and runsgo vet.make fmt– Formats the entire source tree usinggofmt -w ..make skill– Regenerates the Markdown skill file from the source constant after any skill body changes.
Step-by-Step Setup
Follow these commands to build no-mistakes from source:
# Clone the repository
git clone https://github.com/kunchenguid/no-mistakes.git
cd no-mistakes
# Install dependencies
go mod tidy
# Build the binary
make build
This produces bin/no-mistakes in your working directory. Initialize the tool to create the gate directory in ~/.no-mistakes:
./bin/no-mistakes init
Development Workflow
After modifying code under internal/, follow this verification sequence:
- Run
make fmt– Ensures consistent formatting across all Go files. - Run
make lint– Confirms generated skills are synchronized and code passes static analysis. - Run
make test– Catches regressions with the unit test suite. - Run
make e2e– Validates the complete push → pipeline → PR flow (requires network access for agent CLIs).
If you modify the AI skill definitions, regenerate the skill file:
make skill
Key Source Files
README.md– High-level overview and quick-start instructions.Makefile– Build orchestration and release commands.cmd/no-mistakes/main.go– CLI entry point that delegates tointernal/cli.internal/daemon/daemon.go– Daemon lifecycle management and singleton lock implementation.internal/pipeline/executor.go– Pipeline step orchestration and validation gates.internal/git/git.go– Safe Git operations for bare repositories and worktrees.internal/config/config.go– Configuration loading and trusted repository handling.
Summary
- no-mistakes requires Go 1.22+ and uses standard
maketargets for building. - The codebase is organized under
internal/with clear separation between CLI parsing, daemon lifecycle, and pipeline execution. - Use
make buildto compile,make testfor unit tests, andmake e2efor full integration testing. - Run
make skillafter editing AI skill constants to regenerate the Markdown skill file. - The binary initializes its state in
~/.no-mistakeswhen you run./bin/no-mistakes init.
Frequently Asked Questions
What Go version is required to build no-mistakes?
Go 1.22 or higher is recommended. The project uses modern language features and the go.mod file specifies a compatible version. Verify your installation with go version before running make build.
How do I run the full test suite including AI agent integration?
Use make e2e to execute the end-to-end suite. This target requires the e2e build tag and network access to download agent CLIs. Unit tests alone can be run with make test, which executes go test -race ./... to detect race conditions.
Why is there a make skill command and when should I use it?
The cmd/genskill tool generates the /no-mistakes Markdown skill file from a source constant. You must run make skill after editing the skill body in the Go source to keep the generated documentation synchronized. The make lint target will fail if the skill file is out of date.
Where does no-mistakes store its configuration and worktrees?
The daemon creates a gate directory at ~/.no-mistakes when you run ./bin/no-mistakes init. This location stores the singleton lock, disposable worktrees, and cached configuration. The internal/daemon/daemon.go and internal/config/config.go files handle these paths according to the XDG Base Directory specification where applicable.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →