ultrapilot

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Ultrapilot Skill

Ultrapilot Skill

Parallel autopilot that spawns multiple workers with file ownership partitioning for maximum speed.
这是一款并行Autopilot工具,通过生成多个工作进程并结合文件所有权划分,实现最高执行速度。

Overview

概述

Ultrapilot is the parallel evolution of autopilot. It decomposes your task into independent parallelizable subtasks, assigns non-overlapping file sets to each worker, and runs them simultaneously.
Key Capabilities:
  1. Decomposes task into parallel-safe components
  2. Partitions files with exclusive ownership (no conflicts)
  3. Spawns up to 20 parallel workers
  4. Coordinates progress via TaskOutput
  5. Integrates changes with sequential handling of shared files
  6. Validates full system integrity
Speed Multiplier: Up to 5x faster than sequential autopilot for suitable tasks.
Ultrapilot是Autopilot的并行演进版本。它将你的任务分解为独立的可并行子任务,为每个工作进程分配无重叠的文件集,并同时运行它们。
核心功能:
  1. 分解任务为支持并行的组件
  2. 划分文件并设置专属所有权(无冲突)
  3. 生成最多20个并行工作进程
  4. 通过TaskOutput协调进度
  5. 整合变更,对共享文件进行顺序处理
  6. 验证整个系统的完整性
速度提升: 对于适用任务,比串行Autopilot快高达5倍。

Usage

使用方法

/oh-my-claudecode:ultrapilot <your task>
/oh-my-claudecode:up "Build a full-stack todo app"
/oh-my-claudecode:ultrapilot Refactor the entire backend
/oh-my-claudecode:ultrapilot <你的任务>
/oh-my-claudecode:up "构建全栈待办事项应用"
/oh-my-claudecode:ultrapilot 重构整个后端

Magic Keywords

触发关键词

These phrases auto-activate ultrapilot:
  • "ultrapilot", "ultra pilot"
  • "parallel build", "parallel autopilot"
  • "swarm build", "swarm mode"
  • "fast parallel", "ultra fast"
以下短语会自动激活ultrapilot:
  • "ultrapilot", "ultra pilot"
  • "parallel build", "parallel autopilot"
  • "swarm build", "swarm mode"
  • "fast parallel", "ultra fast"

When to Use

适用场景

Ultrapilot Excels At:
  • Multi-component systems (frontend + backend + database)
  • Independent feature additions across different modules
  • Large refactorings with clear module boundaries
  • Parallel test file generation
  • Multi-service architectures
Autopilot Better For:
  • Single-threaded sequential tasks
  • Heavy interdependencies between components
  • Tasks requiring constant integration checks
  • Small focused features in a single module
Ultrapilot擅长处理:
  • 多组件系统(前端+后端+数据库)
  • 跨不同模块的独立功能添加
  • 模块边界清晰的大型重构
  • 并行测试文件生成
  • 多服务架构
Autopilot更适合:
  • 单线程串行任务
  • 组件间高度依赖的任务
  • 需要持续集成检查的任务
  • 单个模块中的小型聚焦功能

Architecture

架构

User Input: "Build a full-stack todo app"
           |
           v
  [ULTRAPILOT COORDINATOR]
           |
   Decomposition + File Partitioning
           |
   +-------+-------+-------+-------+
   |       |       |       |       |
   v       v       v       v       v
[W-1]   [W-2]   [W-3]   [W-4]   [W-5]
backend frontend database api-docs tests
(src/  (src/   (src/    (docs/)  (tests/)
 api/)  ui/)    db/)
   |       |       |       |       |
   +---+---+---+---+---+---+---+---+
       |
       v
  [INTEGRATION PHASE]
  (shared files: package.json, tsconfig.json, etc.)
       |
       v
  [VALIDATION PHASE]
  (full system test)
用户输入: "构建全栈待办事项应用"
           |
           v
  [ULTRAPILOT COORDINATOR]
           |
   任务分解 + 文件划分
           |
   +-------+-------+-------+-------+
   |       |       |       |       |
   v       v       v       v       v
[W-1]   [W-2]   [W-3]   [W-4]   [W-5]
后端     前端     数据库   API文档  测试
(src/  (src/   (src/    (docs/)  (tests/)
 api/)  ui/)    db/)
   |       |       |       |       |
   +---+---+---+---+---+---+---+---+
       |
       v
  [集成阶段]
  (共享文件: package.json, tsconfig.json 等)
       |
       v
  [验证阶段]
  (全系统测试)

Phases

执行阶段

Phase 0: Task Analysis

阶段0:任务分析

Goal: Determine if task is parallelizable
Checks:
  • Can task be split into 2+ independent subtasks?
  • Are file boundaries clear?
  • Are dependencies minimal?
Output: Go/No-Go decision (falls back to autopilot if unsuitable)
目标: 判断任务是否可并行执行
检查项:
  • 任务能否拆分为2个及以上独立子任务?
  • 文件边界是否清晰?
  • 依赖是否最少?
输出: 执行/不执行的决策(若不适合则自动切换到Autopilot)

Phase 1: Decomposition

阶段1:任务分解

Goal: Break task into parallel-safe subtasks
Agent: Architect (Opus)
Method: AI-Powered Task Decomposition
Ultrapilot uses the
decomposer
module to generate intelligent task breakdowns:
typescript
import {
  generateDecompositionPrompt,
  parseDecompositionResult,
  validateFileOwnership,
  extractSharedFiles
} from 'src/hooks/ultrapilot/decomposer';

// 1. Generate prompt for Architect
const prompt = generateDecompositionPrompt(task, codebaseContext, {
  maxSubtasks: 5,
  preferredModel: 'sonnet'
});

// 2. Call Architect agent
const response = await Task({
  subagent_type: 'oh-my-claudecode:architect',
  model: 'opus',
  prompt
});

// 3. Parse structured result
const result = parseDecompositionResult(response);

// 4. Validate no file conflicts
const { isValid, conflicts } = validateFileOwnership(result.subtasks);

// 5. Extract shared files from subtasks
const finalResult = extractSharedFiles(result);
Process:
  1. Analyze task requirements via Architect agent
  2. Identify independent components with file boundaries
  3. Assign agent type (executor-low/executor/executor-high) per complexity
  4. Map dependencies between subtasks (blockedBy)
  5. Generate parallel execution groups
  6. Identify shared files (handled by coordinator)
Output: Structured
DecompositionResult
:
json
{
  "subtasks": [
    {
      "id": "1",
      "description": "Backend API routes",
      "files": ["src/api/routes.ts", "src/api/handlers.ts"],
      "blockedBy": [],
      "agentType": "executor",
      "model": "sonnet"
    },
    {
      "id": "2",
      "description": "Frontend components",
      "files": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
      "blockedBy": [],
      "agentType": "executor",
      "model": "sonnet"
    },
    {
      "id": "3",
      "description": "Wire frontend to backend",
      "files": ["src/client/api.ts"],
      "blockedBy": ["1", "2"],
      "agentType": "executor-low",
      "model": "haiku"
    }
  ],
  "sharedFiles": [
    "package.json",
    "tsconfig.json",
    "README.md"
  ],
  "parallelGroups": [["1", "2"], ["3"]]
}
Decomposition Types:
TypeDescriptionUse Case
DecomposedTask
Full task with id, files, blockedBy, agentType, modelIntelligent worker spawning
DecompositionResult
Complete result with subtasks, sharedFiles, parallelGroupsFull decomposition output
toSimpleSubtasks()
Convert to string[] for legacy compatibilitySimple task lists
目标: 将任务拆分为支持并行的子任务
Agent: Architect(Opus)
方法: AI驱动的任务分解
Ultrapilot使用
decomposer
模块生成智能任务拆分结果:
typescript
import {
  generateDecompositionPrompt,
  parseDecompositionResult,
  validateFileOwnership,
  extractSharedFiles
} from 'src/hooks/ultrapilot/decomposer';

// 1. 为Architect生成提示词
const prompt = generateDecompositionPrompt(task, codebaseContext, {
  maxSubtasks: 5,
  preferredModel: 'sonnet'
});

// 2. 调用Architect agent
const response = await Task({
  subagent_type: 'oh-my-claudecode:architect',
  model: 'opus',
  prompt
});

// 3. 解析结构化结果
const result = parseDecompositionResult(response);

