Git Autopilot
Automatically trigger workflows based on git events like branches, commits, and tags
Git Autopilot monitors your repository activity and automatically suggests or starts workflows based on git events.
Overview#
When you create a feature branch, commit with a specific prefix, or tag a release, Bootspring can automatically:
- Suggest the appropriate workflow
- Start the workflow (if auto-start is enabled)
- Track the connection between git activity and workflows
How It Works#
Git Event Pattern Match Workflow Suggestion
─────────────────────────────────────────────────────────────
branch: feature/* ───▶ feature/* ───▶ Feature Development
commit: feat: ───▶ feat: ───▶ Feature Development
commit: security: ───▶ security: ───▶ Security Audit
files: prisma/* ───▶ prisma/ ───▶ Database Migration
tag: v1.0.0 ───▶ v* ───▶ Launch Preparation
Default Event Mappings#
Branch Patterns#
| Pattern | Workflow |
|---|---|
feature/* | feature-development |
fix/* | feature-development |
hotfix/* | security-audit |
release/* | launch-preparation |
perf/* | performance-optimization |
Commit Message Patterns#
| Prefix | Workflow |
|---|---|
feat: | feature-development |
fix: | feature-development |
security: | security-audit |
perf: | performance-optimization |
refactor: | performance-optimization |
File Change Patterns#
| Files | Workflow |
|---|---|
prisma/* | database-migration |
schema.prisma | database-migration |
src/api/* | api-development |
app/api/* | api-development |
Tag Patterns#
| Pattern | Workflow |
|---|---|
v* | launch-preparation |
release-* | launch-preparation |
Configuration#
Enable Autopilot#
1# Enable with defaults
2bootspring autopilot enable
3
4# Enable with auto-start (no confirmation needed)
5bootspring autopilot enable --auto-start
6
7# Check status
8bootspring autopilot statusConfiguration Options#
1// In bootspring.config.js
2module.exports = {
3 autopilot: {
4 enabled: true,
5 autoStart: false, // Require confirmation before starting
6 requireConfirmation: true, // Show suggestions before acting
7 ignoreBranches: ['main', 'master', 'develop'],
8 eventMapping: {
9 // Custom mappings
10 'branch:docs/*': 'documentation-workflow',
11 'commit:docs:': 'documentation-workflow',
12 }
13 }
14};Using Git Autopilot#
Viewing Suggestions#
When git events trigger suggestions:
1# Check for suggestions
2bootspring autopilot suggestions
3
4# Output:
5# Git Autopilot Suggestions:
6#
7# 1. feature-development (confidence: 0.8)
8# Trigger: branch 'feature/user-auth' matches 'feature/*'
9#
10# 2. database-migration (confidence: 0.6)
11# Trigger: file 'prisma/schema.prisma' modified
12#
13# Accept: bootspring autopilot accept feature-development
14# Dismiss: bootspring autopilot dismiss feature-developmentAccepting Suggestions#
1# Accept and start a suggested workflow
2bootspring autopilot accept feature-development
3
4# Output:
5# Started workflow: Feature Development
6# Current Phase: Design
7# Agents: ui-ux-expert, frontend-expert, api-expertDismissing Suggestions#
# Dismiss a suggestion
bootspring autopilot dismiss feature-developmentCustom Event Mappings#
Adding Mappings#
# Add a custom mapping
bootspring autopilot map "branch:docs/*" "documentation-workflow"
# Add commit prefix mapping
bootspring autopilot map "commit:test:" "testing-workflow"Removing Mappings#
# Remove a mapping
bootspring autopilot unmap "branch:docs/*"API Usage#
1const autopilot = require('bootspring/hooks/git-autopilot');
2
3// Enable autopilot
4autopilot.enable({ autoStart: false });
5
6// Analyze current git state
7const analysis = autopilot.analyzeGitState();
8// {
9// enabled: true,
10// branch: 'feature/new-feature',
11// suggestions: [
12// { trigger: 'branch', workflow: 'feature-development', confidence: 0.8 }
13// ]
14// }
15
16// Accept a suggestion
17autopilot.acceptSuggestion('feature-development');
18
19// Add custom mapping
20autopilot.addEventMapping('branch:custom/*', 'custom-workflow');
21
22// Get status
23autopilot.getStatus();Best Practices#
- Start with suggestions - Use
requireConfirmation: trueuntil you trust the mappings - Ignore protected branches - Keep main/master/develop in
ignoreBranches - Use conventional commits - Autopilot works best with consistent commit prefixes
- Review mappings regularly - Adjust as your workflow evolves
Troubleshooting#
No suggestions appearing#
- Check if autopilot is enabled:
bootspring autopilot status - Verify branch isn't in
ignoreBranches - Check if event patterns match your naming conventions
Wrong workflow suggested#
- Review the event mappings:
bootspring autopilot mappings - Add more specific patterns to override defaults