integrate-pr-stack
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync.
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.
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.
ICN authority-spine work. This skill should be used when the user explicitly invokes "/icn-agent-pack:authority-spine", or asks to work on "entity-aware auth", "trusted token authority / trusted issuance", "coop_id to EntityId mapping", "CoopEntityMap", or "treasury observe/cutover readiness". Orients the agent on the entity-authority spine, requires a written plan before any edit, and surfaces files, risks, verification commands, and required truth/doc updates.
| name | integrate-pr-stack |
| description | Full sprint-batch or stacked-PR integration pipeline. Owns merge order, rebases, local gates, and main sync. |
| argument-hint | [PR numbers...] [--admin] [--dry-run] |
| user-invocable | true |
| allowed-tools | Bash, Read |
| truth_contract | {"canonical_sources":["ops/state/truth/policy.json"],"live_load_required":["gh pr list --json number,title,headRefName,baseRefName,mergeable,mergeStateStatus","gh api repos/InterCooperative-Network/icn/branches/main/protection --jq '.required_status_checks.contexts'"],"examples_only":[],"never_hardcode":["PR numbers, branches, or merge order — resolve from GitHub at runtime"]} |
Own the full lifecycle of safely integrating a batch of PRs into main. This is not a thin wrapper
around gh pr merge. It is the standard integration pipeline for ICN sprint closes.
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 proceeding.
Drift in agent files means the tooling you're running may itself encode stale policy.
The transcript improvised rebase sequencing, rediscovered branch names mid-flight, and had to manually orchestrate the merge order. This skill makes that the default path, not a recovery.
For each PR in $ARGUMENTS (or all open PRs if none given):
# Resolve head branches from GitHub — never trust plan docs
gh pr list --json number,title,headRefName,baseRefName,mergeable,mergeStateStatus \
--jq '.[] | {pr:.number, title:.title, head:.headRefName, base:.baseRefName, mergeable:.mergeable, state:.mergeStateStatus}'
For each PR, fetch required check status:
gh api repos/InterCooperative-Network/icn/branches/main/protection \
--jq '.required_status_checks.contexts'
Then for each PR:
REPO_ROOT="$(git rev-parse --show-toplevel)"
gh pr checks <N> --json name,state,conclusion \
| python3 -c "
import sys, json
# Load required checks from canonical source — never hardcode
required = set(json.load(open('${REPO_ROOT}/ops/state/truth/policy.json'))['merge']['required_checks'])
checks = json.load(sys.stdin)
req = [(c['name'],c['state'],c['conclusion']) for c in checks if c['name'] in required]
opt = [(c['name'],c['state'],c['conclusion']) for c in checks if c['name'] not in required and c['conclusion']=='failure']
print('REQUIRED:', req)
print('NON-BLOCKING FAILURES:', opt)
"
Classify each PR:
mergeable=MERGEABLE--dry-run, print the plan and stop.Suggested ICN ordering heuristic (from sprint patterns):
For each PR in merge order:
a. Pre-merge checks
gh pr view <N> --json mergeable,mergeStateStatus \
--jq '"mergeable=\(.mergeable) state=\(.mergeStateStatus)"'
Stop if mergeable != MERGEABLE.
b. Merge
# Green required checks → direct merge
gh pr merge <N> --squash # or --squash --admin if $ARGUMENTS includes --admin
# Pending required checks → auto-merge (prefer --auto over waiting in a loop)
gh pr merge <N> --auto --squash
c. Pull main
git checkout main && git pull
d. Rebase remaining PR branches For each remaining PR branch:
git checkout <branch> && git rebase origin/main
After rebase, run scoped local verification before force-pushing:
# Use resolve-rust-targets to find the right scope
cargo clippy -p <affected-packages> --all-targets -- -D warnings
Only force-push if verification passes:
git push --force-with-lease
e. Log progress: #<N> merged · rebased [branch1, branch2]
# Confirm main state
git checkout main && git log --oneline -5
# Check for main CI fallout
gh run list --branch main --limit 3 --json status,conclusion,name,databaseId \
--jq '.[] | "\(.databaseId) \(.name) \(.status) \(.conclusion)"'
Print batch summary:
Merged: #1389, #1391, #1392, #1390
Rebased: feat/s22-compute-policy-config (after #1389), feat/s22-obs-attestation-config (after #1391)
Main CI: in_progress (non-blocking only)
Lessons: none new
gh pr view <N> --json headRefName.mergeable=MERGEABLE, merge.git pull after each merge. Subsequent rebases need an updated local main.--admin is for queue-stalled runners only, not for bypassing genuine failures.
Confirm required gates are actually green before using --admin.Build Release, Test, Clippy, Format Check (from branch protection API).Test Coverage, Compare Against Base, Benchmarks, claude-review.ci-runner at operator-supplied host) means parallel PRs queue up. A PR
showing pending / 0s for >30 min is likely queue-stalled, not failing.mergeStateStatus=UNSTABLE with mergeable=MERGEABLE means only non-blocking checks failed.
Safe to merge with --admin.