dag-library

GitHub

实现DAG定义存储与复用,支持自动键值旋转和占位符填充。允许用户保存DAG以便后续重复运行或调度,避免每次粘贴完整JSON,提升多智能体管道等场景的自动化效率。

packages/omo-senpi/skills/dag-library/SKILL.md code-yeongyu/oh-my-openagent

Trigger Scenarios

保存DAG以便重用 运行已保存的DAG 设置定时重复执行DAG 查询DAG定义文件存放位置

Install

npx skills add code-yeongyu/oh-my-openagent --skill dag-library -g -y
More Options

Non-standard path

npx skills add https://github.com/code-yeongyu/oh-my-openagent/tree/dev/packages/omo-senpi/skills/dag-library -g -y

Use without installing

npx skills use code-yeongyu/oh-my-openagent@dag-library

指定 Agent (Claude Code)

npx skills add code-yeongyu/oh-my-openagent --skill dag-library -a claude-code -g -y

安装 repo 全部 skill

npx skills add code-yeongyu/oh-my-openagent --all -g -y

预览 repo 内 skill

npx skills add code-yeongyu/oh-my-openagent --list

SKILL.md

Frontmatter
{
    "name": "dag-library",
    "metadata": {
        "short-description": "Store and re-run named dag definitions"
    },
    "description": "Store a dag definition once and re-run it in one or two lines, instead of pasting the full definition JSON into every eval cell. MUST USE whenever the user wants to save a DAG for reuse, run a previously saved\/named DAG, schedule the same graph repeatedly (nightly\/weekly audits, recurring multi-agent pipelines), or asks where to put a dag definition file. Triggers: dag library, save this dag, reuse a dag, run the saved dag, stored dag definition, recurring dag, nightly dag, dag 정의 저장, 저장된 dag 실행, dag 반복 실행, DAG 만들어두고 여러 번."
}

dag-library

Use this skill when the user wants to KEEP a dag definition and run it again later — the graph is an asset, not a one-off. For authoring a brand-new graph, read mass-ulw first; this skill covers the storage-and-rerun half.

The shape

A stored definition is a plain dag definition JSON file named <name>.json in one of the library dirs. First hit wins:

  1. $OMO_DAG_LIBRARY (multiple dirs, separated by : — or by ; on Windows, so drive-letter paths survive)
  2. $PWD/.omo/dags
  3. $HOME/.omo/dags
{
  "key": "nightly-audit",
  "name": "Nightly audit",
  "nodes": [
    { "id": "audit", "category": "unspecified-low", "prompt": "Audit docs/ for stale claims; write findings to /tmp/audit-{{key}}.md." },
    { "id": "verify", "category": "quick", "prompt": "Verify each finding in /tmp/audit-{{key}}.md against src/.", "dependsOn": ["audit"] }
  ]
}

String values may carry placeholders, filled at load time: {{key}} (the final rotated key — use it in file paths so reruns never clobber each other), {{date}} (UTC YYYYMMDD), {{datetime}} (UTC YYYYMMDD-HHmmss). Node prompts must still stand alone: dependsOn is ordering only, so pass data between nodes through files, exactly as in mass-ulw.

Running it — JS eval cell, two lines

The extension publishes library.js next to sdk.js at OMO_DAG_SDK_ROOT:

const lib = await import(`${env("OMO_DAG_SDK_ROOT")}/library.js`)
const run = await lib.start("nightly-audit")
const result = await run.done()

await lib.load(name) returns the filled definition without starting it; await lib.start(name) loads and starts in one call and returns the same handle shape as sdk.start (run_id, done(), cancel(reason)). Both are async — the kernel's read global is async, so never call them un-awaited.

Key rotation — the one rule that matters

The dag engine keys idempotency on key + graph fingerprint: re-starting the same key with the same graph REUSES the old run instead of running again. So the library treats the stored key as a BASE key and rotates it on every load:

  • lib.start("nightly-audit") → key becomes nightly-audit-<UTC YYYYMMDD-HHmmss>: every call is a fresh run. This is the default because wanting a fresh run is the common case.
  • lib.start("nightly-audit", { suffix: "20260818" }) → key becomes nightly-audit-20260818: explicit suffix, so a retry of the same logical run reuses it (idempotent recovery), while a new day gets a new run.
  • lib.start("nightly-audit", { suffix: "" }) → key stays nightly-audit: full idempotency; only reach for this when reusing the previous result is exactly what you want.

Python cells

Python cannot import the ESM library. Reproduce the same semantics with plain dicts — read the file, rotate the key, fill placeholders, call tool.dag:

import json
from datetime import datetime, timezone
defn = json.loads(read(f"{env('HOME')}/.omo/dags/nightly-audit.json"))
stamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")
defn["key"] = f"{defn['key']}-{stamp}"
text = json.dumps(defn).replace("{{key}}", defn["key"]).replace("{{date}}", stamp[:8]).replace("{{datetime}}", stamp)
run = tool.dag({"action": "start", "definition": json.loads(text)})
result = tool.dag({"action": "wait", "run_id": run["run_id"]})

Saving a new definition

When the user asks to save the current graph: write it as <name>.json into $HOME/.omo/dags (user-level, survives cwd changes) or <repo>/.omo/dags (project-level, shareable through git if the team commits it), then confirm by running it once via lib.start. Names are letters, digits, dot, dash, underscore — the library rejects path-shaped names.

Version History

  • ec3d5af Current 2026-08-20 11:15

Same Skill Collection

.agents/skills/get-unpublished-changes/SKILL.md
.agents/skills/github-triage/SKILL.md
.agents/skills/omomomo/SKILL.md
.agents/skills/publish/SKILL.md
.agents/skills/remove-deadcode/SKILL.md
.opencode/skills/github-triage/SKILL.md
packages/omo-codex/plugin/skills/init-deep/SKILL.md
packages/omo-senpi/plugin/skills/init-deep/SKILL.md
packages/omo-senpi/skills/give-me-tips/SKILL.md
packages/omo-senpi/skills/init-deep/SKILL.md
packages/omo-senpi/skills/mass-ulw/SKILL.md
packages/omo-senpi/skills/ulw-loop/SKILL.md
packages/pi-goal/SKILL.md
packages/shared-skills/skills/ast-grep/SKILL.md
packages/shared-skills/skills/git-master/SKILL.md
packages/shared-skills/skills/init-deep/SKILL.md
packages/shared-skills/skills/refactor/SKILL.md
packages/shared-skills/skills/start-work/SKILL.md
.agents/skills/codex-qa/SKILL.md
.agents/skills/hyperplan/SKILL.md
.agents/skills/opencode-qa/SKILL.md
.agents/skills/pre-publish-review/SKILL.md
.agents/skills/security-research/SKILL.md
.agents/skills/tech-debt-audit/SKILL.md
.agents/skills/work-with-pr/SKILL.md
.opencode/skills/hyperplan/SKILL.md
.opencode/skills/pre-publish-review/SKILL.md
.opencode/skills/work-with-pr/SKILL.md
packages/omo-codex/plugin/skills/ulw-plan/SKILL.md
packages/omo-senpi/plugin/skills/onboarding/SKILL.md
packages/omo-senpi/skills/hyperplan/SKILL.md
packages/omo-senpi/skills/onboarding/SKILL.md
packages/omo-senpi/skills/ultrawork/SKILL.md
packages/omo-senpi/skills/ulw-plan/SKILL.md
packages/omo-senpi/skills/ulw-research/SKILL.md
packages/shared-skills/skills/coding-agent-sessions/SKILL.md
packages/shared-skills/skills/data-scientist/SKILL.md
packages/shared-skills/skills/debugging/SKILL.md
packages/shared-skills/skills/frontend/SKILL.md
packages/shared-skills/skills/lsp-setup/SKILL.md
packages/shared-skills/skills/programming/SKILL.md
packages/shared-skills/skills/remove-ai-slops/SKILL.md
packages/shared-skills/skills/review-work/SKILL.md
packages/shared-skills/skills/ultimate-browsing/SKILL.md
packages/shared-skills/skills/ulw-plan/SKILL.md
packages/shared-skills/skills/ulw-research/SKILL.md
packages/shared-skills/skills/visual-qa/SKILL.md

Metadata

Files
0
Version
ec3d5af
Hash
43bd7d48
Indexed
2026-08-20 11:15

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 13:25
浙ICP备14020137号-1 $방문자$