Skip to content

feat(stack-aware-ship): stacked PR support workflow integration (Layer 2/3)#560

Draft
tmchow wants to merge 4 commits intofeat/gh-stack-foundationfrom
feat/gh-stack-workflow-integration
Draft

feat(stack-aware-ship): stacked PR support workflow integration (Layer 2/3)#560
tmchow wants to merge 4 commits intofeat/gh-stack-foundationfrom
feat/gh-stack-workflow-integration

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Apr 14, 2026

⏸ Blocked on gh-stack GA — Draft pending upstream availability

Current status: This PR is parked as a draft. GitHub's gh stack CLI extension is currently in private preview and is not enabled on this repository. The code in this PR is architecturally complete and ready to ship when gh stack becomes broadly available, but it cannot be validated end-to-end or released in its current state.

What's split out and shipping now: The ce-pr-description skill extraction from this layer has been cherry-picked into a standalone PR (#561) since it is architecturally independent and valuable regardless of gh stack availability. The ce-pr-description work in this PR's diff is therefore already being reviewed separately — the remaining changes here (stack-aware routing in git-commit-push-pr, shipping workflow stacking option in ce-work/ce-work-beta, and stack-aware resolve-pr-feedback) are what stays blocked on gh stack.

What to do when gh stack ships: Re-evaluate the plan, update the CLI surface against any changes between private preview and GA, rebase onto the latest main (which will include the merged #561), validate against a real stack, and move this PR out of draft.


Summary

Second of three stacked PRs. Integrates stacked-PR support into existing stable skills (git-commit-push-pr, ce-work/ce-work-beta shipping workflow, resolve-pr-feedback) so users reach stacking through the same familiar ship flow they use for monolithic PRs.

What's in this layer

  • ce-pr-description (new skill) — focused PR-description writer extracted from git-commit-push-pr's Step 6 + DU-3. This portion is shipping standalone via PR feat(ce-pr-description): focused skill for PR description generation #561 — it is independently valuable.
  • git-commit-push-pr stack-aware ship — single ship path for both monolithic and stacked cases. Four-case routing. Requires gh stack.
  • ce-work and ce-work-beta shipping workflow — adds stacking decision at Phase 4. Requires gh stack.
  • resolve-pr-feedback stack-aware handling — identifies owning layer for each review comment, navigates via gh stack checkout, cascades via gh stack rebase, pushes via gh stack push. Requires gh stack.

Architectural shape

The four skills that touch stacking form a narrow interaction graph:

No back-edges; no duplicate ship logic. The two-stage effectiveness test carries a sync-obligation comment in each heuristic location.

Stack context

Test plan

Run these once gh stack is enabled on the repo:

  • Read plugins/compound-engineering/skills/git-commit-push-pr/references/stack-aware-workflow.md and confirm four-case routing
  • Verify ce-work and ce-work-beta shipping workflows have identical stacking sections (diff them)
  • Confirm the sync-obligation comment in each heuristic location lists all peers
  • Invoke git-commit-push-pr on a real stacked branch; verify Case 1 routing (push + submit + per-PR description via ce-pr-description)
  • Invoke /resolve-pr-feedback on a stacked PR with comments; verify owning-layer identification and cascade

Stack created with GitHub Stacks CLIGive Feedback 💬

🤖 Generated with Claude Code

tmchow and others added 4 commits April 14, 2026 15:12
…d skill

New skill owns the value-first description writing logic that was
previously inline in git-commit-push-pr. Input contract is two-shape:
pr:<number> for existing PRs (used by refresh mode), or range:<base>..<head>
for pre-PR generation (used by new PR creation and by ce-pr-stack per
layer). Output is structured {title, body}; caller decides whether to
apply via gh pr edit.

No interactive prompts, no auto-apply, no branch coupling. The skill
is a pure capability — git-commit-push-pr wraps it with confirmation
prompts and evidence-capture for single-PR interactive flows;
ce-pr-stack (via git-commit-push-pr's stack-aware routing, coming next)
will call it per layer without the interactive scaffolding.

Refactor preserves git-commit-push-pr's user-facing behavior:
- Full flow: commit + push + create PR, description generated via
  ce-pr-description with range:<base>..<head> and passed to gh pr create
  in a single call (no transient placeholder on GitHub)
- Refresh mode (DU-1/DU-2/DU-3): interactive scaffolding stays; DU-3
  delegates description generation to ce-pr-description with pr:<number>,
  then presents the compare-and-confirm as before

Naming: ce-pr-description, not git-pr-description. PR is a GitHub
artifact; the ce- prefix matches the future convention for plugin
skills. git-commit-push-pr will rename later.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Adds four-case routing between push and description steps:
- Case 1: on a stack branch → gh stack push + gh stack submit + per-PR
  description via ce-pr-description + gh pr edit per PR
- Case 2: not in stack, change passes two-stage effectiveness test →
  suggest stacking, on yes load ce-pr-stack, on return re-enter routing
  as Case 1
- Case 3: gh-stack not installed, change passes stage-1 → offer-and-run
  install, on success re-enter as Case 2
- Case 4: monolithic default → existing git push + gh pr create, now
  with description via ce-pr-description

Monolithic Steps 6-7 stay untouched; they are the single source of truth
for monolithic description generation. Case 1 explicitly exits before
them; Case 4 explicitly hands back to them.

Effectiveness test prose carries a sync-obligation comment listing all
four locations (this file, ce-work shipping, ce-work-beta shipping,
ce-plan). Changes to the heuristic update all four atomically.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Adds a new step 1 to Phase 4 in both shipping-workflow files: run the
two-stage effectiveness test (stage-1 size/spread hint, stage-2
effectiveness check with anti-patterns), offer to install gh-stack when
missing and the stage-1 hint fires, and branch into either git-commit-
push-pr for single-PR shipping or ce-pr-stack for decomposition.

Both ce-work and ce-work-beta get identical changes — the two skills
share the shipping workflow and must stay in sync. Sync-obligation
comment at the top of the stacking section names all four heuristic
locations (this file, ce-work-beta twin, git-commit-push-pr stack-
aware reference, ce-plan) so future edits propagate atomically.

When stacking is chosen, the workflow loads ce-pr-stack and hands off
the ship step — git-commit-push-pr is not loaded separately, preventing
double invocation. The governing principle carries prior consent across
the skill chain without structured flags.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
When a PR under review is part of a gh-stack stack, identify the owning
layer for each review comment via git blame + gh stack view --json,
check out that layer, apply the fix, cascade via gh stack rebase, push
via gh stack push, then reply on the original commented PR with a note
when the fix landed on a different layer.

Uses gh stack rebase's documented cascade semantics (pulls from remote,
rebases dependents). Conflicts during rebase halt the workflow with
guidance for manual resolution — V1 does not attempt automated conflict
resolution.

V1 scope: single-comment, single-layer fixes. Multi-layer fixes (one
comment requiring changes in multiple layers) and automated conflict
resolution are deferred to V2.

Non-stack feedback flow is unaffected. Reference file loads only when
gh-stack is installed AND the branch is part of a stack.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@tmchow tmchow changed the title feat/gh stack workflow integration feat(stack-aware-ship): stacked PR support workflow integration (Layer 2/3) Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant