agentleFS
encoreshaoencoreshao/encore-skills/skills/fix-issue/SKILL.md

fix-issue

Skill2 starsChanged 15 days agoMITView on GitHub

Implement a fix following the human-thinking loop — understand the root cause, plan the minimal change, implement, verify the problem is actually gone

53 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prepare-release, document and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ShopifySkill

    prepare-release

    Prepare the changeset-release/main branch for release by syncing version.ts files and running pnpm install

    Also in 4 projects that use this

  • nicolasestremSkill

    document

    Create focused documentation for specific components or features

    Also in 4 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 5 projects that use this

  • SentrySkill

    write-tests

    Write tests following project conventions. Use when adding new tests or modifying existing ones.

    Also in 3 projects that use this

  • AWSSkill

    ship

    Finalize dev work on an issue branch — update docs, push, and open a PR.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    build

    Build the TypeSpec Rust emitter from source. Run this after cloning the repo, after pulling changes, or when TypeScript source files have been modified.

    Also in 4 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 11 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 11

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before touching any code, check the current branch:

    line 22
  2. Very specific:

    If it's a protected branch (main, master, develop, staging), create a new one off it, named <type>/<issue-number>-<func-name> — <type> …

    line 28
  3. Distinctive:

    Read the relevant code before writing a single line.

    line 49
  4. Distinctive:

    If the root cause turns out to be different from the analysis, stop and update the analysis

    line 53
  5. Distinctive:

    Write a short plan (bullet points) before coding:

    line 57
  6. Distinctive:

    Follow existing patterns — check nearby files before writing new code.

    line 68
  7. Distinctive:

    Write the test first when possible — it forces you to define "fixed" before you code

    line 72
  8. Distinctive:

    If you find an unrelated bug, open an issue for it.

    line 73
  9. Distinctive:

    Before declaring done, ask yourself:

    line 77
  10. Distinctive:

    Run the tests — they must pass

    line 87
  11. Distinctive:

    Check the acceptance criteria one by one — don't assume, verify each one

    line 89
  12. Very specific:

    All criteria met, problem confirmed gone → proceed to review-code.

    line 95
  13. Distinctive:

    If something is off:

    line 97

“Common” is measured: kept by at least 6 in 10 of the 51 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fix Issue

Implements a fix following how a senior engineer actually thinks: understand first, code second, verify the problem is gone — not just the tests pass.

Input

  • Analysis from analyze-issue, or the issue itself
  • A feature branch (not main/master/develop/staging)

Branch check

Before touching any code, check the current branch:

git branch --show-current

If it's a protected branch (main, master, develop, staging), create a new one off it, named <type>/<issue-number>-<func-name> — <type> matches the commit convention below (feat, fix, refactor, test, chore, docs).

# Preferred — creates the branch and records the current branch as its base,
# so create-mr can later target the MR back to the right branch
RESOLVE="$HOME/.claude/skills/gitlab-config/scripts/auto_resolve_issue.py"
python $RESOLVE create-branch <issue_iid> "<func name>" <type>
# e.g. python $RESOLVE create-branch 123 "add login" feat  ->  feat/123-add-login

# Fallback (manual)
BASE=$(git branch --show-current)
git checkout -b <type>/<issue-number>-<func-name>
git config --local branch.<type>/<issue-number>-<func-name>.base "$BASE"

Already on a non-protected feature branch? Keep working on it — don't create a nested branch.

The loop

Phase 1: Understand before touching anything

Read the relevant code before writing a single line. You cannot fix what you don't understand.

  • Find the code involved: grep, file search, follow the call chain
  • Understand why the current behavior happens — confirm the root cause from the analysis
  • If the root cause turns out to be different from the analysis, stop and update the analysis

Phase 2: Plan the minimal change

Write a short plan (bullet points) before coding:

  • What exactly will you change and why
  • What you will NOT touch (scope boundary)
  • What could go wrong with your approach

The plan should describe the fix to the root cause — not a workaround or a patch over the symptom. If you're writing a workaround, say so explicitly and explain why.

Show the plan: "Here's my approach — does this look right?"

Phase 3: Implement

Follow existing patterns — check nearby files before writing new code.

Rules:

  • One commit per logical concern — don't bundle unrelated changes
  • Write the test first when possible — it forces you to define "fixed" before you code
  • If you find an unrelated bug, open an issue for it. Do not fix it here.

Phase 4: Check your own work

Before declaring done, ask yourself:

  • Did I fix the root cause or just suppress the symptom?
  • Does any existing test now fail? (git stash your changes, run tests, restore)
  • Did I introduce any security issues? (auth bypass, injection, exposed secrets)
  • Did I change any API contract or schema without a migration?

For any serious risk found: stop, flag it, don't merge.

Phase 5: Verify the problem is actually gone

  • Run the tests — they must pass
  • Manually reproduce the original problem from the issue — confirm it no longer occurs
  • Check the acceptance criteria one by one — don't assume, verify each one

The problem is not fixed until you've confirmed it's gone, not just that tests are green.

Phase 6: Ship or loop

All criteria met, problem confirmed gone → proceed to review-code.

If something is off:

  • Unmet criterion → back to Phase 3
  • Root cause was wrong → back to Phase 1
  • Scope grew → open a new issue, stay focused here

Commit convention

git commit -m "fix(scope): what was broken and how it's fixed

Closes #<issue-number>"

Types: feat, fix, refactor, test, chore, docs

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.