northseadl/norix-skills / agent-task-orchestration
agent-task-orchestration
VerifiedTask decomposition and multi-agent orchestration with retry, checkpoint recovery, and real-time monitoring. Mixed Codex/Claude Code engine. Parallel/sequential execution.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 14 B |
| SKILL.md | skill md | 13.6 KB |
| agents/openai.yaml | config | 281 B |
| evals/evals.json | config | 5.8 KB |
| examples/feature-task-spec.md | markdown | 3.4 KB |
| package.json | manifest | 540 B |
| references/codex-patterns.md | markdown | 4.7 KB |
| references/quality-gate.md | markdown | 2.5 KB |
| references/task-decomposition.md | markdown | 3.1 KB |
| references/trinity-protocol.md | markdown | 4.1 KB |
| scripts/dashboard.html | other | 36.5 KB |
| scripts/dispatch.mjs | script | 7.3 KB |
| scripts/lib/cli.mjs | script | 5.7 KB |
| scripts/lib/dag.mjs | script | 4.2 KB |
| scripts/lib/engines.mjs | script | 15.2 KB |
| scripts/lib/logger.mjs | script | 593 B |
| scripts/lib/manage.mjs | script | 5.7 KB |
| scripts/lib/preflight.mjs | script | 1.2 KB |
| scripts/lib/reporter.mjs | script | 5.4 KB |
| scripts/lib/retry.mjs | script | 2.3 KB |
| scripts/lib/server.mjs | script | 5.4 KB |
| scripts/lib/store.mjs | script | 8.8 KB |
scripts/lib/dag.mjs
View on GitHub// DAG — topological sort, dependency resolution, and task parsing
import { readdir, readFile } from "node:fs/promises";
import { join, basename } from "node:path";
import { log } from "./logger.mjs";
/**
* Extract task numeric ID from filename (e.g. "T3-setup.md" → 3).
* @param {string} filename
* @returns {number|null}
*/
export function extractId(filename) {
const m = basename(filename).match(/^T(\d+)/);
return m ? parseInt(m[1], 10) : null;
}
/**
* Extract dependency IDs from task content (e.g. "← T1, T2" → [1, 2]).
* @param {string} content
* @returns {number[]}
*/
export function extractDeps(content) {
const line = content.split("\n").find((l) => l.includes("← T"));
if (!line) return [];
return [...line.matchAll(/T(\d+)/g)].map((m) => parseInt(m[1], 10));
}
/**
* Extract per-task engine override from content.
* @param {string} content
* @returns {string|null}
*/
export function extractEngine(content) {
const m = content.match(
/^\s*[-*]?\s*\*{0,2}engine\*{0,2}\s*[::]\s*(codex|claude)/im,
);
return m ? m[1].toLowerCase() : null;
}
/**
* Extract task size estimate from content (S/M/L).
* @param {string} content
* @returns {"S"|"M"|"L"}
*/
export function extractEstimate(content) {
const m = content.match(/\*{0,2}预估\*{0,2}\s*[::]\s*(S|M|L)/i);
return m ? m[1].toUpperCase() : "M";
}
/**
* Load and parse task spec files from a directory.
* @param {string} taskDir
* @param {string} defaultEngine
* @returns {Promise<Array<{id: number, file: string, filePath: string, content: string, deps: number[], engine: string}>>}
*/
export async function loadTasks(taskDir, defaultEngine) {
const entries = await readdir(taskDir);
const files = entries.filter((f) => /^T\d+.*\.md$/.test(f)).sort();
const tasks = [];
for (const file of files) {
const filePath = join(taskDir, file);
const content = await readFile(filePath, "utf-8");
const id = extractId(file);
if (id === null) {
log("WARN", `Skipping unparseable file: ${file}`);
continue;
}
const engine = extractEngine(content) || defaultEngine;
tasks.push({ id, file, filePath, content, deps: extractDeps(content), engine });
}
return tasks;
}
/**
* Produce topological batches from tasks — each batch can run in parallel.
* @param {Array<{id: number, deps: number[]}>} tasks
* @returns {number[][]}
*/
export function topologicalBatches(tasks) {
const taskMap = new Map(tasks.map((t) => [t.id, t]));
const completed = new Set();
const remaining = new Set(tasks.map((t) => t.id));
// Pre-satisfy deps that reference non-existent tasks
for (const task of tasks) {
for (const dep of task.deps) {
if (!taskMap.has(dep)) {
log("WARN", `T${task.id} depends on non-existent T${dep} — treated as satisfied`);
completed.add(dep);
}
}
}
const batches = [];
while (remaining.size > 0) {
const batch = [];
for (const id of remaining) {
if (taskMap.get(id).deps.every((d) => completed.has(d))) batch.push(id);
}
if (batch.length === 0) {
throw new Error(
`Deadlock: ${[...remaining].map((id) => `T${id}`).join(", ")} have circular dependencies`,
);
}
batches.push(batch);
for (const id of batch) {
completed.add(id);
remaining.delete(id);
}
}
return batches;
}
/**
* Build directed edge list from task dependencies.
* @param {Array<{id: number, deps: number[]}>} tasks
* @returns {Array<[number, number]>}
*/
export function buildEdges(tasks) {
const edges = [];
for (const task of tasks) {
for (const dep of task.deps) edges.push([dep, task.id]);
}
return edges;
}
/**
* Resolve which SDK engines are needed for a task set.
* @param {Array<{engine: string}>} tasks
*/
export function resolveEngines(tasks) {
const codexCount = tasks.filter((t) => t.engine === "codex").length;
const claudeCount = tasks.filter((t) => t.engine === "claude").length;
return { needsCodex: codexCount > 0, needsClaude: claudeCount > 0, codexCount, claudeCount };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |