resolve-pr-branch
Resolve PR↔branch identity from GitHub. Never trust plan docs or memory for branch names.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Resolve PR↔branch identity from GitHub. Never trust plan docs or memory for branch names.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
ICN development companion for the InterCooperative Network Rust monorepo. Use when working on ICN code, docs, deployment, or protocol design. Provides crate-aware routing to specialist agents (icn-architect, icn-economist, icn-ops), enforces project conventions, and understands the current sprint state, cluster topology, and demo flow status. Triggers on: any ICN crate names, "cooperative contract", "mutual credit", "governance", "gossip", "K3s", "icn-dev", "ops/mcp", "Sprint", "demo flow", "CCL", "federation", "DID", "ledger", "trust graph", "icnd", "icnctl".
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
Show full ICN development status dashboard — active sessions, sprint tasks, worktree freshness, CI state, and cluster health
ICN session preflight. This skill should be used when the user explicitly invokes "/icn-agent-pack:preflight", or asks to "run preflight", "orient me on ICN", or "check the ICN session environment". Loads canonical docs and the latest handoff, then verifies branch, gh auth, ports, toolchain, and a light cargo check. Read-only; reports, never fixes.
ICN repo navigator / knowledge graph. This skill should be used when the user explicitly invokes "/icn-agent-pack:navigator", or asks to "map the repo", "build/refresh the knowledge graph", "trace this concept to its source", or "show the conceptual map / impact map". Begins the living repository knowledge-graph and conceptual-map workflow, grounded in the icn-ops MCP tools and (future) generated graph artifacts.
| name | resolve-pr-branch |
| description | Resolve PR↔branch identity from GitHub. Never trust plan docs or memory for branch names. |
| argument-hint | [PR number | branch name] |
| user-invocable | true |
| allowed-tools | Bash |
| truth_contract | {"canonical_sources":[],"live_load_required":["gh pr view <N> --json number,headRefName,baseRefName,mergeable,mergeStateStatus","gh pr list --json number,headRefName,baseRefName"],"examples_only":[],"never_hardcode":["branch names (always resolve from GitHub — never trust plan docs or memory)","PR numbers","base branch assumptions"]} |
Resolve PR and branch identity from GitHub as the authoritative source. Use this before any checkout, rebase, force-push, or when a plan references a branch by name.
Branch names in plans, notes, and memory drift. The transcript showed a git checkout feat/s22-compute-config
failing because the true head ref was feat/s22-compute-policy-config. That lookup took an extra round-trip
to recover. This skill makes the lookup the first step, not a recovery.
Determine lookup direction from $ARGUMENTS:
PR → head branch:
gh pr view <N> --json number,title,headRefName,baseRefName,state \
--jq '{pr: .number, title: .title, head: .headRefName, base: .baseRefName, state: .state}'
Branch → PR:
gh pr list --json number,title,headRefName,state \
--jq '.[] | select(.headRefName == "<branch>") | {pr: .number, title: .title, state: .state}'
Check local branch existence:
git branch --list <branch> # local
git ls-remote --heads origin <branch> | grep -q . && echo "exists remotely"
Fetch if missing locally but present remotely:
git fetch origin <branch>
Detect stacked PRs (base ≠ main):
gh pr list --json number,headRefName,baseRefName \
--jq '.[] | select(.baseRefName != "main") | "PR #\(.number) \(.headRefName) → \(.baseRefName)"'
PR #1391 · feat/s22-compute-policy-config → main [OPEN]
local branch: present
remote: present
stacked: no
ops/state/sprint/current.json) store branch names that can drift between
plan-time and execution-time. Always verify against gh pr view.icn-wt/ hold their own branch refs; a branch that appears absent may just be
checked out in a worktree.