Skip to content

feat(dag): saved workflow library and create-dag-workflow skill - #157

Merged
LeXwDeX merged 2 commits into
mainfrom
dev
Jul 31, 2026
Merged

feat(dag): saved workflow library and create-dag-workflow skill#157
LeXwDeX merged 2 commits into
mainfrom
dev

Conversation

@LeXwDeX

@LeXwDeX LeXwDeX commented Jul 31, 2026

Copy link
Copy Markdown
Owner

Promotes the saved workflow library (#156) from dev to main.

What ships

A DAG workflow spec used to be a throwaway file the agent rewrote on every run. It can now live under a name and be started by that name:

.opencode/workflows/<name>.yaml          project scope, committed with the repo
<config dir>/workflows/<name>.yaml       global scope, every project

Project shadows global — the same two-level scope, OPENCODE_CONFIG_DIR redirect, and lazy read that dag.jsonc already uses.

  • packages/opencode/src/dag/workflows.ts (new) — name resolution and library listing.
  • Workflow toolspec_path accepts a bare name; isName rejects separators, .yaml/.yml extensions, leading dots, and control characters, so every previously valid spec_path takes the identical old branch. A resolved name skips the external-directory prompt (both scopes are curated config at dag.jsonc's trust level, and only those two directories are reachable that way). New action: "list" shows saved specs, not running workflows.
  • Built-in skill create-dag-workflow — registered in both the core V2 plugin and the opencode V1 registry.
  • .opencode/workflows/change-review.yaml — a working example, guarded by a test that decodes it against StartSpec and checks its template ids and dependency edges resolve.
  • README / README.zh — GraphAgent as the outward product name, a "Using workflows" guide, and the project configuration file inventory.

Verification on dev

The full suite ran on the dev merge commit and is green: Unit Tests (linux), E2E Tests (linux), E2E Tests (windows), Typecheck, CodeQL.

The first Windows E2E attempt failed in Setup Bun → Install dependenciestree-sitter-powershell's node-gyp install script exited 9 while fetching Node headers, before any test ran. This commit touches no package.json, bun.lock, patches/, or CI config, so it cannot be the cause; a rerun of the failed job passed.

Locally: 348 dag/skill tests pass in packages/opencode, 20 plugin tests in packages/core, lint at 4710 (the main baseline, no new warnings), and an L3 deep security review returned 0 findings.

LeXwDeX and others added 2 commits August 1, 2026 00:01
A workflow spec was a throwaway file the agent rewrote per run. Saving one
under a name makes it a durable asset: `.opencode/workflows/<name>.yaml` for
the project, `<config dir>/workflows/<name>.yaml` for every project, project
shadowing global — the same two-level scope dag.jsonc already uses.

- dag/workflows.ts resolves a name to its spec and lists the library. A
  path-shaped spec_path bypasses it, so existing calls behave identically.
- The workflow tool gains `action: "list"`. A resolved name skips the
  external-directory prompt: both scopes are curated config at the same trust
  level as dag.jsonc, and only the library directories are reachable that way.
  isName rejects separators, YAML extensions, leading dots, and control
  characters, so nothing outside those directories resolves.
- New built-in skill create-dag-workflow (registered in both the core V2
  plugin and the opencode V1 registry) covers scope choice, the spec shape,
  the rules a saved spec must respect, and how to verify one.
- .opencode/workflows/change-review.yaml ships as a working example, guarded
  by a test that decodes it against StartSpec and checks its template ids and
  dependency edges resolve.
- README/README.zh: GraphAgent as the product name, a "Using workflows" guide,
  and the project configuration file inventory.
feat(dag): saved workflow library and create-dag-workflow skill
@LeXwDeX
LeXwDeX merged commit 960f7e6 into main Jul 31, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant