How kunchenguid/no-mistakes works
1. What the repository is
- This is a Go-based CLI product that acts as a local Git gate in front of a real remote repository.
- The main user-facing flows are: git push no-mistakes, interactive no-mistakes TUI, and non-interactive /no-mistakes agent skill via axi.
2. Top-level runtime shape
- The core binary is cmd/no-mistakes, with supporting commands for skill generation (cmd/genskill), fixture recording (cmd/recordfixture), and fake agent simulation (cmd/fakeagent).
- The repo is primarily a single Go monorepo, with a docs site under docs/ and a committed agent skill under skills/no-mistakes.
3. Entry points and orchestration
- internal/cli is the command layer: it wires subcommands like init, status, daemon, attach, runs, stats, update, wizard, axi, and doctor.
- The CLI is the control plane. It delegates long-running or stateful work to the daemon and pipeline packages rather than doing heavy work inline.
4. Gate and daemon model
- internal/daemon is the local service layer that owns the gate lifecycle, run attachment, recovery, and process/service management.
- It supports OS-specific service integration for macOS/Linux/Windows, plus recovery of orphaned or active runs after restart.
- The daemon is the boundary between the user’s current checkout and the isolated execution environment used for validation.
5. Pipeline execution core
- internal/pipeline is the heart of the product: it executes ordered steps such as intent extraction, review, test, docs, lint, push, PR creation, CI monitoring, and rebase/force-push handling.
- internal/pipeline/steps contains the concrete step implementations and the rules for when a step auto-fixes, asks the user, or blocks the flow.
- The pipeline is designed around findings: each step can emit actionable results instead of just pass/fail.
6. Worktree isolation and Git operations
- internal/git, internal/paths, internal/update, and parts of internal/daemon cooperate to manage disposable worktrees, branch routing, and safe publishing.
- The repository treats the user’s original branch as protected input and performs checks in an isolated worktree before forwarding to the configured push target.
- There is explicit handling for forked repositories, repo trust, renamed repos, and push/force-push safety.
7. Agent integration boundary
- internal/agent abstracts multiple AI coding agents: Claude, Codex, Copilot, OpenCode, Pi, Rovodev, and ACP-style targets via acpx.
- This package normalizes different CLI and streaming protocols into a common agent interface, including fallback ordering and retry logic.
- Several transport shapes are supported: native command invocation, HTTP/SSE streaming, and server-style process management.
8. Non-interactive skill mode
- skills/no-mistakes/SKILL.md and cmd/genskill define the /no-mistakes skill distribution path.
- The skill drives the same pipeline through no-mistakes axi, which is a machine-friendly approval interface for agent-driven workflows.
- This is the bridge between “agent does the work” and “pipeline validates and escalates only the human decisions.”
9. Interactive human workflow
- internal/tui implements the terminal UI used when a run is active or when the user launches the tool directly.
- The TUI presents findings, gate state, CI status, diff views, review prompts, and action affordances like approve, auto-fix, skip, or abort.
- internal/wizard handles initial onboarding and branch/commit/push setup when the user starts from uncommitted changes.
10. State, persistence, and telemetry
- internal/db stores persistent repo/run/round/step state and stats for active and historical runs.
- internal/telemetry and internal/cli/telemetry.go capture product events, while internal/cimonitor watches CI status after PR creation.
- The data model centers on runs, rounds, steps, findings, and repo metadata, which lets the CLI, daemon, and TUI all observe the same workflow state.
11. SCM and PR provider support
- internal/scm and internal/bitbucket encapsulate provider-specific behavior for GitHub, GitLab, Azure DevOps, and Bitbucket.
- These packages handle host detection, authentication-related concerns, and PR body generation/formatting so the pipeline can open clean PRs consistently across hosts.
12. Intent extraction and safety controls
- internal/intent parses agent output and local context to determine what changed, what the user intended, and what needs escalation.
- internal/gate, internal/safeurl, and internal/types provide the guardrails and shared schemas for findings, intent, and safe redaction.
- This boundary is important because the product deliberately separates mechanical fixes from anything that might alter intent.
13. Platform-specific and lifecycle plumbing
- Several packages have OS-specific files for Unix/Windows behavior: service launch, process handling, signals, shell environment, update replacement, and quarantine.
- internal/update manages self-update behavior and protection of active runs during replacement.
- This makes the architecture operationally portable rather than being a thin cross-platform wrapper.
14. Verification and reproducibility
- The repo is heavily tested, with unit, integration, end-to-end, workflow, and fixture-based tests spread across the codebase.
- internal/e2e uses recorded agent fixtures for Claude, Codex, and OpenCode, while cmd/fakeagent and cmd/recordfixture support deterministic replay and fixture capture.
- GitHub Actions workflows and generated-file guards are part of the architecture because they enforce drift control for the skill, docs, and release artifacts.
Main entry points: cli CLI layer · daemon Daemon · steps Step set · pipeline Pipeline
Components 21
CLI & UX
User-facing commands and terminal interactions
- no-mistakes · Main product binary and command bootstrap
cmd/no-mistakes/main.go - CLI layer · Subcommand routing and control-plane orchestration
internal/cli - Terminal UI · Interactive run display, prompts, diffs, and actions
internal/tui - Setup wizard · Initial repo/branch/push setup for new users
internal/wizard - Telemetry · Product event capture from CLI and workflow surfaces
internal/telemetry
Core workflow
Daemon, pipeline, gate, and shared workflow state
- Daemon · Long-running gate lifecycle, recovery, and attachment manager
internal/daemon - IPC · Client/server transport between CLI, TUI, and daemon
internal/ipc - State DB · Repo, run, round, step, findings, and stats storage
internal/db - Gate · Safety and approval boundary for validating changes
internal/gate - Pipeline · Ordered validation and publishing flow over findings
internal/pipeline - Step set · Concrete intent, review, test, lint, push, PR, CI, and rebase steps
internal/pipeline/steps
Agent boundary
Adapters for AI coding agents and skill mode
- Agent adapters · Common interface for Claude, Codex, Copilot, OpenCode, Pi, Rovodev, and ACP targets
internal/agent - Intent engine · Extracts user intent, summarizes changes, and redacts sensitive output
internal/intent - Skill install · Installed /no-mistakes skill generation and placement
internal/skill
Platform & SCM
Git, storage, update, SCM, and cross-platform plumbing
- Git ops · Branch, diff, hook, and isolated worktree operations
internal/git - Paths · Path derivation and workspace location helpers
internal/paths - Updater · Binary replacement, active-run protection, and release retrieval
internal/update - SCM providers · Host detection, auth, and PR formatting across providers
internal/scm
Docs & packaging
Documentation, skills, and release artifacts
- genskill · Builds committed skill artifacts from the source skill definition
cmd/genskill/main.go - Skill spec · Committed no-mistakes skill used by axi and agent workflows
skills/no-mistakes/SKILL.md - Docs site · Astro-based documentation and guides for usage and concepts
docs/src/content/docs
Connections 24
- no-mistakes → CLI layer: boots · Main binary initializes the command layer
- CLI layer → Daemon: controls · CLI delegates long-running work and lifecycle actions to the daemon
- CLI layer → Pipeline: starts · Commands launch or inspect workflow execution
- CLI layer → Terminal UI: renders · CLI launches or attaches the terminal UI
- CLI layer → Setup wizard: onboards · CLI invokes setup wizard flows
- CLI layer → Telemetry: emits · Command actions generate telemetry events
- Terminal UI → IPC: subscribes · TUI follows live run state over IPC
- Daemon → IPC: serves · Daemon exposes local control and status RPCs
- Daemon → State DB: persists · Daemon stores and recovers run state
- Daemon → Gate: enforces · Daemon owns the gate lifecycle boundary
- Pipeline → Step set: executes · Pipeline runs ordered step implementations
- Pipeline → Gate: reports · Findings and approvals feed gate decisions
- Step set → Git ops: uses · Steps operate on worktrees, branches, diffs, and pushes
- Step set → SCM providers: publishes · PR-related steps use provider-specific integration
- Step set → Agent adapters: consults · Intent and review steps may call out to agents
- Agent adapters → Intent engine: normalizes · Agent output is converted into comparable intent and findings
- Agent adapters → Skill spec: drives · Skill mode is the non-interactive distribution path
- genskill → Skill spec: generates · Skill generator produces the committed skill artifact
- Skill install → Skill spec: installs · Skill installer places the skill for local use
- Git ops → Paths: resolves · Git operations rely on repo and worktree path layout
- Updater → Daemon: protects · Updater preserves active runs during replacement
- SCM providers → Pipeline: opens pr · Provider integration is used by the publishing flow
- Docs site → Skill spec: documents · Docs describe the skill and the machine-friendly workflow
- Docs site → CLI layer: documents · Docs site covers CLI commands and user flows