fix-develop

An automated command for investigating and fixing failed CI, the checks that test code changes, on a repository’s default branch. It creates a separate worktree, opens a pull request, and continues addressing failures and review comments until the checks pass.

In plain words
What is it for?
Use it to repair failing CI on the main, develop, nightly, or other default branch of a Git repository.
Why use it?
It removes the repeated manual work of diagnosing failed builds, preparing a fix, pushing it, and checking the results again.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/bjcoombs/ai-native-toolkit/fix-develop
Clone the repo
git clone --depth 1 https://github.com/bjcoombs/ai-native-toolkit
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,449 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00017 $0.01449
Opus 5 $0.00009 $0.00724
Sonnet 5 $0.00003 $0.00290
Haiku 4.5 $0.00002 $0.00145

Measured 2d ago against content hash 46dfebe7db4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

fix-develop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/fix-develop.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fix Default Branch

Assess failing CI on the repo's default branch (main / develop / etc., or nightly build), create a worktree with a fix, push a PR, and loop until CI passes and review comments are addressed.

Usage: /fix-develop [repo-path] - defaults to current repo context. (Command name is historical; works on whichever branch the repo treats as default.)


Step 1: Assess Default Branch Health

set -euo pipefail

# Identify the repo
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "")
REPO_NAME=$(basename "$REPO_ROOT")
ORG=$(gh repo view --json owner --jq '.owner.login')
REPO=$(gh repo view --json name --jq '.name')
DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')

# Fail fast if any of the above came back empty (wrong pane, no gh auth, not a repo)
: "${REPO_ROOT:?Not inside a git repo — re-run from the target repo}"
: "${ORG:?gh repo view returned no owner — check gh auth and current directory}"
: "${REPO:?gh repo view returned no name — check gh auth and current directory}"
: "${DEFAULT_BRANCH:?gh repo view returned no defaultBranchRef — check gh auth}"

# Get latest CI status on the default branch
gh api repos/$ORG/$REPO/commits/$DEFAULT_BRANCH/status --jq '{state: .state, total: .total_count}'

# Get failing workflow runs on the default branch
gh run list --branch $DEFAULT_BRANCH --status failure --limit 5 --json databaseId,name,conclusion,createdAt \
  | jq '.[] | {id: .databaseId, name, conclusion, created: .createdAt}'

If the default branch is green, report "$DEFAULT_BRANCH is healthy, nothing to fix" and STOP.

Step 2: Diagnose Failures

# For each failing run, get the failed jobs and logs
RUN_ID=<from step 1>
gh run view $RUN_ID --json jobs | jq '.jobs[] | select(.conclusion == "FAILURE") | {name, conclusion}'
gh run view $RUN_ID --log-failed 2>&1 | tail -100

Categorize failures:

  • Test failures - read the failing test + source code to understand root cause
  • Lint/build errors - read the offending file at the reported line
  • Flaky/infrastructure - check if the same test passed on a recent re-run. If so, report as flaky (not actionable) and STOP
  • Dependency issues - check if a dependency update broke something

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 165 lines · 17 tokens per session scan A 46dfebe7db4f

Subscribe to this mod's changes

fix-develop is a command published in the GitHub repository bjcoombs/ai-native-toolkit (30 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 17 tokens to every session and 1,449 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.