Agent skill
stackit
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/documents/stackit
SKILL.md
Stackit - Stacked Branch Management
You are an expert at using Stackit to manage stacked Git branches. Stackit helps developers break large features into small, focused PRs that stack on top of each other.
Before Any Operation
Always run stackit log --no-interactive first to understand:
- Current branch position in the stack
- Parent/child relationships
- Which branches need attention
CRITICAL: Non-Interactive Mode
When calling stackit commands, ALWAYS include the --no-interactive flag. This ensures the command fails or proceeds according to defaults rather than hanging for user input. For commands that require confirmation, include the --force flag (for absorb) or --yes flag (for undo/merge) in addition to --no-interactive.
Check for project conventions:
- Read
README.mdandCONTRIBUTING.mdfor project-specific guidelines before generating commit messages or branch names. - Follow documented commit message formats, PR templates, and workflows.
- Respect any branching or testing requirements specified.
Quick Health Check
Run the stack analyzer to check health and get actionable suggestions:
bash ~/.claude/skills/stackit/scripts/analyze_stack.sh
Note: All stackit commands below should be called with
--no-interactive.
Core Workflows
Creating a New Branch
- Stage changes:
git add <files>or use--allflag - Generate commit message after checking
README.md/CONTRIBUTING.md; follow project conventions if documented, otherwise write a clear, descriptive summary. - Create branch (name optional, auto-generated from message and respects
stackit config branch.pattern):bash# Preferred: pipe format echo "commit message" | stackit create --no-interactive # With explicit name echo "commit message" | stackit create branch-name --no-interactive - If currently on trunk (e.g., main/master), warn and confirm or switch to a feature branch before creating.
- Show stack:
stackit log --no-interactive
Submitting PRs
- Check stack state:
stackit log --no-interactive - Submit options:
- Current + ancestors:
stackit submit --no-interactive - Entire stack:
stackit submit --stack --no-interactive - As drafts:
stackit submit --draft --no-interactive
- Current + ancestors:
Syncing with Main
- Sync with trunk and cleanup:
stackit sync --no-interactive - If branches were deleted:
stackit restack --no-interactive
Fixing Issues
- Rebase conflicts: Resolve files, then
stackit continue --no-interactive - Absorb conflicts: See workflows/absorb-conflict.md or use
stackit absorb --show-conflict --no-interactive - Abort operation:
stackit abort --no-interactive - Undo last command:
stackit undo --no-interactive --yes - Stack health issues: See workflows/fix-absorb.md or run
/stack-fix - Intelligent folding: See workflows/stack-fold.md or run
/stack-fold
Commit Message Examples
Generate commit messages following these patterns:
Example 1: Feature addition
feat(auth): implement JWT-based authentication
Add login endpoint and token validation middleware.
Supports refresh tokens and role-based access.
Example 2: Bug fix
fix(cache): prevent race condition in invalidation
Add mutex locking around cache clear operations.
Fixes issue where concurrent requests could see stale data.
Example 3: Multiple changes
chore: update dependencies and refactor errors
- Upgrade lodash to 4.17.21
- Standardize error response format
- Add error codes for API responses
Format:
- Follow project conventions from README.md/CONTRIBUTING.md if documented
- Otherwise: clear, descriptive subject line + blank line + explanation of "why"
- Some projects use conventional commits:
type(scope): description
Command Reference
For detailed command information, see:
- Navigation: commands/navigation.md - log, checkout, up, down, trunk
- Branch operations: commands/branch.md - create, modify, absorb, delete
- Stack operations: commands/stack.md - restack, submit, sync, foreach
- Recovery & utilities: commands/recovery.md - undo, continue, abort, doctor
Quick reference: reference.md
Detailed Workflows
For complex operations requiring multiple steps:
- Fixing compilation errors after absorb: workflows/fix-absorb.md
- Resolving conflicts during rebase: workflows/conflict-resolution.md
- Resolving absorb conflicts: workflows/absorb-conflict.md
Auto-Generation Guidelines
Branch Names
Branch names are optional - stackit auto-generates from commit message:
- Only provide if user explicitly requests a specific name
- Auto-generated format: kebab-case from commit message
- Example: "Add user authentication" → "add-user-authentication"
Commit Messages
When generating commit messages:
- Check README.md and CONTRIBUTING.md for project guidelines
- Follow documented conventions if available
- If no conventions documented, write a clear, descriptive message
- Always use pipe format:
echo "message" | stackit create --no-interactive
Validation loop:
- Generate message
- Verify: Clear description? Follows project conventions (if documented)?
- If fails: revise and re-validate
- Only proceed when message meets quality standards
PR Descriptions
When generating PR descriptions:
- Check for .github/pull_request_template.md or CONTRIBUTING.md
- Follow project-specific templates if available
- Default format:
markdown
## Summary - Bullet point summary of changes ## Test Plan - [ ] Specific testing steps - [ ] Verification procedures [Additional sections per project templates]
Validation before submission:
- Title is clear and descriptive?
- Body has meaningful content (not placeholders)?
- Test plan is specific?
- Use
bash ~/.claude/skills/stackit/scripts/validate_pr.sh "title" "body"to validate
Important Rules
- Never use raw git for branch operations - always use stackit commands
- Check state before destructive operations - run
stackit logfirst - Always validate after absorb - absorb can cause compilation errors, see fix-absorb workflow
- Handle conflicts gracefully - guide user through resolution, see conflict-resolution workflow
- Keep PRs small and focused - suggest splitting if too large
- Use validation loops - for commit messages, PR descriptions, and post-absorb builds
Version {{VERSION}} Changes
New features:
- Progressive disclosure with organized reference files
- Workflow checklists for complex operations (fix-absorb, conflict resolution)
- Utility scripts for stack analysis and PR validation
- Enhanced slash commands with validation loops
- New
/stack-absorband/stack-foldcommands - Expanded commit message examples
- Better error recovery patterns
Migration:
- Re-run
stackit agent install --forceto update files - No breaking changes to existing workflows
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?