bmad-github-story-sync

bmad-github-story-sync is a skill for Claude Code, Codex from choucrifahed/agent-plugins. It costs 81 tokens per session (2,134 once invoked), scanned A, original, MIT.

A workflow for syncing BMAD project-tracking files with GitHub after pull requests are merged. BMAD is a system that manages software stories and sprint status in project files.

In plain words
What is it for?
Detecting merged pull requests, marking stories complete, syncing GitHub labels, and cleaning up related local worktrees and branches.
Why use it?
It prevents GitHub issue labels, sprint tracking, story files, branches, and worktrees from becoming inconsistent after a merge.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the bmad-github plugin — 6 skills, 1 hook shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/choucrifahed/agent-plugins/bmad-github-story-sync
Any agent
npx skills add choucrifahed/agent-plugins --skill bmad-github-story-sync
Clone the repo
git clone --depth 1 https://github.com/choucrifahed/agent-plugins

Made for: Claude Code, Codex.

Or install bmad-github, the plugin that ships this one along with the rest of its 6 skills, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bmad-github-story-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/choucrifahed/agent-plugins/bmad-github-story-sync.svg)](https://agentmods.dev/skills/choucrifahed/agent-plugins/bmad-github-story-sync)
Your own site
<a href="https://agentmods.dev/skills/choucrifahed/agent-plugins/bmad-github-story-sync"><img src="https://agentmods.dev/badge/skills/choucrifahed/agent-plugins/bmad-github-story-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,134 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00081 $0.02134
Opus 5 $0.00041 $0.01067
Sonnet 5 $0.00016 $0.00427
Haiku 4.5 $0.00008 $0.00213

Measured 5d ago against content hash 62d49c4fef58, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bmad-github-story-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

bmad-github/skills/bmad-github-story-sync/SKILL.md · 248 lines

How it starts

The opening of the file, as written. The whole thing — 248 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Story Sync: Reconcile GitHub State → BMAD Files (on main) + Local Worktree Cleanup

This skill brings sprint-status.yaml and story files on main into agreement with GitHub issue state, and cleans up local worktrees/branches for stories whose PRs have merged.

GitHub issue status:* labels are the authoritative store for cross-agent coordination. sprint-status.yaml is BMAD's own tracker — other BMAD workflows (and other plugins) read it. This skill keeps it current as a courtesy to BMAD.

Writes happen on main (this skill is always run from main, so writes/commits there are not a coordination problem and do not block parallel agents working in worktrees).

The bmad-story-sync GitHub Actions workflow (installed via /story-setup-ci) performs the same writes automatically on every PR merge. Both writers are idempotent — if both run, the second is a no-op. If a user hasn't installed the CI workflow (or it failed), running /story-sync is the reliable manual path.

IMPORTANT: This skill MUST be run from the main repo directory, on main.


Pre-flight Checks

  1. Verify you are in the main repo (not a worktree):

    git rev-parse --show-toplevel
    git rev-parse --git-common-dir
    git rev-parse --git-dir
    

    If --git-dir differs from --git-common-dir, you're in a linked worktree. STOP and tell the user to run this from the main repo directory.

  2. Verify you are on main:

    git branch --show-current
    

    If not on main, warn the user and ask if they want to proceed.

  3. Pull latest (brings in any CI-authored sprint-status.yaml updates):

    git pull --rebase
    
  4. Verify gh CLI is authenticated:

    gh auth status
    

Phase 1: Resolve Worktree Root

Read and follow ${CLAUDE_PLUGIN_ROOT}/references/resolve-worktree-root.md.


Phase 2: Read Current State

  1. Read the GitHub issue map: Read <output_folder>/implementation-artifacts/github-issue-map.json
    • Maps story keys (e.g., "1-2") to GitHub issue numbers and URLs.
    • If the file doesn't exist, STOP and tell the user to run Story Init (SI) first.

Read the full file on GitHub · 248 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 248 lines · 81 tokens per session scan A 62d49c4fef58

Subscribe to this mod's changes

bmad-github-story-sync is a skill published in the GitHub repository choucrifahed/agent-plugins (7 stars, last pushed 1mo ago), licensed MIT. It adds 81 tokens to every session and 2,134 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.