AGENT SKILL

flow-task-authoring

Author, run, debug, and locally test Prefect flows and tasks with retries, caching, states, futures, task runners, results, transactions, hooks, and concurrency.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
flow-task-authoring
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Author, run, debug, and locally test Prefect flows and tasks with retries, caching, states, futures, task runners, results, transactions, hooks, and concurrency.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Flow And Task Authoring

Use this sub-skill when a task is about writing or debugging Prefect SDK workflow code: @flow, @task, local execution, state handling, futures, task runners, result persistence, retries, caching, logging, hooks, interactive pauses, transactions, and unit-style tests.

Start Here

  1. Read references/api-reference.md for live Prefect 3.6.24 decorator parameters, state constructors, futures, task runners, cache policies, result storage, pause/resume, transactions, and concurrency contexts.
  2. Read references/workflows.md for copyable patterns: basic flows, task composition, .submit(), .map(), state inspection, local tests, cached tasks, result persistence, retry policies, hooks, and nested subflows.
  3. Read references/troubleshooting.md before diagnosing parameter validation, cache misses, retry behavior, missing logs, unresolved futures, failed states, result persistence, async/sync mismatches, pause/suspend behavior, timeouts, and concurrency-limit failures.
  4. Run python scripts/flow_task_smoke.py --help when you need a deterministic local smoke example with no network, credentials, long-running service, or original-repo dependency.

Routing Boundaries

  • Use this sub-skill for authoring and local SDK behavior inside Python files, including Flow and Task objects created by decorators.
  • Route deployment creation, flow.serve, flow.deploy, schedules, work pools, work queues, workers, and prefect.yaml to ../deployments-workers/SKILL.md.
  • Route CLI profiles, server startup/status, Cloud login, dashboard, variables, artifacts, and operational commands to ../cli-server-operations/SKILL.md.
  • Route direct get_client, PrefectClient, schema models, profiles/settings internals, and temporary_settings to ../api-client-settings/SKILL.md.
  • Route maintainer-only repository changes, test selection, uv/just, generated docs, and source-tree development workflow to ../repo-development/SKILL.md.

Safe Defaults

  • Prefer direct local calls to flow_fn(...) or task_fn(...) while authoring; add deployments/workers only after the workflow behavior is correct.
  • Prefer @flow(log_prints=True) or get_run_logger() when the user expects logs to appear in Prefect run logs.
  • Prefer .submit() or .map() only inside a flow when concurrency or dependency tracking is needed; call tasks directly when sequential behavior is clearer.
  • Prefer future.result() or PrefectFutureList.result() before returning or asserting values; use return_state=True when debugging failed states without raising immediately.
  • Prefer explicit persist_result=True, result_storage_key, or cache_policy=INPUTS when cache/result reuse must survive beyond one task call.

Bundled Script

  • scripts/flow_task_smoke.py demonstrates deterministic flow/task authoring, local HTML parsing adapted from the repo example without network, retries, cache configuration, futures, mapping, hooks, and state inspection.
  • The script prints JSON and supports --mode basic, --mode futures, --mode state, --mode cache, and --mode all for focused checks.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351