@supierior/workflower-authoring 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/package.json +7 -7
- package/skills/workflower-authoring/SKILL.md +85 -33
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ The skill helps an agent:
|
|
|
14
14
|
|
|
15
15
|
- design a folder-safe workflow id and step list;
|
|
16
16
|
- choose step commands and companion skills;
|
|
17
|
-
- scaffold a Pi package that registers a `WorkflowDefinition`;
|
|
18
|
-
- organize generated TypeScript workflow packages with a small `src/index.ts` entrypoint and one `src
|
|
17
|
+
- scaffold a Pi package that registers a `WorkflowDefinition` with `registerWorkflows([...])`;
|
|
18
|
+
- organize generated TypeScript workflow packages with a small `src/index.ts` entrypoint and one `src/<workflow-id>/` folder per workflow, holding that workflow's definition, bundled skills, and scripts together (nesting under `src/workflows/<workflow-id>/` only when the package needs it), plus a shared `src/routing/` router and shared skill-context folder when multiple workflows need them;
|
|
19
19
|
- teach the garden/flower artifact model, including `.workflower/workflows/<garden-name>/0001-<workflow-id>/` and each flower's `index.json`;
|
|
20
|
-
- configure workflow-level `model` and `thinkingLevel` defaults (including level names `tiny`/`small`/`medium`/`large`/`xl`),
|
|
21
|
-
- document garden state keys, `workflower_state_set`/`workflower_state_get`/`workflower_state_list` calls, and
|
|
20
|
+
- configure workflow-level `model` and `thinkingLevel` defaults (including level names `tiny`/`small`/`medium`/`large`/`xl`) deliberately, with step-level overrides tuned to each step's cost, workflow-level `autoNext`, `userInvocable`, and `modelInvocable`, and workflow-level `pollen`/`acceptPollen` when chained workflows should pass or ignore previous flower outputs;
|
|
21
|
+
- document garden state keys, `workflower_state_set`/`workflower_state_get`/`workflower_state_list` calls, and a single shared `<package-id>-route` router command when small facts such as review ratings drive later steps, including bounded review loops with an attempt cap;
|
|
22
22
|
- register computed step prompts with `registerWorkflowerCommand` when a step needs generated content instead of a static bundled skill;
|
|
23
23
|
- add package metadata that loads the generated extension and skills;
|
|
24
24
|
- document a smoke test using `/wf:<workflow-id> <garden-name>`, optional active handoff with `/wf:<next-workflow-id>`, `/next`, and the `/wf` management subcommands (`status`, `stop`, `list`, `clean`, `state`, `resume`, `config`).
|
|
@@ -38,13 +38,15 @@ Generated guidance should align with Workflower's garden/flower model:
|
|
|
38
38
|
- Workflow ids must be folder-safe (`^[a-z0-9_-]+$`) because ids become `/wf:<workflow-id>` commands and flower folder names.
|
|
39
39
|
- Start a fresh garden with `/wf:<workflow-id> <garden-name>`.
|
|
40
40
|
- While a workflow is active, hand off to another workflow in the same garden with `/wf:<next-workflow-id>` and no garden name.
|
|
41
|
-
- Artifacts live in flower folders such as `.workflower/workflows/<garden-name>/0001-<workflow-id>/`; each flower has an `index.json` recording status and pollen paths. A flower only exists at runtime, once a workflow starts in a garden — it is distinct from a package's own `src
|
|
42
|
-
-
|
|
41
|
+
- Artifacts live in flower folders such as `.workflower/workflows/<garden-name>/0001-<workflow-id>/`; each flower has an `index.json` recording status and pollen paths. A flower only exists at runtime, once a workflow starts in a garden — it is distinct from a package's own `src/<workflow-id>/` source folder, which holds that workflow's definition, skills, and scripts at author time.
|
|
42
|
+
- Register workflows with `registerWorkflows([...])`, not the deprecated singular `registerWorkflow`; the registry already dedupes idempotently, so no manual "already registered" guard is needed in the extension entrypoint.
|
|
43
|
+
- Use workflow-level `model` and `thinkingLevel` as defaults for all steps, set deliberately rather than left unset; step-level runtime settings override only the current step, tuned to that step's actual cost, before falling back to workflow settings and then starting defaults. `model` may be a level name (`tiny`/`small`/`medium`/`large`/`xl`), a `provider/model-id` string, or an ordered fallback array; level names resolve through the user's `/wf config` model-level mapping.
|
|
43
44
|
- Use workflow-level `autoNext` to set the default for steps that omit their own `autoNext`.
|
|
44
|
-
- Use workflow-level `userInvocable` (default `true`) and `modelInvocable` (default `true`) to control whether a workflow can be started with `/wf:<id>` and/or via `workflower_handoff`.
|
|
45
|
+
- Use workflow-level `userInvocable` (default `true`) and `modelInvocable` (default `true`) to control whether a workflow can be started with `/wf:<id>` and/or via `workflower_handoff`. Several public workflows may intentionally share the same private loop chain (a full entry and a shortcut entry, for example).
|
|
45
46
|
- Use workflow-level `pollen` and `acceptPollen` to control which output paths are referenced during handoff.
|
|
47
|
+
- `clearOnStart`, `clearOnCompletion`, and `cleanupOnCompletion` all default to `true`; only set them to `false`, and only when turning that default off is actually wanted — `cleanupOnCompletion: false` in particular should be reserved for workflows whose outputs are a genuine user-facing deliverable, not a debugging convenience.
|
|
46
48
|
- Use garden state for small JSON-compatible facts that must survive context-clearing boundaries, such as `review.rating`; instruct agents exactly when to call `workflower_state_set`, `workflower_state_get`, and `workflower_state_list`.
|
|
47
|
-
- Use `registerWorkflowerCommand` for step commands whose prompt content must be computed at step-start time instead of a static bundled skill.
|
|
49
|
+
- Use `registerWorkflowerCommand` for step commands whose prompt content must be computed at step-start time instead of a static bundled skill. When a package has more than one deterministic branch, register a single router command named `<package-id>-route` that switches on a route-name argument, rather than one command per branch.
|
|
48
50
|
- Use deterministic router code or model-callable tools for autonomous branching; do not rely on assistant text printing slash commands.
|
|
49
51
|
- Use the built-in `/wf` subcommands (`status`, `stop`, `list`, `clean <garden-name>`, `state list|get|set`, `resume [garden-name]`, `config`) for manual inspection, cleanup, and model-level configuration.
|
|
50
52
|
- Cleanup waits until the whole garden completes; handoffs preserve previous flowers for pollen and inspection.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supierior/workflower-authoring",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Pi skill package for creating Workflower workflow packages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"skills",
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
|
-
"pi": {
|
|
19
|
-
"skills": [
|
|
20
|
-
"./skills"
|
|
21
|
-
]
|
|
22
|
-
},
|
|
23
18
|
"scripts": {
|
|
24
19
|
"build": "echo \"No build for workflower-authoring\"",
|
|
25
20
|
"test": "echo \"No tests for workflower-authoring\"",
|
|
26
21
|
"typecheck": "echo \"No typecheck for workflower-authoring\"",
|
|
27
22
|
"lint": "echo \"No lint for workflower-authoring\"",
|
|
28
23
|
"clean": "rimraf dist coverage .turbo || true"
|
|
24
|
+
},
|
|
25
|
+
"pi": {
|
|
26
|
+
"skills": [
|
|
27
|
+
"./skills"
|
|
28
|
+
]
|
|
29
29
|
}
|
|
30
|
-
}
|
|
30
|
+
}
|
|
@@ -26,12 +26,13 @@ Ask only for missing information. Gather:
|
|
|
26
26
|
- pass the latest completed step outputs by default when handing off to another workflow;
|
|
27
27
|
- set workflow-level `pollen` when only specific output path(s) should be pinned and handed off;
|
|
28
28
|
- set workflow-level `acceptPollen: false` when a workflow should ignore incoming pollen paths from a previous flower.
|
|
29
|
-
8. Lifecycle preferences:
|
|
30
|
-
- preserve artifacts after final garden completion? Set `cleanupOnCompletion: false
|
|
31
|
-
-
|
|
32
|
-
- keep
|
|
29
|
+
8. Lifecycle preferences. `clearOnStart`, `clearOnCompletion`, and `cleanupOnCompletion` all default to `true`; only set them when turning that default _off_ (`false`), and only leave a field unset when the default is what you want:
|
|
30
|
+
- preserve artifacts after final garden completion instead of cleaning them up? Set `cleanupOnCompletion: false` — only when the workflow's outputs are a real user-facing deliverable (a final report, a doc meant for later review, screenshots), not as a standing habit and never just to make inspection easier while iterating on the workflow itself.
|
|
31
|
+
- continue the visible session that was already active instead of starting cold? Set `clearOnStart: false` — typical for a shortcut entry workflow chained into mid-conversation, not typical for a private loop workflow reached only by handoff.
|
|
32
|
+
- keep the visible session instead of clearing it when the workflow completes? Set `clearOnCompletion: false`.
|
|
33
33
|
- keep context between specific steps? Set that step's `clearOnNext: false`.
|
|
34
34
|
- immediately advance after a step finishes? Set that step's `autoNext: true`.
|
|
35
|
+
9. Composability: does this workflow need more than one public entry point? A shortcut entry workflow (skips an early question-gathering step, `clearOnStart: false`, jumps straight into a shared step) can hand off into the same private loop chain as the full entry workflow. Design the shared private chain once; add thin entry workflows around it as needed.
|
|
35
36
|
|
|
36
37
|
## Validate the design
|
|
37
38
|
|
|
@@ -55,13 +56,16 @@ For a new package, create this structure. In a monorepo it may live under `packa
|
|
|
55
56
|
<package-root>/
|
|
56
57
|
├── src/
|
|
57
58
|
│ ├── index.ts # registers every workflow + calls setupWorkflower(pi)
|
|
58
|
-
│
|
|
59
|
-
│
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
│
|
|
63
|
-
│
|
|
64
|
-
│
|
|
59
|
+
│ ├── routing/
|
|
60
|
+
│ │ └── <package-id>-router.ts # one shared router command for all deterministic branching, if any
|
|
61
|
+
│ ├── <shared-context-folder>/ # markdown context shared by skills across workflows, if any
|
|
62
|
+
│ └── my-workflow/ # folder name matches the workflow id
|
|
63
|
+
│ ├── my-workflow-workflow.ts # WorkflowDefinition
|
|
64
|
+
│ ├── skills/
|
|
65
|
+
│ │ └── my-first-step/SKILL.md # when using skill-backed steps
|
|
66
|
+
│ └── scripts/
|
|
67
|
+
│ └── helper.js # workflow-scoped scripts, if any
|
|
68
|
+
├── docs/ # optional: standards multiple skills/scripts enforce
|
|
65
69
|
├── package.json
|
|
66
70
|
├── README.md
|
|
67
71
|
├── tsconfig.json
|
|
@@ -69,17 +73,21 @@ For a new package, create this structure. In a monorepo it may live under `packa
|
|
|
69
73
|
└── vitest.config.ts
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
One folder per workflow id, even for a single-workflow package: everything that workflow needs (definition, its skills, its scripts) stays together under `src/workflows/<workflow-id
|
|
76
|
+
One folder per workflow id, even for a single-workflow package: everything that workflow needs (definition, its skills, its scripts) stays together directly under `src/<workflow-id>/`. Default to this flat shape; only nest an extra `src/workflows/<workflow-id>/` layer when the package also has other non-workflow top-level `src/` concerns that a flat `src/<workflow-id>/` would otherwise crowd. Use an existing small workflow package as a scaffold when available, but prefer the architecture above for new packages.
|
|
73
77
|
|
|
74
78
|
## Architecture guidance
|
|
75
79
|
|
|
76
80
|
Generated TypeScript workflow packages should follow the suPIerior package architecture direction:
|
|
77
81
|
|
|
78
|
-
- Keep `src/index.ts` small and stable: import each `WorkflowDefinition`, call `
|
|
79
|
-
- Group everything one workflow needs under its own `src
|
|
80
|
-
- If multiple workflows share
|
|
82
|
+
- Keep `src/index.ts` small and stable: import each `WorkflowDefinition`, call `registerWorkflows([...])` once with all of them, then call `setupWorkflower(pi)`, and export the result as the default extension entrypoint. This is the one file that shows the whole package's workflow registration at a glance. Do not hand-roll a module-level "already registered" boolean guard: `registerWorkflows` already dedupes idempotently (re-registering the same definition is a no-op; a conflicting redefinition under the same id throws), so the extension entrypoint can call it unconditionally on every load.
|
|
83
|
+
- Group everything one workflow needs under its own `src/<workflow-id>/` folder: the `WorkflowDefinition`, its bundled step skills (`skills/`), and any helper scripts (`scripts/`). Add other folders local to that workflow (for example its own `internals/`) only when that workflow's own logic grows past a few files.
|
|
84
|
+
- If multiple workflows share deterministic routing logic, put it in one `src/routing/<package-id>-router.ts` that registers a single `registerWorkflowerCommand` named `<package-id>-route`, whose handler switches on a route-name argument (see "Step archetypes" below), rather than one command per branch.
|
|
85
|
+
- If multiple skills across different workflows share instructional context (methodology docs, contracts, quality bars), put that markdown under a domain-named shared folder, for example `src/global-skill-context/`, and reference it by relative path from each skill's own instructions.
|
|
86
|
+
- If multiple workflows share non-Pi logic that is neither routing nor skill context, put it under `src/internals/<domain-capability>/` using workflow domain language, not generic names like `utils` or `helpers`. Workflows may import shared `src/internals/`; shared internals should not import from a specific workflow or from `src/index.ts`.
|
|
87
|
+
- `scripts/` inside a workflow folder may hold either TypeScript helpers imported by that workflow's definition, or standalone executable scripts (plain `.js`, run as `node path/to/script.js --flag`) that a bundled skill's instructions shell out to via bash. When a skill relies on the latter, its `SKILL.md` should show the exact copy-paste invocation.
|
|
88
|
+
- An optional `docs/` folder at the package root can hold standards documents that multiple skills or scripts enforce (for example a required output file-layout convention) — distinct from the README (user-facing smoke test) and from shared skill-context markdown (instructional content meant to be injected into a skill's own prompt).
|
|
81
89
|
- Do not create empty architecture folders for tiny packages; add seams when they clarify navigation.
|
|
82
|
-
- Reserve "flower" for the runtime run-instance concept (`.workflower/workflows/<garden-name>/0001-<workflow-id>/`). A `src
|
|
90
|
+
- Reserve "flower" for the runtime run-instance concept (`.workflower/workflows/<garden-name>/0001-<workflow-id>/`). A `src/<workflow-id>/` folder holds a workflow's source — its definition, skills, and scripts — not a flower; a flower only exists once that workflow starts running in a garden.
|
|
83
91
|
|
|
84
92
|
Markdown-only companion skill packages can stay simple. If a skill grows beyond one `SKILL.md` plus a few directly referenced files, use an analogous split with `SKILL.md`, `skill-api/`, and `internals/`.
|
|
85
93
|
|
|
@@ -89,19 +97,19 @@ Markdown-only companion skill packages can stay simple. If a skill grows beyond
|
|
|
89
97
|
|
|
90
98
|
```ts
|
|
91
99
|
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
92
|
-
import setupWorkflower, {
|
|
100
|
+
import setupWorkflower, { registerWorkflows } from "@supierior/workflower";
|
|
93
101
|
|
|
94
|
-
import { myWorkflow } from "./
|
|
102
|
+
import { myWorkflow } from "./my-workflow/my-workflow-workflow";
|
|
95
103
|
|
|
96
104
|
export { myWorkflow };
|
|
97
105
|
|
|
98
106
|
export default function myWorkflowPackageExtension(pi: ExtensionAPI): void {
|
|
99
|
-
|
|
107
|
+
registerWorkflows([myWorkflow]);
|
|
100
108
|
setupWorkflower(pi);
|
|
101
109
|
}
|
|
102
110
|
```
|
|
103
111
|
|
|
104
|
-
`src/
|
|
112
|
+
`src/my-workflow/my-workflow-workflow.ts`:
|
|
105
113
|
|
|
106
114
|
```ts
|
|
107
115
|
import type { WorkflowDefinition } from "@supierior/workflower";
|
|
@@ -110,9 +118,12 @@ export const myWorkflow: WorkflowDefinition = {
|
|
|
110
118
|
id: "my-workflow",
|
|
111
119
|
userInvocable: true,
|
|
112
120
|
modelInvocable: true,
|
|
121
|
+
// cleanupOnCompletion defaults to true (artifacts are cleaned up); only set it to
|
|
122
|
+
// false when the workflow's outputs are a real user-facing deliverable meant to
|
|
123
|
+
// survive after the garden finishes, e.g. this workflow's second-step.md report.
|
|
113
124
|
cleanupOnCompletion: false,
|
|
114
|
-
model:
|
|
115
|
-
thinkingLevel: "
|
|
125
|
+
model: "medium",
|
|
126
|
+
thinkingLevel: "low",
|
|
116
127
|
autoNext: false,
|
|
117
128
|
pollen: "second-step.md",
|
|
118
129
|
acceptPollen: true,
|
|
@@ -121,6 +132,8 @@ export const myWorkflow: WorkflowDefinition = {
|
|
|
121
132
|
id: "first-step",
|
|
122
133
|
command: "/skill:my-first-step",
|
|
123
134
|
outputs: ["first-step.md"],
|
|
135
|
+
// Override the workflow default for the one step doing real authoring work.
|
|
136
|
+
model: "large",
|
|
124
137
|
thinkingLevel: "high",
|
|
125
138
|
clearOnNext: false,
|
|
126
139
|
},
|
|
@@ -136,19 +149,20 @@ export const myWorkflow: WorkflowDefinition = {
|
|
|
136
149
|
For a package with several workflows, `src/index.ts` imports each `WorkflowDefinition` and registers all of them before calling `setupWorkflower(pi)` once:
|
|
137
150
|
|
|
138
151
|
```ts
|
|
139
|
-
import { firstWorkflow } from "./
|
|
140
|
-
import { secondWorkflow } from "./
|
|
152
|
+
import { firstWorkflow } from "./first-workflow/first-workflow-workflow";
|
|
153
|
+
import { secondWorkflow } from "./second-workflow/second-workflow-workflow";
|
|
141
154
|
|
|
142
155
|
export default function myWorkflowPackageExtension(pi: ExtensionAPI): void {
|
|
143
|
-
|
|
144
|
-
registerWorkflow(secondWorkflow);
|
|
156
|
+
registerWorkflows([firstWorkflow, secondWorkflow]);
|
|
145
157
|
setupWorkflower(pi);
|
|
146
158
|
}
|
|
147
159
|
```
|
|
148
160
|
|
|
149
161
|
Use `setupWorkflower(pi)` in workflow packages so installing the workflow package also initializes Workflower's `/wf`, `/wf:<id>`, and `/next` commands.
|
|
150
162
|
|
|
151
|
-
|
|
163
|
+
Set `model` and `thinkingLevel` deliberately — do not leave every workflow on Workflower's start-of-garden defaults. Set workflow-level `model`/`thinkingLevel` as the default for every step, then override per step to match that step's actual cost: a cheap router-only step (see "Step archetypes" below) can drop to a low/minimal thinking level, while the one step doing real authoring or review work should get the workflow's best model and a higher thinking level. Step-level `model` and `thinkingLevel` override the workflow default for only that step; the next step falls back to the workflow settings, then the model and thinking level that were active when the garden started. `model` accepts a level name (`tiny`, `small`, `medium`, `large`, `xl`), a `provider/model-id` string, or an ordered fallback array of `provider/model-id` strings. Level names resolve against the user's `/wf config` model-level mapping (`.workflower/config.json`); do not assume a level name resolves to a specific model.
|
|
164
|
+
|
|
165
|
+
`WorkflowDefinition` and `WorkflowStep` are fully documented in `@supierior/workflower`'s type declarations, including which fields are optional and each field's default — treat the installed package's `.d.ts` as the source of truth for current optional/required fields and defaults, and re-check it if this skill's guidance and the type declarations ever disagree.
|
|
152
166
|
|
|
153
167
|
Workflow-level `autoNext?: boolean` sets the default for steps that omit their own `autoNext`; it defaults to `false`. Step-level `autoNext` overrides it for that step only.
|
|
154
168
|
|
|
@@ -190,7 +204,7 @@ await wf.handoff(nextWorkflow);
|
|
|
190
204
|
|
|
191
205
|
## Custom private step commands
|
|
192
206
|
|
|
193
|
-
Use `registerWorkflowerCommand` when a step's `command` should expand to generated, per-invocation prompt content instead of a static skill body, for example injecting the current garden state or a computed file list into the kickoff prompt. Register once at extension startup, next to `
|
|
207
|
+
Use `registerWorkflowerCommand` when a step's `command` should expand to generated, per-invocation prompt content instead of a static skill body, for example injecting the current garden state or a computed file list into the kickoff prompt. Register once at extension startup, next to `registerWorkflows`:
|
|
194
208
|
|
|
195
209
|
```ts
|
|
196
210
|
import { registerWorkflowerCommand } from "@supierior/workflower";
|
|
@@ -206,6 +220,16 @@ registerWorkflowerCommand({
|
|
|
206
220
|
|
|
207
221
|
Reference it from a step as `command: "/my-workflow-review-brief"`. Prefer a bundled skill (`/skill:<name>`) for static, hand-written step instructions; reach for `registerWorkflowerCommand` only when the prompt content must be computed at step-start time.
|
|
208
222
|
|
|
223
|
+
## Step archetypes
|
|
224
|
+
|
|
225
|
+
Most steps are one of three shapes. Recognizing which one a step is decides whether it needs a skill, `outputs`, `autoNext`, or none of those:
|
|
226
|
+
|
|
227
|
+
- **Skill step** — does the actual work. `command: "/skill:<name>"`, declares `outputs` when it writes files, usually `autoNext: true` unless a human should review the result before continuing.
|
|
228
|
+
- **Router step** — pure deterministic branching, no skill. `command: "/<package-id>-route <route-name>"` hitting the single shared router command (see "Architecture guidance" above), never declares `outputs`, always `autoNext: true` and `clearOnNext: true` since it only reads/writes garden state and hands off. Give it a step id starting with `route-`.
|
|
229
|
+
- **Human-pause step** — waits for a person to reply before continuing, no skill required if the prompt is simple. No `autoNext`, and usually `clearOnNext: false` so the question and the eventual answer stay in the same visible context. This differs from a router step's missing `autoNext`: a router step still moves on its own by calling `workflower_handoff`, a human-pause step genuinely stops until the user responds.
|
|
230
|
+
|
|
231
|
+
A bounded review loop composes a skill step (implement/improve), another skill step (review, writes a `review.score` state key), and a router step (reads the score, either hands off forward on pass or hands back to the first skill step with an incremented attempt counter). Cap the attempt counter with a constant; once exceeded, the router step's prompt should tell the model to stop and ask the user to intervene rather than handing off again.
|
|
232
|
+
|
|
209
233
|
## Compact kickoff prompt display
|
|
210
234
|
|
|
211
235
|
Current Workflower shows generated workflow kickoff prompts compactly in chat. A user may see only a label such as `Workflow: my-workflow — demo-garden` or `Step: first-step` instead of the whole generated prompt.
|
|
@@ -219,7 +243,7 @@ Teach junior workflow authors these rules:
|
|
|
219
243
|
|
|
220
244
|
## Step skill template
|
|
221
245
|
|
|
222
|
-
`src/
|
|
246
|
+
`src/my-workflow/skills/my-first-step/SKILL.md`:
|
|
223
247
|
|
|
224
248
|
```markdown
|
|
225
249
|
---
|
|
@@ -245,6 +269,29 @@ Describe the concrete outcome of this step.
|
|
|
245
269
|
5. Tell the user what was written and, unless this step has `autoNext: true`, tell them to inspect the output and run `/next` when ready.
|
|
246
270
|
```
|
|
247
271
|
|
|
272
|
+
## Minimal workflow example
|
|
273
|
+
|
|
274
|
+
Not every workflow needs `outputs` or `pollen`. A workflow with no file artifacts at all is valid — for example a two-step counter that only reads and writes garden state:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
export const counterWorkflow: WorkflowDefinition = {
|
|
278
|
+
id: "counter",
|
|
279
|
+
model: "medium",
|
|
280
|
+
thinkingLevel: "low",
|
|
281
|
+
steps: [
|
|
282
|
+
{ id: "initialize-counter", command: "/skill:counter-init", clearOnNext: true },
|
|
283
|
+
{
|
|
284
|
+
id: "start-counter-loop",
|
|
285
|
+
command: "/skill:counter-start-loop",
|
|
286
|
+
autoNext: true,
|
|
287
|
+
clearOnNext: true,
|
|
288
|
+
},
|
|
289
|
+
],
|
|
290
|
+
};
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Don't add `outputs`, `pollen`, or lifecycle overrides a workflow doesn't need just to match a bigger template.
|
|
294
|
+
|
|
248
295
|
## package.json requirements
|
|
249
296
|
|
|
250
297
|
A workflow package should include:
|
|
@@ -260,7 +307,7 @@ A workflow package should include:
|
|
|
260
307
|
},
|
|
261
308
|
"pi": {
|
|
262
309
|
"extensions": ["./dist/index.mjs"],
|
|
263
|
-
"skills": ["./src
|
|
310
|
+
"skills": ["./src/*/skills"]
|
|
264
311
|
}
|
|
265
312
|
}
|
|
266
313
|
```
|
|
@@ -316,12 +363,17 @@ Cleanup waits until the whole garden completes. Handoffs preserve earlier flower
|
|
|
316
363
|
|
|
317
364
|
Before finishing:
|
|
318
365
|
|
|
319
|
-
- Each workflow lives in its own `src
|
|
320
|
-
-
|
|
366
|
+
- Each workflow lives in its own `src/<workflow-id>/` folder alongside its bundled skills and scripts (nested under `src/workflows/<workflow-id>/` only if the package needs that extra layer — see "Minimal workflow package shape").
|
|
367
|
+
- Every workflow is registered in one `registerWorkflows([...])` call in `src/index.ts`, during extension startup, with no hand-rolled "already registered" guard.
|
|
321
368
|
- The package initializes Workflower with `setupWorkflower(pi)`.
|
|
322
369
|
- Every `/skill:<name>` command has a matching bundled skill under its workflow's `skills/` folder.
|
|
323
|
-
- Skill instructions and workflow `outputs` agree.
|
|
370
|
+
- Skill instructions and workflow `outputs` agree; steps that don't write files (router steps, state-only review steps) correctly omit `outputs` rather than declaring an empty or fake one.
|
|
324
371
|
- The package manifest loads both extension and skills.
|
|
372
|
+
- Every workflow-level and step-level field set on a `WorkflowDefinition` differs from that field's documented default; fields left at their default are omitted rather than restated (check `@supierior/workflower`'s type declarations for current defaults).
|
|
373
|
+
- `model` and `thinkingLevel` are set deliberately at the workflow level and tuned per step (higher for the step doing real authoring/review work, lower for router-only steps), not left unset by default.
|
|
374
|
+
- `cleanupOnCompletion: false` is only used when the workflow's outputs are a genuine user-facing deliverable meant to survive after the garden completes — not left over from debugging, and not set merely to make artifacts easier to inspect while iterating.
|
|
375
|
+
- A package with more than one loop-back branch shares a single `registerWorkflowerCommand` router named `<package-id>-route`, rather than one command per branch; router steps have no skill, no `outputs`, and always `autoNext: true` + `clearOnNext: true`.
|
|
376
|
+
- If several public workflows share a private loop chain (a full entry and a shortcut entry, for example), that composability is intentional and documented, not accidental duplication.
|
|
325
377
|
- The README includes a copy-paste smoke test using `/wf:<workflow-id> <garden-name>`.
|
|
326
378
|
- The README and bundled skills explain active handoff with `/wf:<next-workflow-id>` when relevant.
|
|
327
379
|
- The README or workflow usage notes explain compact prompt display and warn authors not to verify private skill injection by visible transcript content alone.
|