workflow-authoring
Writes deterministic DisCo workflow scripts that coordinate subagents with stable coverage IDs, bounded recovery, explicit usage semantics, and structured environment handoffs.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- workflow-authoring
- metadata
- { "upstream": "@quintinshaw/pi-dynamic-workflows@3.10.0", "disco-role": "shared" }
- description
- Writes deterministic DisCo workflow scripts that coordinate subagents with stable coverage IDs, bounded recovery, explicit usage semantics, and structured environment handoffs.
- disable-model-invocation
- false
03 SKILL.md 正文
Workflow Authoring
Use the workflow tool only for genuinely decomposable work. The script is an
orchestration program, not a container for the task's entire natural-language
brief.
When another skill requires workflow orchestration, read this file completely
before the first workflow call. Do not infer agent() option fields from a
producer's private report schema.
Script and args boundary
- Keep
scriptshort: metadata, phases, job mapping,agent()/parallel()calls, coverage accounting, and the final return value. - Put long or Markdown-rich prompts in
args.jobsorargs.briefs. This keeps Markdown backticks, code spans, quotes, and multiline content out of JavaScript template literals and prevents avoidable parser failures. - Do not put an unescaped Markdown backtick inside a script template literal. If a
parser error does occur, use its source line and caret, then move that payload to
argsinstead of escaping one occurrence and retaining the fragile structure. parallel()receives functions, not already-started promises:await parallel(jobs.map((job) => () => agent(job.prompt, options))).
Stable coverage contract
Every job needs one canonical lowercase-hyphen id. Pass that same value as
subSkill when it represents a generated sub-skill. A coordinated workflow
should return a ledger shaped like:
const rows = await parallel(jobs.map((job) => async () => {
const result = await agent(job.prompt, {
label: job.id,
subSkill: job.id,
environment: args.environment,
});
return { id: job.id, ok: result !== null, result };
}));
const missing = rows
.filter((row) => !row || row.ok !== true)
.map((row, index) => row?.id ?? jobs[index].id);
return {
rows,
complete: missing.length === 0,
missing,
errors: rows
.filter((row) => row && row.ok !== true)
.map((row) => ({ id: row.id, error: row.error })),
};
results.length is only the number of returned positions; it is never the
success count. null, a missing row, or an explicit ok: false is incomplete
coverage.
Recovery
For recovery, create a new workflow call with:
args.jobscontaining only the currentmissingIDs and their original briefs;recoveryOfRunIdset to the original run ID;recoveryRoundincremented for the new round;maxRecoveryRoundsleft at the default 50 unless the user has a reason to choose another value.
Within one script, recoverMissing(jobs, worker, options) is also available. It
only submits the current pending IDs, never reruns successful IDs, and stops with
an explicit stoppedReason after the configured round cap or two consecutive
rounds with no reduction in the missing set. An incomplete result must be shown
to the main agent and resolved before integration; never silently merge the
successful subset as if the batch were complete.
Timeouts, retries, and usage
- Omit
agentTimeoutMsunless the user explicitly asks for a hard time bound. The runtime default is no hard timeout. - A timeout attempt is aborted and drained before its default one retry begins. Do not design workflows that assume the timed-out agent can keep writing in the background.
- Use
tokenBudgetonly when the user asks for a spend cap. - Final usage is terminal usage when available. Live usage is observability only;
it is not finalized accounting. Estimated fallback usage is labeled as such,
and
cacheReadis shown separately.
Prepared environment handoff
After prepare-repo-skill-env succeeds, use the report's canonical
workflowEnvironment object. Pass its verified executable and expected
distribution version structurally, for example:
args: {
environment: {
executable: preparedEnvironmentExecutable,
cwd: repositoryPath,
package: "target-package",
version: "target-version",
},
jobs,
}
Every subagent must pass environment: args.environment to agent(). The
runtime executes the assertion before creating the session. A missing executable
or version mismatch is a hard failure; never replace it with ambient python, a
different virtual environment, or an unverified package installation.
The private prepare-env report may also contain legacy evidence fields. Their only supported migration mapping is:
pythonExecutable -> executable
expectedDistribution -> package
expectedVersion -> version
assertBeforeStartup -> omitted; assertion is always required
Do not author new workflows with those legacy names. The runtime normalizes this known shape only as a visible deprecation safety net. Canonical and legacy values that disagree are a hard contract failure before subagent startup; no ambient runtime is guessed.
Integration gate
Only integrate generated files after complete === true. If the result is
incomplete, preserve the original jobs and IDs, start a recovery workflow for
the current missing set, and report any no-progress or safety-cap stop explicitly.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).