Repository navigation
Closed
Labels
cliCLI commands and interfaceenhancementNew feature or requestplannedImplementation plan approvedready-for-reviewReady for code review
Description
Summary
Currently sequant run always creates worktrees from main branch (hardcoded in scripts/dev/new-feature.sh). This prevents using sequant run for workflows that need a different base branch, such as:
- Feature integration branches (e.g.,
feature/dashboard) - Release branches
- Team-specific branches in monorepos
Design Decision
Base branch resolution priority:
1. --base <branch> flag → Explicit override (highest priority)
2. .sequant/settings.json → defaultBase field (project config)
3. Repository default branch → main/master (safe fallback)
No magic detection from current branch - explicit is better than implicit.
Acceptance Criteria
Core Implementation
- AC-1: Add
--base <branch>option tosequant runcommand inbin/cli.ts - AC-2: Read
defaultBasefrom.sequant/settings.jsonif no flag provided - AC-3: Update
src/commands/run.tsto resolve base branch (flag → config → default) - AC-4: Update
scripts/dev/new-feature.shto accept base branch argument (default:main) - AC-5: Add
defaultBaseto settings schema insrc/lib/settings.ts
Skill Updates
- AC-6: Update
/solveskill to recommend--basewhen issues are linked to a feature branch - AC-7: Update
/execskill to pass base branch when creating worktrees - AC-8: Update
/specskill to detect feature branch context and note in plan output
Documentation
- AC-9: Update CLI help text (
sequant run --help) - AC-10: Update README.md with
--baseusage examples - AC-11: Add feature branch workflow guide to docs/
Implementation Plan
Phase 1: Core Infrastructure
- Settings schema - Add
defaultBasetosrc/lib/settings.ts - Script update - Modify
scripts/dev/new-feature.shto accept$2as base branch - CLI option - Add
--basetobin/cli.tsrun command - Run command - Update
src/commands/run.tsto resolve and pass base branch
Phase 2: Skill Integration
-
/execskill - Update to use base branch when invokingnew-feature.sh- File:
.claude/skills/exec/skill.md - Pass base branch to worktree creation commands
- File:
-
/solveskill - Detect feature branch workflows and recommend--base- File:
.claude/skills/solve/skill.md - Add detection logic for issues linked to feature branches
- Update output template to include
--basewhen appropriate
- File:
-
/specskill - Note feature branch context in planning output- File:
.claude/skills/spec/skill.md - Detect if
defaultBaseis set or feature branch context exists - Include in "Recommended Workflow" section
- File:
Phase 3: Documentation
- CLI help - Ensure
--baseappears insequant run --help - README.md - Add section on feature branch workflows
- Workflow guide - Create
docs/feature-branch-workflow.mdexplaining:- When to use
--basevs config vs default - Integration branch patterns
- Example: dashboard feature development
- When to use
Example Usage
# Explicit flag (one-off override)
npx sequant run 117 --base feature/dashboard
# Project config (persistent for all runs)
# .sequant/settings.json: { "defaultBase": "feature/dashboard" }
npx sequant run 117 # Uses feature/dashboard from config
# Default behavior (no config, no flag)
npx sequant run 117 # Uses main
# Chain mode with custom base
npx sequant run 117 118 119 --sequential --chain --base feature/dashboardTechnical Notes
Files to Modify
| File | Change |
|---|---|
bin/cli.ts |
Add --base option to run command |
src/commands/run.ts |
Resolve base branch, pass to worktree creation |
src/lib/settings.ts |
Add defaultBase to SettingsSchema |
scripts/dev/new-feature.sh |
Accept base branch as $2, default to main |
.claude/skills/exec/skill.md |
Document base branch usage |
.claude/skills/solve/skill.md |
Add --base recommendation logic |
.claude/skills/spec/skill.md |
Detect and report feature branch context |
README.md |
Document --base flag and feature branch workflows |
Settings Schema Addition
// src/lib/settings.ts
export const SettingsSchema = z.object({
// ... existing fields
defaultBase: z.string().optional(), // New field
});Script Modification
# scripts/dev/new-feature.sh
BASE_BRANCH="${2:-main}" # Accept base branch as second arg, default main
git fetch origin "$BASE_BRANCH"
git checkout "$BASE_BRANCH"
git pull origin "$BASE_BRANCH"Context
This came up while planning the dashboard feature work (#114, #116, #117, #118, #119, #120) where all issues should branch from feature/dashboard instead of main.
Priority
Medium - Enables automated workflows on feature branches.
Labels
enhancement, cli, planned
Metadata
Metadata
Assignees
Labels
cliCLI commands and interfaceenhancementNew feature or requestplannedImplementation plan approvedready-for-reviewReady for code review
Activity
admarble commentedon Jan 19, 2026
Design Decision: Base Branch Resolution
Recommended approach (explicit + config + default):
Example Usage
Why Not Detect from Current Branch?
Magic detection from
git branch --show-currentis tempting but problematic:This matches
gh pr create --basebehavior - explicit flag, sensible default, no surprises.admarble commentedon Jan 19, 2026
Relationship with
--chainFlagQuestion: Does
--basemake--chainobsolete?Answer: No, they're complementary:
--base--chainVisual Comparison
When to Use Each
--base feature/dashboard--chain --sequential--base feature/dashboard --chain --sequentialSummary
--basesets where the work starts--chainsets how issues relate to each otheradmarble commentedon Jan 19, 2026
Spec Review - Verification Criteria & Implementation Plan
Acceptance Criteria with Verification
AC-1: Add
--base <branch>option to CLIVerification: Manual Test
Scenario:
npx sequant run 123 --base feature/dashboard→ option parsed correctlyAC-2: Read
defaultBasefrom settingsVerification: Integration Test
Scenario: Settings has
defaultBase: "feature/dashboard"→ resolved without flagAC-3: Resolve base branch (flag → config → default)
Verification: Unit Test
Scenarios:
develop, Config=feature/x→ Returnsdevelopfeature/x→ Returnsfeature/xmainAC-4: Script accepts base branch argument
Verification: Manual Test
Scenario:
./scripts/dev/new-feature.sh 123 feature/dashboard→ worktree from feature branchAC-5: Settings schema update
Verification: Unit Test
Scenario:
getSettings()returnsdefaultBasewhen configuredAC-6-8: Skill updates (/solve, /exec, /spec)
Verification: Manual Test
Scenarios:
/execpasses base branch to worktree creation/solverecommends--basewhen feature branch context detected/specuses correct base for in-flight conflict detectionAC-9-11: Documentation
Verification: Manual Review
Implementation Plan
Phase 1: Core Infrastructure
src/lib/settings.tsdefaultBase?: stringtoRunSettingsscripts/dev/new-feature.sh$2as base branch, update git commandsbin/cli.ts--base <branch>optionsrc/commands/run.tsPhase 2: Skill Integration
.claude/skills/exec/SKILL.mdnew-feature.sh.claude/skills/solve/SKILL.md--baseto example commands.claude/skills/spec/skill.mdmainin conflict detectionPhase 3: Documentation
docs/feature-branch-workflow.md- When to use flag vs configRecommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Well-defined AC with clear patterns to follow
Consolidated Assumptions
--stashflagdefaultBasefield works with existing configs (no migration)main🤖 Generated with Claude Code via
/specfeat(#122): add --base flag to sequant run for custom base branches
admarble commentedon Jan 19, 2026
QA Review for Issue #122
AC Coverage
--base <branch>option to CLIbin/cli.ts:133-136with proper descriptiondefaultBasefrom settingsrun.ts:1227-1229:options.base ?? settings.run.defaultBase ?? undefinedmainnew-feature.shto accept base branchtemplates/scripts/new-feature.shupdated with--base <branch>flag parsingdefaultBaseto settings schemasrc/lib/settings.ts:78-83with JSDoc/solveskill for--baserecommendation--baseexamples inSKILL.md/execskill for base branch passingSEQUANT_BASE_BRANCHenv var and documentation/specskill for feature branch contextsequant run --helpshows--basewith proper description--baseexample anddefaultBaseconfig optiondocs/feature-branch-workflow.md(166 lines)Coverage: 11/11 AC items fully met ✅
Quality Metrics
any)Code Review
Strengths:
main)ensureWorktree()--baseflag with any positionIssues:
Suggestions:
Self-Evaluation
--baseflag, code paths reviewed, build passes--baseresolution, but existing tests passVerdict: READY_FOR_MERGE
All 11 acceptance criteria are fully met. The implementation:
Documentation
feature-branch-workflow.mdcreated)Next Steps
--baseflag feature🤖 Generated with Claude Code via
/qaadmarble commentedon Jan 19, 2026
Documentation Complete
Documentation was created as part of the implementation (AC-9 through AC-11):
Files:
docs/feature-branch-workflow.md(166 lines) - Comprehensive workflow guideREADME.md- Quick start example and config optionsequant run --helpshows--baseflagCoverage:
--base <branch>)run.defaultBase)Status: Documentation complete and merged with PR #123.
🤖 Generated with Claude Code via
/docsfeat(#122): add --base flag to sequant run for custom base branches (#…