Autopilot System
Autopilot systemは、複雑な開発ワークフローをインテリジェントで実行可能なレシピに変換するHatcherの戦術的自動化フレームワークです。Playbookが戦略(標準とパターン)を定義する一方で、AutopilotはAI駆動のインテリジェンスでそれらのパターンの実装を自動化する戦術です。
Autopilotとは何ですか?
Autopilotは、次のものを組み合わせた構造化されたワークフローです:
- タスク自動化:精度をもって実行される複数ステップのプロセス
- AIインテリジェンス:実行中の文脈を認識した決定
- ツール統合:開発ツールとのシームレスな相互作用
- エラー処理:一般的な問題からのインテリジェントな回復
それらは、あなたのPlaybookが達成したいと宣言するものをどのように達成するかを知っている「レシピ」です。
Autopilot構造
基本的なAutopilotは次の構造に従います:
{
"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"
}
]
}
組み込みAutopilot
Hatcherは、一般的な開発パターンのための強力なAutopilotを搭載しています:
Component Autopilots
- Create Component:テスト付きの完全なコンポーネントを生成
- Extract Component:コードを再利用可能なコンポーネントにリファクタリング
- Update Props:コンポーネントインターフェースを安全に変更
Refactoring Autopilots
- Extract Function:ロジックをユーティリティ関数に抽出
- Rename Symbol:コードベース全体で安全に名前変更
- Move Module:インポート更新でコードを再配置
Testing Autopilots
- Generate Tests:実装からテストスイートを作成
- Update Snapshots:テストスナップショットをインテリジェントにリフレッシュ
- Coverage Report:テストカバレッジを分析して改善
Documentation Autopilots
- Generate JSDoc:コード分析からドキュメントを追加
- Update README:ドキュメントを同期して保つ
- API Documentation:コードからAPIドキュメントを生成
カスタムAutopilotの作成
基本ワークフローAutopilot
チームの特定のワークフローのためのAutopilotを作成:
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強化Autopilot
インテリジェントなタスク実行のためにAIを活用:
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トリガー
手動実行
オンデマンドでAutopilotを実行:
hatcher run create-component --name UserProfile
ファイル監視トリガー
ファイル変更時にAutopilotを実行:
{
"triggers": [
{
"type": "file-change",
"pattern": "**/*.vue",
"autopilot": "update-component-docs"
}
]
}
Git Hook統合
Gitワークフローでオートパイロットを自動化:
{
"triggers": [
{
"type": "pre-commit",
"autopilot": "format-and-lint"
},
{
"type": "post-merge",
"autopilot": "update-dependencies"
}
]
}
Autopilot構成
順次Autopilot
複雑なワークフローのためにAutopilotをチェーン:
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']
並列Autopilot
独立したタスクを同時に実行:
name: Project Setup
parallel: true
steps:
- action: npm.install
- action: generate.types
- action: setup.environment
条件付きAutopilot
ワークフローにロジックを追加:
steps:
- name: Check TypeScript
action: config.check
key: useTypeScript
- name: Generate types
condition: ${steps.checkTypeScript.result}
action: typescript.generate
エラー処理
リトライロジック
一時的な失敗を優雅に処理:
steps:
- name: API Setup
action: api.initialize
retry:
attempts: 3
delay: 1000
backoff: exponential
フォールバックAutopilot
代替パスを提供:
steps:
- name: Use npm
action: npm.install
fallback:
- action: yarn.install
- action: pnpm.install
エラー回復
失敗時にクリーンアップ:
steps:
- name: Database migration
action: db.migrate
onError:
- action: db.rollback
- action: notify.team
message: Migration failed
Autopilot Marketplace
コミュニティAutopilot
コミュニティからAutopilotを閲覧してインストール:
- フレームワーク固有:React、Vue、Angular用に最適化
- ツール統合:Docker、Kubernetes、CI/CD
- ドメイン固有:eコマース、SaaS、モバイル
Autopilotの公開
コミュニティとあなたのAutopilotを共有:
hatcher autopilot publish my-awesome-workflow
Autopilotバージョン管理
- セマンティックバージョニング:互換性を追跡
- 依存関係管理:Autopilot依存関係を処理
- 更新通知:改善を最新に保つ
設定
グローバルAutopilot
すべてのプロジェクトのデフォルトAutopilotを設定:
{
"globalAutopilots": [
"code-formatter",
"commit-validator",
"dependency-checker"
]
}
プロジェクトAutopilot
hatcher.config.json
でプロジェクト固有のAutopilotを定義:
{
"autopilots": {
"directory": "./autopilots",
"autoload": ["setup", "deploy"],
"aliases": {
"dev": "start-development",
"ship": "deploy-production"
}
}
}
ベストプラクティス
Autopilot設計
- 単一責任:各Autopilotは1つのワークフローをうまくオーケストレートすべき
- 冪等性:Autopilotは複数回実行しても安全であるべき
- 構成可能性:Autopilotを一緒に動作するように設計
- 文書化:明確な説明と例
パフォーマンス
- 結果のキャッシュ:冗長な操作を避ける
- 並列実行:可能な場所で並列性を使用
- 漸進的強化:シンプルに始め、必要に応じて複雑さを追加
セキュリティ
- 入力検証:実行前にすべての入力を検証
- サンドボックス実行:信頼できないAutopilotを安全に実行
- 監査ログ:すべてのAutopilot実行を追跡
PlaybookとActionsとの統合
Autopilotは、Playbook(戦略)とActions(検証)の間でオーケストレート:
name: Implement Feature
playbooks:
- vue3-typescript # 従うべき標準
- team-standards # 使用するパターン
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 # テストが通ることを検証
- lint:check # コード品質を検証
- coverage:verify # テストカバレッジを検証
モニタリングと分析
実行追跡
Autopilotパフォーマンスを監視:
- 実行時間:期間とボトルネックを追跡
- 成功率:信頼性を監視
- 使用パターン:チームワークフローを理解
最適化提案
AI駆動のインサイト:
- ワークフローの改善:より良いAutopilotシーケンスを提案
- パフォーマンスのヒント:最適化の機会を特定
- パターン検出:自動化の機会を発見
将来の機能
ビジュアルAutopilotビルダー
コードなしで複雑なワークフローを作成するためのドラッグアンドドロップインターフェース。
AI Autopilot生成
開発者のパターンを観察することで自動的にAutopilotを生成。
分散実行
大規模な並列性のために複数のマシン間でAutopilotを実行。
タイムトラベルデバッグ
複雑なワークフローをデバッグするためにAutopilot実行履歴をステップスルー。
戦術的自動化の力
Autopilot systemは、反復的な開発タスクを時間とともに学習して改善するインテリジェントで自動化されたワークフローに変換します。それらは、戦略的PlaybookとActionsを検証する間のギャップを埋める戦術レイヤーであり、あなたの標準を尊重しながら開発を加速する完全な自動化エコシステムを作成します。
覚えておいてください:PlaybookはWHATを定義し、AutopilotはHOWを実行し、ActionsはIFを検証します。
最初のAutopilotを展開
インテリジェントで自己改善するAIエージェントで複雑なワークフローを自動化