@lukstei/wf 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/.agents/plugins/marketplace.json +21 -0
- package/.agents/plugins/wf/AGENTS.md +34 -0
- package/.agents/plugins/wf/dist/wf.cjs +8998 -0
- package/.agents/plugins/wf/hooks.json +16 -0
- package/.agents/plugins/wf/plugin.json +4 -0
- package/.agents/plugins/wf/rules/AGENTS.md +34 -0
- package/.agents/plugins/wf/skills/wf/SKILL.md +10 -0
- package/.agents/plugins/wf/skills/wf-help/SKILL.md +10 -0
- package/.agents/plugins/wf/skills/wf-next/SKILL.md +10 -0
- package/.agents/plugins/wf/skills/wf-show/SKILL.md +11 -0
- package/.agents/plugins/wf/skills/wf-stop/SKILL.md +10 -0
- package/.claude-plugin/marketplace.json +16 -0
- package/.claude-plugin/plugin.json +5 -0
- package/.codex-plugin/plugin.json +5 -0
- package/AGENTS.md +12 -0
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/dist/wf.cjs +8998 -0
- package/hooks/claude-codex-hooks.json +38 -0
- package/package.json +57 -0
- package/plugin.json +4 -0
- package/rules/AGENTS.md +34 -0
- package/skills/wf/SKILL.md +10 -0
- package/skills/wf-help/SKILL.md +10 -0
- package/skills/wf-next/SKILL.md +10 -0
- package/skills/wf-show/SKILL.md +11 -0
- package/skills/wf-stop/SKILL.md +10 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Workflow Runner (`wf`) Guidelines
|
|
2
|
+
|
|
3
|
+
These rules govern agent behavior whenever the `wf` plugin or an active workflow is present.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Strict Step-by-Step Execution
|
|
8
|
+
|
|
9
|
+
- **Execute Only the Active Step:** When a step instruction is injected into context, execute that specific step and nothing else.
|
|
10
|
+
- **Never Jump Ahead:** Do not anticipate or execute subsequent steps, future phases, or follow-on actions ahead of time.
|
|
11
|
+
- **Conclude Immediately:** Stop and complete your response as soon as the current step's task is finished. The workflow engine will automatically inject the next step.
|
|
12
|
+
|
|
13
|
+
## 2. Never Read Raw Workflow Files
|
|
14
|
+
|
|
15
|
+
- **Ban on Reading Workflow Files:** Do not use `view_file`, `grep_search`, `read_url_content`, or shell commands to view raw workflow files (`.md` / `.json`) or plugin `SKILL.md` definitions during execution.
|
|
16
|
+
- **Why:** The workflow runner already compiles, tracks, and injects each step with its relevant context into your prompt. Reading raw workflow files clutters the context window, duplicates state, and leads to hallucinated out-of-order execution.
|
|
17
|
+
|
|
18
|
+
## 3. Condition Step Decision Format
|
|
19
|
+
|
|
20
|
+
- **Evaluation:** When injected with a condition evaluation step, evaluate whether the stated condition is true or false using appropriate read-only inspection tools if necessary.
|
|
21
|
+
- **Strict Decision Token:** Always end your response with strictly either `[DECISION: YES]` or `[DECISION: NO]`.
|
|
22
|
+
- **Placement:** The decision token must appear at the very end of your response so the runner can deterministically parse the branch choice and advance the workflow.
|
|
23
|
+
|
|
24
|
+
## 4. Workflow Runner Commands
|
|
25
|
+
|
|
26
|
+
Users and agents interact with workflows via slash commands:
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
| :--- | :--- |
|
|
30
|
+
| `/wf <workflow-file>` | Start and run a workflow from a Markdown (`.md`) or JSON (`.json`) file. |
|
|
31
|
+
| `/wf-show [<workflow-file>]` | Display workflow status, Mermaid diagram, and current position (or visualize a file). |
|
|
32
|
+
| `/wf-next` | Advance and execute the next step when a workflow is paused. |
|
|
33
|
+
| `/wf-stop` | Abort and reset the currently active or paused workflow. |
|
|
34
|
+
| `/wf-help` | Display usage instructions and supported runner commands. |
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf
|
|
3
|
+
description: Run a workflow from a Markdown or JSON file (/wf <workflow-file>)
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The wf command starts a workflow and will be intercepted by the workflow runner hook.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
/wf <workflow-file> - Run a workflow from a Markdown (.md) or JSON (.json) file.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-help
|
|
3
|
+
description: Show workflow runner commands and usage guide
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The wf-help command will be intercepted by the workflow runner hook.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
/wf-help - Display available workflow runner commands.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-next
|
|
3
|
+
description: Execute the next step in a paused workflow
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The wf-next command will be intercepted by the workflow runner hook.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
/wf-next - Advance and execute the next step of a paused workflow.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-show
|
|
3
|
+
description: Visualize workflow status, diagram, and current position (/wf-show [<workflow-file>])
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The wf-show command visualizes a workflow and will be intercepted by the workflow runner hook.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
/wf-show - Show current workflow status, diagram, and active step.
|
|
11
|
+
/wf-show <workflow-file> - Visualize a specific workflow from a Markdown (.md) or JSON (.json) file.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wf-stop
|
|
3
|
+
description: Stop and reset the active workflow
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The wf-stop command will be intercepted by the workflow runner hook.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
/wf-stop - Stop and reset the currently active or paused workflow.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
|
|
3
|
+
"name": "wf-marketplace",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "Lukas Steinbrecher",
|
|
6
|
+
"url": "https://github.com/lukstei"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "wf",
|
|
11
|
+
"description": "Deterministic skill workflow runner for AI agents",
|
|
12
|
+
"source": "./",
|
|
13
|
+
"category": "productivity"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
- Prefer snapshot testing of a list of assertions
|
|
2
|
+
- Always place workflow state transitions and status mutations in `src/transitions.ts`
|
|
3
|
+
- Run `npm run verify` after each change
|
|
4
|
+
- Keep the code as clean and pure as possible
|
|
5
|
+
- no unecessary condition checking
|
|
6
|
+
- no over-defensive programming (instead assert, the precondtions of a function if necessary)
|
|
7
|
+
- no unecessary optional types
|
|
8
|
+
- No unecessary exporting of internal types
|
|
9
|
+
- Especially no unecessary states, always think about how to keep the state minimal
|
|
10
|
+
- Prefer inline types, if the type is not reused
|
|
11
|
+
- Prefer discriminated unions
|
|
12
|
+
- No use of any or unjustified type castings
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lukas Steinbrecher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# @lukstei/wf
|
|
2
|
+
|
|
3
|
+
> Deterministic skill workflow runner for AI agents
|
|
4
|
+
|
|
5
|
+
[](https://github.com/lukstei/wf/actions/workflows/ci.yml)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
[](https://www.npmjs.com/package/@lukstei/wf)
|
|
8
|
+
|
|
9
|
+
> [!NOTE]
|
|
10
|
+
> `wf` is currently in alpha (`v0.1.x`). Expect bugs and breaking changes.
|
|
11
|
+
|
|
12
|
+
When you give an AI coding agent a multi-step plan, it tries to execute the whole thing at once. It skips tests, hallucinates future steps, and blows past human review points.
|
|
13
|
+
|
|
14
|
+
`wf` turns Markdown runbooks into step graphs and feeds them to the agent one step at a time. The agent cannot see or run future steps until the current step passes.
|
|
15
|
+
|
|
16
|
+
Runs in Google Antigravity, Claude Code, and OpenAI Codex.
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
flowchart TD
|
|
20
|
+
A["Markdown runbook (.md)"] --> B["wf compiler"]
|
|
21
|
+
B --> C["Inject active step"]
|
|
22
|
+
C --> D["Agent executes step"]
|
|
23
|
+
D --> E{"Step type"}
|
|
24
|
+
E -->|"Linear"| F["Advance to next step"]
|
|
25
|
+
E -->|"Gate"| G["Pause for human approval"]
|
|
26
|
+
E -->|"Condition"| H["Branch on YES / NO"]
|
|
27
|
+
F --> C
|
|
28
|
+
G --> C
|
|
29
|
+
H --> C
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Goals
|
|
33
|
+
|
|
34
|
+
- **Skills as workflows:** Turn existing `SKILL.md` files and Markdown runbooks into executable workflows with minimal changes.
|
|
35
|
+
- **Minimal syntax:** Plain Markdown headings, conditions, and human gates. No custom DSL.
|
|
36
|
+
- **Agent does the work:** The model inspects code, runs tools, and evaluates conditions. `wf` only enforces step order and human checkpoints.
|
|
37
|
+
- **Zero infrastructure:** Runs as a self-contained plugin. No server, database, or background daemon.
|
|
38
|
+
|
|
39
|
+
## Non-goals
|
|
40
|
+
|
|
41
|
+
- **Full-blown workflow engine:** No heavy orchestration frameworks, distributed graph runners, or complex runtime dependencies.
|
|
42
|
+
|
|
43
|
+
## How it works
|
|
44
|
+
|
|
45
|
+
- **One step at a time:** The agent prompt only contains instructions for the active step. Future steps stay hidden.
|
|
46
|
+
- **Explicit branch decisions:** Conditional steps require `[DECISION: YES]` or `[DECISION: NO]` before the graph advances.
|
|
47
|
+
- **Human gates:** Steps marked `## Gate:` pause execution until you run `/wf-next`.
|
|
48
|
+
- **Visual status:** Generates Mermaid diagrams showing the current position in the graph.
|
|
49
|
+
- **Zero runtime dependencies:** Single bundle in `dist/wf.cjs` invoked directly by agent lifecycle hooks.
|
|
50
|
+
|
|
51
|
+
## Supported environments
|
|
52
|
+
|
|
53
|
+
| Environment | Slash commands | Lifecycle hooks |
|
|
54
|
+
| :--- | :--- | :--- |
|
|
55
|
+
| Google Antigravity | `/wf`, `/wf-show`, `/wf-next`, `/wf-stop`, `/wf-help` | `PreInvocation`, `Stop` |
|
|
56
|
+
| Claude Code | `/wf`, `/wf-show`, `/wf-next`, `/wf-stop`, `/wf-help` | `SessionStart`, `UserPromptSubmit`, `Stop` |
|
|
57
|
+
| OpenAI Codex | `/wf`, `/wf-show`, `/wf-next`, `/wf-stop`, `/wf-help` | `SessionStart`, `UserPromptSubmit`, `Stop` |
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
### Google Antigravity
|
|
62
|
+
Clone into your global or workspace plugin directory:
|
|
63
|
+
```bash
|
|
64
|
+
git clone https://github.com/lukstei/wf.git ~/.gemini/config/plugins/wf
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Claude Code
|
|
68
|
+
Add the marketplace catalog and install:
|
|
69
|
+
```bash
|
|
70
|
+
/plugin marketplace add lukstei/wf
|
|
71
|
+
/plugin install wf@wf-marketplace
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### OpenAI Codex
|
|
75
|
+
Add the marketplace catalog, install, and trust:
|
|
76
|
+
```bash
|
|
77
|
+
codex plugin marketplace add lukstei/wf
|
|
78
|
+
codex plugin install wf
|
|
79
|
+
codex plugin trust wf
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Quickstart
|
|
83
|
+
|
|
84
|
+
### 1. Write a workflow (`deploy.md`)
|
|
85
|
+
|
|
86
|
+
```markdown
|
|
87
|
+
# Production Deployment
|
|
88
|
+
|
|
89
|
+
Ensure all checks pass before deploying.
|
|
90
|
+
|
|
91
|
+
## 1. Run tests
|
|
92
|
+
Run the test suite:
|
|
93
|
+
`npm run verify`
|
|
94
|
+
|
|
95
|
+
## 2. If: Did all tests pass?
|
|
96
|
+
|
|
97
|
+
### Publish
|
|
98
|
+
Publish packages to npm and create GitHub release.
|
|
99
|
+
|
|
100
|
+
### No
|
|
101
|
+
Stop and report the failures.
|
|
102
|
+
|
|
103
|
+
## Gate: Confirm release
|
|
104
|
+
Check the files in `dist/`. Ready to publish to production?
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 2. Run in chat
|
|
108
|
+
|
|
109
|
+
In Antigravity, Claude Code, or Codex:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
/wf deploy.md
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
| Command | Description |
|
|
116
|
+
| :--- | :--- |
|
|
117
|
+
| `/wf <workflow-file>` | Start a workflow and inject step 1. Supports relative paths, `@path`, or `@[path]`. |
|
|
118
|
+
| `/wf-show [<workflow-file>]` | Display workflow status, Mermaid diagram, and current step. Visualizes a file when provided. |
|
|
119
|
+
| `/wf-next` | Advance and execute the next step when a workflow is paused at a gate. |
|
|
120
|
+
| `/wf-stop` | Stop and reset the active or paused workflow. |
|
|
121
|
+
| `/wf-help` | Display usage instructions and supported runner commands. |
|
|
122
|
+
|
|
123
|
+
## Syntax
|
|
124
|
+
|
|
125
|
+
See [docs/SYNTAX.md](docs/SYNTAX.md) for the complete syntax specification, rules, and examples.
|
|
126
|
+
|
|
127
|
+
### Frontmatter (optional)
|
|
128
|
+
YAML frontmatter at the top of the file configures the workflow name and description:
|
|
129
|
+
```markdown
|
|
130
|
+
---
|
|
131
|
+
name: deploy
|
|
132
|
+
description: Production release workflow
|
|
133
|
+
---
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Workflow Preamble (Context)
|
|
137
|
+
Any text between the H1 title and the first step heading is treated as top-level workflow context. It is injected into every step under `CONTEXT:`:
|
|
138
|
+
```markdown
|
|
139
|
+
# Production Deployment
|
|
140
|
+
|
|
141
|
+
Ensure DATABASE_URL is pointing to staging replica before running checks.
|
|
142
|
+
All commands must be executed from repository root.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Steps (`##`)
|
|
146
|
+
Any H2 heading that does not match a keyword (`if`, `gate`) creates a step. Heading numbers or prefixes are supported:
|
|
147
|
+
```markdown
|
|
148
|
+
## 1. Run migrations
|
|
149
|
+
Run `./scripts/migrate.sh` and verify all tables migrate cleanly.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Conditions (`## If:` / `### No`)
|
|
153
|
+
Condition headings create binary branching points evaluated dynamically by the model:
|
|
154
|
+
- **Condition Instruction**: Body text directly beneath `## If:` tells the agent how to evaluate the condition.
|
|
155
|
+
- **YES Branch (0..N steps)**: Child `###` subheadings are executed when the condition evaluates to YES.
|
|
156
|
+
- **NO Branch**: A child heading `### No` (or `### Else`) is executed when the condition evaluates to NO.
|
|
157
|
+
|
|
158
|
+
The agent concludes its evaluation with `[DECISION: YES]` or `[DECISION: NO]`:
|
|
159
|
+
|
|
160
|
+
```markdown
|
|
161
|
+
## 2. If: Any migrations pending?
|
|
162
|
+
Run `npx prisma migrate status` to check the database state.
|
|
163
|
+
|
|
164
|
+
### Run dry-run
|
|
165
|
+
Run migration dry-run and save output.
|
|
166
|
+
|
|
167
|
+
### No: Skip verification
|
|
168
|
+
Skip to schema verification.
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Gates (`## Gate:`)
|
|
172
|
+
Pauses execution for human review. Resumes when you run `/wf-next`:
|
|
173
|
+
```markdown
|
|
174
|
+
## Gate: Confirm schema changes
|
|
175
|
+
Review the schema diff above. Run `/wf-next` to continue or `/wf-stop` to abort.
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Development
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
npm install
|
|
182
|
+
npm run verify # runs tests and tsc
|
|
183
|
+
npm run build # builds dist/wf.cjs
|
|
184
|
+
npm run test:watch # test watcher
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## License
|
|
188
|
+
|
|
189
|
+
[MIT](LICENSE) © 2026 Lukas Steinbrecher
|