// 4. 验证无文件冲突
const { isValid, conflicts } = validateFileOwnership(result.subtasks);

// 5. 从子任务中提取共享文件
const finalResult = extractSharedFiles(result);
流程:
  1. 通过Architect agent分析任务需求
  2. 识别带有文件边界的独立组件
  3. 根据复杂度分配agent类型(executor-low/executor/executor-high)
  4. 映射子任务之间的依赖关系(blockedBy)
  5. 生成并行执行组
  6. 识别共享文件(由协调器处理)
输出: 结构化的
DecompositionResult
json
{
  "subtasks": [
    {
      "id": "1",
      "description": "Backend API routes",
      "files": ["src/api/routes.ts", "src/api/handlers.ts"],
      "blockedBy": [],
      "agentType": "executor",
      "model": "sonnet"
    },
    {
      "id": "2",
      "description": "Frontend components",
      "files": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
      "blockedBy": [],
      "agentType": "executor",
      "model": "sonnet"
    },
    {
      "id": "3",
      "description": "Wire frontend to backend",
      "files": ["src/client/api.ts"],
      "blockedBy": ["1", "2"],
      "agentType": "executor-low",
      "model": "haiku"
    }
  ],
  "sharedFiles": [
    "package.json",
    "tsconfig.json",
    "README.md"
  ],
  "parallelGroups": [["1", "2"], ["3"]]
}
分解类型:
类型描述适用场景
DecomposedTask
包含id、文件、blockedBy、agentType、model的完整任务智能工作进程生成
DecompositionResult
包含子任务、共享文件、并行组的完整结果全部分解输出
toSimpleSubtasks()
转换为string[]以兼容旧版本简单任务列表

Phase 2: File Ownership Partitioning

阶段2:文件所有权划分

Goal: Assign exclusive file sets to workers
Rules:
  1. Exclusive ownership - No file in multiple worker sets
  2. Shared files deferred - Handled sequentially in integration
  3. Boundary files tracked - Files that import across boundaries
Data Structure:
.omc/state/ultrapilot-ownership.json
json
{
  "sessionId": "ultrapilot-20260123-1234",
  "workers": {
    "worker-1": {
      "ownedFiles": ["src/api/routes.ts", "src/api/handlers.ts"],
      "ownedGlobs": ["src/api/**"],
      "boundaryImports": ["src/types.ts"]
    },
    "worker-2": {
      "ownedFiles": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
      "ownedGlobs": ["src/ui/**"],
      "boundaryImports": ["src/types.ts"]
    }
  },
  "sharedFiles": ["package.json", "tsconfig.json", "src/types.ts"],
  "conflictPolicy": "coordinator-handles"
}
目标: 为每个工作进程分配专属文件集
规则:
  1. 专属所有权 - 无文件被多个工作进程共享
  2. 共享文件延迟处理 - 在集成阶段进行顺序处理
  3. 边界文件跟踪 - 跟踪跨边界导入的文件
数据结构:
.omc/state/ultrapilot-ownership.json
json
{
  "sessionId": "ultrapilot-20260123-1234",
  "workers": {
    "worker-1": {
      "ownedFiles": ["src/api/routes.ts", "src/api/handlers.ts"],
      "ownedGlobs": ["src/api/**"],
      "boundaryImports": ["src/types.ts"]
    },
    "worker-2": {
      "ownedFiles": ["src/ui/App.tsx", "src/ui/TodoList.tsx"],
      "ownedGlobs": ["src/ui/**"],
      "boundaryImports": ["src/types.ts"]
    }
  },
  "sharedFiles": ["package.json", "tsconfig.json", "src/types.ts"],
  "conflictPolicy": "coordinator-handles"
}

Phase 3: Parallel Execution

阶段3:并行执行

Goal: Run all workers simultaneously
Spawn Workers:
javascript
// Pseudocode
workers = [];
for (subtask in decomposition.subtasks) {
  workers.push(
    Task(
      subagent_type: "oh-my-claudecode:executor",
      model: "sonnet",
      prompt: `ULTRAPILOT WORKER ${subtask.id}

Your exclusive file ownership: ${subtask.files}

Task: ${subtask.description}

CRITICAL RULES:
1. ONLY modify files in your ownership set
2. If you need to modify a shared file, document the change in your output
3. Do NOT create new files outside your ownership
4. Track all imports from boundary files

Deliver: Code changes + list of boundary dependencies`,
      run_in_background: true
    )
  );
}
Monitoring:
  • Poll TaskOutput for each worker
  • Track completion status
  • Detect conflicts early
  • Accumulate boundary dependencies
Max Workers: 5 (Claude Code limit)
目标: 同时运行所有工作进程
生成工作进程:
javascript
// 伪代码
workers = [];
for (subtask in decomposition.subtasks) {
  workers.push(
    Task(
      subagent_type: "oh-my-claudecode:executor",
      model: "sonnet",
      prompt: `ULTRAPILOT WORKER ${subtask.id}

Your exclusive file ownership: ${subtask.files}

Task: ${subtask.description}

CRITICAL RULES:
1. ONLY modify files in your ownership set
2. If you need to modify a shared file, document the change in your output
3. Do NOT create new files outside your ownership
4. Track all imports from boundary files

Deliver: Code changes + list of boundary dependencies`,
      run_in_background: true
    )
  );
}
监控:
  • 轮询每个工作进程的TaskOutput
  • 跟踪完成状态
  • 提前检测冲突
  • 累积边界依赖
最大工作进程数: 5(Claude Code限制)

Phase 4: Integration

阶段4:集成

Goal: Merge all worker changes and handle shared files
Process:
  1. Collect outputs - Gather all worker deliverables
  2. Detect conflicts - Check for unexpected overlaps
  3. Handle shared files - Sequential updates to package.json, etc.
  4. Integrate boundary files - Merge type definitions, shared utilities
  5. Resolve imports - Ensure cross-boundary imports are valid
Agent: Executor (Sonnet) - sequential processing
Conflict Resolution:
  • If workers unexpectedly touched same file → manual merge
  • If shared file needs multiple changes → sequential apply
  • If boundary file changed → validate all dependent workers
目标: 合并所有工作进程的变更并处理共享文件
流程:
  1. 收集输出 - 收集所有工作进程的交付成果
  2. 检测冲突 - 检查是否存在意外重叠
  3. 处理共享文件 - 对package.json等文件进行顺序更新
  4. 整合边界文件 - 合并类型定义、共享工具类
  5. 解析导入 - 确保跨边界导入有效
Agent: Executor(Sonnet)- 顺序处理
冲突解决:
  • 若多个工作进程意外修改了同一文件 → 手动合并
  • 若共享文件需要多处修改 → 顺序应用
  • 若边界文件被修改 → 验证所有依赖该文件的工作进程

Phase 5: Validation

阶段5:验证

Goal: Verify integrated system works
Checks (parallel):
  1. Build - Run the project's build command
  2. Lint - Run the project's lint command
  3. Type check - Run the project's type check command
  4. Unit tests - All tests pass
  5. Integration tests - Cross-component tests
Agents (parallel):
  • Build-fixer (Sonnet) - Fix build errors
  • Architect (Opus) - Functional completeness
  • Security-reviewer (Opus) - Cross-component vulnerabilities
Retry Policy: Up to 3 validation rounds. If failures persist, detailed error report to user.
目标: 验证集成后的系统可正常运行
并行检查项:
  1. 构建 - 运行项目的构建命令
  2. 代码检查 - 运行项目的Lint命令
  3. 类型检查 - 运行项目的类型检查命令
  4. 单元测试 - 所有测试通过
  5. 集成测试 - 跨组件测试
Agent(并行):
  • Build-fixer(Sonnet)- 修复构建错误
  • Architect(Opus)- 功能完整性检查
  • Security-reviewer(Opus)- 跨组件漏洞检查
重试策略: 最多3轮验证。若持续失败,向用户发送详细错误报告。

State Management

状态管理

Session State

会话状态

Location:
.omc/ultrapilot-state.json
json
{
  "sessionId": "ultrapilot-20260123-1234",
  "taskDescription": "Build a full-stack todo app",
  "phase": "execution",
  "startTime": "2026-01-23T10:30:00Z",
  "decomposition": { /* from Phase 1 */ },
  "workers": {
    "worker-1": {
      "status": "running",
      "taskId": "task-abc123",
      "startTime": "2026-01-23T10:31:00Z",
      "estimatedDuration": "5m"
    }
  },
  "conflicts": [],
  "validationAttempts": 0
}
位置:
.omc/ultrapilot-state.json
json
{
  "sessionId": "ultrapilot-20260123-1234",
  "taskDescription": "Build a full-stack todo app",
  "phase": "execution",
  "startTime": "2026-01-23T10:30:00Z",
  "decomposition": { /* 来自阶段1 */ },
  "workers": {
    "worker-1": {
      "status": "running",
      "taskId": "task-abc123",
      "startTime": "2026-01-23T10:31:00Z",
      "estimatedDuration": "5m"
    }
  },
  "conflicts": [],
  "validationAttempts": 0
}

File Ownership Map

文件所有权映射

Location:
.omc/state/ultrapilot-ownership.json
Tracks which worker owns which files (see Phase 2 example above).
位置:
.omc/state/ultrapilot-ownership.json
跟踪每个工作进程拥有的文件(见阶段2示例)。

Progress Tracking

进度跟踪

Location:
.omc/ultrapilot/progress.json
json
{
  "totalWorkers": 5,
  "completedWorkers": 3,
  "activeWorkers": 2,
  "failedWorkers": 0,
  "estimatedTimeRemaining": "2m30s"
}
位置:
.omc/ultrapilot/progress.json
json
{
  "totalWorkers": 5,
  "completedWorkers": 3,
  "activeWorkers": 2,
  "failedWorkers": 0,
  "estimatedTimeRemaining": "2m30s"
}

Configuration

配置

Optional settings in
.claude/settings.json
:
json
{
  "omc": {
    "ultrapilot": {
      "maxWorkers": 5,
      "maxValidationRounds": 3,
      "conflictPolicy": "coordinator-handles",
      "fallbackToAutopilot": true,
      "parallelThreshold": 2,
      "pauseAfterDecomposition": false,
      "verboseProgress": true
    }
  }
}
Settings Explained:
  • maxWorkers
    - Max parallel workers (5 is Claude Code limit)
  • maxValidationRounds
    - Validation retry attempts
  • conflictPolicy
    - "coordinator-handles" or "abort-on-conflict"
  • fallbackToAutopilot
    - Auto-switch if task not parallelizable
  • parallelThreshold
    - Min subtasks to use ultrapilot (else fallback)
  • pauseAfterDecomposition
    - Confirm with user before execution
  • verboseProgress
    - Show detailed worker progress
可在
.claude/settings.json
中设置可选配置:
json
{
  "omc": {
    "ultrapilot": {
      "maxWorkers": 5,
      "maxValidationRounds": 3,
      "conflictPolicy": "coordinator-handles",
      "fallbackToAutopilot": true,
      "parallelThreshold": 2,
      "pauseAfterDecomposition": false,
      "verboseProgress": true
    }
  }
}
配置说明:
  • maxWorkers
    - 最大并行工作进程数(5为Claude Code限制)
  • maxValidationRounds
    - 验证重试次数
  • conflictPolicy
    - "coordinator-handles" 或 "abort-on-conflict"
  • fallbackToAutopilot
    - 若任务不可并行,自动切换到Autopilot
  • parallelThreshold
    - 使用ultrapilot的最小子任务数(否则回退)
  • pauseAfterDecomposition
    - 执行前需用户确认
  • verboseProgress
    - 显示详细的工作进程进度

Cancellation

取消

/oh-my-claudecode:cancel
Or say: "stop", "cancel ultrapilot", "abort"
Behavior:
  • All active workers gracefully terminated
  • Partial progress saved to state file
  • Session can be resumed
/oh-my-claudecode:cancel
或说出:"stop", "cancel ultrapilot", "abort"
行为:
  • 所有活跃工作进程优雅终止
  • 部分进度保存到状态文件
  • 会话可恢复

Resume

恢复

If ultrapilot was cancelled or a worker failed:
/oh-my-claudecode:ultrapilot resume
Resume Logic:
  • Restart failed workers only
  • Re-use completed worker outputs
  • Continue from last phase
