stacked-pr
Create and update stacked pull requests. Use this after completing an implementation phase to commit changed files.
What this skill does
# Stacked PR Workflow This skill enables Claude to create stacked pull requests using git-town automation scripts. Each phase becomes an atomic PR that builds on previous phases. ## When to Use This Skill Invoke this skill after completing a phase from `/implement_plan` when: 1. All automated verification has passed (`just check-test`) 2. User has confirmed manual verification is complete 3. There are uncommitted changes ready to be stacked DO NOT use this skill: - Before verification is complete - When there are no changes to commit - For non-plan-based work (use standard git workflow instead) ## Pre-Flight Checks Before creating the stack, verify: 1. Current git status shows modified/new files 2. All tests and checks have passed 3. You know the phase number and plan context ## Workflow Instructions ### Step 1: Determine Phase Type Check the current branch to determine if this is Phase 1 or Phase N: ```bash git branch --show-current ``` **Decision Logic:** - **If on `main`**: This is Phase 1 โ Use `just new-stack` - **If on `phase-X-*`**: This is Phase N (where N = X + 1) โ Use `just append-stack` ### Step 2: Prepare Arguments Both scripts require the same arguments (in order): 1. **phase-num**: The phase number (e.g., `1`, `2`, `3`) 2. **branch-name**: Short descriptive name (e.g., `websocket-foundation`, `message-parser`) 3. **commit-msg**: Full commit message (multiline string) 4. **pr-title**: PR title (e.g., `Phase 1: WebSocket Connection Foundation`) 5. **pr-body**: PR body/description (multiline string) #### Branch Naming Convention - Format: `phase-N-<short-description>` - Examples: - `phase-1-websocket-foundation` - `phase-2-message-parser` - `phase-3-orderbook-state` #### Commit Message Format ``` <type>: <phase-summary> Phase N: <detailed-description> Changes: - <key change 1> - <key change 2> - <key change 3> <any relevant context or notes> ``` Types: `feat`, `fix`, `refactor`, `test`, `chore`, `docs` #### PR Body Format ``` ## Phase N: <Title> ### Summary <1-2 sentence overview of what this phase accomplishes> ### Changes - <key change 1> - <key change 2> - <key change 3> ### Stack <!-- branch-stack --> ### Verification - [x] All automated tests passed (\`just check-test\`) - [x] Manual verification completed - [x] Code follows project patterns ### Related Part of implementation plan: [link to plan if available] --- ๐ค Generated with [Claude Code](https://claude.com/claude-code) ``` ### Step 3: Execute the Appropriate Script **For Phase 1 (on `main` branch):** ```bash just new-stack \ "<phase-num>" \ "<branch-name>" \ "<commit-msg>" \ "<pr-title>" \ "<pr-body>" ``` **For Phase N > 1 (on `phase-X-*` branch):** ```bash just append-stack \ "<phase-num>" \ "<branch-name>" \ "<commit-msg>" \ "<pr-title>" \ "<pr-body>" ``` ## Example Workflows ### Example 1: Phase 1 (Starting New Stack) ```bash # Current state check $ git branch --show-current main $ git status # Shows: modified files in src/connection/ (uncommitted) # Execute new-stack just new-stack \ "1" \ "websocket-foundation" \ "feat: Add WebSocket connection foundation Phase 1: Implement core WebSocket connection logic Changes: - Add WebsocketConnection class with lifecycle management - Implement exponential backoff reconnection strategy - Add connection health monitoring - Create connection stats tracking Establishes the foundation for real-time market data streaming." \ "Phase 1: WebSocket Connection Foundation" \ "## Phase 1: WebSocket Connection Foundation ### Summary Implements the core WebSocket connection class with automatic reconnection, health monitoring, and stats tracking. ### Changes - Add WebsocketConnection class with lifecycle management - Implement exponential backoff reconnection strategy (1s โ 30s) - Add connection health monitoring (60s silence detection) - Create connection stats tracking ### Stack <!-- branch-stack --> ### Verification - [x] All automated tests passed (\`just check-test\`) - [x] Manual verification: Connected to Polymarket API successfully - [x] Code follows project patterns --- ๐ค Generated with [Claude Code](https://claude.com/claude-code)" ``` **What the script does:** 1. โ Verifies you're on `main` branch 2. โ Checks for uncommitted changes 3. โ Creates branch `phase-1-websocket-foundation` via `git town hack` 4. โ Commits changes (excluding `thoughts/` directory) 5. โ Creates PR with `--base main` 6. โ Syncs the stack ### Example 2: Phase 2 (Extending Stack) ```bash # Current state check $ git branch --show-current phase-1-websocket-foundation $ git status # Shows: modified files (uncommitted) # Execute append-stack just append-stack \ "2" \ "message-parser" \ "feat: Add message parsing with msgspec Phase 2: Implement zero-copy message parser Changes: - Add msgspec-based message parser - Define protocol structures for BookSnapshot, PriceChange, LastTradePrice - Implement generator-based parsing for streaming - Handle integer scaling for prices/sizes Enables efficient parsing of WebSocket messages with zero-copy optimization." \ "Phase 2: Message Parser with msgspec" \ "## Phase 2: Message Parser with msgspec ### Summary Implements zero-copy message parsing using msgspec, enabling efficient processing of WebSocket events. ### Changes - Add msgspec-based MessageParser class - Define protocol structures (BookSnapshot, PriceChange, LastTradePrice) - Implement generator-based parsing for streaming - Handle integer scaling (PRICE_SCALE=1000, SIZE_SCALE=100) ### Stack <!-- branch-stack --> Merge order: This PR should be merged after Phase 1. ### Verification - [x] All automated tests passed (\`just check-test\`) - [x] Manual verification: Parsed live messages successfully - [x] Code follows project patterns --- ๐ค Generated with [Claude Code](https://claude.com/claude-code)" ``` **What the script does:** 1. โ Verifies you're NOT on `main` (you must be on previous phase branch) 2. โ Auto-detects previous phase branch (`phase-1-websocket-foundation`) 3. โ Checks for uncommitted changes 4. โ Creates branch `phase-2-message-parser` via `git town append` 5. โ Commits changes (excluding `thoughts/` directory) 6. โ Creates PR with `--base phase-1-websocket-foundation` 7. โ Syncs the stack ## Script Features Both scripts automatically: - Validate pre-conditions (branch state, uncommitted changes) - Create properly named branches with git-town - Stage changes (excluding `thoughts/` directory) - Commit with your provided message - Create GitHub PR with proper base branch - Sync the stack after PR creation - Provide clear output with emoji indicators ## Common Issues and Solutions ### Issue: "No uncommitted changes detected" The script checks `git status --porcelain`. Ensure: - You have modified, added, or deleted files - Changes are not in the `thoughts/` directory (which is excluded) ### Issue: "Previous phase branch does not exist" For `append-stack`, ensure: - You're on the correct previous phase branch before running - The branch name follows the `phase-N-*` pattern ### Issue: Wrong base branch in PR Use GitHub CLI to fix: ```bash gh pr edit <pr-number> --base <correct-base-branch> ``` ### Issue: Need to update an earlier phase ```bash # Checkout the phase that needs changes git checkout phase-N-<name> # Make changes and commit # ... # Sync stack to propagate changes forward git town sync --stack ``` ## Key Principles 1. **One phase = One PR**: Each phase should be atomic with passing CI 2. **Sequential dependencies**: Phase N+1 builds on Phase N 3. **Clear commit messages**: Reference phase number and provide context 4. **Automatic base branches**: Scripts handle this (Phase 1 โ main, Phase N โ Phase N-1) 5. **Always sync**: Scripts automatically sync the stack after PR creation 6. **Thoughts excluded**: Both scripts exclude the `thoughts/` directory from commits ## Integration with /implement_plan This skill integrates with the
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.