Skip to content

feat(#31): Worktree isolation and multi-issue integration - #35

Merged
admarble merged 2 commits into
mainfrom
feature/31-feat-worktree-isolation-and-multi-issue-integra
Jan 9, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/31-feat-worktree-isolation-and-multi-issue-integra

Conversation

@admarble

@admarble admarble commented Jan 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Implements automatic worktree creation for issue isolation during sequant run
  • Adds dependency tracking and topological sorting for multi-issue runs
  • Exports utility functions for conflict detection in /spec and /merger skills
  • Includes comprehensive tests for new functionality

Changes

Worktree Isolation (AC-1 through AC-5)

  • sequant run automatically creates worktrees before exec/qa phases
  • Each issue executes in its own isolated worktree
  • Sets SEQUANT_WORKTREE and SEQUANT_ISSUE environment variables
  • Reuses existing worktrees (resume scenario)
  • Copies .env.local and .claude/settings.local.json to worktrees
  • Automatically installs dependencies in new worktrees

Dependency Tracking (AC-9, AC-14)

  • Parses DEPENDS_ON from issue body (Depends on: #123)
  • Parses depends-on/N labels
  • Topologically sorts issues by dependencies before execution
  • Displays dependency order when reordering occurs

Conflict Detection Support (AC-6, AC-7)

  • Exports listWorktrees() function to get active worktrees
  • Exports getWorktreeChangedFiles() for file diff analysis
  • Enables /spec and /merger skills to detect conflicts

Hook Enforcement (AC-4) - Local Configuration

The pre-tool hook has been enhanced to support SEQUANT_WORKTREE environment variable for worktree boundary enforcement. This is local Claude Code configuration (.claude/hooks/pre-tool.sh).

Skills Created - Local Configuration

  • /merger skill for post-QA integration of completed worktrees
  • Enhanced /spec skill with in-flight work conflict detection

Note: Skills and hooks are in .claude/ which is gitignored. These are operational configurations documented in the skill files.

Test plan

  • Run sequant run 1 - verify worktree is created
  • Run sequant run 1 2 with issue 2 depending on 1 - verify ordering
  • Run tests: npm test - all 156 tests pass
  • Run build: npm run build - builds successfully

🤖 Generated with Claude Code

Implements automatic worktree creation for issue isolation during execution:

- Auto-create worktrees before exec/qa phases when running `sequant run`
- Set SEQUANT_WORKTREE and SEQUANT_ISSUE environment variables for hooks
- Reuse existing worktrees for resumed work
- Copy .env.local and .claude/settings.local.json to worktrees
- Install dependencies automatically in new worktrees

Adds dependency tracking and ordering:

- Parse DEPENDS_ON declarations from issue body and labels
- Topological sort issues by dependencies before execution
- Support patterns: "Depends on: #123", "depends-on/123" labels

Adds exported functions for conflict detection:

- listWorktrees() - Get all active worktrees with issue numbers
- getWorktreeChangedFiles() - Get files changed in a worktree

Includes tests for:

- listWorktrees parsing
- getWorktreeChangedFiles behavior
- Dependency pattern detection

Fixes #31

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update .gitignore to track Claude Code configuration:
- .claude/hooks/ - Pre/post tool hooks for security and quality
- .claude/skills/ - Skill definitions including /merger and /spec
- .claude/settings.json - Hook configuration

Still ignored:
- .claude/settings.local.json - Local/sensitive settings
- .claude/memory/ - Context memory files

This enables the worktree isolation hooks and multi-issue integration
skills to be shared with the repository.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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