若ultrapilot被取消或某个工作进程失败:
/oh-my-claudecode:ultrapilot resume
恢复逻辑:
  • 仅重启失败的工作进程
  • 复用已完成工作进程的输出
  • 从最后一个阶段继续

Examples

示例

Example 1: Full-Stack App

示例1:全栈应用

/oh-my-claudecode:ultrapilot Build a todo app with React frontend, Express backend, and PostgreSQL database
Workers:
  1. Frontend (src/client/)
  2. Backend (src/server/)
  3. Database (src/db/)
  4. Tests (tests/)
  5. Docs (docs/)
Shared Files: package.json, docker-compose.yml, README.md
Duration: ~15 minutes (vs ~75 minutes sequential)
/oh-my-claudecode:ultrapilot Build a todo app with React frontend, Express backend, and PostgreSQL database
工作进程:
  1. 前端(src/client/)
  2. 后端(src/server/)
  3. 数据库(src/db/)
  4. 测试(tests/)
  5. 文档(docs/)
共享文件: package.json, docker-compose.yml, README.md
耗时: ~15分钟(串行Autopilot约需75分钟)

Example 2: Multi-Service Refactor

示例2:多服务重构

/oh-my-claudecode:up Refactor all services to use dependency injection
Workers:
  1. Auth service
  2. User service
  3. Payment service
  4. Notification service
Shared Files: src/types/services.ts, tsconfig.json
Duration: ~8 minutes (vs ~32 minutes sequential)
/oh-my-claudecode:up Refactor all services to use dependency injection
工作进程:
  1. 认证服务
  2. 用户服务
  3. 支付服务
  4. 通知服务
共享文件: src/types/services.ts, tsconfig.json
耗时: ~8分钟(串行Autopilot约需32分钟)

Example 3: Test Coverage

示例3:测试覆盖率

/oh-my-claudecode:ultrapilot Generate tests for all untested modules
Workers:
  1. API tests
  2. UI component tests
  3. Database tests
  4. Utility tests
  5. Integration tests
Shared Files: jest.config.js, test-utils.ts
Duration: ~10 minutes (vs ~50 minutes sequential)
/oh-my-claudecode:ultrapilot Generate tests for all untested modules
工作进程:
  1. API测试
  2. UI组件测试
  3. 数据库测试
  4. 工具类测试
  5. 集成测试
共享文件: jest.config.js, test-utils.ts
耗时: ~10分钟(串行Autopilot约需50分钟)

Best Practices

最佳实践

  1. Clear module boundaries - Works best with well-separated code
  2. Minimal shared state - Reduces integration complexity
  3. Trust the decomposition - Architect knows what's parallel-safe
  4. Monitor progress - Check
    .omc/ultrapilot/progress.json
  5. Review conflicts early - Don't wait until integration
  1. 清晰的模块边界 - 在代码结构良好的项目中效果最佳
  2. 最小化共享状态 - 降低集成复杂度
  3. 信任分解结果 - Architect知晓哪些任务支持并行
  4. 监控进度 - 查看
    .omc/ultrapilot/progress.json
  5. 尽早审查冲突 - 不要等到集成阶段

File Ownership Strategy

文件所有权策略

Ownership Types

所有权类型

Exclusive Ownership:
  • Worker has sole write access
  • No other worker can touch these files
  • Worker can create new files in owned directories
Shared Files:
  • No worker has exclusive access
  • Handled sequentially in integration phase
  • Includes: package.json, tsconfig.json, config files, root README
Boundary Files:
  • Can be read by all workers
  • Write access determined by usage analysis
  • Typically: type definitions, shared utilities, interfaces
专属所有权:
  • 工作进程拥有唯一写入权限
  • 其他工作进程无法修改这些文件
  • 工作进程可在所属目录中创建新文件
共享文件:
  • 无工作进程拥有专属权限
  • 在集成阶段进行顺序处理
  • 包括:package.json、tsconfig.json、配置文件、根目录README
边界文件:
  • 所有工作进程均可读取
  • 写入权限由使用分析决定
  • 通常包括:类型定义、共享工具类、接口

Ownership Detection Algorithm

所有权检测算法

