Repository navigation
Description
Summary
Add a --chain flag to sequant run that creates cascading worktrees where each issue branches from the previous issue's completed branch, rather than from main.
sequant run 1 2 3 --sequential --chainCurrent behavior: Each issue branches from origin/main
Proposed behavior with --chain: Issue 2 branches from feature/1-xxx, issue 3 from feature/2-xxx
Motivation
When implementing related features in sequence, later issues often depend on earlier ones. Currently, each issue starts fresh from main, requiring manual rebasing or re-implementation of dependencies.
With --chain:
- Issue 2 automatically has access to issue 1's implementation
- No manual rebasing between issues
- Natural workflow for dependent features
Technical Design
Worktree Creation
origin/main
└─→ feature/1-add-auth (issue 1)
└─→ feature/2-add-login-page (issue 2, depends on auth)
└─→ feature/3-add-logout (issue 3, depends on login)
Execution Flow
- Issue 1: Branch from
origin/main, run phases, pass QA - Issue 2: Branch from
feature/1-xxx, run phases, pass QA - Issue 3: Branch from
feature/2-xxx, run phases, pass QA
If any issue fails, the chain stops (already handled by --sequential).
Merge Strategy Considerations
Several options for merging a completed chain:
Option A: Sequential Merge to Main
feature/1-xxx → main (PR #1)
feature/2-xxx → main (PR #2, after #1 merged)
feature/3-xxx → main (PR #3, after #2 merged)
Pros: Standard PR workflow, individual reviews
Cons: Requires rebasing between merges, slow
Option B: Stacked PRs
PR #1: feature/1-xxx → main
PR #2: feature/2-xxx → feature/1-xxx
PR #3: feature/3-xxx → feature/2-xxx
Merge in order: #1 first, GitHub auto-updates #2's base, etc.
Pros: Native GitHub support, parallel reviews possible
Cons: Complex to set up, GitHub's stacked PR UX is rough
Option C: Chain Squash
Merge entire chain as single PR with combined changes.
Pros: Simple, single review
Cons: Loses granularity, may be too large for review
Recommendation
Option A (Sequential) for initial implementation. Consider /merge-chain skill that:
- Creates PRs for each issue in order
- Merges them sequentially
- Handles rebase automatically between merges
Review Considerations
For Short Chains (2-3 issues)
Standard /qa per issue is sufficient. Each QA sees the accumulated changes in context.
For Long Chains (4+ issues)
Consider:
- Checkpoints: Push/commit after each issue passes QA (recovery point)
- Chain summary:
/qa-chainskill that reviews entire chain holistically - Length limit: Warn or require confirmation for chains > 5 issues
- Incremental review: Allow human review between issues
Risk Mitigation
| Risk | Mitigation |
|---|---|
| Issue 1 changes invalidate issue 2+ | Checkpoint commits allow recovery |
| Merge conflicts accumulate | /merge-chain handles rebasing |
| Single failure blocks chain | --sequential already stops on failure |
| Chain too long to review | Warn at 5+ issues, suggest breaking up |
New Skills/Commands Needed
/merge-chain (or extend /merger)
Handles merging a chain of dependent PRs:
- Detects chain structure from branch names
- Creates PRs in dependency order
- Merges sequentially with auto-rebase
- Reports conflicts for human resolution
/qa-chain (optional, for long chains)
Reviews entire chain holistically:
- Sees all changes across issues
- Identifies cross-issue inconsistencies
- Validates the chain as a cohesive unit
Acceptance Criteria
-
--chainflag implemented insequant run - Chain issues branch from previous issue's branch
- Chain stops on first failure (via
--sequential) - Documentation updated with chain workflow
- Warning shown for chains > 5 issues
- Checkpoint commits after each issue passes QA
Future (separate issues)
-
/merge-chainskill for merging dependent PRs -
/qa-chainskill for holistic chain review -
--chain-base <branch>to start chain from non-main branch
Related
- Fresh baseline fix (worktrees now fetch and branch from origin/main)
- Existing dependency detection in
parseDependencies() /mergerskill for post-QA integration
Activity
feat(#88): add --chain flag for dependent sequential issues
admarble commentedon Jan 17, 2026
/fullsolve Complete
Status: READY_FOR_MERGE
Summary
AC Coverage
--chainflag implementedKey Changes
--chainflag tosequant runensureWorktreesChain()creates worktrees branching from previous--sequential, incompatible with--batchdocs/run-command.mdSelf-Evaluation
ensureWorktreesChainandcreateCheckpointCommitin a follow-up.PR: #110
Ready for human review and merge.
test(#88): add unit tests for chain mode
admarble commentedon Jan 17, 2026
Update: Added 10 unit tests for chain mode. Total tests: 379 passing. PR #110 updated.