Community코딩 & 개발github.com

github-story-to-merge

Deliver a feature on GitHub the way a disciplined team does. Plans it as a user story with sub-issues on a project board, then works one branch per sub-issue with prefixed commits, a pull request that closes the issue, green CI, a squash merge and full cleanup. Use when the user asks to plan, track or ship a feature, story or task through GitHub issues, branches and pull requests, or says "work like a team", "use the board", "one branch per issue" or similar.

github-story-to-merge란 무엇인가요?

github-story-to-merge is a Claude Code agent skill that deliver a feature on GitHub the way a disciplined team does. Plans it as a user story with sub-issues on a project board, then works one branch per sub-issue with prefixed commits, a pull request that closes the issue, green CI, a squash merge and full cleanup. Use when the user asks to plan, track or ship a feature, story or task through GitHub issues, branches and pull requests, or says "work like a team", "use the board", "one branch per issue" or similar.

지원 대상✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/FarukValjevac/agent-skills/tree/HEAD/skills/github-story-to-merge

Installed? Explore more 코딩 & 개발 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

GitHub story to merge

Ship work in small, reviewable, traceable steps: every change starts as an issue, lives on its own branch, lands through a pull request with green CI, and leaves nothing behind.

Requires the GitHub CLI (gh) logged in with repo and project scopes (gh auth refresh -s project adds the second). Check with gh auth status before you start.

0. Learn the repository's conventions first

Before creating anything, read what already exists and follow it over the defaults below:

  • gh label list, gh issue list --state all --limit 20: existing labels, title style, story numbering.
  • git log --oneline -20: commit prefix style.
  • .github/ (PR template, workflows), CONTRIBUTING.md, AGENTS.md, CLAUDE.md.
  • gh project list --owner <owner>: is there a board already?

Ask the user only what you cannot find: which board to use, and whether to assign issues to them.

1. Plan: one user story, small sub-issues

Create the user story as a parent issue (template in references/templates.md):

  • Title: [US-07] <outcome in user words>, label User Story.
  • Body: "As a … I want … so that …", then acceptance criteria as - [ ] checkboxes.

Split it into sub-issues that each fit one pull request (roughly under 300 changed lines, one concern):

  • Title: [US-07-02] <concrete change>, label Issue.
  • Body: Work, acceptance criteria, how to verify.
  • Link each as a real sub-issue of the story: gh api repos/{owner}/{repo}/issues/<story>/sub_issues -X POST -F sub_issue_id=<sub issue id> (the numeric id from gh api repos/{owner}/{repo}/issues/<n> -q .id, not the number).
  • Add every issue to the board: gh project item-add <project-number> --owner <owner> --url <issue url>.

Show the user the plan (story plus sub-issue titles) before starting work if the feature is larger than three sub-issues.

2. Work each sub-issue: the loop

For one sub-issue at a time, in order:

  1. Board: move it to In progress (scripts/board-status.sh).
  2. Branch from an up-to-date default branch: git switch main && git pull --ff-only && git switch -c <n>-<short-slug> (for example 42-us-07-02-add-export-button).
  3. Change only what this sub-issue needs. Unrelated fixes you notice become new issues, not extra commits.
  4. Verify locally with the project's real commands (lint, type check, tests, build). Do not open a pull request on red.
  5. Commit with a prefix: feat:, fix:, test:, docs:, refactor:, ci:, chore:. Subject in the imperative, under 72 characters, saying what changes for the user or the code.
  6. Pull request: gh pr create --title "<prefix>: <subject>" --body "Closes #<n>" plus a short summary and how it was verified. Move the issue to In review.
  7. Wait for CI: gh pr checks --watch. If a check fails, read the log (gh run view --log-failed), fix on the same branch, push, wait again. Never merge on red, never skip hooks or checks.
  8. Merge if the user allowed you to merge; otherwise stop here and hand over the PR link. Merge as a squash with a prefixed subject: gh pr merge --squash --subject "<prefix>: <subject> (#<pr>)".
  9. Clean up: git switch main && git pull --ff-only, delete the local branch, delete the remote branch (git push origin --delete <branch>), git fetch --prune. Move the issue to Done.

git status must be clean and only main must remain before the next sub-issue starts.

3. Close the story

When every sub-issue is merged, run scripts/close-story.sh <story-number>: it ticks the story's acceptance criteria, closes it as completed and moves it to Done. Check each criterion is really met before you run it; if one is not, leave the story open and say which.

Rules

  • Ask before the irreversible. Creating issues and branches is fine once the user asked for this workflow. Merging, force-pushing, deleting branches you did not create, and closing issues you did not open need the user's go-ahead unless they already gave it.
  • Never on main directly. If you find yourself on the default branch with changes, create the branch first, then commit.
  • One concern per pull request. If a review or CI fix grows into new work, open a new sub-issue.
  • Report faithfully. If CI is red or a criterion is unmet, say so with the output; do not mark it done.
  • No secrets in issues, commits or PR text. No tokens, .env contents or customer data.

Scripts

  • scripts/board-status.sh <owner> <project-number> "<Status>" <issue-number>...: moves issues on a GitHub project board by status name. It looks up the board, the Status field and the option ids itself.
  • scripts/close-story.sh <owner>/<repo> <owner> <project-number> <story-number>: ticks the story's checkboxes, closes it, moves it to Done.

If the board has no Status field, or uses other column names, use the names it has (the script prints the available ones).

Individual skills in this repo

This repo contains 1 individual skill — each has its own dedicated page.

관련 스킬