Skip to main content
skill CX Codex

create-fix-pr — Claude Code skill: what it does, how to install

Finds bug root causes and submits minimal GitHub pull requests from observability logs. Helps ship targeted fixes without unnecessary refactoring.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add launchdarkly/ai-tooling --skill create-fix-pr -a claude-code
Open on GitHub

What create-fix-pr does

This skill guides agents through fixing verified bugs. It relies on the investigate skill first, requiring an exact trace ID, log entry, or error group before touching code. Before creating a branch, it searches GitHub using gh pr list to make sure no duplicate pull request exists. If the issue is a feature flag flip or external configuration change, it describes the fix instead of touching code.

Diffs stay minimal. The workflow explicitly forbids refactoring surrounding modules, bumping package versions to mask symptoms, or modifying tests to hide failures. It checks local rules in CLAUDE.md or agents.md, sets git identity according to pr-conventions.md, and commits only targeted changes.

Without an authenticated GitHub CLI session via gh auth status, the skill stops immediately. It will not attempt fallback authentication methods.

What it helps with

  • Track down root causes using trace IDs and error logs
  • Check GitHub for duplicate pull requests before filing
  • Create minimal pull requests adhering to repository rules
  • Recommend config or flag changes when code edits are unnecessary

Example prompts for the agent

  • Investigate the trace ID trace-991 and open a minimal PR fixing the root cause.
  • Check if an open PR exists for the checkout timeout, then prepare a targeted patch.
  • Find the bug causing error group AUTH_FAIL_01 and submit a PR following CLAUDE.md rules.

How to install create-fix-pr

1Skills CLI (Vercel)

npx skills add launchdarkly/ai-tooling --skill create-fix-pr -a claude-code

2Manually: put the files in place

~/.claude/skills/create-fix-pr/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-fix-pr/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about create-fix-pr

How to install create-fix-pr in Claude Code?

Run npx skills add launchdarkly/ai-tooling --skill create-fix-pr -a claude-code.

What does create-fix-pr do?

It investigates an error using trace data, checks for existing pull requests, and opens a minimal bug fix PR using the GitHub CLI.

What tools are required to run create-fix-pr?

The skill requires git and gh. If gh is missing or gh auth status reports no active login, execution halts immediately.

Source text

SKILL.md · Apache-2.0
---
name: create-fix-pr
description: "Investigates a root cause and files a minimal fix PR for a reported bug or observability finding."
license: Apache-2.0
compatibility: Requires git and the GitHub CLI (gh); pairs with the investigate skill
metadata:
  author: launchdarkly
  version: "0.1.0"
---

# Create a fix PR

## Overview

You are investigating a problem and filing a pull request that resolves it. This builds on the `investigate` skill — do the investigation properly first, don't jump to a fix without evidence.

Use the `gh` CLI for all GitHub operations (auth comes from your `gh` login) and standard `Bash` / `Edit` / `Read` / `Grep` for everything else.

## Workflow

1. **Investigate.** Use the `investigate` skill to find the root cause. Cite the exact trace ID, log line, error group, and code location that pins the problem.
2. **Confirm there isn't already a PR open.** Before filing anything, search GitHub for an existing open PR addressing the same issue — `gh pr list --search "<keywords>" --state open`. If one exists, direct the user to it — do not create a duplicate.
3. **Judge whether a PR is the right tool.** If the fix requires a config change, a flag flip, or a change outside the code you can access, describe the solution instead of filing a PR.
4. **Get the repo.** Clone it if you don't already have it locally — `gh repo clone <owner>/<repo>`.
5. **Check for repo conventions.** Read `agents.md` or `CLAUDE.md` at the repo root — these describe repo-specific rules your fix needs to respect.
6. **Make the change.** Minimal diff. Don't refactor surrounding code, don't add features, don't fix unrelated bugs you happen to notice. One PR, one fix.
7. **Set git identity** before committing — see `pr-conventions.md`.
8. **Commit, push, and file the PR.** See `pr-conventions.md` for branch naming and PR body rules.

## What's a good fix

- Changes the smallest possible number of lines
- Preserves current production behavior unless the bug IS the current behavior
- Doesn't depend on assumptions you can't verify from the evidence
- Would pass a `code-review` skill's check if one existed

## What isn't

- Sweeping refactors unrelated to the reported problem
- Speculative null checks or error handling added "while you're in there"
- Changes to tests that hide the underlying bug
- Bumping dependency versions to fix a symptom

## Restricted tools

If `gh` isn't installed or `gh auth status` shows no auth, surface the error to the user and stop — don't try alternative auth schemes.

## Never include in a PR

- GitHub access tokens or any other secrets or credentials.
- Debugging logs or print statements you added during investigation.

Follow the repo's own commit and PR conventions for everything else.

© launchdarkly · Apache-2.0 · launchdarkly/ai-tooling

Similar skills

All skills for Git and GitHub →

From the same set44

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor