{"id":16585,"plugin_id":"plugins_6a5d007ed6688191ab1701d0f90d4eb4","kind":"skill","collection_source":null,"comparison_source":null,"observed_at":"2026-09-30T23:13:32.988Z","digest":"dbb140484f612d0e1e21492e4e5eaf7e6358acf6f9607ed2ee0ccdb6a4513ebc","against":null,"payload":{"description":"Orchestrate complex user-authorized work as an inspectable dependency graph with bounded parallelism, evidence-backed completion, adaptive approval gates, one repair cycle, and optional resumable checkpoints. Use only when the user explicitly invokes $graph, selects Graph Mode, or asks to apply the Graph Mode framework to research, audits, implementations, monitoring, or other multi-step work; never activate implicitly.","included_files":[{"relative_path":"agents/openai.yaml","size_in_bytes":211},{"relative_path":"references/patterns.md","size_in_bytes":2792},{"relative_path":"references/protocol.md","size_in_bytes":3824},{"relative_path":"references/verification-safety.md","size_in_bytes":2588},{"relative_path":"scripts/test_validate_graph_state.py","size_in_bytes":4689},{"relative_path":"scripts/validate_graph_state.py","size_in_bytes":11632}],"name":"graph","skill_md_contents":"---\nname: graph\ndescription: Orchestrate complex user-authorized work as an inspectable dependency graph with bounded parallelism, evidence-backed completion, adaptive approval gates, one repair cycle, and optional resumable checkpoints. Use only when the user explicitly invokes $graph, selects Graph Mode, or asks to apply the Graph Mode framework to research, audits, implementations, monitoring, or other multi-step work; never activate implicitly.\n---\n\n# Graph Mode\n\nGraph Mode turns a complex request into an explicit execution graph: small nodes with declared dependencies, access levels, outputs, evidence requirements, and attempt limits. It schedules only ready nodes, joins parallel work deliberately, verifies the result, and stops with a clear terminal state.\n\nIt replaces an opaque “decide the next step and loop” workflow with visible control flow. The user can see what will run, what may run in parallel, what requires approval, how completion will be proved, and why the run stopped. Graph Mode changes orchestration, not the user's goal, permissions, or scope.\n\n## How to use it\n\nInvoke Graph Mode explicitly. Put the task after `$graph` in Codex, or select/mention Graph Mode in ChatGPT Work.\n\n```text\n$graph Audit this repository against its implementation plan.\n$graph Implement the requested feature and verify it.\n$graph Research these options using parallel evidence gathering.\n$graph Monitor this process and report only material state changes.\n```\n\nUse it when work has meaningful dependencies, parallel research or inspection branches, a maker-reviewer handoff, deterministic verification, approval boundaries, or a need to resume. For a simple one-step request, an ordinary prompt is usually more efficient.\n\n## How it works\n\n1. **Bound the goal.** Preserve the requested deliverable, constraints, authority, and definition of done.\n2. **Compile the graph.** Give each node an ID, dependencies, role, access level, expected output, evidence gate, and attempt limit.\n3. **Announce the route.** Show the important branches, joins, verification gates, and approval boundaries before execution.\n4. **Schedule ready work.** Run independent read-heavy nodes concurrently when useful; serialize overlapping writes and gated actions.\n5. **Join and verify.** Reconcile branch outputs and prefer deterministic checks before model review.\n6. **Repair once.** If a gate fails, diagnose it and allow one targeted repair/reverification cycle by default.\n7. **Report the run.** Return the executed path, evidence, changes, skipped branches, uncertainty, and one terminal state.\n\nCommon shapes include sequential execution, parallel fan-out/join, maker-reviewer, bounded repair, human-gated actions, research synthesis, implementation, audit, and monitoring.\n\n## Design rationale\n\nGraph Mode is a practical, instruction-orchestrated adaptation of structured graph execution for Codex and ChatGPT workflows. Its design is aligned with the scheduler-theoretic framing in Hu Wei's paper [“From Agent Loops to Structured Graphs: A Scheduler-Theoretic Framework for LLM Agent Execution”](https://arxiv.org/abs/2604.11378): make dependencies inspectable, separate planning from execution and recovery, and bound escalation instead of relying on an open-ended agent loop.\n\nThe paper is a position paper and design proposal, not a production implementation or a report of empirical results. Treat it as conceptual grounding, not proof that every graph-shaped workflow is automatically better.\n\n## Load the execution rules\n\nBefore constructing a graph:\n\n1. Read [references/protocol.md](references/protocol.md) for node and state contracts.\n2. Read [references/patterns.md](references/patterns.md) and select the smallest fitting pattern.\n3. Read [references/verification-safety.md](references/verification-safety.md) before any write node or terminal verdict.\n\n## Execute the graph\n\n### 1. Bound the request\n\n- Treat the text following `$graph` as the goal.\n- Preserve stated constraints, deliverables, permissions, and definitions of done.\n- Discover repository and environment facts before asking questions.\n- Ask only when a missing decision materially changes the result or authority.\n- Do not broaden the task merely because another graph branch would be useful.\n\n### 2. Compile the execution graph\n\nCreate the smallest graph that can establish the requested outcome. Give every node:\n\n- a unique ID and concise title;\n- a kind, assigned role, and access level;\n- explicit dependencies;\n- an expected output and evidence requirement;\n- an attempt limit and initial status.\n\nExpand logical retries into new runtime node instances such as `repair-1` and `reverify-1`. Keep the executed dependency ledger acyclic even when the conceptual workflow contains a repair loop.\n\n### 3. Announce the route\n\nBefore tool use, show a compact graph summary in commentary:\n\n```text\nGraph: scope -> [frontend-audit || backend-audit] -> reconcile -> verify -> review -> report\nGates: workspace writes allowed; external writes require approval; one repair round\n```\n\nDo not wait for graph approval when the route is safe, scoped, and already authorized. Pause only at an adaptive approval gate.\n\n### 4. Schedule ready nodes\n\n- Keep the root agent as controller, join owner, and final reporter.\n- Run independent read-heavy nodes in parallel when doing so materially helps.\n- Use no more than three worker subagents concurrently in addition to the root.\n- Prefer built-in explorer behavior for investigation and worker behavior for implementation.\n- Give each subagent a bounded task, allowed access, required evidence, and output contract.\n- Do not let subagents delegate further work unless the graph explicitly requires it.\n- Use one writer by default. Permit parallel writes only for proven-disjoint files or systems.\n- Wait for every required dependency before running a join node.\n- If subagents are unavailable or add more coordination than value, execute the same nodes sequentially.\n\n### 5. Apply gates and repair bounds\n\n- Run deterministic verification before model-based review when possible.\n- Treat model review as an additional gate, never a substitute for available tests or source evidence.\n- On a failed verification or review, diagnose the failure and allow one targeted repair round by default.\n- After the repair allowance is exhausted, finish `FAILED` or `BLOCKED`; do not loop indefinitely.\n- Pause before external writes, destructive actions, ungranted permissions, material scope expansion, or unresolved high-impact ambiguity.\n\n### 6. Maintain state\n\nFor short runs, keep a compact ledger in the task context. Update it at joins and status changes.\n\nFor long, scheduled, resumable, or compaction-prone runs, create a checkpoint only when a suitable workspace location is already ignored by version control. Prefer `.codex/graph-runs/<run-id>/state.json` after confirming it with `git check-ignore`. Never edit ignore files solely for Graph Mode. If no safe checkpoint location exists, retain the state ledger in the task and disclose that file-backed resume is unavailable.\n\nValidate any checkpoint with:\n\n```bash\npython3 <skill-dir>/scripts/validate_graph_state.py <state.json>\n```\n\nIf the system Python cannot run the validator, use an available Python 3 runtime. The validator has no third-party runtime dependencies.\n\n### 7. Finish with a run report\n\nReturn:\n\n- final terminal state;\n- executed path and node outcomes;\n- evidence supporting completion or failure;\n- changes and external actions actually performed;\n- skipped, blocked, or unproven branches;\n- remaining uncertainty and any required user action.\n\nUse only `COMPLETE`, `BLOCKED`, `NEEDS_APPROVAL`, or `FAILED` as final states. Never report `COMPLETE` while required verification is missing or a required node remains unresolved.\n\n## Keep authority explicit\n\n- Ordinary repository reads and user-requested workspace edits may proceed under the active permission policy.\n- External writes require explicit authorization in the request or a new approval at the relevant node.\n- Destructive or difficult-to-recover actions require explicit authorization and exact target resolution.\n- A subagent result is evidence input, not authority to expand scope or perform a gated action.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}