Resolve issue

From gittower/git-flow-next · View interactive version

Resolve issue is an AI agent skill from the GitHub repository gittower/git-flow-next. Resolve a spec issue end-to-end using sequential subagents

How to use this skill

Skill file

Resolve Issue

Resolve a GitHub spec issue end-to-end by orchestrating the full workflow.

Each step runs in a fresh subagent context via the Task tool so that no

single context becomes overloaded. Runs autonomously; the only user gates

are abort conditions and the final publish (push + PR creation).

Arguments

/resolve-issue <issue-number>

Precondition: Spec Issue Required

Before anything else, fetch issue #$ARGUMENTS (mcp__github__get_issue) and

verify it is a spec issue: it carries the spec label, or its body has

the spec structure per ISSUE_GUIDELINES.md (Goal, Expected Behavior, Test

Scenarios sections).

If it is not a spec issue, stop and tell the user:

If the spec has a Breakdown section (sub-issues), do not resolve the parent

— tell the user to run /resolve-issue per sub-issue instead.

Workflow

Execute these steps sequentially. Each step uses the Task tool with

subagent_type: "general-purpose" to spawn a fresh agent. Wait for each

step to complete and verify its output before proceeding.

Between steps, you (the orchestrator) handle verification and branch

management directly.


Step 1: Analyze Spec Against Codebase

Spawn a subagent:

Verify: Use Glob to confirm .ai/issue-$ARGUMENTS-*/analysis.md was created.


Step 2: Create Feature Branch + Worktree

Run directly (no subagent needed):

  1. Find the .ai/ folder created in step 1:

```bash

ls -d .ai/issue-$ARGUMENTS-*

```

  1. Extract the slug from the folder name (e.g., issue-42-squash-merge → 42-squash-merge)
  2. Create the feature branch in its own worktree, using the sibling-root

convention (see DEV_WORKFLOW.md §3):

```bash

git worktree add -b feature/<number>-<slug> ../git-flow-next.worktrees/<number>-<slug> main

cd ../git-flow-next.worktrees/<number>-<slug>

```

  1. Claim the issue by assigning it to yourself — the gh-authenticated user

— so it reflects who is working on it:

```bash

gh issue edit $ARGUMENTS --add-assignee @me

```

Verify: Confirm the current directory is the new worktree and the current

branch is the feature branch.

Save the worktree path and slug in variables for subsequent steps. The .ai/

folder stays in the main clone — reference it as

../git-flow-next/.ai/issue-<number>-<slug>/ from inside the worktree.


Step 3: Create Test-First Plan

Spawn a subagent:

Verify: Use Glob to confirm <ai-folder>/plan.md was created and it contains a Test Plan section.


Step 4: Codex-Gate the Test Plan

Spawn a subagent:

Verify: Confirm <ai-folder>/codex-test-plan.md was created. After this

step the test plan is authoritative.


Step 5: Implement

Spawn a subagent:

Verify (run directly, not in subagent):

go build ./...
go test ./...

If the subagent reports a 3-revision abort, stop the workflow entirely

and report to the user: the spec/plan and implementation are fundamentally

at odds and need human review. Do not continue to later steps.

If build or tests fail, report the error and ask the user whether to retry

or abort.


Step 6: Local Review

Spawn a subagent:

Verify: Use Glob to confirm <ai-folder>/review-*.md was created.


Step 7: Codex Code Review

Run a Codex gate per .claude/skills/_shared/CODEX_GATE.md (directly or in

a subagent):

commit list

edge cases, guideline violations. Provide the spec (#$ARGUMENTS) as the

source of truth

REVIEW_CRITERIA.md

Evaluate findings per the convention (high-confidence only; the local

review from step 6 is context for judging them). Log all verdicts to

<ai-folder>/codex-code-review.md.


Step 8: Implement Review Fixes

Combine accepted findings from steps 6 and 7. If fixes are needed,

spawn a subagent:

If both reviews are clean, skip this step and report that.

Verify (run directly):

go build ./...
go test ./...

Step 9: PR Summary

Spawn a subagent:

Verify: Use Glob to confirm <ai-folder>/pr_summary.md was created.


Step 10: Publish Gate

Public actions wait for the user. Present:

Format** checklist — the PR body is a GitHub-only artifact and won't be

caught later in code review

explicitly (a worktree branch mis-tracks with git push -u, e.g. to

main):

```bash

git push origin feature/<slug>:refs/heads/feature/<slug>

git branch --set-upstream-to=origin/feature/<slug> feature/<slug>

gh pr create --title "<title>" --body "$(cat <ai-folder>/pr_summary.md)"

```

<title> follows the PR-title format from /pr-summary /

COMMIT_GUIDELINES.md — type(scope): Subject, no issue number.

Ask: "Publish the branch and create the PR?"

On confirmation, push and create the PR. Verify the posted body with

gh pr view <n>; if it drifted from pr_summary.md, fix it with

gh pr edit. Report the PR URL.


Progress Reporting

After each step, report to the user:

Error Handling

If any step fails:

  1. Report the failure with details from the subagent
  2. Ask the user whether to retry, skip, or abort
  3. Do not automatically proceed past failures

The 3-revision abort in step 5 is terminal — never retry it automatically.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.