merge-prs
Merge one or more PRs with full stack-integration pipeline. Resolves branches, rebases, gates, pulls main.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Merge one or more PRs with full stack-integration pipeline. Resolves branches, rebases, gates, pulls main.
التثبيت باستخدام 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 | merge-prs |
| description | Merge one or more PRs with full stack-integration pipeline. Resolves branches, rebases, gates, pulls main. |
| argument-hint | [PR numbers...] [--admin] [--dry-run] |
| user-invocable | true |
| allowed-tools | Bash |
| truth_contract | {"canonical_sources":["ops/state/truth/policy.json","ops/state/truth/sources.json"],"live_load_required":["gh pr view <N> --json number,headRefName,baseRefName,mergeable,mergeStateStatus","gh api repos/InterCooperative-Network/icn/branches/main/protection --jq '.required_status_checks.contexts'"],"examples_only":[],"never_hardcode":["PR numbers or branch names","required check lists (query live or read policy.json)","sprint state"]} |
Stack-integration merge pipeline. Not a thin gh pr merge wrapper. Owns branch resolution,
merge ordering, post-merge rebases, local verification, and main sync.
For single quick merges when you already know the state is clean, this still works. For sprint
batch closes, use /integrate-pr-stack instead (same logic, more verbose output).
REPO_ROOT="$(git rev-parse --show-toplevel)"
bash "${REPO_ROOT}/ops/scripts/what-matters-now.sh" 2>/dev/null || true
If what-matters-now.sh reports drift errors → stop and fix drift before merging.
Drift in agent files (stale paths, missing truth_contracts, hardcoded check sets) means
the tooling you're running may itself be unreliable.
Resolve PRs to merge:
$ARGUMENTS specifies numbers, use those.gh pr list --json number,title,headRefName,mergeable,mergeStateStatusFor each PR, resolve head branch from GitHub (never trust plan names):
gh pr view <N> --json number,title,headRefName,baseRefName,mergeable,mergeStateStatus \
--jq '{pr:.number, head:.headRefName, base:.baseRefName, mergeable:.mergeable, state:.mergeStateStatus}'
Classify check state (required gates only — load from policy.json, never hardcode):
REPO_ROOT="$(git rev-parse --show-toplevel)"
REQUIRED=$(python3 -c "import json; p=json.load(open('${REPO_ROOT}/ops/state/truth/policy.json')); print(','.join('\"'+c+'\"' for c in p['merge']['required_checks']))")
gh pr view <N> --json statusCheckRollup \
--jq ".statusCheckRollup[] | select(.name | IN(${REQUIRED})) | {name:.name, result:.conclusion}" 2>/dev/null
UNSTABLE mergeStateStatus + all required conclusions SUCCESS → treat as GREEN, safe to merge--auto or waitclaude-review, Compare Against Base, Test Coverage failures → never block, ignoreMerge (in order provided; smallest/safest first for batch). This repo uses squash merge:
gh pr merge <N> --squash # green required checks (default)
gh pr merge <N> --squash --admin # if $ARGUMENTS includes --admin (queue-stalled)
gh pr merge <N> --auto --squash # pending required checks
Exception: subtree merge commits require --merge — note the reason explicitly.
After each merge:
git checkout main && git pull
Rebase remaining PR branches after each merge to keep them current:
gh pr view <remaining-N> --json headRefName --jq '.headRefName' # resolve branch
git checkout <branch> && git rebase origin/main
# Run scoped clippy before force-pushing
cargo clippy -p <affected-packages> --all-targets -- -D warnings
git push --force-with-lease
Final: confirm main state, print one-line summary per PR.
#1389 merged · rebased [feat/s22-compute-policy-config, feat/s22-obs-attestation-config]
#1391 merged · rebased [feat/s22-obs-attestation-config]
#1390 merged · rebased []
--auto for pending checks; use --admin for queue-stalled (not failing).--json with jq or python3.mergeable=MERGEABLE → merge.Verify live: gh api repos/InterCooperative-Network/icn/branches/main/protection --jq '.required_status_checks.contexts'
Or read canonical: python3 -c "import json; print(json.load(open('$(git rev-parse --show-toplevel)/ops/state/truth/policy.json'))['merge']['required_checks'])"