Communitygithub.com

graph

決定論的オーケストレーショングラフランタイム - 宣言的なDAGパイプラインと、ジャーナルベースのクラッシュリカバリを提供します。

graph とは?

Graphスキルは、宣言的なJSON記述子から決定論的なオーケストレーショングラフを実行するためのランタイムです。`/oh-my-claudecode:graph` コマンドで起動し、`src/graph/*` に定義された sealed-descriptor および pure-scheduler コントラクトに従い、独立したOSプロセス (`omc graph run`) として動作します。このアーキテクチャにより、実行中のプロセスが強制終了された場合でも、同一の `run_id` で再実行することでジャーナルから状態を復元し、中断された位置から処理を再開できます。主なユースケースは、明示的な依存関係を持つ反復可能なマルチステップパイプライン(DAG)であり、クラッシュに強いワークフローや監査可能な実行ログが必要な場合に適しています。一方、探索的な単発作業や、実行中に適応的に再計画が必要な処理には向いていません。記述子は、コマンドノード、エージェントノード、人間による承認ノードをサポートし、エッジは固定、ファンアウト/ジョインをサポートします。条件分岐やバックエッジはランタイムではサポートされていますが、組み込みのエグゼキュータでは対応していないため、カスタムエグゼキュータが必要です。コマンドノードは少なくとも1回の実行を保証し、冪等性キーを環境変数として提供します。組み込みエージェントノードは明示的に読み取り専用であり、エージェントのタイムアウトはSDKクエリを中断します。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Yeachan-Heo/oh-my-claudecode/tree/main/skills/graph

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Graph スキル

宣言的なJSON記述子から決定論的なオーケストレーショングラフを実行します。 このランタイムは、src/graph/* 内の sealed-descriptor および pure-scheduler コントラクトを消費し、独立したOSプロセス (omc graph run) を通じて実行されるため、クラッシュリカバリ(実行中の強制終了、再実行、ジャーナルからの再開)が実際に機能します。

使用方法

/oh-my-claudecode:graph <descriptor.json>
/oh-my-claudecode:graph "build then test then ask me before deploy"   (最初に記述子を作成してください)

実行インターフェースは常にCLIサブコマンドです:

omc graph run <descriptor.json> [--runs-root <dir>]

非対話型グラフの場合は Bash ツールを介して実行します。進捗状況は [run]、[node]、[ok]、[fail]、[join]、[done] としてストリーム出力されます。

使用すべき場合

  • 明示的な依存関係を持つ反復可能なマルチステップパイプライン (DAG)
  • 中断に耐えなければならない処理:強制終了/再起動はジャーナルから再開します
  • 監査可能な実行:.omc/graph-runs/<run_id>/ 下の OCC ジャーナル + プロジェクションスナップショット

使用すべきでない場合:探索的な単発作業(会話または /team を使用);実行中に適応的な再計画が必要なもの(グラフは決定論的です)。

ワークフロー

  1. 記述子が指定された場合 -> ステップ3に進みます。

  2. パイプラインが記述された場合 -> 記述子JSON(スキーマは以下)を作成し、プロジェクトの隣(.omc/graphs/<name>.json を推奨)に書き込み、実行前にユーザーに表示します。run_id は論理パイプラインごとに一意である必要があります。同じ run_id で再実行すると再開され、再起動はされません。

  3. 承認ノード:記述子に "kind": "human-approval" ノードが含まれている場合は、Bash ツールで実行しないでください(標準入力が対話的でなく、EOF は拒否として閉じます)。代わりに、ユーザーに対話的に実行するように指示してください:

    ! omc graph run <file>
    

    ! プレフィックスは、このセッション内でライブ標準入力を使って実行するため、y/n が機能します。

  4. 実行して進捗を中継します。終了コード(標準): 0 成功 | 1 致命的な失敗 | 19 別のライターがこの実行を所有しています(ビジー) 20 破損/改ざんされたジャーナル(フェイルクローズ)| 21 再開時に記述子のずれが発生 | 70 ランタイムクラッシュ(未マップのエラー)

  5. 再開:クラッシュ後に同じコマンドを再実行すると、コミットされた遷移が再生され、続行されます。完了したノードは決して再実行されません。

記述子スキーマ(最小限)

{
  "descriptor_version": 1,
  "run_id": "unique-pipeline-id",
  "revision_id": "rev-1",
  "goal": "one line",
  "nodes": [
    { "id": "n1", "kind": "command", "title": "...", "timeout_ms": 60000,
      "max_attempts": 2, "effect_policy": { "policy": "side_effect_free" },
      "command": "npm test" },
    { "id": "a1", "kind": "agent", "title": "...", "timeout_ms": 300000,
      "max_attempts": 1, "effect_policy": { "policy": "side_effect_free" },
      "instructions": "..." },
    { "id": "gate", "kind": "human-approval", "title": "...",
      "prompt": "Proceed?" }
  ],
  "edges": [ { "id": "e1", "kind": "fixed", "from": "n1", "to": "a1" } ],
  "entry_node_ids": ["n1"],
  "concurrency_limit": 2,
  "terminal_verification_node_id": "a1"
}

エッジの種類: fixed | conditional | fan_out/join ペア | back_edge (max_traversals による制限付き再試行)。決定版の Zod スキーマについては src/graph/schema.ts を参照してください。また、上記の「機能境界」セクションを読んで、今日実際に実行できる組み込みエグゼキュータを確認してください。

機能境界とセマンティクス(作成前に読んでください)

  • エッジサポート: 組み込みの command/agent エグゼキュータは fixed エッジと fan_out/join ペアをカバーします。conditional エッジと back_edge ルートはランタイムとスケジューラコントラクトで完全にサポートされていますが、結果に route を出力するカスタム NodeExecutor が必要です。組み込みエグゼキュータはルートを生成しないため、それらに依存するグラフは推測する代わりに route_required で即座に失敗します。
  • クラッシュリカバリの保証は、コマンドノードに対して 少なくとも1回の実行です。外部の副作用とそのジャーナル追記の間にクラッシュが発生すると、再開時にそのノードが再実行されます。idempotent コマンドの場合、解決されたキーは開始前に GRAPH_IDEMPOTENCY_KEY としてコマンドに利用可能になり、後続の重複排除のために記録されます。組み込みエグゼキュータは reconcile を拒否します。調整には、実際の外部調整機関を持つカスタムエグゼキュータが必要です。外部副作用に対する正確に1回の実行は v1 の範囲外です。
  • コマンド信頼境界: コマンドノードは、カレントワーキングディレクトリ内でプロセス権限を持つ任意のシェル行です。自分で作成した、または信頼する記述子のみを実行してください。コマンド子プロセスは、許可リストに登録された環境(PATH、HOME/USERPROFILE、TEMP/TMP、ロケール/タイムゾーン、USER 識別子、GRAPH_*、およびオプションの冪等性キー)を受け取ります。ホストの完全なシークレットは受け取りません。コマンドはファイルシステム/プロセスサンドボックス化されていません。
  • エージェント権限境界: 組み込みのエージェントノードは明示的に読み取り専用です。カレントワーキングディレクトリで実行され、追加のディレクトリはなく、Read、Glob、Grep のみ、permissionMode: dontAsk、セッションパーシスタンスは無効、プロバイダ固有の環境許可リストが使用されます。エージェントのタイムアウトは SDK クエリを中断します。変更や外部効果が必要なエージェントにはカスタムエグゼキュータを使用してください。.omc/graph-runs/<run_id>/descriptor.json を実行可能コンテンツとして扱ってください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

agent-doc-discipline

Writing-time discipline for documents agents consume (the five surfaces, specs, tickets, .omc/skills/) — every rule checkable and carrying a why, steps before reference, one meaning in one home, no restating what the environment already says. Mandatory at drydock seed generation and the launch C5 sediment pass; opt-in for any other agent-facing doc edit. The companion of minimal-code-discipline: that one disciplines code, this one disciplines papers.

ai-slop-cleaner

Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode

ask

Process-first advisor routing for Claude, Codex, Gemini, Antigravity, Grok, or Cursor via `omc ask`, with artifact capture and no raw CLI assembly

ask-navigator

Shipyard

autopilot

Full autonomous execution from idea to working code

autoresearch

Stateful single-mission improvement loop with strict evaluator contract, markdown decision logs, and max-runtime stop behavior

cancel

Cancel any active OMC mode (autopilot, ralph, ultragoal, swarm, ultrapilot, pipeline, team) and clean up retired legacy state

configure-notifications

Configure notification integrations (Telegram, Discord, Slack) via natural language

debug

Diagnose the current OMC session or repo state using logs, traces, state, and focused reproduction

deepinit

Deep codebase initialization with hierarchical AGENTS.md documentation

deep-interview

Socratic deep interview with mathematical ambiguity gating before explicit execution approval

drydock

Lay the keel of the shipyard harness in any repo — the 4-pillar shared environment (Context, Rules, Tools, Standards) across 5 surfaces (CLAUDE.md, skills, design-system, mcp/cli, shared context) so that every human and agent inherits the same design language and anyone can ship. Run once per repo; re-run with --check to audit drift.

execute

Carry an approved task through to working, verified code

external-context

Invoke parallel document-specialist agents for external web searches and documentation lookup

harbor

Harbor intake for external work — the captain only handles unresolved decisions. Sweeps incoming issues and PRs, verifies every claim before disposition, reuses every decision already made, and hands the maintainer a docket whose pending items each carry one question with options, recommendation, impact and evidence. Agent-autonomous for facts and for actions covered by standing authorization; signed for every new judgment. Never merges.

hud

Configure HUD display options (layout, presets, display elements)

launch

Shipyard

loft

Loft the shape before cutting steel — answer a design question that prose cannot settle by building a throwaway artifact: a pure logic module in a clickable shell, or structurally different UI variants behind one route. The captain reacts to the artifact; the answer folds into the decision; the artifact never docks. Use when a design question stalls in words, when a navigator map carries a loft ticket, or when a spec discussion reaches

minimal-code-discipline

YAGNI-ladder coding discipline for writing changes — existence-first, reuse before writing, dependency ladder, shortest correct diff, with non-negotiables that must never be minimized away

omc-doctor

Diagnose and fix oh-my-claudecode installation issues

関連スキル