Langsung ke konten
Skillpedia
Agen70k Β· #3118

dag-library

Fungsinya

Alat ini memungkinkan Anda menyimpan definisi 'graph' tugas (disebut DAG) untuk digunakan kembali nanti. Daripada menjelaskan graph itu setiap kali, Anda cukup menyimpannya dengan sebuah nama lalu menjalankannya dengan nama tersebut.

Kapan dipakai

  • βœ“Saat Anda ingin menyimpan graph tugas untuk dipakai ulang.
  • βœ“Saat Anda perlu menjalankan graph tugas yang sama berkali-kali.
  • βœ“Saat Anda ingin menjadwalkan eksekusi berulang dari alur kerja yang kompleks.

Link skill

https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-senpi/skills/dag-library/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/code-yeongyu/oh-my-openagent/blob/dev/packages/omo-senpi/skills/dag-library/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œSimpan graph tugas ini dengan nama 'monthly-audit' lalu jalankan.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda menyimpan definisi graph dalam sebuah file khusus. Setelah itu, Anda bisa meminta AI untuk menjalankan graph tersebut menggunakan nama yang sudah Anda berikan. AI akan mencari file tersebut dan menjalankan tugas-tugasnya sesuai urutan yang sudah ditentukan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

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 re-running the same logical run reuses it (idempotent recovery), while a new day gets a new run. Recovering a FAILED node inside such a run is retry/amend on that run id, not a new suffix.
  • 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.workflow:

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.workflow({"action": "start", "definition": json.loads(text)})
result = tool.workflow({"action": "wait", "run_id": run["run_id"], "detach": False})  # detach=False keeps the cell-blocking wait; the bare tool action detaches against a live run

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.

Pertanyaan umum

Di mana graph disimpan?

Graph disimpan di folder tertentu pada komputer Anda, seperti '$HOME/.omo/dags' atau di folder '.omo/dags' di dalam proyek Anda saat ini.

Bagaimana AI tahu graph mana yang harus dijalankan?

Anda memberi tahu AI nama graph yang sudah disimpan. AI akan mencari nama tersebut di lokasi penyimpanan graph dan menjalankan apa yang sudah didefinisikan.

Apakah saya bisa mengubah graph yang sudah disimpan?

Skill ini berfokus pada menyimpan dan menjalankan. Untuk membuat atau mengubah graph dari awal, Anda mungkin memerlukan alat lain, seperti 'mass-ulw'.

Detail

Deskripsi asli dari pembuat

Stores a DAG definition once and re-runs it by name, instead of pasting the definition into every run. Use when the user wants to save a DAG, run a saved one, or schedule the same multi-agent graph repeatedly.

repo: code-yeongyu/oh-my-openagent

Popularitas

Bintang GitHub
70k
Peringkat
#3118
Lisensi
NOASSERTION
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa