feat(ce-pr-stack): stacked PR support foundation (Layer 1/3)#559
Draft
feat(ce-pr-stack): stacked PR support foundation (Layer 1/3)#559
Conversation
Covers retroactive splitting, shipping-time suggestion, and detection across ce-setup, git-commit-push-pr, ce-work, and a new git-stack skill. Reviewed by 5 document-review personas with 12 auto-fixes and 7 judgment findings addressed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ciple Added Unit 7 (stack-aware resolve-pr-feedback), Unit 8 (ce:plan stack- candidacy assessment), renumbered README unit to Unit 9. Replaced the files+lines+concerns heuristic with a two-stage effectiveness test (size/spread hint then independence/divergence/sequencing/mixed-kinds signals) grounded in SmartBear/Cisco, Rigby & Bird, and practitioner consensus. Added "Respect prior user decisions within the session" as a governing principle. Corrected the gh-stack CLI surface against the installed extension (added rebase, sync, merge, view, checkout, etc. — the plan previously listed status which does not exist). Documented offer-and-run install across all touchpoints. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detection uses gh extension list because gh-stack is a gh CLI extension, not a standalone binary. The check-health loop now handles gh-* entries specially and skips them gracefully when gh itself is missing, avoiding confusing "install gh extension" messaging in that case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ysis Emits parseable signals about gh-stack availability, current branch's stack-membership state, and change summary vs a base branch. Supports --mock and STACK_DETECT_MOCK for testing without a real stack. Reports signals only — no "should stack" judgments, which belong in consuming skills per the plan's governing principle. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Handles two operational modes (split to decompose a branch into stacked PRs, manage to drive an existing stack via gh stack commands) with three invocation flavors (manual, delegated, auto-invoked). Auto-invocation runs an effectiveness-test gate before proposing a split; manual and delegated entries go straight to layer proposal, which remains the second gate for all modes. Availability gate offers to install gh-stack and runs the command on consent, honoring the session-level governing principle that respects prior user decisions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion Four-phase workflow for decomposing a feature branch into stacked PRs: analyze (commit-based grouping as V1 strategy), propose layers with mandatory user approval, create the stack locally using gh stack init and gh stack add, submit via gh stack push plus gh stack submit. The rollback protocol separates local construction from remote submission so failures stay local. Workflow content verified against the installed gh-stack CLI via --help on each command referenced. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ecomposition skill Renames git-stack to ce-pr-stack — stacking is a GitHub feature, not a git feature, and the ce- prefix matches the future convention for plugin skills. Restructures responsibilities: - ce-pr-stack: decomposition only (analyze + propose + create layers locally). Manage mode removed; pure pass-throughs to gh stack commands do not warrant a skill wrapper. - git-commit-push-pr: single ship path for both monolithic and stacked cases, with four explicit routing cases (already in stack, suggest stacking, offer install, monolithic). Absorbs what was previously a duplicate submit phase in ce-pr-stack. - ce-pr-description (new Unit 5): focused skill for PR description writing, invoked by git-commit-push-pr for each PR created or updated. Drops the three-flavor invocation enumeration (manual/delegated/auto-invoked) and the delegated: true flag. Consent routing now relies on the governing principle that respects prior user decisions within the session — agent context awareness handles it without structural signal plumbing. Adds the --plan input for ce-pr-stack so ce:work's Phase 4 shipping delegation can pass plan-unit boundaries as primary signal for candidate layers. Adds R10 (ce-pr-description) and renumbers Units 5-10. Updates Requirements Trace, Key Technical Decisions, System-Wide Impact, and Risks tables for the new architecture. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Renames the skill directory to match the plan's architectural reshape. Stacking is a GitHub feature (gh-stack extension, GitHub's stack UI), not a git feature, and the ce- prefix matches the future convention for plugin skills. Narrows scope to decomposition only: - Removes manage-mode operations. Push and submit are owned by git-commit-push-pr now that it is stack-aware. Rebase, sync, view, and navigation commands are one-line pass-throughs to gh stack with no skill-scale value — invoked directly when needed. - Removes the three-flavor invocation enumeration (manual / delegated / auto-invoked). Consent routing relies on the governing principle that respects prior user decisions within the session, rather than structured caller-side flags. - Drops the delegated / stacking_declined / gh_stack_install_declined signal plumbing from the SKILL.md. Agent context awareness is the primary mechanism; the principle is documented at the bottom. Narrows the CLI surface section: init, add, view, unstack --local for rollback. Ship commands (push, submit) moved to git-commit-push-pr. Rewrites splitting-workflow reference file: four phases collapsed to three. Removes the submit phase entirely; phase 3 ends with a handoff to git-commit-push-pr, which then runs gh stack push + gh stack submit + per-PR description generation via ce-pr-description. Separating decomposition from shipping bounds failure blast radius to local state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⏸ Blocked on gh-stack GA — Draft pending upstream availability
Summary
First of three stacked PRs introducing stacked-PR support to the compound-engineering plugin via GitHub's
gh stackCLI extension. This layer is the foundation: plan, detection, and the newce-pr-stackskill. No stable skills are modified in this layer — that's Layer 2 (PR #560).What's in this layer
docs/plans/2026-04-14-001-feat-gh-stack-stacked-pr-support-plan.md) — 10-unit implementation plan with two-stage effectiveness test grounded in SmartBear/Cisco + Rigby & Bird data, governing principle that respects prior user decisions within a session, and the full gh-stack CLI surface verified against the installed extension at the time of writing.gh-stackadded as arecommendeddependency. Detection usesgh extension listand skips gracefully whenghitself is missing.stack-detectscript — deterministic shell script emitting labeled signal sections (=== TOOL ===,=== STACK_STATE ===,=== CHANGE_SUMMARY ===,=== COMMIT_LOG ===). No judgments — those belong to the model.ce-pr-stackskill (SKILL.md) — decompose a branch into stacked PRs. Scope is decomposition only; shipping is handed off togit-commit-push-pr. Consent routing relies on the governing principle rather than structured caller-side flags.git-commit-push-pr. Rollback protocol bounds failure blast radius to local state.Stack context
Related shipping PR
ce-pr-descriptionextraction. Not blocked ongh stackavailability. Ready to merge independently.Naming
The new skill is
ce-pr-stack, notgit-stack. Stacking is a GitHub feature (gh-stack extension + GitHub's stack UI), not a git feature. Thece-prefix matches the future convention for plugin skills.Dogfooding and lessons
gh stack init --adoptworked cleanly on an existing branchgh stack pushcascades correctly;gh stack submit --draft --autocreates PRsgh stack submit --autodo NOT match conventional-commit format, causing the repo'spr-titleCI check to fail on first submit. Current workaround:gh pr edit+gh run rerunafter everygh stack submit --auto. This is the exact flow Unit 6's stack-aware ship automates.gh stack submitsurfaces⚠ Stacked PRs are not enabled for this repository— the GitHub-side stack UI (native stack navigator) requires admin enablement; without it, PRs are linked via base branches instead of the navigator. No public API probes this enablement state before submit.Test plan
Run these once
gh stackis enabled on the repo:bash plugins/compound-engineering/skills/ce-setup/scripts/check-healthincludesgh-stackwith correct tierbash plugins/compound-engineering/skills/ce-pr-stack/scripts/stack-detect mainon this branch emits all four sections with accurate databun test tests/frontmatter.test.tspassesbun run release:validateclean/ce-pr-stackon a real feature branch; verify the three-phase decomposition runs to completion and hands off correctlyStack created with GitHub Stacks CLI • Give Feedback 💬
🤖 Generated with Claude Code