Native implementation of oh-my-opencode-style orchestration using OpenClaw's tools.
skills/speckit-swarm/
├── SKILL.md # This file
├── src/
│ ├── ultrawork.ts # Ultrawork detection & trigger
│ ├── personas/
│ │ ├── mod.ts # Persona exports
│ │ ├── sisyphus.ts # Main orchestrator
│ │ ├── hephaestus.ts # Deep worker
│ │ ├── oracle.ts # Design/debug
│ │ ├── librarian.ts # Research/docs
│ │ └── explore.ts # Fast scout
│ ├── planner.ts # Task decomposition
│ └── index.ts # Main entry
# Use personas directly
sessions_spawn task:"..." model:"minimax-m2.5" thinking:"high"
When user includes "ulw" or "ultrawork":
import { PERSONAS, buildTaskPrompt } from './speckit-swarm';
const persona = PERSONAS.hephaestus;
const task = "Fix the login bug in auth.ts";
sessions_spawn({
task: buildTaskPrompt({ task, persona: 'hephaestus' }),
model: persona.config.model,
thinking: persona.config.thinking
});
When user includes "ulw" or "ultrawork":
import { planTask, shouldUseUltrawork } from './speckit-swarm';
const task = "ulw refactor the auth module";
if (shouldUseUltrawork(task)) {
const plan = planTask(task);
// Execute plan.chunks with parallel_spawn
}
import { planTask } from './speckit-swarm';
const plan = planTask("Create a new API endpoint");
// plan.chunks = [{ label: 'spec', ... }, { label: 'setup', ... }, ...]
O handler detecta "ulw" automaticamente e prepara tarefas para parallel_spawn.
// Verifica se contém keyword ulw
containsUltrawork(task: string): boolean
// Limpa o prefixo ulw da tarefa
cleanUltraworkTask(task: string): string
// Prepara execução ultrawork
prepareUltrawork(task: string): {
shouldExecute: boolean;
chunks: Array<{
label: string;
task: string;
model?: string;
thinking?: string;
}>;
cleanedTask: string;
}
// Na minha resposta, quando receber mensagem com "ulw":
const ultrawork = prepareUltrawork("ulw create a new API");
if (ultrawork.shouldExecute) {
// Executar com parallel_spawn
parallel_spawn({
tasks: ultrawork.chunks,
wait: "all"
});
}
Antes de paralelizar, verifico se não há conflitos:
| Tipo de Tarefa | Estratégia |
|---|---|
| ---------------- | ------------ |
| Criar novo projeto/CLI/API | PARALLEL ✓ |
| Múltiplos arquivos novos | PARALLEL ✓ |
| Refatorar módulo | CAUTIOUS (verifica dependências) |
| Corrigir bug | SEQUENTIAL ✗ |
| Editar mesmo arquivo | SEQUENTIAL ✗ |
| Tarefa simples | SINGLE |
Isso evita problemas de concorrência quando múltiplos agentes tentam modificar o mesmo arquivo.
// Detecção automática
const result = prepareParallelExecution("criar um novo CLI");
// result.shouldExecute = true (detectou complexidade)
if (result.shouldExecute) {
parallel_spawn({
tasks: result.chunks,
wait: "all"
});
}
共 1 个版本