For each file in codebase:
  If file in shared_patterns (package.json, *.config.js):
    → sharedFiles

  Else if file imported by 2+ subtask modules:
    → boundaryFiles
    → Assign to most relevant worker OR defer to shared

  Else if file in subtask directory:
    → Assign to subtask worker

  Else:
    → sharedFiles (safe default)
对于代码库中的每个文件:
  如果文件属于shared_patterns(package.json、*.config.js):
    → 标记为sharedFiles

  否则如果文件被2个及以上子任务模块导入:
    → 标记为boundaryFiles
    → 分配给最相关的工作进程或延迟到共享处理

  否则如果文件属于子任务目录:
    → 分配给该子任务的工作进程

  否则:
    → 标记为sharedFiles(安全默认)

Shared File Patterns

共享文件模式

Automatically classified as shared:
  • package.json
    ,
    package-lock.json
  • tsconfig.json
    ,
    *.config.js
    ,
    *.config.ts
  • .eslintrc.*
    ,
    .prettierrc.*
  • README.md
    ,
    CONTRIBUTING.md
    ,
    LICENSE
  • Docker files:
    Dockerfile
    ,
    docker-compose.yml
  • CI files:
    .github/**
    ,
    .gitlab-ci.yml
自动归类为共享文件的类型:
  • package.json
    ,
    package-lock.json
  • tsconfig.json
    ,
    *.config.js
    ,
    *.config.ts
  • .eslintrc.*
    ,
    .prettierrc.*
  • README.md
    ,
    CONTRIBUTING.md
    ,
    LICENSE
  • Docker文件:
    Dockerfile
    ,
    docker-compose.yml
  • CI文件:
    .github/**
    ,
    .gitlab-ci.yml

Conflict Handling

冲突处理

Conflict Types

冲突类型

Unexpected Overlap:
  • Two workers modified the same file
  • Resolution: Coordinator merges with human confirmation
Shared File Contention:
  • Multiple workers need to update package.json
  • Resolution: Sequential application in integration phase
Boundary File Conflict:
  • Type definition needed by multiple workers
  • Resolution: First worker creates, others import
意外重叠:
  • 两个工作进程修改了同一文件
  • 解决方式: 协调器尝试自动合并,若复杂则交由用户确认
共享文件竞争:
  • 多个工作进程需要更新package.json
  • 解决方式: 在集成阶段顺序应用变更
边界文件冲突:
  • 多个工作进程需要修改同一类型定义
  • 解决方式: 第一个工作进程创建,其他工作进程导入

Conflict Policy

冲突策略

coordinator-handles (default):
  • Coordinator attempts automatic merge
  • Falls back to user if complex
abort-on-conflict:
  • Any conflict immediately cancels ultrapilot
  • User reviews conflict report
  • Can resume after manual fix
coordinator-handles(默认):
  • 协调器尝试自动合并
  • 若冲突复杂则回退给用户
abort-on-conflict:
  • 任何冲突立即取消ultrapilot
  • 用户查看冲突报告
  • 手动修复后可恢复

Troubleshooting

故障排除

Decomposition fails?
  • Task may be too coupled
  • Fallback to autopilot triggered automatically
  • Review
    .omc/ultrapilot/decomposition.json
    for details
Worker hangs?
  • Check worker logs in
    .omc/logs/ultrapilot-worker-N.log
  • Cancel and restart that worker
  • May indicate file ownership issue
Integration conflicts?
  • Review
    .omc/ultrapilot-state.json
    conflicts array
  • Check if shared files were unexpectedly modified
  • Adjust ownership rules if needed
Validation loops?
  • Cross-component integration issue
  • Review boundary imports
  • May need sequential retry with full context
Too slow?
  • Check if workers are truly independent
  • Review decomposition quality
  • Consider if autopilot would be faster (high interdependency)
分解失败?
  • 任务可能耦合度过高
  • 会自动切换到Autopilot
  • 查看
    .omc/ultrapilot/decomposition.json
    获取详情
工作进程挂起?
  • 查看
    .omc/logs/ultrapilot-worker-N.log
    中的工作进程日志
  • 取消并重启该工作进程
  • 可能是文件所有权问题导致
集成冲突?
  • 查看
    .omc/ultrapilot-state.json
    中的conflicts数组
  • 检查共享文件是否被意外修改
  • 必要时调整所有权规则
验证循环?
  • 跨组件集成问题
  • 审查边界导入
  • 可能需要在完整上下文下进行串行重试
速度太慢?
  • 检查工作进程是否真的独立
  • 审查分解质量
  • 考虑是否Autopilot更快(高依赖场景)

Differences from Autopilot

与Autopilot的差异

FeatureAutopilotUltrapilot
ExecutionSequentialParallel (up to 5x)
Best ForSingle-threaded tasksMulti-component systems
ComplexityLowerHigher
SpeedStandard3-5x faster (suitable tasks)
File ConflictsN/AOwnership partitioning
FallbackN/ACan fallback to autopilot
SetupInstantDecomposition phase (~1-2 min)
Rule of Thumb: If task has 3+ independent components, use ultrapilot. Otherwise, use autopilot.
特性AutopilotUltrapilot
执行方式串行并行(最高5倍速)
最佳场景单线程任务多组件系统
复杂度
速度标准快3-5倍(适用任务)
文件冲突所有权划分解决
回退机制可回退到Autopilot
启动时间即时分解阶段(约1-2分钟)
经验法则: 若任务包含3个及以上独立组件,使用ultrapilot;否则使用Autopilot。

Advanced: Custom Decomposition

高级:自定义分解

You can provide a custom decomposition file to skip Phase 1:
Location:
.omc/ultrapilot/custom-decomposition.json
json
{
  "subtasks": [
    {
      "id": "worker-auth",
      "description": "Add OAuth2 authentication",
      "files": ["src/auth/**", "src/middleware/auth.ts"],
      "dependencies": ["src/types/user.ts"]
    },
    {
      "id": "worker-db",
      "description": "Add user table and migrations",
      "files": ["src/db/migrations/**", "src/db/models/user.ts"],
      "dependencies": []
    }
  ],
  "sharedFiles": ["package.json", "src/types/user.ts"]
}
Then run:
/oh-my-claudecode:ultrapilot --custom-decomposition
你可提供自定义分解文件以跳过阶段1:
位置:
.omc/ultrapilot/custom-decomposition.json
json
{
  "subtasks": [
    {
      "id": "worker-auth",
      "description": "Add OAuth2 authentication",
      "files": ["src/auth/**", "src/middleware/auth.ts"],
      "dependencies": ["src/types/user.ts"]
    },
    {
      "id": "worker-db",
      "description": "Add user table and migrations",
      "files": ["src/db/migrations/**", "src/db/models/user.ts"],
      "dependencies": []
    }
  ],
  "sharedFiles": ["package.json", "src/types/user.ts"]
}
然后运行:
/oh-my-claudecode:ultrapilot --custom-decomposition

STATE CLEANUP ON COMPLETION

完成后的状态清理

IMPORTANT: Delete state files on completion - do NOT just set
active: false
When all workers complete successfully:
bash
undefined
重要提示: 完成后请删除状态文件 - 不要仅设置
active: false
当所有工作进程成功完成后:
bash
undefined

Delete ultrapilot state files

删除ultrapilot状态文件

rm -f .omc/state/ultrapilot-state.json rm -f .omc/state/ultrapilot-ownership.json
undefined
rm -f .omc/state/ultrapilot-state.json rm -f .omc/state/ultrapilot-ownership.json
undefined

Future Enhancements

未来规划

Planned for v4.1:
  • Dynamic worker scaling (start with 2, spawn more if needed)
  • Predictive conflict detection (pre-integration analysis)
  • Worker-to-worker communication (for rare dependencies)
  • Speculative execution (optimistic parallelism)
  • Resume from integration phase (if validation fails)
Planned for v4.2:
  • Multi-machine distribution (if Claude Code supports)
  • Real-time progress dashboard
  • Worker performance analytics
  • Auto-tuning of decomposition strategy
v4.1版本计划:
  • 动态工作进程扩展(从2个开始,按需生成更多)
  • 预测性冲突检测(集成前分析)
  • 工作进程间通信(处理罕见依赖)
  • 推测执行(乐观并行)
  • 从集成阶段恢复(若验证失败)
v4.2版本计划:
  • 多机器分布式执行(若Claude Code支持)
  • 实时进度仪表盘
  • 工作进程性能分析
  • 分解策略自动调优