AGENT SKILL

prompt-workflows

Compose, validate, and apply reusable Outlines prompt workflows with Template, Application, Chat, multimodal inputs, caching, and safe iterative prompting.

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

01 前言 Front Matter

name
prompt-workflows
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Compose, validate, and apply reusable Outlines prompt workflows with Template, Application, Chat, multimodal inputs, caching, and safe iterative prompting.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Prompt Workflows

Use this sub-skill when the task is to build or troubleshoot reusable prompt composition around Outlines rather than to choose a model backend or design a schema. It covers:

  • Jinja prompt rendering with outlines.Template.
  • Reusable outlines.Application objects that pair a template or callable with an optional output type.
  • outlines.inputs.Chat conversations and multimodal Image, Audio, and Video inputs.
  • Prompt/workflow caching controls.
  • Bounded iteration patterns such as structured extraction refinement, self-consistency, task-list loops, and regex-guided structured-output debugging.

Do not call remote providers, start local model downloads, or execute model-generated code from this skill alone. After prompt/input assembly is validated, route execution to the appropriate sibling skill: ../structured-generation/ for schemas and output types, ../remote-providers/ for hosted model capability/credential routing, or ../local-models/ for local model setup and capability routing.

Quick Route

  1. Render first. Use Template.from_string(content, filters={}) for inline prompts. Use Template.from_file(path, filters={}) only when the template file and all includes/extends are bundled under the same template directory boundary.
  2. Fail early on variables. Outlines templates use Jinja StrictUndefined; render with a complete variable mapping before any model call.
  3. Package repeated tasks. Use Application(template_or_callable, output_type=None) when the same prompt/output contract will be applied repeatedly. Call it as application(model, {"var": value}, **inference_kwargs).
  4. Choose the right input carrier. Import chat and assets from outlines.inputs: Chat, Image, Audio, Video. Keep each chat message shaped as {"role": "system"|"user"|"assistant", "content": ...}.
  5. Validate assets before routing. Image requires a PIL image with a real format and base64-encodes it. Audio and Video are wrappers; actual support is model/provider-specific.
  6. Control caching deliberately. Use OUTLINES_CACHE_DIR, outlines.caching.cache, cache_disabled(), outlines.disable_cache(), and outlines.clear_cache() for deterministic workflow components and stale-cache recovery.
  7. Keep iteration bounded and safe. Self-consistency and agent-loop patterns should have fixed budgets, deterministic parsers, no credential assumptions, no network requirements unless separately authorized, and no eval/exec of generated code.

Load These References

  • references/api-reference.md: exact APIs, imports, Jinja filters, Application, Chat, multimodal inputs, and cache controls.
  • references/workflows.md: reusable workflow recipes distilled from Outlines examples without source-checkout dependencies.
  • references/troubleshooting.md: failure modes for missing variables, include boundaries, paths, chat/content shape, image/base64 conversion, provider capability mismatches, cache behavior, and generated-code safety.

Bundled Script

Use scripts/render_template.py to render an inline Outlines Template with JSON variables or a small built-in fixture before wiring a prompt into an Application, Chat, or generator call. The script performs only local template rendering; it does not read repository-relative prompt files by default, call providers, or execute generated code.

Example:

python scripts/render_template.py \
  --template 'Hello {{ name }}!' \
  --vars-json '{"name":"Ada"}'

Expected output:

Hello Ada!

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