The Autopilot System
The Autopilot system is Hatcher's tactical automation framework that transforms complex development workflows into intelligent, executable recipes. Where Playbooks define the strategy (standards and patterns), Autopilots are the tactics that automate the implementation of those patterns with AI-powered intelligence.
What Are Autopilots?
Autopilots are structured workflows that combine:
- Task Automation: Multi-step processes executed with precision
- AI Intelligence: Context-aware decisions during execution
- Tool Integration: Seamless interaction with development tools
- Error Handling: Intelligent recovery from common issues
They are the "recipes" that know HOW to achieve what your Playbooks declare you WANT to achieve.
Autopilot Structure
A basic Autopilot follows this structure:
{
"name": "Create Vue Component",
"version": "1.0.0",
"description": "Generate a complete Vue 3 component with tests",
"inputs": [
{
"name": "componentName",
"type": "string",
"description": "Name of the component in PascalCase",
"required": true
},
{
"name": "useTypeScript",
"type": "boolean",
"description": "Use TypeScript",
"default": true
}
],
"steps": [
{
"name": "create-component",
"action": "file.create",
"path": "src/components/${componentName}.vue"
},
{
"name": "create-test",
"action": "file.create",
"path": "tests/${componentName}.spec.ts"
},
{
"name": "validate-quality",
"action": "run.action",
"name": "test:component"
}
]
}
Built-in Autopilots
Hatcher ships with powerful Autopilots for common development patterns:
Component Autopilots
- Create Component: Generate complete components with tests
- Extract Component: Refactor code into reusable components
- Update Props: Modify component interfaces safely
Refactoring Autopilots
- Extract Function: Pull logic into utility functions
- Rename Symbol: Safely rename across entire codebase
- Move Module: Relocate code with import updates
Testing Autopilots
- Generate Tests: Create test suites from implementation
- Update Snapshots: Refresh test snapshots intelligently
- Coverage Report: Analyze and improve test coverage
Documentation Autopilots
- Generate JSDoc: Add documentation from code analysis
- Update README: Keep documentation synchronized
- API Documentation: Generate API docs from code
Creating Custom Autopilots
Basic Workflow Autopilots
Create Autopilots for your team's specific workflows:
name: Setup New Feature
description: Initialize a new feature with all required structure
inputs:
- name: featureName
type: string
required: true
- name: includeTests
type: boolean
default: true
steps:
- name: Create feature directory
action: directory.create
path: src/features/${featureName}
- name: Generate index file
action: file.create
path: src/features/${featureName}/index.ts
template: feature-index
- name: Create component structure
action: run.autopilot
name: Create Vue Component
inputs:
componentName: ${featureName}View
- name: Setup routing
action: file.modify
path: src/router/index.ts
operation: add-route
route:
path: /${featureName}
component: ${featureName}View
- name: Validate with Actions
action: run.actions
actions: ["test:unit", "lint:check", "types:validate"]
AI-Enhanced Autopilots
Leverage AI for intelligent task execution:
name: Optimize Component Performance
description: Analyze and optimize Vue component performance
ai-mode: enhanced
steps:
- name: Analyze component
action: ai.analyze
prompt: |
Analyze this Vue component for performance issues:
- Unnecessary re-renders
- Missing memoization
- Inefficient computed properties
- Large bundle size
- name: Apply optimizations
action: ai.refactor
playbooks:
- vue-performance
- bundle-optimization
constraints:
- Maintain all existing functionality
- Keep TypeScript types intact
- Preserve component API
- name: Verify changes
action: run.actions
actions: ['test:component', 'performance:benchmark']
Autopilot Triggers
Manual Execution
Run Autopilots on demand:
hatcher run create-component --name UserProfile
File Watch Triggers
Execute Autopilots on file changes:
{
"triggers": [
{
"type": "file-change",
"pattern": "**/*.vue",
"autopilot": "update-component-docs"
}
]
}
Git Hook Integration
Automate Autopilots with Git workflows:
{
"triggers": [
{
"type": "pre-commit",
"autopilot": "format-and-lint"
},
{
"type": "post-merge",
"autopilot": "update-dependencies"
}
]
}
Autopilot Composition
Sequential Autopilots
Chain Autopilots for complex workflows:
name: Complete Feature Development
steps:
- action: run.autopilot
name: Create Component
- action: run.autopilot
name: Generate Tests
- action: run.autopilot
name: Update Documentation
- action: git.commit
message: 'feat: Add ${featureName} component'
- action: run.actions
name: Final Quality Gates
actions: ['coverage:verify', 'bundle:size']
Parallel Autopilots
Execute independent tasks simultaneously:
name: Project Setup
parallel: true
steps:
- action: npm.install
- action: generate.types
- action: setup.environment
Conditional Autopilots
Add logic to your workflows:
steps:
- name: Check TypeScript
action: config.check
key: useTypeScript
- name: Generate types
condition: ${steps.checkTypeScript.result}
action: typescript.generate
Error Handling
Retry Logic
Handle transient failures gracefully:
steps:
- name: API Setup
action: api.initialize
retry:
attempts: 3
delay: 1000
backoff: exponential
Fallback Autopilots
Provide alternative paths:
steps:
- name: Use npm
action: npm.install
fallback:
- action: yarn.install
- action: pnpm.install
Error Recovery
Clean up on failure:
steps:
- name: Database migration
action: db.migrate
onError:
- action: db.rollback
- action: notify.team
message: Migration failed
Autopilot Marketplace
Community Autopilots
Browse and install Autopilots from the community:
- Framework-specific: Optimized for React, Vue, Angular
- Tool integrations: Docker, Kubernetes, CI/CD
- Domain-specific: E-commerce, SaaS, Mobile
Publishing Autopilots
Share your Autopilots with the community:
hatcher autopilot publish my-awesome-workflow
Autopilot Versioning
- Semantic Versioning: Track compatibility
- Dependency Management: Handle Autopilot dependencies
- Update Notifications: Stay current with improvements
Configuration
Global Autopilots
Configure default Autopilots for all projects:
{
"globalAutopilots": [
"code-formatter",
"commit-validator",
"dependency-checker"
]
}
Project Autopilots
Define project-specific Autopilots in hatcher.config.json
:
{
"autopilots": {
"directory": "./autopilots",
"autoload": ["setup", "deploy"],
"aliases": {
"dev": "start-development",
"ship": "deploy-production"
}
}
}
Best Practices
Autopilot Design
- Single Responsibility: Each Autopilot should orchestrate one workflow well
- Idempotent: Autopilots should be safe to run multiple times
- Composable: Design Autopilots to work together
- Documented: Clear descriptions and examples
Performance
- Cache Results: Avoid redundant operations
- Parallel Execution: Use parallelism where possible
- Progressive Enhancement: Start simple, add complexity as needed
Security
- Input Validation: Verify all inputs before execution
- Sandboxed Execution: Run untrusted Autopilots safely
- Audit Logging: Track all Autopilot executions
Integration with Playbooks and Actions
Autopilots orchestrate between Playbooks (strategy) and Actions (validation):
name: Implement Feature
playbooks:
- vue3-typescript # The standards to follow
- team-standards # The patterns to use
steps:
- name: Generate component
action: ai.create
prompt: Create a Vue component following our standards
- name: Apply team patterns
action: playbook.apply
strict: true
- name: Validate with Actions
action: run.actions
actions:
- test:unit # Verify tests pass
- lint:check # Verify code quality
- coverage:verify # Verify test coverage
Monitoring and Analytics
Execution Tracking
Monitor Autopilot performance:
- Execution Time: Track duration and bottlenecks
- Success Rate: Monitor reliability
- Usage Patterns: Understand team workflows
Optimization Suggestions
AI-powered insights:
- Workflow Improvements: Suggest better Autopilot sequences
- Performance Tips: Identify optimization opportunities
- Pattern Detection: Discover automation opportunities
Future Features
Visual Autopilot Builder
Drag-and-drop interface for creating complex workflows without code.
AI Autopilot Generation
Automatically generate Autopilots by observing developer patterns.
Distributed Execution
Run Autopilots across multiple machines for massive parallelism.
Time Travel Debugging
Step through Autopilot execution history to debug complex workflows.
The Power of Tactical Automation
The Autopilot system transforms repetitive development tasks into intelligent, automated workflows that learn and improve over time. They are the tactical layer that bridges the gap between strategic Playbooks and validating Actions, creating a complete automation ecosystem that respects your standards while accelerating your development.
Remember: Playbooks define WHAT, Autopilots execute HOW, Actions validate IF.
Deploy Your First Autopilot
Automate complex workflows with intelligent, self-improving AI agents