# How the /no-mistakes Skill Is Generated for Agent-Driven Guidance

> Discover how the /no-mistakes skill generates agent-driven guidance. Learn how Cmd genskill converts a body constant into a distributable SKILL.md file for seamless builds.

- Repository: [Kun Chen/no-mistakes](https://github.com/kunchenguid/no-mistakes)
- Tags: internals
- Published: 2026-07-25

---

**The /no-mistakes skill is generated automatically from a single `body` constant defined in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go), which the `cmd/genskill` tool converts into the distributable [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) file during the build process.**

The `no-mistakes` repository ships a version-controlled skill that drives agent behavior for commands like `axi run` and `axi review`. Rather than maintaining static documentation, the project treats agent guidance as code, generating the final prompt from a Go source constant to ensure strict synchronization between the CLI logic and the instructions given to autonomous agents.

## The Source of Truth in internal/skill/skill.go

All agent-facing guidance originates from one location: the `body` string constant in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go). This constant contains the complete system prompt, including role definitions, repository conventions, and step-by-step instructions that agents must follow.

According to the `no-mistakes` source code, the file defines the prompt as a raw string literal:

```go
// internal/skill/skill.go – the source of truth
const body = `
You are a highly capable and autonomous agent, and you can definitely solve this problem...
... (full prompt omitted for brevity)
`

```

Because this file is the **single source of truth**, any modification to agent behavior must start here. The constant is typically unexported (lowercase `body`) but accessed by the generator via an exported alias or package variable `Body` as implemented in the source.

## The Generation Pipeline via cmd/genskill

The repository includes a dedicated generator at [`cmd/genskill/main.go`](https://github.com/kunchenguid/no-mistakes/blob/main/cmd/genskill/main.go). This command-line utility imports the `skill` package, reads the `Body` constant, and writes the content to [`skills/no-mistakes/SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/skills/no-mistakes/SKILL.md) without manual intervention.

The core logic of the generator follows this pattern:

```go
// cmd/genskill/main.go – core of the generator
func main() {
    src := skill.Body // import from internal/skill
    outPath := "skills/no-mistakes/SKILL.md"
    // write the body to outPath, formatting as needed
    if err := os.WriteFile(outPath, []byte(src), 0644); err != nil {
        log.Fatalf("failed to write skill: %v", err)
    }
}

```

### Automating with make skill

To streamline the workflow, the `Makefile` exposes a `skill` target that invokes the generator. Developers never run the Go command directly; instead, they use the build system to ensure consistency:

```bash

# Regenerate the skill after editing internal/skill/skill.go

$ make skill          # runs cmd/genskill

$ cat skills/no-mistakes/SKILL.md   # the up‑to‑date prompt

```

Running `make skill` guarantees that the Markdown file reflects the exact current state of the `body` constant.

## Agent Integration at Runtime

When users execute CLI commands such as `axi run` or `axi review`, the implementation in `internal/cli/axi*.go` loads the generated skill. The code either imports the `body` constant directly at compile time or reads the generated [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) file at runtime, then passes the full text as a system prompt to the underlying agent (e.g., Codex or Claude).

This design ensures that agents always operate with the latest guidance derived from the version-controlled Go source, eliminating drift between the CLI implementation and the agent's instructions.

## Why You Must Never Edit SKILL.md Directly

[`skills/no-mistakes/SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/skills/no-mistakes/SKILL.md) is a **generated artifact**. The project enforces this rule through CI: a lint step verifies that the Markdown file byte-for-byte matches the output of `cmd/genskill`. If a developer edits [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) manually, the drift detection fails the build.

Consequently, the workflow is strictly unidirectional:

1. Edit the `body` constant in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go).
2. Run `make skill` to regenerate [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md).
3. Commit both files; CI validates they are synchronized.

## Summary

- The `body` constant in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go) serves as the immutable source of truth for all agent guidance.
- The `cmd/genskill` tool generates [`skills/no-mistakes/SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/skills/no-mistakes/SKILL.md) by reading and writing this constant.
- The `make skill` target automates regeneration and is the only supported method for updating the skill file.
- CLI commands in `internal/cli/axi*.go` consume this content to prime agents during `axi run` and `axi review` operations.
- Direct modification of [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) is prohibited and caught by continuous integration validation.

## Frequently Asked Questions

### What file contains the source of truth for the /no-mistakes skill?

The source of truth is the `body` string constant defined in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go). This file contains the raw prompt text, examples, and constraints that agents use to interpret user intent and repository conventions.

### How do I update the agent guidance prompts?

Modify the `body` constant in [`internal/skill/skill.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/skill/skill.go), then execute `make skill` to regenerate [`skills/no-mistakes/SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/skills/no-mistakes/SKILL.md). Commit both the Go source and the generated Markdown to ensure the change persists and passes CI validation.

### What happens if I edit SKILL.md manually?

Manual edits to [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) are temporary and will be overwritten by the next execution of `make skill`. Additionally, the CI pipeline detects drift between the generated file and the source constant, causing the build to fail if they do not match exactly.

### How does the CLI load the skill for agents?

The CLI implementation located in `internal/cli/axi*.go` loads the skill by accessing either the `body` constant directly or the generated [`SKILL.md`](https://github.com/kunchenguid/no-mistakes/blob/main/SKILL.md) file. This content is then injected as a system prompt when initializing agent sessions for commands like `axi run` or `axi review`.