@geekbb: pi-workflow 是一个为 Pi 设计的工作流编排工具,让 Pi 能执行多步骤、可复用的工作流,而不是只有单轮对话。用自然语言就能触发,不用每次手写提示词。 四种工作流直接用: - deep-research 做深度研究 - dee…

X AI KOLs Timeline 工具

摘要

pi-workflow 是一个为 Pi AI 助手设计的工作流编排工具,使其能够执行多步骤、可重复的工作流,包括深度研究、代码审查、规格检查和影响评估。它通过 JSON 阶段图定义工作流,支持多种执行模式。

pi-workflow 是一个为 Pi 设计的工作流编排工具,让 Pi 能执行多步骤、可复用的工作流,而不是只有单轮对话。用自然语言就能触发,不用每次手写提示词。 四种工作流直接用: - deep-research 做深度研究 - deep-review 审代码 - spec-review 查规格 - impact-review 评估影响。 工作流定义成 JSON 阶段图,支持 single、foreach、reduce、loop、dag、dynamic 六种模式。 https://github.com/AgwaB/pi-workflow…
查看原文
查看缓存全文

缓存时间: 2026/07/02 10:20

pi-workflow 是一个为 Pi 设计的工作流编排工具,让 Pi 能执行多步骤、可复用的工作流,而不是只有单轮对话。用自然语言就能触发,不用每次手写提示词。

四种工作流直接用:

  • deep-research 做深度研究
  • deep-review 审代码
  • spec-review 查规格
  • impact-review 评估影响。

工作流定义成 JSON 阶段图,支持 single、foreach、reduce、loop、dag、dynamic 六种模式。

https://github.com/AgwaB/pi-workflow…


AgwaB/pi-workflow

Source: https://github.com/AgwaB/pi-workflow

pi-workflow

pi-workflow

Workflow orchestration for Pi.

npm

pi-workflow lets Pi run named, repeatable multi-step workflows: research, code review, spec conformance checks, impact review, and project-specific team routines.

Built on @agwab/pi-subagent, it coordinates Pi subagent workers across workflow steps, passes results between them, and records the run so it can be inspected or resumed.

You choose a workflow and describe the task in natural language.

Installation

Install the package:

pi install npm:@agwab/pi-workflow

Then reload Pi.

This installs:

  • the /workflow extension
  • the bundled workflow-guide skill
  • the bundled execution-router skill

To update later:

pi update npm:@agwab/pi-workflow

Requires Node.js >=22.19.0 on macOS or Linux. Native Windows is not supported; use WSL2.

Usage: ask naturally

After installation, ask Pi to use a bundled or project workflow by name and describe the task you want handled. If you are not sure which workflow to use, ask Pi to list or choose from the available workflows.

Bundled workflows use local-first agent lookup and fall back to pi-workflow’s bundled common agents such as scout and researcher. Tool-level invocation details live in docs/usage.md.

Use the bundled deep-research workflow to research this repository and summarize the architecture tradeoffs.
Use the deep-review workflow to review the current diff from multiple perspectives.
Use the spec-review workflow to compare docs/API_SPEC.md against the implementation and tests.

If you want deterministic manual control, use the slash command form:

/workflow run deep-research "Research this repository and summarize the architecture tradeoffs."

For a one-off adaptive workflow that should plan, fan out, and synthesize without choosing a saved workflow, use:

/workflow dynamic "Research this repository and summarize the architecture tradeoffs."

/workflow dynamic uses pi-workflow’s built-in trusted dynamic controller and records a normal workflow run under .pi/workflows/. Use it when you explicitly want adaptive orchestration rather than a named reusable workflow.

Usage: choose an execution mode

Use the bundled execution-router skill when you are not sure whether a task should be handled directly, by a targeted verifier/subagent, by an existing workflow, or by a new workflow:

/skill:execution-router decide whether this repository review should use a single-agent pass, deep-review, or a targeted verifier.

Usage: create your own workflows

Use the bundled workflow-guide skill when you want to create, adapt, or review a workflow definition. It includes validated scaffold bundles for common graph shapes, so new workflows can start from a known-good structure before customization and validation:

/skill:workflow-guide create a workflow for weekly release readiness.
It should inspect docs, tests, recent changes, package metadata, and produce a final checklist.
Save it as a reusable project workflow.
/skill:workflow-guide customize deep-review for frontend accessibility and UX review.
Save it as a reusable project workflow.
/skill:workflow-guide create a backend API review workflow.
It should check concurrency, transaction safety, error handling, observability, and test risk.

Workflow architecture

A workflow is a deterministic stage graph for running one natural-language task through a reusable process.

pi-workflow is organized around three parts:

  1. Workflow — the graph and run lifecycle: what stages exist, when they run, and how outputs move forward.
  2. Task — agent-backed work: focused prompts, dynamic fan-out, fan-in synthesis, and bounded loops.
  3. Support — deterministic local rails: helper code, validation, normalization, artifacts, and resume-friendly run state.

In short: workflows define the process, tasks ask Pi agents to do the work, and support keeps the process structured and repeatable.

A small workflow definition looks like this:

{
  "schemaVersion": 1,
  "defaults": {
    "agent": "researcher",
    "readOnly": true,
    "tools": ["read", "grep", "find", "ls"]
  },
  "artifactGraph": {
    "stages": [
      {
        "id": "plan",
        "type": "single",
        "prompt": "Put machine-readable JSON in <control> with an items array."
      },
      {
        "id": "inspect",
        "type": "foreach",
        "from": { "source": "plan", "path": "$.items" },
        "each": { "prompt": "Inspect this item: ${item}" }
      },
      {
        "id": "prepare",
        "from": "inspect",
        "sourcePolicy": "partial",
        "support": { "uses": "./helpers/prepare.mjs" }
      },
      {
        "id": "report",
        "type": "reduce",
        "from": ["plan", "prepare"],
        "prompt": "Use upstream workflow artifacts to write the final report."
      }
    ]
  }
}

Supported stage patterns

Workflow definitions compose a small set of stage patterns and graph shapes.

PatternUse it forRuntime shape
singleOne focused stepone prompt -> one subagent
foreachDynamic fan-outJSON array from an upstream control artifact -> one subagent per item
reduceFan-in / synthesisupstream workflow artifacts -> one synthesis subagent
loopBounded repetitionrepeat child stages until a deterministic stop condition
dagNested graph containerchild stages lowered to namespaced tasks; selected output exposed downstream
dynamicAdaptive orchestrationtrusted bundle-local controller code can create official workflow tasks with ctx.agent()

Core workflow stage shapes: single, foreach, reduce, loop, dag, and dynamic

Predefined workflows

The package includes four bundled workflows for common research and review jobs. They are runnable defaults and authoring examples, not a complete workflow catalog.

WorkflowBest forWhat it does
deep-researchDeep, source-grounded research when breadth, verification, and cited recommendations matter.Plans research questions by depth, fans out question-level research, normalizes and ranks claims, verifies selected claims against evidence, and renders an audited executive handoff.
deep-reviewCode or design review when one reviewer pass is not enough.Triage selects review lenses, reviewers produce findings, a deterministic helper deduplicates them, a challenge pass tests the surviving findings, a deterministic helper partitions verdicts, and the final report keeps only evidence-backed issues.
spec-reviewRequirements-to-implementation traceability for an existing spec, API contract, or acceptance criteria.Extracts testable requirements, maps implementation and tests, verifies candidate gaps, and reports which requirements are covered, missing, ambiguous, or need human judgment.
impact-reviewSide-effect and risk review for proposed or applied changes.Maps change scope and affected surfaces, analyzes contract, state/data, validation, docs, security, and performance impact, then joins those lenses into likely regressions, missing checks, and next actions.

Deep research workflow flow

Deep review workflow flow

Spec review workflow flow

Impact review workflow flow

More official workflows are planned. Most teams should create project-specific workflows as their patterns settle.

Workflow board

After starting a run, open /workflow to inspect it in a read-only TUI. Browse runs, drill into stages and tasks, and preview task output without leaving Pi.

Start from the run list.

Workflow board: runs list

Drill into stage progress.

Workflow board: stages view

Inspect task-level fan-out.

Workflow board: task list

Open a task detail view with its artifact output.

Workflow board: task detail

More

Runtime dependencies

pi-workflow bundles the runtime pieces it needs:

  • @agwab/pi-subagent launches and tracks the Pi subagent workers used by workflow tasks.
  • pi-web-access provides web tools such as web_search, fetch_content, get_search_content, and code_search when a workflow or agent requests them.

The web provider is just a tool provider. You can replace or narrow it with your own extension if it exposes compatible tool names, arguments, and results. Be careful when changing providers: if the tool result shape, reference/evidence formatting, or field names differ, workflow specs, prompts, and control/output schemas that depend on those fields may need to change too. The stage graph and normal workflow run record format do not need to change for a compatible web-tool implementation swap.

相似文章

pi-dynamic-workflows (GitHub 仓库)

TLDR AI

pi-dynamic-workflows 是一个 Pi 扩展,它添加了一个工作流工具,允许模型编写 JavaScript 脚本以将工作分发给多个子代理,从而支持代码库审计和大规模重构等任务。

@Gorden_Sun: Kuse Workflow:AI生成工作流 操作简单,功能强大。能力覆盖n8n的全部能力,有丰富的应用生态。但使用比n8n简单的多的多,不需要接触复杂的节点配置,通过语言描述需求,AI就能自动创建稳定可复用的工作流。工作流支持定时执行,支…

X AI KOLs Timeline

Kuse Workflow 是一个由AI驱动的工作流自动化工具,比n8n更易用,用户只需用语言描述需求即可自动创建可复用的工作流,支持定时和事件触发。

@Jolyne_AI: 最近公司里在推一套 AI 工作流,用起来体感还不错,在此分享给大家。 OpenSpec + Superpowers 工作流:AI 辅助开发从「写代码」到「按规格交付」的完整闭环。 两个工具,各司其职: • OpenSpec 管规格和记忆 …

X AI KOLs Timeline

介绍了一套AI辅助开发工作流,结合OpenSpec(规格与记忆管理)和Superpowers(设计与执行),通过TDD和统一上下文解决AI开发中缺记忆和缺纪律的问题。