Skip to content

Commit f5dff3b

Browse files
committed
docs(workflow): teach profile selection and project scripts
1 parent 81a0a2e commit f5dff3b

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

skills/dynamic-workflows/SKILL.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ return { summary, findings }
5656

5757
| API | Notes |
5858
|---|---|
59-
| `agent(prompt, opts?)` | Throws on failure. `opts`: `label`, `phase`, `schema`, `model`, `effort`, `provider`, `isolation: 'worktree'` |
59+
| `agent(prompt, opts?)` | Throws on failure. `opts`: `label`, `phase`, `schema`, `model`, `effort`, `profile` or `provider`, `isolation: 'worktree'` |
6060
| `parallel(thunks)` | Barrier; throw → `null` slot |
6161
| `pipeline(items, ...stages)` | Per-item chains; no cross-item barrier |
6262
| `phase(title)` / `log(msg)` | Progress; journaled |
@@ -85,7 +85,13 @@ const out = await agent('Return JSON findings', {
8585

8686
### Providers
8787

88-
Default: first **enabled ∩ available** provider (`agentProviders.enabled` in config, else all live providers in product order). Override with `opts.provider` or `meta.defaultProvider`.
88+
Profiles exposed by `open_workspace` may be selected with `opts.profile`. The
89+
profile supplies instructions, provider, model, and effort defaults; per-call
90+
`model` and `effort` override those defaults. `profile` and `provider` are
91+
mutually exclusive.
92+
93+
Without a profile, default provider resolution is `opts.provider`
94+
`meta.defaultProvider` → first **enabled ∩ available** provider.
8995

9096
### Resume
9197

src/workflow-contracts.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ assert.throws(
5151
() => agentOptsSchema.parse({ provider: "made-up" }),
5252
/Invalid option/,
5353
);
54+
assert.throws(
55+
() => agentOptsSchema.parse({ profile: "reviewer", provider: "codex" }),
56+
/mutually exclusive/,
57+
);
5458
assert.throws(() => agentOptsSchema.parse({ schema: [] }), /expected record/i);
5559
assert.throws(() => jsonValueSchema.parse(new Date()), /invalid input/i);
5660
assert.throws(() => jsonValueSchema.parse(() => undefined), /invalid input/i);
@@ -113,6 +117,8 @@ if (false) {
113117
// @ts-expect-error providers are exhaustive
114118
await agent("x", { provider: "made-up" });
115119

120+
await agent("review", { profile: "reviewer", effort: "high" });
121+
116122
const tuple = await parallel([
117123
async () => "text",
118124
async () => 42,

src/workflow-tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const WORKFLOW_UI_WAIT_MAX_MS = 30_000;
4747
const WORKFLOW_API_CHEATSHEET = `
4848
Workflow scripts (JS only):
4949
export const meta = { name, description, phases?, defaultProvider?, concurrency? }
50-
agent(prompt, { label?, phase?, schema?, model?, effort?, provider?, isolation?: 'worktree' })
50+
agent(prompt, { label?, phase?, schema?, model?, effort?, profile? | provider?, isolation?: 'worktree' })
5151
parallel(thunks) → Array<T|null> // barrier; throw → null
5252
pipeline(items, ...stages) // no cross-item barrier
5353
phase(title); log(msg); args

0 commit comments

Comments
 (0)