How to Use the /no-mistakes Skill with Claude Code for Agent-Driven Pipelines

The /no-mistakes skill integrates Claude Code into end-to-end pipelines by running the Anthropic Claude CLI in stream-JSON mode, parsing real-time events, and returning structured outputs that drive automated lint, test, and push workflows.

The kunchenguid/no-mistakes repository provides a Go-based CLI that orchestrates complete software development pipelines through LLM agents. When you invoke the /no-mistakes skill with the Claude Code agent, you delegate complex refactoring, testing, and validation tasks to Anthropic's Claude CLI while maintaining strict JSON-schema contracts for machine-readable outputs.

Architecture of the Claude Code Integration

Skill Definition and CLI Driver

The pipeline starts with a static skill definition in skills/no-mistakes/SKILL.md, which describes the command surface that agents see. This file is generated from internal/skill/skill.go. The axi interactive shell serves as the CLI driver, parsing user input and resolving skills through internal/cli/axi_drive.go.

The Agent Interface

All agents implement the agent.Agent interface defined in internal/agent/agent.go, which requires Name, Run, and Close methods. The driver calls Run(ctx, opts) and streams chunk callbacks to the UI. The Claude-specific implementation lives in internal/agent/claude.go.

Stream-JSON Event Parsing

The claudeAgent launches the Claude binary with flags -p and --output-format stream-json. The parseClaudeEvents function reads JSONL events from stderr, aggregates token usage, and captures the final result event containing structured output.

How the Pipeline Flow Works

  1. User invokes the skill via no-mistakes axi drive --agent=claude with a prompt and optional JSON schema.

  2. CLI builds RunOpts containing the prompt, schema, working directory, and UI callback.

  3. claudeAgent.runOnce creates an exec.CommandContext with gitSafeEnv and shellenv.ConfigureShellCommand for proper process cleanup.

  4. parseClaudeEvents streams JSONL, forwards text chunks via onChunk callbacks, and aggregates TokenUsage.

  5. Result validation occurs when the driver receives a Result struct with Output, Text, and Usage fields. If a schema was provided but structured_output is missing, the driver returns errNoStructuredOutput.

  6. Pipeline continues to the next step (e.g., git apply, test run, or human review gate).

Claude Code vs. Generic Chat Agents

Claude Code differs from standard chat agents because it emits a stream-JSON payload that the pipeline parses incrementally. This enables real-time assistant text display, accurate token usage telemetry, and enforcement of JSON-schema contracts for automated fix loops.

Configuration and Customization

Repository-level settings live in .no-mistakes.yaml, which controls allowed agents, per-repo overrides, and default arguments via agent_args_override. The CLI merges global and repo-specific settings, passing extra arguments to the Claude binary.

Practical Usage Examples

Run a simple fix with schema validation:

no-mistakes axi drive \
  --agent=claude \
  --prompt="Replace the deprecated `os.IsAbs` call with `filepath.IsAbs`" \
  --json-schema='{"type":"object","properties":{"patch":{"type":"string"}},"required":["patch"]}'

Use a repository-specific model override:

no-mistakes axi drive \
  --agent=claude \
  --prompt="Add unit tests for the `ParseConfig` function" \
  --extra-args="--model=claude-2.1"

Integrate into a CI pipeline programmatically:

go run ./cmd/no-mistakes axi drive \
  --agent=claude \
  --prompt="$(cat ./fix_prompt.txt)" \
  --json-schema="$(cat ./fix_schema.json)"

Summary

  • The /no-mistakes skill wraps Claude Code in a structured pipeline that automates lint, test, rebase, and push operations.
  • Claude Code runs in stream-JSON mode (--output-format stream-json), enabling real-time event parsing and token usage tracking in internal/agent/claude.go.
  • The claudeAgent implementation handles process lifecycle through runOnce, JSONL parsing via parseClaudeEvents, and structured output validation.
  • Configuration via .no-mistakes.yaml allows per-repository agent selection and argument overrides through agent_args_override.
  • JSON schemas enforce machine-readable contracts, critical for auto-fix loops that apply patches automatically without human intervention.

Frequently Asked Questions

What makes Claude Code different from other agents in no-mistakes?

Claude Code uses a stream-JSON output format that emits parseable JSONL events, allowing the pipeline to display real-time text chunks and accurately track token usage. Other agents may return plain text or lack the structured event streaming required for intermediate UI updates.

How does the stream-JSON output format work?

The Claude CLI emits newline-delimited JSON events to stderr, including assistant chunks for streaming text and a final result event containing structured_output. The parseClaudeEvents function in internal/agent/claude.go buffers this stream, aggregates token usage statistics, and extracts the final result for pipeline consumption.

Where is the agent configuration stored?

Agent settings reside in .no-mistakes.yaml at the repository root. This file defines allowed agents, default arguments, and overrides via the agent_args_override field. The CLI merges these settings with global configuration before launching the Claude binary.

Can I use custom JSON schemas with the Claude Code agent?

Yes. Pass a JSON schema via the --json-schema flag when running no-mistakes axi drive. If provided, the Claude Code agent expects the result event to contain a structured_output field matching the schema. Missing structured output triggers errNoStructuredOutput, causing the pipeline step to fail.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →