@supierior/workflower-authoring 0.1.0
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 +50 -0
- package/package.json +30 -0
- package/skills/workflower-authoring/SKILL.md +336 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @supierior/workflower-authoring
|
|
2
|
+
|
|
3
|
+
Standalone Pi skill package for creating Workflower workflow packages.
|
|
4
|
+
|
|
5
|
+
Install this package when you want to ask Pi to scaffold or modify a workflow package. It does not load the Workflower runtime extension itself; generated workflow packages should depend on `@supierior/workflower` and initialize it from their extension entrypoint.
|
|
6
|
+
|
|
7
|
+
## Skill
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
/skill:workflower-authoring create a workflow for <goal>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The skill helps an agent:
|
|
14
|
+
|
|
15
|
+
- design a folder-safe workflow id and step list;
|
|
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/workflows/<workflow-id>/` folder per workflow, holding that workflow's definition, bundled skills, and scripts together;
|
|
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`), optional step-level runtime overrides, 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 deterministic router commands/tools when small facts such as review ratings drive later steps;
|
|
22
|
+
- register computed step prompts with `registerWorkflowerCommand` when a step needs generated content instead of a static bundled skill;
|
|
23
|
+
- add package metadata that loads the generated extension and skills;
|
|
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`).
|
|
25
|
+
|
|
26
|
+
## Why standalone?
|
|
27
|
+
|
|
28
|
+
Authoring workflows and running workflows are separate concerns:
|
|
29
|
+
|
|
30
|
+
- `@supierior/workflower-authoring` teaches Pi how to create workflow packages.
|
|
31
|
+
- `@supierior/workflower` provides the runtime commands and workflow state handling.
|
|
32
|
+
- Generated workflow packages can depend on `@supierior/workflower` internally so users install only the workflow package they intend to run. The authoring guidance follows the repository architecture notes for AI-navigable package structure without adding unnecessary folders to this small Markdown-only skill package.
|
|
33
|
+
|
|
34
|
+
## Runtime model taught by this package
|
|
35
|
+
|
|
36
|
+
Generated guidance should align with Workflower's garden/flower model:
|
|
37
|
+
|
|
38
|
+
- Workflow ids must be folder-safe (`^[a-z0-9_-]+$`) because ids become `/wf:<workflow-id>` commands and flower folder names.
|
|
39
|
+
- Start a fresh garden with `/wf:<workflow-id> <garden-name>`.
|
|
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/workflows/<workflow-id>/` source folder, which holds that workflow's definition, skills, and scripts at author time.
|
|
42
|
+
- Use workflow-level `model` and `thinkingLevel` as defaults for all steps; step-level runtime settings override only the current step 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
|
+
- 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 `pollen` and `acceptPollen` to control which output paths are referenced during handoff.
|
|
46
|
+
- 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.
|
|
48
|
+
- Use deterministic router code or model-callable tools for autonomous branching; do not rely on assistant text printing slash commands.
|
|
49
|
+
- 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
|
+
- Cleanup waits until the whole garden completes; handoffs preserve previous flowers for pollen and inspection.
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@supierior/workflower-authoring",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Pi skill package for creating Workflower workflow packages.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"pi-package",
|
|
7
|
+
"pi",
|
|
8
|
+
"skill",
|
|
9
|
+
"workflow",
|
|
10
|
+
"workflower",
|
|
11
|
+
"authoring"
|
|
12
|
+
],
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"files": [
|
|
15
|
+
"skills",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"pi": {
|
|
19
|
+
"skills": [
|
|
20
|
+
"./skills"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "echo \"No build for workflower-authoring\"",
|
|
25
|
+
"test": "echo \"No tests for workflower-authoring\"",
|
|
26
|
+
"typecheck": "echo \"No typecheck for workflower-authoring\"",
|
|
27
|
+
"lint": "echo \"No lint for workflower-authoring\"",
|
|
28
|
+
"clean": "rimraf dist coverage .turbo || true"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: workflower-authoring
|
|
3
|
+
description: Creates or modifies Pi Workflower workflow packages, workflow definitions, and companion step skills. Use when a user asks Pi to create, scaffold, or update a Workflower workflow.
|
|
4
|
+
allowed-tools: read write edit bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Workflower Authoring
|
|
8
|
+
|
|
9
|
+
Use this skill when the user wants a Workflower workflow created or changed.
|
|
10
|
+
|
|
11
|
+
This is a standalone authoring skill. The user does not need to install or run `@supierior/workflower` just to use this skill. Generated workflow packages should depend on `@supierior/workflower` internally and initialize it from their extension entrypoint, so workflow users can install the generated workflow package rather than manually installing Workflower first.
|
|
12
|
+
|
|
13
|
+
Workflower runs garden-scoped multi-step workflows. Start the first flower with `/wf:<workflow-id> <garden-name>`, hand off to another workflow while active with `/wf:<next-workflow-id>`, and advance steps with `/next`. A workflow package usually registers a `WorkflowDefinition` from a Pi extension entrypoint and may ship companion skills used by each step.
|
|
14
|
+
|
|
15
|
+
## First, clarify the workflow
|
|
16
|
+
|
|
17
|
+
Ask only for missing information. Gather:
|
|
18
|
+
|
|
19
|
+
1. Workflow id, for example `feature`, `github_issue`, or `release-notes`.
|
|
20
|
+
2. Initial garden name example for README smoke tests, such as `demo-garden`.
|
|
21
|
+
3. What the workflow should accomplish.
|
|
22
|
+
4. Step list, including each step's purpose.
|
|
23
|
+
5. Command for each step. Prefer `/skill:<skill-name>` when the step should be implemented by a bundled skill.
|
|
24
|
+
6. Expected output files for each step, if any.
|
|
25
|
+
7. Pollen behavior:
|
|
26
|
+
- pass the latest completed step outputs by default when handing off to another workflow;
|
|
27
|
+
- set workflow-level `pollen` when only specific output path(s) should be pinned and handed off;
|
|
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
|
+
- keep same visible session on start? Set `clearOnStart: false`.
|
|
32
|
+
- keep same visible session on completion? Set `clearOnCompletion: false`.
|
|
33
|
+
- keep context between specific steps? Set that step's `clearOnNext: false`.
|
|
34
|
+
- immediately advance after a step finishes? Set that step's `autoNext: true`.
|
|
35
|
+
|
|
36
|
+
## Validate the design
|
|
37
|
+
|
|
38
|
+
Before writing files:
|
|
39
|
+
|
|
40
|
+
- Workflow ids must be folder-safe and match `^[a-z0-9_-]+$`: lowercase ASCII letters, digits, underscores, and hyphens only. Do not use colon-separated, uppercase, whitespace, slash, dot-segment, or quoted ids.
|
|
41
|
+
- The initial garden name is provided by the user at runtime with `/wf:<workflow-id> <garden-name>` and becomes `.workflower/workflows/<garden-name>/`.
|
|
42
|
+
- The first workflow execution creates a flower workdir like `.workflower/workflows/<garden-name>/0001-<workflow-id>/` and a flower index at `.workflower/workflows/<garden-name>/0001-<workflow-id>/index.json`.
|
|
43
|
+
- While a workflow is active, hand off to another workflow with `/wf:<next-workflow-id>` and no garden name; Workflower creates the next flower in the same garden, such as `.workflower/workflows/<garden-name>/0002-<next-workflow-id>/`.
|
|
44
|
+
- Step ids should be short, stable, lowercase kebab-case.
|
|
45
|
+
- Step commands should exist or be created as bundled skills/commands.
|
|
46
|
+
- Output paths should be relative file paths under the workflow workdir.
|
|
47
|
+
- If a skill writes an output, its instructions must mention the exact output filename declared in the workflow definition.
|
|
48
|
+
- If a skill reads a previous output, its instructions must read from the previous-step output path provided by the kickoff prompt.
|
|
49
|
+
|
|
50
|
+
## Minimal workflow package shape
|
|
51
|
+
|
|
52
|
+
For a new package, create this structure. In a monorepo it may live under `packages/<package-name>/`; in a standalone repo it can live at the repository root.
|
|
53
|
+
|
|
54
|
+
```text
|
|
55
|
+
<package-root>/
|
|
56
|
+
├── src/
|
|
57
|
+
│ ├── index.ts # registers every workflow + calls setupWorkflower(pi)
|
|
58
|
+
│ └── workflows/
|
|
59
|
+
│ └── my-workflow/ # folder name matches the workflow id
|
|
60
|
+
│ ├── my-workflow-workflow.ts # WorkflowDefinition
|
|
61
|
+
│ ├── skills/
|
|
62
|
+
│ │ └── my-first-step/SKILL.md # when using skill-backed steps
|
|
63
|
+
│ └── scripts/
|
|
64
|
+
│ └── helper.ts # workflow-scoped helper scripts, if any
|
|
65
|
+
├── package.json
|
|
66
|
+
├── README.md
|
|
67
|
+
├── tsconfig.json
|
|
68
|
+
├── tsup.config.ts
|
|
69
|
+
└── vitest.config.ts
|
|
70
|
+
```
|
|
71
|
+
|
|
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>/`. Use an existing small workflow package as a scaffold when available, but prefer the architecture above for new packages.
|
|
73
|
+
|
|
74
|
+
## Architecture guidance
|
|
75
|
+
|
|
76
|
+
Generated TypeScript workflow packages should follow the suPIerior package architecture direction:
|
|
77
|
+
|
|
78
|
+
- Keep `src/index.ts` small and stable: import each `WorkflowDefinition`, call `registerWorkflow` for each, 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.
|
|
79
|
+
- Group everything one workflow needs under its own `src/workflows/<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.
|
|
80
|
+
- If multiple workflows share non-Pi logic, 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`.
|
|
81
|
+
- 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/workflows/<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
|
+
|
|
84
|
+
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
|
+
|
|
86
|
+
## Extension entrypoint templates
|
|
87
|
+
|
|
88
|
+
`src/index.ts`:
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
92
|
+
import setupWorkflower, { registerWorkflow } from "@supierior/workflower";
|
|
93
|
+
|
|
94
|
+
import { myWorkflow } from "./workflows/my-workflow/my-workflow-workflow";
|
|
95
|
+
|
|
96
|
+
export { myWorkflow };
|
|
97
|
+
|
|
98
|
+
export default function myWorkflowPackageExtension(pi: ExtensionAPI): void {
|
|
99
|
+
registerWorkflow(myWorkflow);
|
|
100
|
+
setupWorkflower(pi);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
`src/workflows/my-workflow/my-workflow-workflow.ts`:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import type { WorkflowDefinition } from "@supierior/workflower";
|
|
108
|
+
|
|
109
|
+
export const myWorkflow: WorkflowDefinition = {
|
|
110
|
+
id: "my-workflow",
|
|
111
|
+
userInvocable: true,
|
|
112
|
+
modelInvocable: true,
|
|
113
|
+
cleanupOnCompletion: false,
|
|
114
|
+
model: ["openai-codex/gpt-5.3-codex-spark"],
|
|
115
|
+
thinkingLevel: "medium",
|
|
116
|
+
autoNext: false,
|
|
117
|
+
pollen: "second-step.md",
|
|
118
|
+
acceptPollen: true,
|
|
119
|
+
steps: [
|
|
120
|
+
{
|
|
121
|
+
id: "first-step",
|
|
122
|
+
command: "/skill:my-first-step",
|
|
123
|
+
outputs: ["first-step.md"],
|
|
124
|
+
thinkingLevel: "high",
|
|
125
|
+
clearOnNext: false,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "second-step",
|
|
129
|
+
command: "/skill:my-second-step",
|
|
130
|
+
outputs: ["second-step.md"],
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For a package with several workflows, `src/index.ts` imports each `WorkflowDefinition` and registers all of them before calling `setupWorkflower(pi)` once:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { firstWorkflow } from "./workflows/first-workflow/first-workflow-workflow";
|
|
140
|
+
import { secondWorkflow } from "./workflows/second-workflow/second-workflow-workflow";
|
|
141
|
+
|
|
142
|
+
export default function myWorkflowPackageExtension(pi: ExtensionAPI): void {
|
|
143
|
+
registerWorkflow(firstWorkflow);
|
|
144
|
+
registerWorkflow(secondWorkflow);
|
|
145
|
+
setupWorkflower(pi);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Use `setupWorkflower(pi)` in workflow packages so installing the workflow package also initializes Workflower's `/wf`, `/wf:<id>`, and `/next` commands.
|
|
150
|
+
|
|
151
|
+
Workflow-level `model` and `thinkingLevel` set defaults for every step. Step-level `model` and `thinkingLevel` override those defaults 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.
|
|
152
|
+
|
|
153
|
+
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
|
+
|
|
155
|
+
Workflow-level `userInvocable?: boolean` (default `true`) controls whether Workflower registers `/wf:<id>` for users to start the workflow directly. Set `userInvocable: false` for workflows that should only be reached by handoff. Workflow-level `modelInvocable?: boolean` (default `true`) controls whether `workflower_handoff` may start this workflow; set `modelInvocable: false` to keep a workflow user-started only.
|
|
156
|
+
|
|
157
|
+
Workflow-level `pollen?: string | string[]` pins the output path or paths that should be referenced when another workflow is started in the same garden. If omitted, completed step outputs become unpinned pollen as `/next` advances. Workflow-level `acceptPollen?: boolean` defaults to `true`; set `acceptPollen: false` when a workflow should not receive previous flower pollen paths in its kickoff prompt. Pollen paths are referenced from the previous flower's `index.json`; files are not copied into the new flower.
|
|
158
|
+
|
|
159
|
+
## Garden state and deterministic routing
|
|
160
|
+
|
|
161
|
+
Use Workflower garden state for small structured facts that must survive context-clearing boundaries or drive deterministic routing. State lives at `.workflower/workflows/<garden-name>/state.json`, is shared by all flowers in the garden, and is deleted on final garden completion. Use output files for large artifacts: do not use state for large reports, logs, diffs, or plans; write those as declared output files instead.
|
|
162
|
+
|
|
163
|
+
When authoring workflows and companion skills:
|
|
164
|
+
|
|
165
|
+
- Declare expected state keys in README and skill instructions, for example `review.rating`, `review.summary`, and `review.required_changes`.
|
|
166
|
+
- Tell agents exactly when to call `workflower_state_set` and which JSON value shape to write.
|
|
167
|
+
- Tell agents to use `workflower_state_get` when a later step depends on previously saved state.
|
|
168
|
+
- Use `workflower_state_list` when an agent needs to discover which state keys are already set without guessing key names.
|
|
169
|
+
- Use code/router commands or model-callable tools for deterministic branching, then call `createWorkflowerRuntime(pi, ctx).handoff(...)` or the `workflower_handoff` tool.
|
|
170
|
+
- For autonomous branching, prefer a model-callable router tool. Do not rely on assistant text to invoke `/wf:<id>` or `/review-route`; printed slash commands are not executed by Pi.
|
|
171
|
+
|
|
172
|
+
Example reviewer instruction:
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
After writing `implementation-review.md`, call `workflower_state_set` three times:
|
|
176
|
+
|
|
177
|
+
1. `{ "key": "review.rating", "value": <integer 1-5> }`
|
|
178
|
+
2. `{ "key": "review.summary", "value": "<one-sentence summary>" }`
|
|
179
|
+
3. `{ "key": "review.required_changes", "value": ["<change>"] }`
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Example deterministic router:
|
|
183
|
+
|
|
184
|
+
```ts
|
|
185
|
+
const rating = await wf.state.getValue("review.rating");
|
|
186
|
+
const nextWorkflow =
|
|
187
|
+
typeof rating === "number" && rating >= 4 ? "feature-next-steps" : "implementation-review-loop";
|
|
188
|
+
await wf.handoff(nextWorkflow);
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## Custom private step commands
|
|
192
|
+
|
|
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 `registerWorkflow`:
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
import { registerWorkflowerCommand } from "@supierior/workflower";
|
|
197
|
+
|
|
198
|
+
registerWorkflowerCommand({
|
|
199
|
+
name: "my-workflow-review-brief",
|
|
200
|
+
description: "Builds the review-step prompt from current garden state.",
|
|
201
|
+
handler: async (args, ctx) => {
|
|
202
|
+
return { kind: "prompt", content: `Review garden ${ctx.gardenName}, step ${ctx.stepId}.` };
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
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
|
+
|
|
209
|
+
## Compact kickoff prompt display
|
|
210
|
+
|
|
211
|
+
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.
|
|
212
|
+
|
|
213
|
+
Teach junior workflow authors these rules:
|
|
214
|
+
|
|
215
|
+
- The model still receives the full kickoff prompt, including workflow id, garden name, workdir, previous pollen paths, previous outputs, expected output paths, and expanded private skill instructions.
|
|
216
|
+
- Private Workflower skills may be injected into model context even when their Markdown body is not visible in the transcript. Do not rely on visible transcript content to verify full private skill injection.
|
|
217
|
+
- This is not a token-saving feature. Keep workflow prompts and private skills concise because the full prompt still uses context.
|
|
218
|
+
- Assistant text that prints `/wf:<id>`, `/next`, or a router command does not execute that slash command. Autonomous workflow movement should call `workflower_handoff` or a deterministic model-callable router tool instead.
|
|
219
|
+
|
|
220
|
+
## Step skill template
|
|
221
|
+
|
|
222
|
+
`src/workflows/my-workflow/skills/my-first-step/SKILL.md`:
|
|
223
|
+
|
|
224
|
+
```markdown
|
|
225
|
+
---
|
|
226
|
+
name: my-first-step
|
|
227
|
+
description: Performs the first step of the my-workflow Workflower workflow and writes first-step.md.
|
|
228
|
+
allowed-tools: read write edit bash
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
# My First Step
|
|
232
|
+
|
|
233
|
+
You are step 1 of the `my-workflow` Workflower workflow.
|
|
234
|
+
|
|
235
|
+
## Goal
|
|
236
|
+
|
|
237
|
+
Describe the concrete outcome of this step.
|
|
238
|
+
|
|
239
|
+
## Instructions
|
|
240
|
+
|
|
241
|
+
1. Use the workflow kickoff prompt for the workflow id, garden name, active flower workdir, previous pollen paths, previous outputs, and expected output paths.
|
|
242
|
+
2. Create the declared output file: `first-step.md`.
|
|
243
|
+
3. Write the file at the absolute expected output path shown in the kickoff prompt. If no absolute path is visible, write it relative to the current working directory.
|
|
244
|
+
4. If this step is expected to write garden state, call `workflower_state_set` with the exact documented key names and JSON-compatible values.
|
|
245
|
+
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
|
+
```
|
|
247
|
+
|
|
248
|
+
## package.json requirements
|
|
249
|
+
|
|
250
|
+
A workflow package should include:
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"keywords": ["pi-package", "pi", "workflow", "workflower"],
|
|
255
|
+
"dependencies": {
|
|
256
|
+
"@supierior/workflower": "workspace:^"
|
|
257
|
+
},
|
|
258
|
+
"peerDependencies": {
|
|
259
|
+
"@mariozechner/pi-coding-agent": "*"
|
|
260
|
+
},
|
|
261
|
+
"pi": {
|
|
262
|
+
"extensions": ["./dist/index.mjs"],
|
|
263
|
+
"skills": ["./src/workflows/*/skills"]
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
`pi.skills` is a glob (Pi's array fields support glob patterns and `!exclusions`), so it picks up every workflow's `skills/` directory without listing each workflow by name. Skills are plain Markdown and load directly from `src/`; they do not need a build step or a `dist/` copy. Update the glob (or list workflow folders explicitly) only if a workflow intentionally ships no skills and an author wants tighter filtering.
|
|
269
|
+
|
|
270
|
+
Use `workspace:^` for monorepo workflow packages so pnpm links the local workspace package during development and publishes the dependency as a compatible semver range such as `^0.1.0`. For published packages outside this monorepo, use a real `@supierior/workflower` version/range. Follow current Pi package dependency rules for the target distribution method; if publishing an npm Pi package that depends on another Pi package, consider adding `@supierior/workflower` to `bundledDependencies` so the generated package is self-contained for users.
|
|
271
|
+
|
|
272
|
+
## README smoke test
|
|
273
|
+
|
|
274
|
+
Document how to run the workflow from a fresh session:
|
|
275
|
+
|
|
276
|
+
```text
|
|
277
|
+
/wf:<workflow-id> <garden-name>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Then after each non-auto step:
|
|
281
|
+
|
|
282
|
+
```text
|
|
283
|
+
/next
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
If the README demonstrates chaining to another workflow while active, use the handoff form with no garden name:
|
|
287
|
+
|
|
288
|
+
```text
|
|
289
|
+
/wf:<next-workflow-id>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Also mention the built-in `/wf` management subcommands:
|
|
293
|
+
|
|
294
|
+
```text
|
|
295
|
+
/wf status
|
|
296
|
+
/wf stop
|
|
297
|
+
/wf list
|
|
298
|
+
/wf clean <garden-name>
|
|
299
|
+
/wf state list | get <key> | set <key> <json-value>
|
|
300
|
+
/wf resume [garden-name]
|
|
301
|
+
/wf config
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
`/wf clean` removes a garden's artifacts by hand (refuses while a workflow is still active in it). `/wf state` lets a user inspect or edit garden state without a running step. `/wf resume` restarts an interrupted garden from its durable resume metadata. `/wf config` opens an interactive editor for the model-level mapping (`tiny`/`small`/`medium`/`large`/`xl`), default model, and fallback strategy used to resolve level-name `model` settings.
|
|
305
|
+
|
|
306
|
+
and where artifacts are written:
|
|
307
|
+
|
|
308
|
+
```text
|
|
309
|
+
.workflower/workflows/<garden-name>/0001-<workflow-id>/
|
|
310
|
+
.workflower/workflows/<garden-name>/0001-<workflow-id>/index.json
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Cleanup waits until the whole garden completes. Handoffs preserve earlier flowers so their pollen can be referenced by later workflows; final `/next` cleanup applies each flower's producing workflow `cleanupOnCompletion` setting.
|
|
314
|
+
|
|
315
|
+
## Final checklist
|
|
316
|
+
|
|
317
|
+
Before finishing:
|
|
318
|
+
|
|
319
|
+
- Each workflow lives in its own `src/workflows/<workflow-id>/` folder alongside its bundled skills and scripts.
|
|
320
|
+
- The workflow is registered exactly once, in `src/index.ts`, during extension startup.
|
|
321
|
+
- The package initializes Workflower with `setupWorkflower(pi)`.
|
|
322
|
+
- Every `/skill:<name>` command has a matching bundled skill under its workflow's `skills/` folder.
|
|
323
|
+
- Skill instructions and workflow `outputs` agree.
|
|
324
|
+
- The package manifest loads both extension and skills.
|
|
325
|
+
- The README includes a copy-paste smoke test using `/wf:<workflow-id> <garden-name>`.
|
|
326
|
+
- The README and bundled skills explain active handoff with `/wf:<next-workflow-id>` when relevant.
|
|
327
|
+
- The README or workflow usage notes explain compact prompt display and warn authors not to verify private skill injection by visible transcript content alone.
|
|
328
|
+
- Artifact examples use `.workflower/workflows/<garden-name>/0001-<workflow-id>/` flower paths and mention `index.json`.
|
|
329
|
+
- Workflow-level `pollen` and `acceptPollen` choices are documented when handoff behavior matters.
|
|
330
|
+
- Expected garden state keys and `workflower_state_set` calls are documented when state drives later steps or routing.
|
|
331
|
+
- Deterministic routers are implemented as commands/tools or extension code, not as printed slash-command text.
|
|
332
|
+
- Cleanup timing is clear: flower artifacts are cleaned only after final garden completion, not during handoff; garden state is also deleted on final completion.
|
|
333
|
+
- `userInvocable` / `modelInvocable` are set explicitly whenever a workflow should not be both user-startable and handoff-startable.
|
|
334
|
+
- Level-name `model` settings (`tiny`/`small`/`medium`/`large`/`xl`) are only used when the README tells users they must configure `/wf config` first.
|
|
335
|
+
- Any `registerWorkflowerCommand` step commands are registered once at extension startup and documented alongside the bundled skills.
|
|
336
|
+
- Run package-local validation when practical: `pnpm test`, `pnpm typecheck`, `pnpm lint`, `pnpm build`.
|