AgentSkillsCN

fix

端到端修复 GitHub 问题——获取问题、创建分支、规划并实施修复方案、运行验证、打开 PR、回归主干。

SKILL.md
--- frontmatter
name: fix
description: Fix a GitHub issue end-to-end — fetches issue, creates branch, plans and implements fix, runs validation, opens PR, returns to main.
argument-hint: [issue-number-or-url]
disable-model-invocation: true
allowed-tools: Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch

Fix GitHub Issue

You are fixing a GitHub issue for the jiki-education/front-end repository.

Issue details

json
!`gh issue view $ARGUMENTS --json number,title,body,labels,comments`

Issue number: !echo "$ARGUMENTS" | grep -oE '[0-9]+$'

Critical: Two phase.

Your work is split into two phases.

The first phase is purely planning. You must NOT make any changes to git state (switching branches, creating branches etc). You should presume that other work is SIMULTANEOUSLY happening WHILE you are planning.

Once the plan has been APPROVED by the user you should check the current git state:

  • Run git status to check for uncommitted changes and the current branch.
  • If there are uncommitted or staged changes, STOP and ask the user how to proceed. Do NOT checkout another branch, stash, or discard anything.
  • If you are not on main, STOP and ask the user how to proceed. Do NOT switch branches or reset.

Never destroy or discard existing work.

If the plan has been approved, and you are on a clean main branch, continue with your work.

Workflow

Follow these steps in order. Do not skip any step.

Step 1: Understand the issue

Read the issue details above carefully. Identify:

  • What is broken or needs to change
  • Which parts of the codebase are likely affected
  • Any reproduction steps or error messages mentioned

This is a monorepo with four packages: app, content, curriculum, and interpreters. Identify which package(s) are affected and read the relevant AGENTS.md and .context/ files:

  • app/AGENTS.md — Next.js frontend application
  • content/AGENTS.md — Blog posts and articles content library
  • curriculum/AGENTS.md — Exercise content library
  • interpreters/AGENTS.md — Language interpreters

Step 2: Plan the fix

Do NOT create a branch yet. Stay on the current branch while planning.

Use /plan to enter plan mode. Explore the codebase thoroughly:

  • Find the relevant files using Glob and Grep
  • Read the code to understand current behavior
  • Identify what needs to change and why
  • Check for existing test coverage
  • Look at similar patterns in the codebase for reference

Design a complete fix before writing any code.

Step 3: Create a feature branch

Only create the branch after the plan is approved. The issue number has been extracted above (works whether the argument was a full URL like https://github.com/jiki-education/front-end/issues/123 or just 123).

bash
git checkout main
git pull --ff-only origin main
git checkout -b fix/<issue-number>

Step 4: Implement the fix

After the plan is approved and the branch is created, implement the changes:

  • Follow existing patterns and conventions in the codebase
  • Read the relevant AGENTS.md for package-specific guidelines
  • Keep changes minimal and focused on the issue
  • Add or update tests as appropriate

Step 5: Run pre-commit validation

Run all checks. All must pass before committing:

bash
pnpm typecheck
pnpm test

If any check fails, fix the issues and re-run until all pass.

Step 6: Commit the changes

Stage only the files you changed (do not use git add -A or git add .). Write a clear commit message that describes the fix.

Step 7: Push and create a PR

Push the branch and create a pull request:

bash
git push -u origin fix/<issue-number>

Create the PR using gh pr create. The PR body must include Closes #<issue-number> to auto-close the issue on merge:

bash
gh pr create --title "<concise title>" --body "$(cat <<'EOF'
Closes #<issue-number>

## Summary
<bullet points describing what changed and why>

## Test plan
<checklist of how the fix was validated>

🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"

Step 8: Return to main

bash
git checkout main

Report the PR URL to the user.