@zibby/skills 0.1.11 → 0.1.13
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/dist/index.js +5 -5
- package/dist/package.json +3 -3
- package/dist/skill-installer.js +5 -5
- package/docs/cli-reference.md +120 -256
- package/docs/cloning-repositories.md +2 -2
- package/docs/cloud/bundles.md +92 -0
- package/docs/cloud/dedicated-egress.md +140 -0
- package/docs/cloud/env-vars.md +144 -0
- package/docs/cloud/limits.md +81 -0
- package/docs/cloud/logs.md +104 -0
- package/docs/cloud/triggering.md +114 -0
- package/docs/concepts/agents.md +112 -0
- package/docs/concepts/graph.md +83 -0
- package/docs/concepts/sessions.md +70 -0
- package/docs/concepts/skills.md +84 -0
- package/docs/concepts/state.md +106 -0
- package/docs/get-started/deploy.md +75 -0
- package/docs/get-started/install.md +58 -0
- package/docs/get-started/run-locally.md +94 -0
- package/docs/get-started/trigger-and-logs.md +90 -0
- package/docs/get-started/your-first-workflow.md +66 -0
- package/docs/intro.md +37 -65
- package/docs/legacy/test-automation.md +110 -0
- package/docs/packages/agent-workflow.md +88 -0
- package/docs/packages/cli.md +42 -207
- package/docs/packages/core.md +40 -224
- package/docs/recipes/index.md +62 -0
- package/docs/recipes/test.md +154 -0
- package/package.json +3 -3
package/docs/packages/cli.md
CHANGED
|
@@ -1,238 +1,73 @@
|
|
|
1
1
|
---
|
|
2
|
-
sidebar_position:
|
|
3
|
-
title:
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
title: '@zibby/cli'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# @zibby/cli
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@zibby/cli)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
npm install -g @zibby/cli
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## What It Does
|
|
15
|
-
|
|
16
|
-
`@zibby/cli` is the only package most users install. It provides:
|
|
17
|
-
|
|
18
|
-
- **`zibby run`** — execute test specs with AI agents
|
|
19
|
-
- **`zibby init`** — scaffold a customizable workflow
|
|
20
|
-
- **`zibby login/logout/status`** — authentication
|
|
21
|
-
- **`zibby upload`** — push existing artifacts to Zibby Cloud
|
|
22
|
-
- **`zibby workflow`** — download/upload/list workflow graphs
|
|
23
|
-
- **`zibby setup-playwright`** — configure Playwright MCP
|
|
24
|
-
- **`zibby ci-setup`** — configure for CI/CD pipelines
|
|
25
|
-
- **`zibby memory`** — memory database management
|
|
26
|
-
- **`zibby video`** — organize test video files
|
|
27
|
-
|
|
28
|
-
## Quick Usage
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# Zero setup — run immediately
|
|
32
|
-
echo "Go to example.com and verify the page title" > test.txt
|
|
33
|
-
zibby run test.txt --agent cursor
|
|
34
|
-
|
|
35
|
-
# Or with npx (no install)
|
|
36
|
-
npx @zibby/cli run test.txt --agent cursor
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Commands
|
|
40
|
-
|
|
41
|
-
### `zibby run [spec-path]`
|
|
42
|
-
|
|
43
|
-
Run a test specification.
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# Local test spec
|
|
47
|
-
zibby run test-specs/login.txt --agent cursor
|
|
48
|
-
|
|
49
|
-
# With cloud sync
|
|
50
|
-
zibby run test-specs/login.txt --sync
|
|
51
|
-
|
|
52
|
-
# Cloud test cases
|
|
53
|
-
zibby run --sources TC001,TC002 --execution abc123
|
|
54
|
-
|
|
55
|
-
# Specific workflow
|
|
56
|
-
zibby run test.txt --workflow QuickSmokeWorkflow
|
|
57
|
-
|
|
58
|
-
# Single node (debugging)
|
|
59
|
-
zibby run test.txt --node execute_live --session last
|
|
60
|
-
|
|
61
|
-
# Headless (CI/CD)
|
|
62
|
-
zibby run test.txt --headless --auto-approve
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
| Flag | Description |
|
|
66
|
-
|---|---|
|
|
67
|
-
| `--agent <type>` | `cursor`, `claude`, or `codex` |
|
|
68
|
-
| `--workflow <name>` | Named workflow (e.g., `QuickSmokeWorkflow`, `quick-smoke`) |
|
|
69
|
-
| `--headless` | Headless browser mode |
|
|
70
|
-
| `--node <name>` | Run a single node (`preflight`, `execute_live`, `generate_script`) |
|
|
71
|
-
| `--session <id>` | Reuse session (`last` for most recent) — requires `--node` |
|
|
72
|
-
| `--sources <ids>` | Comma-separated cloud test case IDs |
|
|
73
|
-
| `--execution <id>` | Execution ID (with `--sources`) |
|
|
74
|
-
| `--project <id>` | Project ID |
|
|
75
|
-
| `--collection <name>` | Collection to organize the run |
|
|
76
|
-
| `--folder <path>` | Folder within collection |
|
|
77
|
-
| `--sync` | Upload results to cloud |
|
|
78
|
-
| `--no-sync` | Skip cloud upload |
|
|
79
|
-
| `--config <path>` | Config file path (default: `.zibby.config.js`) |
|
|
80
|
-
| `--auto-approve` | Auto-approve MCP tool calls (CI/CD) |
|
|
81
|
-
| `-o, --open` | Open dashboard after upload |
|
|
82
|
-
| `--verbose` | Info-level logs |
|
|
83
|
-
| `--debug` | Full debug logs |
|
|
84
|
-
|
|
85
|
-
### `zibby init [project-name]`
|
|
86
|
-
|
|
87
|
-
Scaffold a Zibby project with config and workflow files.
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
zibby init
|
|
91
|
-
zibby init my-project --agent cursor --cloud-sync
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
| Flag | Description |
|
|
95
|
-
|---|---|
|
|
96
|
-
| `--agent <type>` | `cursor`, `claude`, or `codex` |
|
|
97
|
-
| `--cloud-sync` | Enable cloud sync |
|
|
98
|
-
| `--headless` / `--headed` | Browser mode |
|
|
99
|
-
| `--skip-install` | Skip `npm install` |
|
|
100
|
-
| `-f, --force` | Overwrite existing config |
|
|
101
|
-
| `--mem` | Initialize memory database |
|
|
102
|
-
|
|
103
|
-
Creates:
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
.zibby.config.js
|
|
107
|
-
.zibby/
|
|
108
|
-
├── graph.js
|
|
109
|
-
├── nodes/
|
|
110
|
-
│ ├── preflight.js
|
|
111
|
-
│ ├── execute-live.js
|
|
112
|
-
│ └── generate-script.js
|
|
113
|
-
└── result-handler.js
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### `zibby login` / `zibby logout` / `zibby status`
|
|
10
|
+
The user-facing entry point — the `zibby` command. Install once globally; it pulls in `@zibby/core`, `@zibby/agent-workflow`, `@zibby/skills` automatically.
|
|
117
11
|
|
|
118
12
|
```bash
|
|
119
|
-
|
|
120
|
-
zibby
|
|
121
|
-
zibby status # Show auth status
|
|
122
|
-
zibby status --json # Machine-readable
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### `zibby upload <spec-path>`
|
|
126
|
-
|
|
127
|
-
Upload existing test artifacts to Zibby Cloud.
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
zibby upload test-specs/login.txt --collection "Auth Tests"
|
|
13
|
+
npm install -g @zibby/cli
|
|
14
|
+
zibby --version
|
|
131
15
|
```
|
|
132
16
|
|
|
133
|
-
|
|
17
|
+
## What it does
|
|
134
18
|
|
|
135
|
-
|
|
19
|
+
- **Scaffolds** workflows: `zibby workflow new <name>`
|
|
20
|
+
- **Runs** workflows locally (one-shot): `zibby workflow run <name>`
|
|
21
|
+
- **Deploys** to Zibby Cloud (Heroku-style bundles): `zibby workflow deploy <name>`
|
|
22
|
+
- **Triggers** deployed workflows: `zibby workflow trigger <uuid>`
|
|
23
|
+
- **Tails** logs: `zibby workflow logs <uuid> -t`
|
|
24
|
+
- **Manages** auth: `zibby login`, `zibby logout`, `zibby status`
|
|
136
25
|
|
|
137
|
-
|
|
138
|
-
zibby workflow list
|
|
139
|
-
zibby workflow download --type run_test
|
|
140
|
-
zibby workflow upload --type analysis --file .zibby/workflow-analysis.json
|
|
141
|
-
```
|
|
26
|
+
The full command catalog lives at [CLI Reference](../cli-reference).
|
|
142
27
|
|
|
143
|
-
|
|
28
|
+
## Self-contained workflow projects
|
|
144
29
|
|
|
145
|
-
|
|
30
|
+
`zibby workflow new` creates a workflow as a **self-contained npm project** — its own `package.json`, its own `node_modules`. So a workflow can pull in arbitrary deps (PDF libraries, custom MCP servers, your own SDK) without polluting the parent project.
|
|
146
31
|
|
|
147
|
-
```bash
|
|
148
|
-
zibby setup-playwright
|
|
149
|
-
zibby setup-playwright --headed --viewport-width 1920 --viewport-height 1080
|
|
150
32
|
```
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
33
|
+
my-app/
|
|
34
|
+
├── package.json
|
|
35
|
+
├── src/
|
|
36
|
+
└── .zibby/
|
|
37
|
+
└── workflows/
|
|
38
|
+
└── my-pipeline/
|
|
39
|
+
├── package.json # workflow's own deps
|
|
40
|
+
├── node_modules/
|
|
41
|
+
├── graph.mjs
|
|
42
|
+
└── nodes/
|
|
160
43
|
```
|
|
161
44
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
Organize test videos — moves videos from `test-results/` to sit next to test files:
|
|
45
|
+
The cloud bundle build does the same — `npm install` runs *inside* the workflow folder, scoped to its own package.json.
|
|
165
46
|
|
|
166
|
-
|
|
167
|
-
zibby video
|
|
168
|
-
```
|
|
47
|
+
## Configuration
|
|
169
48
|
|
|
170
|
-
|
|
49
|
+
The CLI reads `.zibby.config.mjs` at the project root for defaults:
|
|
171
50
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
zibby list
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## Configuration File
|
|
179
|
-
|
|
180
|
-
`.zibby.config.js` (or `.zibby.config.mjs`) in your project root:
|
|
181
|
-
|
|
182
|
-
```javascript
|
|
51
|
+
```js
|
|
52
|
+
// .zibby.config.mjs
|
|
183
53
|
export default {
|
|
184
|
-
agent: {
|
|
185
|
-
cursor: {
|
|
186
|
-
model: 'auto',
|
|
187
|
-
// Options: 'auto', 'opus-4.5', 'sonnet-4.5', 'composer-1',
|
|
188
|
-
// 'gpt-5.2-codex', 'gpt-5.2', 'gpt-5.3', 'gpt-5.4',
|
|
189
|
-
// 'gemini-3-pro', 'gemini-3-flash'
|
|
190
|
-
},
|
|
191
|
-
// claude: { model: 'auto' },
|
|
192
|
-
// codex: { model: 'gpt-5.2-codex' },
|
|
193
|
-
strictMode: false,
|
|
194
|
-
},
|
|
195
|
-
|
|
196
|
-
// Per-node model overrides
|
|
197
|
-
// models: {
|
|
198
|
-
// default: 'auto',
|
|
199
|
-
// execute_live: 'claude-opus-4',
|
|
200
|
-
// },
|
|
201
|
-
|
|
202
54
|
paths: {
|
|
203
|
-
|
|
204
|
-
generated: 'tests',
|
|
55
|
+
workflows: '.zibby/workflows', // override if you want a different folder
|
|
205
56
|
output: '.zibby/output',
|
|
206
57
|
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
58
|
+
agent: {
|
|
59
|
+
default: 'cursor', // fallback agent when no per-node override
|
|
60
|
+
},
|
|
61
|
+
models: {
|
|
62
|
+
default: 'auto',
|
|
63
|
+
execute_live: 'claude-opus-4.6', // per-node model override
|
|
213
64
|
},
|
|
214
|
-
|
|
215
|
-
video: 'on',
|
|
216
|
-
viewport: { width: 1280, height: 720 },
|
|
217
|
-
playwrightArtifacts: true,
|
|
218
|
-
cloudSync: false,
|
|
219
65
|
};
|
|
220
66
|
```
|
|
221
67
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
| Variable | Description |
|
|
225
|
-
|---|---|
|
|
226
|
-
| `CURSOR_API_KEY` | Cursor agent API key (required in CI, optional locally) |
|
|
227
|
-
| `ANTHROPIC_API_KEY` | Claude agent API key |
|
|
228
|
-
| `OPENAI_API_KEY` | Codex agent API key |
|
|
229
|
-
| `ZIBBY_API_KEY` | Project API key for cloud sync |
|
|
230
|
-
| `ZIBBY_USER_TOKEN` | Personal Access Token for CI/CD |
|
|
231
|
-
| `ZIBBY_ENV` | Environment override: `local`, `staging`, `prod` |
|
|
68
|
+
`zibby workflow deploy` resolves this file locally and ships the result as `zibby.config.json` inside the deploy bundle, so the cloud runtime sees the same `agent` block, per-node `models`, and other declarative knobs as your local runs. Function values are dropped at deploy time (config is data, not code) — if you need runtime variation in cloud, use [per-workflow env vars](../cloud/env-vars).
|
|
232
69
|
|
|
233
|
-
##
|
|
70
|
+
## Source
|
|
234
71
|
|
|
235
|
-
`@zibby/cli`
|
|
236
|
-
-
|
|
237
|
-
- `@zibby/skills` — skill catalog
|
|
238
|
-
- `@zibby/memory` — test memory
|
|
72
|
+
- npm: [`@zibby/cli`](https://www.npmjs.com/package/@zibby/cli)
|
|
73
|
+
- See [CLI Reference](../cli-reference) for every command + option
|
package/docs/packages/core.md
CHANGED
|
@@ -1,256 +1,72 @@
|
|
|
1
1
|
---
|
|
2
|
-
sidebar_position:
|
|
3
|
-
title:
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
title: '@zibby/core'
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# @zibby/core
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@zibby/core)
|
|
9
|
+
|
|
10
|
+
The batteries — five built-in agent strategies, the runtime, and a re-export of the `@zibby/agent-workflow` engine. This is what `zibby workflow new` scaffolds workflows against.
|
|
9
11
|
|
|
10
12
|
```bash
|
|
11
13
|
npm install @zibby/core
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## What's Inside
|
|
16
|
+
## What's in it
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### Built-in agent strategies
|
|
19
19
|
|
|
20
|
-
|
|
|
20
|
+
| Strategy | Backed by |
|
|
21
21
|
|---|---|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
| **Code Generator** | `generateWorkflowCode` — serializes graphs to code |
|
|
28
|
-
| **Templates** | Built-in workflow templates (browser-test-automation, code-analysis) |
|
|
29
|
-
| **Enrichment Pipeline** | DOM enrichers, accessibility enrichers, page-state enrichers |
|
|
30
|
-
| **Runtime** | Stable-ID runtime, verification strategies, Playwright integration |
|
|
31
|
-
| **Sync** | Cloud upload/download for test results |
|
|
32
|
-
|
|
33
|
-
## Exports
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
// Framework
|
|
37
|
-
import {
|
|
38
|
-
WorkflowGraph,
|
|
39
|
-
Node,
|
|
40
|
-
ConditionalNode,
|
|
41
|
-
WorkflowState,
|
|
42
|
-
OutputParser,
|
|
43
|
-
compileGraph,
|
|
44
|
-
validateGraphConfig,
|
|
45
|
-
extractSteps,
|
|
46
|
-
} from '@zibby/core';
|
|
22
|
+
| `CursorAgentStrategy` | `cursor-agent` CLI |
|
|
23
|
+
| `ClaudeAgentStrategy` | `@anthropic-ai/claude-agent-sdk` |
|
|
24
|
+
| `CodexAgentStrategy` | `@openai/codex` CLI |
|
|
25
|
+
| `GeminiAgentStrategy` | `@google/gemini-cli` |
|
|
26
|
+
| `AssistantStrategy` | OpenAI Assistants API |
|
|
47
27
|
|
|
48
|
-
|
|
49
|
-
import {
|
|
50
|
-
invokeAgent,
|
|
51
|
-
getAgentStrategy,
|
|
52
|
-
CursorAgentStrategy,
|
|
53
|
-
ClaudeAgentStrategy,
|
|
54
|
-
AgentStrategy,
|
|
55
|
-
} from '@zibby/core';
|
|
56
|
-
|
|
57
|
-
// Skill registry
|
|
58
|
-
import {
|
|
59
|
-
registerSkill,
|
|
60
|
-
getSkill,
|
|
61
|
-
hasSkill,
|
|
62
|
-
getAllSkills,
|
|
63
|
-
listSkillIds,
|
|
64
|
-
} from '@zibby/core';
|
|
65
|
-
|
|
66
|
-
// Zod (re-exported for convenience)
|
|
67
|
-
import { z } from '@zibby/core';
|
|
28
|
+
Importing `@zibby/core` registers all five into the `@zibby/agent-workflow` strategy registry automatically. So:
|
|
68
29
|
|
|
69
|
-
|
|
70
|
-
import { SKILLS } from '@zibby/core';
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## WorkflowGraph
|
|
74
|
-
|
|
75
|
-
The central class. Create a graph, add nodes and edges, then run it.
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
30
|
+
```js
|
|
78
31
|
import { WorkflowGraph } from '@zibby/core';
|
|
79
|
-
import { z } from '@zibby/core';
|
|
80
|
-
|
|
81
|
-
const graph = new WorkflowGraph({
|
|
82
|
-
stateSchema: z.object({ // Optional: validates initial state
|
|
83
|
-
testSpec: z.string(),
|
|
84
|
-
cwd: z.string().optional(),
|
|
85
|
-
}),
|
|
86
|
-
middleware: [], // Optional: wrap every node execution
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
graph.addNode('step_a', myNode);
|
|
90
|
-
graph.addEdge('step_a', 'step_b');
|
|
91
|
-
graph.setEntryPoint('step_a');
|
|
92
|
-
|
|
93
|
-
const result = await graph.run(agent, { testSpec: '...' });
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**Key methods:**
|
|
97
|
-
|
|
98
|
-
| Method | Description |
|
|
99
|
-
|---|---|
|
|
100
|
-
| `addNode(name, config, options?)` | Add an executable node |
|
|
101
|
-
| `addConditionalNode(name, config)` | Add a node that routes based on state |
|
|
102
|
-
| `addEdge(from, to)` | Linear connection between nodes |
|
|
103
|
-
| `addConditionalEdges(from, routeFn)` | Branch based on state — `routeFn(state) => 'next_node'` |
|
|
104
|
-
| `setEntryPoint(name)` | Declare which node runs first |
|
|
105
|
-
| `setStateSchema(zodSchema)` | Validate initial state before execution |
|
|
106
|
-
| `use(middlewareFn)` | Add graph-level middleware |
|
|
107
|
-
| `serialize()` | Export graph as JSON (for dashboard visual editor) |
|
|
108
|
-
| `run(agent, initialState)` | Execute the graph |
|
|
109
|
-
|
|
110
|
-
## Node Definition
|
|
111
|
-
|
|
112
|
-
A node is a plain object with `name`, `prompt`, and `outputSchema`:
|
|
113
|
-
|
|
114
|
-
```javascript
|
|
115
|
-
import { z } from '@zibby/core';
|
|
116
|
-
|
|
117
|
-
export const myNode = {
|
|
118
|
-
name: 'my_node',
|
|
119
|
-
|
|
120
|
-
// Prompt: function receiving state, returns string
|
|
121
|
-
prompt: (state) => `Analyze: ${state.testSpec}`,
|
|
122
32
|
|
|
123
|
-
|
|
124
|
-
outputSchema:
|
|
125
|
-
|
|
126
|
-
confidence: z.number().min(0).max(1),
|
|
127
|
-
}),
|
|
128
|
-
|
|
129
|
-
// Optional: skills needed (MCP tools)
|
|
130
|
-
skills: ['browser', 'memory'],
|
|
131
|
-
|
|
132
|
-
// Optional: timeout in ms (default 300000)
|
|
133
|
-
timeout: 600000,
|
|
134
|
-
|
|
135
|
-
// Optional: retry count
|
|
136
|
-
retries: 1,
|
|
137
|
-
|
|
138
|
-
// Optional: post-processing hook
|
|
139
|
-
onComplete: async (state, result) => {
|
|
140
|
-
// Transform result before it goes into state
|
|
141
|
-
return { ...result, processedAt: Date.now() };
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
For nodes that don't call an LLM (pure data transforms), use a custom `execute` function:
|
|
147
|
-
|
|
148
|
-
```javascript
|
|
149
|
-
export const transformNode = {
|
|
150
|
-
name: 'transform',
|
|
151
|
-
_isCustomCode: true,
|
|
152
|
-
outputSchema: z.object({ cleaned: z.string() }),
|
|
153
|
-
execute: async (context) => {
|
|
154
|
-
const raw = context.state.get('raw_data');
|
|
155
|
-
return { cleaned: raw.trim().toLowerCase() };
|
|
156
|
-
},
|
|
157
|
-
};
|
|
33
|
+
const graph = new WorkflowGraph()
|
|
34
|
+
.addNode('plan', { prompt, outputSchema, agent: 'cursor' }) // already registered
|
|
35
|
+
.setEntryPoint('plan');
|
|
158
36
|
```
|
|
159
37
|
|
|
160
|
-
|
|
38
|
+
### Re-exports from agent-workflow
|
|
161
39
|
|
|
162
|
-
|
|
40
|
+
So you can do `import { WorkflowGraph, z, AgentStrategy } from '@zibby/core'` without separately importing the engine:
|
|
163
41
|
|
|
164
|
-
|
|
165
|
-
|
|
42
|
+
- `WorkflowGraph`, `WorkflowAgent`, `Node`, `WorkflowState`
|
|
43
|
+
- `AgentStrategy`, `registerStrategy`, `getAgentStrategy`, `invokeAgent`
|
|
44
|
+
- `registerSkill`, `getSkill`, `getAllSkills`
|
|
45
|
+
- `compileGraph`, `validateGraphConfig`
|
|
46
|
+
- `timeline`, session helpers, constants
|
|
166
47
|
|
|
167
|
-
|
|
168
|
-
constructor() {
|
|
169
|
-
super('my-agent', 'My Custom Agent', 50);
|
|
170
|
-
}
|
|
48
|
+
### z (Zod)
|
|
171
49
|
|
|
172
|
-
|
|
173
|
-
return !!process.env.MY_AGENT_KEY;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
async invoke(prompt, options) {
|
|
177
|
-
// options.schema — Zod schema for structured output
|
|
178
|
-
// options.workspace — working directory
|
|
179
|
-
// options.skills — skill IDs to resolve
|
|
180
|
-
// options.model — model name or 'auto'
|
|
181
|
-
// options.timeout — execution timeout
|
|
182
|
-
const response = await myApiCall(prompt, options);
|
|
183
|
-
if (options.schema) {
|
|
184
|
-
return { raw: response, structured: options.schema.parse(JSON.parse(response)) };
|
|
185
|
-
}
|
|
186
|
-
return response;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Select and invoke an agent:
|
|
192
|
-
|
|
193
|
-
```javascript
|
|
194
|
-
import { invokeAgent, getAgentStrategy } from '@zibby/core';
|
|
195
|
-
|
|
196
|
-
// Auto-select based on config
|
|
197
|
-
const result = await invokeAgent(prompt, { state: { agentType: 'cursor' } }, {
|
|
198
|
-
model: 'auto',
|
|
199
|
-
workspace: process.cwd(),
|
|
200
|
-
schema: MyZodSchema,
|
|
201
|
-
skills: ['browser'],
|
|
202
|
-
});
|
|
203
|
-
```
|
|
50
|
+
Re-exports `zod/v3` so you don't need a separate Zod dep:
|
|
204
51
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
Compile a JSON graph definition (from the Zibby dashboard visual editor) into an executable `WorkflowGraph`:
|
|
208
|
-
|
|
209
|
-
```javascript
|
|
210
|
-
import { compileGraph, validateGraphConfig } from '@zibby/core';
|
|
211
|
-
|
|
212
|
-
const graphJson = {
|
|
213
|
-
nodes: [
|
|
214
|
-
{ id: 'preflight', type: 'preflight', data: { nodeType: 'preflight' } },
|
|
215
|
-
{ id: 'execute_live', type: 'execute_live', data: { nodeType: 'execute_live' } },
|
|
216
|
-
],
|
|
217
|
-
edges: [
|
|
218
|
-
{ source: 'preflight', target: 'execute_live' },
|
|
219
|
-
{ source: 'execute_live', target: 'END' },
|
|
220
|
-
],
|
|
221
|
-
nodeConfigs: {
|
|
222
|
-
preflight: { prompt: 'Analyze: {{testSpec}}' },
|
|
223
|
-
},
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
// Validate
|
|
227
|
-
const { valid, errors } = validateGraphConfig(graphJson);
|
|
228
|
-
|
|
229
|
-
// Compile
|
|
230
|
-
const graph = compileGraph(graphJson, { stateSchema: MySchema });
|
|
52
|
+
```js
|
|
53
|
+
import { z } from '@zibby/core';
|
|
231
54
|
|
|
232
|
-
|
|
233
|
-
await graph.run(agent, initialState);
|
|
55
|
+
const Plan = z.object({ tasks: z.array(z.string()) });
|
|
234
56
|
```
|
|
235
57
|
|
|
236
|
-
|
|
58
|
+
### Cloud-runtime helpers
|
|
237
59
|
|
|
238
|
-
|
|
60
|
+
Functions used by the cloud executor and Studio integration — `ZibbyRuntime`, `StableIdRuntime`, `resolveIntegrationToken`, `cloneRepo`, `patchCursorAgentForCI`, `runPlaywrightTestTool`. Most users don't import these directly.
|
|
239
61
|
|
|
240
|
-
|
|
241
|
-
preflight → execute_live → generate_script → END
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
| Node | Skills | Output |
|
|
245
|
-
|---|---|---|
|
|
246
|
-
| `preflight` | — | `{ title, assertions[] }` |
|
|
247
|
-
| `execute_live` | browser, memory | `{ success, steps[], actions[], assertions[] }` |
|
|
248
|
-
| `generate_script` | — | `{ testCode, filename }` |
|
|
62
|
+
## When to depend on this vs. agent-workflow
|
|
249
63
|
|
|
250
|
-
|
|
64
|
+
| Goal | Pick |
|
|
65
|
+
|---|---|
|
|
66
|
+
| Build a workflow with built-in agents (cursor/claude/codex/gemini/assistant) | `@zibby/core` |
|
|
67
|
+
| Embed the engine in your own app with custom agents only | `@zibby/agent-workflow` |
|
|
68
|
+
| Use the CLI | `@zibby/cli` (transitively pulls both) |
|
|
251
69
|
|
|
252
|
-
|
|
253
|
-
setup → analyze_ticket → generate_code → generate_test_cases → finalize → END
|
|
254
|
-
```
|
|
70
|
+
## Source
|
|
255
71
|
|
|
256
|
-
|
|
72
|
+
- npm: [`@zibby/core`](https://www.npmjs.com/package/@zibby/core)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
title: Recipes overview
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Built-in workflow recipes
|
|
7
|
+
|
|
8
|
+
Zibby ships with a few **vertical slice workflows** — production-ready pipelines you can run today, demonstrating what the platform does. Each recipe is a real Zibby workflow under the hood, eating its own dog food.
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
┌─────────────────────┐
|
|
12
|
+
┌──────────────────►│ zibby workflow new │ ◄── Build your own
|
|
13
|
+
│ │ zibby workflow ... │
|
|
14
|
+
│ └─────────────────────┘
|
|
15
|
+
│ ▲
|
|
16
|
+
│ │ uses the same primitives
|
|
17
|
+
│ │
|
|
18
|
+
│ ┌─────────────────────┐
|
|
19
|
+
│ Recipes built ──►│ zibby test │ ◄── Browser testing
|
|
20
|
+
│ on top of the │ zibby analyze │ ◄── Code analysis
|
|
21
|
+
│ same platform │ zibby video │ ◄── Test playback
|
|
22
|
+
│ │ zibby generate │ ◄── Spec generation
|
|
23
|
+
│ └─────────────────────┘
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
You don't have to use the recipes. You can build whatever pipeline you want with `zibby workflow new`. The recipes just save you from writing the obvious starter graphs for common cases.
|
|
27
|
+
|
|
28
|
+
## Available recipes
|
|
29
|
+
|
|
30
|
+
| Recipe | What it does | Best for |
|
|
31
|
+
|---|---|---|
|
|
32
|
+
| [`zibby test`](./test) | Drives a browser via Cursor or Claude, runs assertions, generates a Playwright script + verification video | E2E test generation from plain-English specs |
|
|
33
|
+
| `zibby analyze` | Reads a Jira/Linear ticket, walks the codebase, produces an implementation plan | Pre-implementation planning, ticket triage |
|
|
34
|
+
| `zibby generate` | Generates test specs from a ticket + codebase | Backfilling test coverage on legacy projects |
|
|
35
|
+
| `zibby video` | Re-records or organizes verification videos for an existing test | Producing demos, regenerating after code changes |
|
|
36
|
+
|
|
37
|
+
## Why recipes matter
|
|
38
|
+
|
|
39
|
+
Three reasons we ship vertical workflows alongside the platform:
|
|
40
|
+
|
|
41
|
+
1. **Proof of concept** — every recipe IS a Zibby workflow. If `zibby test` works, the platform works. You can see the actual graph definition and adapt it.
|
|
42
|
+
2. **Faster onboarding** — you don't need to design a full graph on day one. Run a recipe, see the output, then build your own.
|
|
43
|
+
3. **Demonstrates multi-vendor** — the test recipe runs across Cursor / Claude / Codex / Gemini. Pick the agent that gives you the best results for your use case; the recipe doesn't care.
|
|
44
|
+
|
|
45
|
+
## Building your own recipe
|
|
46
|
+
|
|
47
|
+
If you have a workflow you'd want shipped as a built-in:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
zibby workflow new my-recipe # scaffold
|
|
51
|
+
# ... build it out ...
|
|
52
|
+
zibby workflow run my-recipe # test locally
|
|
53
|
+
zibby workflow deploy my-recipe # ship to your cloud account
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If it's broadly useful, we may pull it into the official recipes set. Open an issue or PR.
|
|
57
|
+
|
|
58
|
+
## Next
|
|
59
|
+
|
|
60
|
+
- **[`zibby test` recipe](./test)** — the most-used recipe, walked through end-to-end
|
|
61
|
+
- **[Build your own workflow](../get-started/your-first-workflow)** — scaffold and customize
|
|
62
|
+
- **[Concepts: graph](../concepts/graph)** — the primitives every recipe is built on
|