How to Set Up a Development Environment for no-mistakes: Complete Guide
You need Go 1.22+, Git, and Make to build the no-mistakes CLI from source, then use make build to compile the binary and make test to validate your changes.
no-mistakes is a Go-based CLI tool that intermediates between your local Git repository and remote push targets by running an AI-driven validation pipeline in disposable worktrees. Setting up a development environment for no-mistakes requires installing the Go toolchain, cloning the repository, and leveraging the project's Makefile for build automation. This guide walks you through the complete setup process using the actual source structure from kunchenguid/no-mistakes.
Prerequisites and repository setup
Before compiling the project, ensure your system meets the baseline requirements. The codebase uses Go modules and requires a minimum Go version of 1.22 for optimal compatibility.
Install the following dependencies:
- Go 1.22 or later – required for building the binary and running tests
- Git – used for repository operations and worktree management
- Make – drives the build system via the
Makefile
Clone the repository and prepare the module dependencies:
git clone https://github.com/kunchenguid/no-mistakes.git
cd no-mistakes
go mod tidy
The go mod tidy command ensures your local go.mod and go.sum files match the exact dependency tree required by the source code.
Understanding the codebase structure
The no-mistakes source is organized under an internal/ package hierarchy that separates concerns between CLI parsing, daemon lifecycle, and pipeline execution. Familiarizing yourself with these packages helps when navigating the code:
internal/cli– Parses user commands, launches the TUI, and writes CLI logs. Entry point atcmd/no-mistakes/main.go.internal/daemon– Runs the long-lived daemon that owns the gate lock, manages worktrees, and coordinates pipeline runs. Core logic resides ininternal/daemon/daemon.go.internal/pipeline– Implements the step-wise validation pipeline (review → test → docs → lint → push → PR). Orchestrated byinternal/pipeline/executor.go.internal/git– Thin wrapper around Git commands ensuring correct handling of bare repositories and worktrees. Implementation ininternal/git/git.go.internal/shellenv– Helper for spawning subprocesses with proper cancellation and cleanup. Seeinternal/shellenv/shell_command.go.internal/config– Loads global and repository-specific configuration including trusted repo settings. Defined ininternal/config/config.go.internal/telemetry– Sends anonymised usage metrics while respecting privacy guarantees. Located ininternal/telemetry/track.go.
Building the project
The build system is driven by the Makefile in the repository root. The most common target for developers is make build, which compiles the binary with version information baked in.
Run the build command:
make build
This produces the executable at bin/no-mistakes. For development iterations, you may also want to run make fmt to ensure consistent formatting across the codebase:
make fmt
The fmt target runs gofmt -w . to automatically format all Go source files according to standard conventions.
Testing your changes
The project provides multiple test targets to verify code correctness at different levels of integration.
For rapid feedback during development, run the unit test suite with race detection:
make test
This executes go test -race ./... to catch concurrency issues and logic regressions.
To validate the complete push → pipeline → PR flow—including agent interactions and network operations—run the end-to-end suite:
make e2e
Note that the e2e target requires network access for agent CLIs and runs behind the e2e build tag.
Before committing changes, verify that generated skill files remain synchronized and that go vet passes:
make lint
The lint target ensures the generated skill is up-to-date and performs static analysis on the codebase.
Development workflow
A typical development workflow for contributing to no-mistakes follows these steps:
- Edit code – Make changes under
internal/…orcmd/…directories. - Run
make fmt– Keep formatting consistent with Go standards. - Run
make lint– Ensure the generated skill is still current. - Run
make test– Catch regressions early with unit tests. - Run
make e2e– Verify the complete validation pipeline still functions correctly.
After initial build, you can initialize a local gate to test the CLI behavior:
./bin/no-mistakes init
This creates the ~/.no-mistakes directory and initializes the gate configuration required for local testing.
Working with the skill generator
The project ships a skill generator located at cmd/genskill/main.go that produces the /no-mistakes skill used by AI agents. This tool generates Markdown skill files from source constants.
If you modify the skill body or any source constants affecting agent behavior, regenerate the skill file:
make skill
This keeps the generated documentation in sync with the implementation, ensuring AI agents receive accurate instructions when processing your code changes.
Summary
Setting up a development environment for no-mistakes requires Go 1.22+, Git, and Make, with builds managed through the repository's Makefile.
- Clone the repository from
kunchenguid/no-mistakesand rungo mod tidyto fetch dependencies. - Use
make buildto compile the binary tobin/no-mistakesandmake fmtto standardize formatting. - Validate changes with
make testfor unit tests andmake e2efor full integration testing. - Remember to run
make skillafter editing AI agent skill definitions in the source code.
Frequently Asked Questions
What Go version is required to build no-mistakes?
Go version 1.22 or later is recommended. While earlier versions may compile the code, the project targets Go 1.22 features and has been tested primarily against this release. Run go version to verify your installation meets this requirement.
How do I run only the unit tests without the end-to-end suite?
Run make test to execute only the unit tests with race detection enabled. This command runs go test -race ./... and excludes the slower e2e tests that require network access and external agent CLIs.
What is the skill generator used for?
The skill generator at cmd/genskill/main.go creates the AI agent skill documentation used by the /no-mistakes command. When you modify the skill constants in the source, running make skill regenerates the Markdown files so that AI agents have current instructions for code review and validation tasks.
How do I debug the no-mistakes daemon during development?
The daemon lifecycle and singleton lock logic reside in internal/daemon/daemon.go. For debugging, build the binary with make build and run ./bin/no-mistakes with appropriate flags to trigger daemon initialization. The daemon manages worktree creation and pipeline coordination through internal/pipeline/executor.go, where you can add logging or attach a debugger to trace execution flow.
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 →