vision-audit
Audit project alignment with VISION.md, identify SDLC gaps, and generate feature proposals. Use when reviewing strategic direction or planning new features.
merge-prs
Merge multiple PRs with conflict resolution and CI failure auto-patching. Analyzes optimal merge order, resolves conflicts, pulls CI logs on failure, and fixes issues. Use when multiple feature branches need merging into the base branch.
Full skill instructions
Merge multiple pull requests into a single integration branch with intelligent conflict resolution, risk scoring, security pre-flight, automated CI failure diagnosis, flaky test awareness, and bisection-based failure isolation.
gh CLI installed and authenticated (gh auth status works)git status shows no uncommitted changes)| Argument | Required | Default | Description |
|---|---|---|---|
$1...$N | No | all open | Space-separated PR numbers (e.g., 63 64 65 66) |
--base | No | main | Base branch to integrate against |
--strategy | No | merge | merge (preserve commits) or rebase (linear history) |
--dry-run | No | off | Analyze conflicts, risk, and order without merging |
--no-fix | No | off | Skip auto-fix on CI failures (report only) |
--no-security | No | off | Skip security pre-flight checks |
--force | No | off | Proceed even if risk score is RED (>60) |
Copy this checklist and track progress:
Merge PRs Progress:
- [ ] Phase 0: Risk assessment & safety (scoring, tiers, security, dry-run)
- [ ] Phase 1: Discovery & analysis (metadata, CI status, conflicts, merge order)
- [ ] Phase 2: CI triage for RED PRs (log retrieval, flaky check, diagnosis, auto-fix)
- [ ] Phase 3: Integration merge (safety tag, sequential merge, conflict resolution, verify)
- [ ] Phase 4: Finalize (summary, changelog, merge strategy, execute)
- [ ] Phase 5: Cleanup (close PRs, delete branches, prune)
Run this phase BEFORE any git operations. It gates whether the merge should proceed. See RISK_SCORING.md for detailed computation tables and commands.
--force, ask user.never-tier PRs excluded from batching.--no-security): Scan diffs for secrets and audit dependencies for CVEs. BLOCK on secrets, WARN on CVEs.git merge-tree for actual conflict detection (no working tree changes).If --dry-run was specified, STOP after Phase 0 and report the full analysis.
gh pr list --state open --json number,title,headRefName,baseRefName,additions,deletions,files,mergeable,labels,createdAt
If specific PR numbers were given as arguments, filter to only those. If no arguments, use ALL open PRs targeting the base branch.
Report a summary table:
PR │ Branch │ Files │ +/- │ Risk │ Tier │ Mergeable
────┼─────────────────────────────────┼───────┼────────────┼──────┼────────┼──────────
#64 │ codex/run-codex-review-since-feb│ 3 │ +104/-2 │ 12 │ always │ ✓
#65 │ codex/perform-automated-bug-scan│ 2 │ +6/-16 │ 8 │ always │ ✓
#66 │ codex/assess-wizarddemo-flow │ 4 │ +135/-26 │ 34 │ maybe │ ✓
#63 │ codex/run-tech-debt-check │ 24 │ +1149/-742 │ 72 │ never │ ✓
gh pr checks <PR_NUMBER> --json name,state,conclusion
Categorize: GREEN (passed), RED (failed), PENDING (running), NONE (no checks).
If any PR is RED and --no-fix is NOT set, proceed to Phase 2 (CI Triage) for that PR.
If any PR is PENDING, wait up to 5 minutes (polling every 30s) then proceed.
Use git merge-tree results from Phase 0. Build a conflict matrix showing no overlap, file overlap, or confirmed conflicts between PR pairs.
Ordering heuristic (apply in priority):
always → maybe → iffy. never-tier PRs offered separatelyAsk the user to confirm the merge order before proceeding.
For each PR with failing CI checks:
Follow the 3-tier CI log retrieval chain in CI_DIAGNOSIS.md:
Tier 1 (check-run annotations) -> Tier 2 (--log-failed) -> Tier 3 (full log tail).
Prefer Tier 1 -- annotations give structured {file, line, message} triples for direct edit operations.
Before diagnosing a test failure as a real regression, check flaky test indicators (see CI_DIAGNOSIS.md for flaky test management details):
.claude/flaky-tests.json registrygh run rerun <RUN_ID> --failedParse log output to identify the failure category (see CI_DIAGNOSIS.md for failure signatures and fix strategies):
| Category | Auto-fixable? |
|---|---|
| TypeScript error | Yes — read file, fix type |
| ESLint violation | Yes — npm run lint:fix |
| Test failure | Maybe — read test + source |
| Build error | Yes — fix imports |
| Env/secret missing | No — report to user |
| Dependency issue | Maybe — npm ci or fix versions |
| Timeout/infra | No — retry once, then report |
If auto-fixable and --no-fix is NOT set:
gh pr checkout <PR_NUMBER>.workstream/verify.shIf NOT auto-fixable, report to user and ask: "Skip this PR and continue, or abort?"
git checkout <base-branch>
git pull origin <base-branch>
git tag "pre-merge/$(date +%Y%m%d-%H%M%S)" <base-branch>
git checkout -b integrate/<descriptive-name>
For each PR in the planned merge order:
git fetch origin <pr-branch>
git merge origin/<pr-branch> --no-edit
If merge has conflicts, resolve intelligently:
| Conflict Type | Resolution Strategy |
|---|---|
| Import additions | Keep both, deduplicate |
| Adjacent line changes | Keep both changes |
| Same line, different changes | Analyze intent — later PR usually incorporates earlier |
| Structural conflicts | Prefer refactoring PR's structure, re-apply other's logic |
| Type definition conflicts | Union the type changes |
| Test file conflicts | Keep all tests from both PRs |
| package-lock.json | git checkout --theirs package-lock.json && npm install && git add package-lock.json |
After resolving, verify file is syntactically valid, mark resolved and commit.
After ALL PRs are merged:
.workstream/verify.sh
If checks pass, proceed to Phase 4. If checks fail and --no-fix is NOT set:
If verification fails after 3 fix attempts, use binary bisection to isolate the culprit PR. See CI_DIAGNOSIS.md for the full bisection protocol.
For N PRs, this requires at most log2(N) verification runs. Once the culprit is identified, ask user: merge passing subset, attempt to fix, or abort.
See MERGE_STRATEGIES.md for detailed templates and commands.
See MERGE_STRATEGIES.md for detailed commands.
After integration succeeds, automatically prompt for cleanup:
gh auth status fails → "Please run gh auth login first"<name> not found"<base>"If aborting mid-process:
git merge --abort 2>/dev/null
git checkout <original-branch>
git branch -D integrate/<name> 2>/dev/null
git branch -D bisect-test 2>/dev/null
Report: "Integration aborted. Cleaned up integration branch. You're back on <original-branch>."
Safety tags are NEVER deleted automatically. Report their names so the user can clean up when ready.
--force or explicit confirmationREMINDER: These guardrails apply throughout all phases. Never force-push, never suppress security findings, and always ask for confirmation before destructive actions.
Audit project alignment with VISION.md, identify SDLC gaps, and generate feature proposals. Use when reviewing strategic direction or planning new features.
Orient to project structure and load context. Use at the start of each new session or after context reset to understand the project state.
Complete OAuth login flow and store tokens for verification. Use when browser verification requires authenticated sessions.
Attempt automated verification of criteria before falling back to manual. Parses criterion text for automation hints and executes appropriate tool (curl, browser, file check). Invoked by verify-task and phase-checkpoint for MANUAL and MANUAL:DEFER criteria.
Initialize a new project with the AI Coding Toolkit. Use when setting up toolkit skills in a new or existing project.
Review deferred verification items. Use when you want to check or clear the deferred review queue without waiting for project completion.
Define feature requirements (problem, users, scope, acceptance criteria) through guided Q&A and write FEATURE_SPEC.md. Use when starting a new feature.
Execute all tasks in a phase autonomously. Use after /phase-prep confirms prerequisites are met.
Add a properly formatted TODO item to TODOS.md. Use when you need to capture a new task, bug, or feature request during development.
Extract automation patterns from session logs and rank by impact. Use periodically after multiple sessions to identify repetitive workflows that could become skills or hooks.
Resume execution from wherever you left off. Detects current state and runs the appropriate next command, or reports what's blocking progress. Use at the start of any session to pick up where you left off.
Run dependency audits, secrets detection, and static analysis to find CVEs, leaked credentials, and insecure code patterns. Use at phase checkpoints or before releases.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience