一键导入
meta-workflow-creator
Create Pi daemon workflows with proper structure, config, agents, and validators. Use when building automated workflows for the daemon system.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create Pi daemon workflows with proper structure, config, agents, and validators. Use when building automated workflows for the daemon system.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | meta-workflow-creator |
| description | Create Pi daemon workflows with proper structure, config, agents, and validators. Use when building automated workflows for the daemon system. |
| license | MIT |
| compatibility | pi |
| metadata | {"audience":"developers","category":"meta"} |
Create daemon workflows that run automatically via triggers (schedules, file watchers) or manually.
workflow-name/
├── config.toml # Required - trigger, model, prompt, retry settings
├── agent.md # Required for agent workflows - system prompt
├── validate-input.ts # Optional - bun script, exit 0 to proceed, 1 to skip
├── validate-output.ts # Optional - bun script, exit 0 = pass, 1 = retry
├── test/ # Optional - test fixtures and assertions
│ ├── fixtures/
│ └── workflow.test.ts
└── README.md # Optional - documentation
Locations (discovery order, later overrides earlier):
packages/<pkg>/workflows/<name>/.pi/workflows/<name>/workspace/workflows/<name>/ (gitignored)The agent is the brain. It has tools (read, write, bash) and does the actual work. The daemon just spawns it and validates the result.
[workflow]
name = "my-workflow"
description = "What this workflow does"
type = "agent"
[trigger]
schedule = "hourly" # or: watcher, manual, startup
[agent]
model = "lite" # Tier name from config.toml [models]
prompt = "Task description for the agent."
[retry]
max_attempts = 2
[validators]
input = "validate-input.ts"
output = "validate-output.ts"
[timeout]
minutes = 10
For pure automation that doesn't need LLM intelligence (backups, cleanup, etc).
[workflow]
name = "daily-backup"
type = "script"
[trigger]
schedule = "daily:02"
[script]
command = "backup.ts"
[timeout]
minutes = 5
| Trigger | Config | Description |
|---|---|---|
| Schedule | schedule = "hourly" | Time-based: hourly, daily:HH, interval:NNm |
| File watcher | watcher = "path/**/*.json" | Fires on file add/change matching glob |
| Manual | manual = true | Via daemon trigger <name> CLI |
| Startup | startup = true | Runs once when daemon starts |
agent.md)The agent.md is the system prompt. Write it like you're briefing a developer:
Key env vars available to agents:
WORKFLOW_NAME - workflow nameWORKFLOW_DIR - workflow directory pathWORKFLOW_PATHS - comma-separated trigger file paths (from file watcher)WORKFLOW_DATE - date string (from scheduled triggers)USER / LOGNAME - current userValidators are Bun TypeScript scripts. They receive context via env vars.
Runs before agent. Exit 0 to proceed, exit 1 to skip (saves cost).
// validate-input.ts
import { existsSync, readdirSync } from "fs";
import { join } from "path";
const dataDir = join(process.cwd(), "workspace", "data");
if (!existsSync(dataDir) || readdirSync(dataDir).length === 0) {
console.error("No data files to process");
process.exit(1);
}
process.exit(0);
Runs after agent. Exit 0 = success. Exit 1 = retry (stderr fed back to agent).
// validate-output.ts
import { existsSync, readFileSync } from "fs";
const outputFile = process.env.EXPECTED_OUTPUT || "output.json";
if (!existsSync(outputFile)) {
console.error(`Output file not created: ${outputFile}. Write results to this path.`);
process.exit(1);
}
// Validate structure
try {
const data = JSON.parse(readFileSync(outputFile, "utf-8"));
if (!data.results || !Array.isArray(data.results)) {
console.error("Output JSON missing 'results' array");
process.exit(1);
}
} catch (e) {
console.error(`Invalid JSON: ${e}`);
process.exit(1);
}
process.exit(0);
Chain workflows via filesystem. One workflow writes output, another watches for it:
analyzer/config.toml: scribe/config.toml:
[trigger] [trigger]
schedule = "hourly" watcher = "workspace/analysis/**/*.json"
# Writes JSON analysis # Reads analysis, writes reports
Each step is independently testable, retriable, and inspectable.
Workflows reference model tiers from config.toml:
# In root config.toml
[models]
lite = "claude-haiku-4-5"
medium = "claude-sonnet-4"
cheap = "gemini-2.0-flash"
The workflow's [agent] model = "lite" resolves to the concrete model ID.
To create a new workflow:
packages/<pkg>/workflows/<name>/ or .pi/workflows/<name>/config.toml with trigger and typeagent.md with the system promptjust workflow-dag to visualize the dependency graphdaemon trigger <name>model = "lite" for routine tasks, higher tiers for complex reasoningBosun configuration — models, sandbox, daemon, Pi settings. Use when changing models, editing config, or understanding how bosun is set up.
Bootstrap a new project using bosun as a foundation — via bun dependency (recommended) or git submodule. Creates a downstream project that inherits bosun's multi-agent infrastructure while adding custom agents, skills, and extensions. Works standalone — fetchable by any pi agent via raw GitHub URL.
Search curated markdown memory like sessions, plans, docs, and skills. Use when recalling prior context or looking for relevant historical/project knowledge.
Analyze Pi session JSONL files using jq patterns. Use when extracting metrics, tool usage, costs, or reviewing session history. Load for session export, summarization, or workflow analysis.
Session-based browser plan review primitives for Bosun. Provides a local-first state model, markdown-aware anchor extraction, and review-session persistence for reviewing existing plan files in dedicated CDP browser windows. Triggers: "plan-review", "review this plan", "review markdown plan".
Session-based browser diff review primitives for Bosun. Provides transport- agnostic v1 schemas plus local state and git snapshot helpers for immutable review rounds. Triggers: "diff-review", "reround", "review round", "snapshot-backed review".