bluekiwi 0.1.7 → 0.2.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/dist/assets/mcp/server.js +97 -2
- package/dist/assets/skills/bk-approve/SKILL.md +78 -0
- package/dist/assets/skills/bk-credential/SKILL.md +146 -0
- package/dist/assets/skills/bk-design/SKILL.md +127 -0
- package/dist/assets/skills/bk-improve/SKILL.md +106 -0
- package/dist/assets/skills/bk-instruction/SKILL.md +177 -0
- package/dist/assets/skills/bk-next/SKILL.md +128 -116
- package/dist/assets/skills/bk-report/SKILL.md +97 -0
- package/dist/assets/skills/bk-rewind/SKILL.md +34 -41
- package/dist/assets/skills/bk-run/SKILL.md +50 -0
- package/dist/assets/skills/bk-scan/SKILL.md +115 -0
- package/dist/assets/skills/bk-share/SKILL.md +99 -0
- package/dist/assets/skills/bk-start/SKILL.md +67 -64
- package/dist/assets/skills/bk-status/SKILL.md +14 -14
- package/dist/assets/skills/bk-version/SKILL.md +95 -0
- package/package.json +1 -1
|
@@ -122,7 +122,9 @@ const tools = [
|
|
|
122
122
|
session_meta: { type: "string" },
|
|
123
123
|
target: { type: "object" },
|
|
124
124
|
}, ["workflow_id"]),
|
|
125
|
-
tool("execute_step", "Submit the result for the current workflow step"
|
|
125
|
+
tool("execute_step", "Submit the result for the current workflow step. " +
|
|
126
|
+
"IMPORTANT: If the response contains next_action='wait_for_human_approval', " +
|
|
127
|
+
"you MUST call request_approval next and then STOP — do NOT call advance until a human approves.", {
|
|
126
128
|
task_id: { type: "number" },
|
|
127
129
|
node_id: { type: "number" },
|
|
128
130
|
output: { type: "string" },
|
|
@@ -137,10 +139,23 @@ const tools = [
|
|
|
137
139
|
user_name: { type: "string" },
|
|
138
140
|
model_id: { type: "string" },
|
|
139
141
|
}, ["task_id", "node_id", "output", "status"]),
|
|
140
|
-
tool("advance", "Advance a task to the next step or inspect the current step"
|
|
142
|
+
tool("advance", "Advance a task to the next step, or use peek=true to inspect the current step without advancing. " +
|
|
143
|
+
"WARNING: Do NOT call advance if execute_step returned next_action='wait_for_human_approval'. " +
|
|
144
|
+
"In that case, call request_approval and wait. The server will reject advance with 403 until a human approves.", {
|
|
141
145
|
task_id: { type: "number" },
|
|
142
146
|
peek: { type: "boolean" },
|
|
143
147
|
}, ["task_id"]),
|
|
148
|
+
tool("request_approval", "Signal that the current step is complete and human approval is needed before proceeding. " +
|
|
149
|
+
"Call this after execute_step returns next_action='wait_for_human_approval'. " +
|
|
150
|
+
"After calling this, stop and wait — do NOT call advance until the human approves.", {
|
|
151
|
+
task_id: { type: "number" },
|
|
152
|
+
message: { type: "string" },
|
|
153
|
+
}, ["task_id"]),
|
|
154
|
+
tool("approve_step", "Approve the current HITL step on behalf of the human, unlocking advance. " +
|
|
155
|
+
"ONLY call this when the human explicitly invokes /bk-approve and confirms approval. " +
|
|
156
|
+
"Never call this autonomously — it must be a deliberate human action.", {
|
|
157
|
+
task_id: { type: "number" },
|
|
158
|
+
}, ["task_id"]),
|
|
144
159
|
tool("heartbeat", "Append progress information for a running task step", {
|
|
145
160
|
task_id: { type: "number" },
|
|
146
161
|
node_id: { type: "number" },
|
|
@@ -174,6 +189,45 @@ const tools = [
|
|
|
174
189
|
task_id: { type: "number" },
|
|
175
190
|
}, ["task_id"]),
|
|
176
191
|
tool("list_credentials", "List credentials available to the current user"),
|
|
192
|
+
tool("create_credential", "Create a new credential set (API key, token, etc.). Credentials must be placed in a private folder; they cannot live in public folders. Defaults to the caller's My Workspace if folder_id is omitted. Pass secrets as a JSON-serialisable object.", {
|
|
193
|
+
service_name: { type: "string" },
|
|
194
|
+
description: { type: "string" },
|
|
195
|
+
secrets: { type: "object" },
|
|
196
|
+
folder_id: { type: "number" },
|
|
197
|
+
}, ["service_name"]),
|
|
198
|
+
tool("update_credential", "Update an existing credential. Pass only the fields you want to change. Replacing secrets overwrites the entire secrets object.", {
|
|
199
|
+
credential_id: { type: "number" },
|
|
200
|
+
service_name: { type: "string" },
|
|
201
|
+
description: { type: "string" },
|
|
202
|
+
secrets: { type: "object" },
|
|
203
|
+
folder_id: { type: "number" },
|
|
204
|
+
}, ["credential_id"]),
|
|
205
|
+
tool("delete_credential", "Delete a credential. Fails with 409 if any instruction references this credential.", {
|
|
206
|
+
credential_id: { type: "number" },
|
|
207
|
+
}, ["credential_id"]),
|
|
208
|
+
tool("list_instructions", "List instruction templates visible to the current user. Optionally filter by folder_id.", {
|
|
209
|
+
folder_id: { type: "number" },
|
|
210
|
+
}),
|
|
211
|
+
tool("create_instruction", "Create a new instruction template. agent_type defaults to 'general'. priority is an integer (higher = more important). To reference a credential, include the service_name from list_credentials in the content text — actual credential binding happens at the workflow node level via create_workflow/update_workflow.", {
|
|
212
|
+
title: { type: "string" },
|
|
213
|
+
content: { type: "string" },
|
|
214
|
+
agent_type: { type: "string" },
|
|
215
|
+
tags: { type: "array" },
|
|
216
|
+
priority: { type: "number" },
|
|
217
|
+
folder_id: { type: "number" },
|
|
218
|
+
}, ["title"]),
|
|
219
|
+
tool("update_instruction", "Update an existing instruction template. Pass only the fields you want to change. Set is_active=false to soft-disable without deleting.", {
|
|
220
|
+
instruction_id: { type: "number" },
|
|
221
|
+
title: { type: "string" },
|
|
222
|
+
content: { type: "string" },
|
|
223
|
+
agent_type: { type: "string" },
|
|
224
|
+
tags: { type: "array" },
|
|
225
|
+
priority: { type: "number" },
|
|
226
|
+
is_active: { type: "boolean" },
|
|
227
|
+
}, ["instruction_id"]),
|
|
228
|
+
tool("delete_instruction", "Delete an instruction template. Fails with 409 if any workflow node references this instruction.", {
|
|
229
|
+
instruction_id: { type: "number" },
|
|
230
|
+
}, ["instruction_id"]),
|
|
177
231
|
tool("create_workflow", "Create a new workflow. Optionally place it in a specific folder_id (defaults to the caller's My Workspace).", {
|
|
178
232
|
title: { type: "string" },
|
|
179
233
|
description: { type: "string" },
|
|
@@ -292,6 +346,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
292
346
|
delete body.task_id;
|
|
293
347
|
return wrap(await client.request("POST", `/api/tasks/${taskId}/advance`, body));
|
|
294
348
|
}
|
|
349
|
+
case "request_approval": {
|
|
350
|
+
const taskId = requireNumberArg(args, "task_id");
|
|
351
|
+
const body = { ...args };
|
|
352
|
+
delete body.task_id;
|
|
353
|
+
return wrap(await client.request("POST", `/api/tasks/${taskId}/request-approval`, body));
|
|
354
|
+
}
|
|
355
|
+
case "approve_step": {
|
|
356
|
+
const taskId = requireNumberArg(args, "task_id");
|
|
357
|
+
return wrap(await client.request("POST", `/api/tasks/${taskId}/approve`, {}));
|
|
358
|
+
}
|
|
295
359
|
case "heartbeat": {
|
|
296
360
|
const taskId = requireNumberArg(args, "task_id");
|
|
297
361
|
const body = { ...args };
|
|
@@ -336,6 +400,37 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
336
400
|
}
|
|
337
401
|
case "list_credentials":
|
|
338
402
|
return wrap(await client.request("GET", "/api/credentials"));
|
|
403
|
+
case "create_credential":
|
|
404
|
+
return wrap(await client.request("POST", "/api/credentials", args));
|
|
405
|
+
case "update_credential": {
|
|
406
|
+
const credentialId = requireNumberArg(args, "credential_id");
|
|
407
|
+
const body = { ...args };
|
|
408
|
+
delete body.credential_id;
|
|
409
|
+
return wrap(await client.request("PUT", `/api/credentials/${credentialId}`, body));
|
|
410
|
+
}
|
|
411
|
+
case "delete_credential": {
|
|
412
|
+
const credentialId = requireNumberArg(args, "credential_id");
|
|
413
|
+
return wrap(await client.request("DELETE", `/api/credentials/${credentialId}`));
|
|
414
|
+
}
|
|
415
|
+
case "list_instructions": {
|
|
416
|
+
const qs = new URLSearchParams();
|
|
417
|
+
if (typeof args.folder_id === "number")
|
|
418
|
+
qs.set("folder_id", String(args.folder_id));
|
|
419
|
+
const suffix = qs.toString() ? `?${qs.toString()}` : "";
|
|
420
|
+
return wrap(await client.request("GET", `/api/instructions${suffix}`));
|
|
421
|
+
}
|
|
422
|
+
case "create_instruction":
|
|
423
|
+
return wrap(await client.request("POST", "/api/instructions", args));
|
|
424
|
+
case "update_instruction": {
|
|
425
|
+
const instructionId = requireNumberArg(args, "instruction_id");
|
|
426
|
+
const body = { ...args };
|
|
427
|
+
delete body.instruction_id;
|
|
428
|
+
return wrap(await client.request("PUT", `/api/instructions/${instructionId}`, body));
|
|
429
|
+
}
|
|
430
|
+
case "delete_instruction": {
|
|
431
|
+
const instructionId = requireNumberArg(args, "instruction_id");
|
|
432
|
+
return wrap(await client.request("DELETE", `/api/instructions/${instructionId}`));
|
|
433
|
+
}
|
|
339
434
|
case "create_workflow":
|
|
340
435
|
return wrap(await client.request("POST", "/api/workflows", args));
|
|
341
436
|
case "update_workflow": {
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bk-approve
|
|
3
|
+
description: BlueKiwi approval skill. Handles two approval scenarios — (1) gate steps where the agent asks the human a question, and (2) HITL steps where auto_advance=false and the agent has requested human approval before proceeding. This skill should be used when the user says "/bk-approve", "approve this", "approve step", "yes proceed", or wants to approve a pending step in a BlueKiwi workflow.
|
|
4
|
+
user_invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# BlueKiwi Step Approval
|
|
8
|
+
|
|
9
|
+
Handle pending approvals in a running workflow. Covers two scenarios:
|
|
10
|
+
|
|
11
|
+
- **Gate step** (`node_type: gate`): Agent asked the human a question; collect the answer.
|
|
12
|
+
- **HITL step** (`node_type: action`, `auto_advance: false`): Agent completed work and called `request_approval`; human reviews and approves before the workflow continues.
|
|
13
|
+
|
|
14
|
+
## Argument Handling
|
|
15
|
+
|
|
16
|
+
- `/bk-approve` → Inspect the current step and handle whichever scenario applies.
|
|
17
|
+
- `/bk-approve <task_id>` → Load the pending step for the specified task.
|
|
18
|
+
|
|
19
|
+
## Execution Steps
|
|
20
|
+
|
|
21
|
+
### Step 1: Inspect Current Step
|
|
22
|
+
|
|
23
|
+
Call `advance` with `peek: true` to inspect the current step and its log status.
|
|
24
|
+
|
|
25
|
+
If no active task → show "No active task." and exit.
|
|
26
|
+
|
|
27
|
+
Check `log_status` and `node_type` to determine scenario:
|
|
28
|
+
|
|
29
|
+
| node_type | log_status | Scenario |
|
|
30
|
+
| ------------- | ----------------------- | ----------------------------------------------- |
|
|
31
|
+
| `gate` | any | Gate — collect human answer |
|
|
32
|
+
| `action` | `completed` / `success` | HITL — review agent output and approve |
|
|
33
|
+
| anything else | `pending` / `running` | Not ready — tell user the step is still running |
|
|
34
|
+
|
|
35
|
+
### Step 2a: Gate Step
|
|
36
|
+
|
|
37
|
+
1. Show the gate question from `instruction`.
|
|
38
|
+
2. Check `get_web_response` for a pre-submitted web response. If found, show it and ask to confirm.
|
|
39
|
+
3. Collect decision via AskUserQuestion:
|
|
40
|
+
- header: "Gate decision"
|
|
41
|
+
- options: ["Approve (Recommended)", "Approve with edits", "Reject and revise", "Rewind to previous step"]
|
|
42
|
+
4. Call `execute_step` with the decision as `output`, status `"success"`.
|
|
43
|
+
5. Call `advance` to move to the next step and follow the auto_advance loop (see `/bk-next`).
|
|
44
|
+
|
|
45
|
+
### Step 2b: HITL Step
|
|
46
|
+
|
|
47
|
+
1. Show a summary of what the agent completed:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
51
|
+
⏸ Awaiting Approval: {step title}
|
|
52
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
{brief summary of agent's output from task log}
|
|
54
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2. Ask via AskUserQuestion:
|
|
58
|
+
- header: "Approve?"
|
|
59
|
+
- options: ["Approve — proceed to next step (Recommended)", "Reject — rewind to this step", "Rewind to earlier step"]
|
|
60
|
+
|
|
61
|
+
3. **If Approved**:
|
|
62
|
+
- Call `approve_step(task_id=<id>)` MCP tool.
|
|
63
|
+
- Call `advance` to move to the next step.
|
|
64
|
+
- Follow the auto_advance loop (see `/bk-next`).
|
|
65
|
+
|
|
66
|
+
4. **If Rejected**:
|
|
67
|
+
- Ask the user for the reason.
|
|
68
|
+
- Call `rewind` to return to this step so the agent can redo it.
|
|
69
|
+
- Tell the user: "Rewound to step {N}. Type `/bk-next` to retry."
|
|
70
|
+
|
|
71
|
+
5. **If Rewind to earlier step**:
|
|
72
|
+
- Switch to `/bk-rewind` flow.
|
|
73
|
+
|
|
74
|
+
## Notes
|
|
75
|
+
|
|
76
|
+
- `approve_step` MCP tool handles authentication automatically using the configured API key.
|
|
77
|
+
- After approving a HITL step, always follow the auto_advance loop — the next step may auto-proceed.
|
|
78
|
+
- If `advance` still returns 403 after approval, wait a moment and retry — the approval write may not have propagated yet.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bk-credential
|
|
3
|
+
description: BlueKiwi credential management skill. Securely registers, updates, and deletes external service credentials (API keys, tokens) in BlueKiwi. This skill should be used when the user says "/bk-credential", "add credential", "register API key", or wants to manage credentials in BlueKiwi.
|
|
4
|
+
user_invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# BlueKiwi Credential Management
|
|
8
|
+
|
|
9
|
+
Securely manage external service credentials (API keys, tokens) on the BlueKiwi server.
|
|
10
|
+
|
|
11
|
+
## Argument Handling
|
|
12
|
+
|
|
13
|
+
- `/bk-credential` → Show action selection menu.
|
|
14
|
+
- `/bk-credential add <service name>` → Start the add credential flow.
|
|
15
|
+
- `/bk-credential list` → Show registered credentials list.
|
|
16
|
+
|
|
17
|
+
## Security Principles
|
|
18
|
+
|
|
19
|
+
<HARD-RULE>
|
|
20
|
+
- Never print credential secret values to the user.
|
|
21
|
+
- When editing, never display existing secrets. Accept new values and replace entirely.
|
|
22
|
+
- Credentials must be stored in **private (personal) folders only**. Never store in public folders.
|
|
23
|
+
</HARD-RULE>
|
|
24
|
+
|
|
25
|
+
## Execution Steps
|
|
26
|
+
|
|
27
|
+
### Step 0: Select Action
|
|
28
|
+
|
|
29
|
+
If no argument, ask via AskUserQuestion:
|
|
30
|
+
|
|
31
|
+
- header: "Credentials"
|
|
32
|
+
- options: ["List", "Add new", "Edit", "Delete"]
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
### Action: List
|
|
37
|
+
|
|
38
|
+
Call `list_credentials` and display results:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Registered Credentials
|
|
42
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
+
ID Service Name Description
|
|
44
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
45
|
+
1 openai OpenAI API
|
|
46
|
+
2 github GitHub PAT
|
|
47
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
48
|
+
2 total
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Action: Add New
|
|
54
|
+
|
|
55
|
+
**Service name**: Ask via AskUserQuestion.
|
|
56
|
+
|
|
57
|
+
**Folder selection**: Call `list_folders`, filter for private folders only, then ask via AskUserQuestion:
|
|
58
|
+
|
|
59
|
+
- header: "Save folder"
|
|
60
|
+
- "Which folder should this be stored in? (Only private folders shown)"
|
|
61
|
+
- options: private folder list + "My Workspace (default)"
|
|
62
|
+
|
|
63
|
+
**Secrets input**: Ask the user for key-value pairs:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Enter the credentials for <service name>.
|
|
67
|
+
Format: KEY=VALUE (one per line)
|
|
68
|
+
Example:
|
|
69
|
+
API_KEY=sk-xxxx
|
|
70
|
+
BASE_URL=https://api.example.com
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Parse the input to build the secrets object.
|
|
74
|
+
|
|
75
|
+
**Description** (optional): Accept a short description.
|
|
76
|
+
|
|
77
|
+
**Confirm**: Ask via AskUserQuestion before registering:
|
|
78
|
+
|
|
79
|
+
- header: "Confirm"
|
|
80
|
+
- "Service: <service_name>\nKeys: <key list (values masked)>\nRegister?"
|
|
81
|
+
- options: ["Register", "Cancel"]
|
|
82
|
+
|
|
83
|
+
Call `create_credential`:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"service_name": "<service name>",
|
|
88
|
+
"description": "<description>",
|
|
89
|
+
"secrets": { "KEY": "value", ... },
|
|
90
|
+
"folder_id": <folder id or omit>
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### Action: Edit
|
|
97
|
+
|
|
98
|
+
Call `list_credentials`, then ask which one to edit via AskUserQuestion.
|
|
99
|
+
|
|
100
|
+
Ask what to change (AskUserQuestion):
|
|
101
|
+
|
|
102
|
+
- options: ["Change service name", "Change description", "Replace secrets", "Cancel"]
|
|
103
|
+
|
|
104
|
+
For "Replace secrets" → accept all new key-value pairs and replace entirely.
|
|
105
|
+
|
|
106
|
+
Call `update_credential`:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"credential_id": <id>,
|
|
111
|
+
"service_name": "<if changed>",
|
|
112
|
+
"description": "<if changed>",
|
|
113
|
+
"secrets": { ... }
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
### Action: Delete
|
|
120
|
+
|
|
121
|
+
Call `list_credentials`, then ask which one to delete via AskUserQuestion.
|
|
122
|
+
|
|
123
|
+
Confirm via AskUserQuestion:
|
|
124
|
+
|
|
125
|
+
- header: "Confirm delete"
|
|
126
|
+
- "Delete the '<service_name>' credential? This will fail if any workflow node references it."
|
|
127
|
+
- options: ["Delete", "Cancel"]
|
|
128
|
+
|
|
129
|
+
Call `delete_credential`. On 409 error (in use), inform the user which workflow is using it.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Linking to Workflows
|
|
134
|
+
|
|
135
|
+
Credentials are linked to workflow nodes via `credential_id`.
|
|
136
|
+
|
|
137
|
+
When designing workflows (`/bk-design`, `/bk-improve`), set the credential on the node that calls an external API:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"title": "Call External API",
|
|
142
|
+
"credential_id": <credential id>
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
BlueKiwi automatically injects the secrets into that node at runtime.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bk-design
|
|
3
|
+
description: BlueKiwi workflow design skill. Takes a natural language goal and designs a structured workflow, then registers it on the server. This skill should be used when the user says "/bk-design", "create workflow", "design new workflow", or wants to build a new BlueKiwi workflow from scratch.
|
|
4
|
+
user_invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# BlueKiwi Workflow Design
|
|
8
|
+
|
|
9
|
+
Design a structured workflow from a natural language goal and register it on the BlueKiwi server.
|
|
10
|
+
|
|
11
|
+
## Argument Handling
|
|
12
|
+
|
|
13
|
+
- `/bk-design` → Ask for the goal via AskUserQuestion.
|
|
14
|
+
- `/bk-design <goal>` → Start designing from the provided goal.
|
|
15
|
+
|
|
16
|
+
## Core Principles
|
|
17
|
+
|
|
18
|
+
- One node = **one agent action**. Split overly large chunks.
|
|
19
|
+
- `auto_advance: true` = proceeds without user intervention. Suitable for data collection and transformation steps.
|
|
20
|
+
- `auto_advance: false` = requires user confirmation or judgment.
|
|
21
|
+
- `node_type` must be either `"agent"` (agent execution) or `"gate"` (user decision).
|
|
22
|
+
|
|
23
|
+
## Execution Steps
|
|
24
|
+
|
|
25
|
+
### Step 1: Understand the Goal
|
|
26
|
+
|
|
27
|
+
Extract the goal from arguments. If none, ask via AskUserQuestion:
|
|
28
|
+
|
|
29
|
+
- header: "What to build?"
|
|
30
|
+
- "What task would you like to automate? Please describe in detail."
|
|
31
|
+
- options: ["Competitor analysis", "Code review", "Report generation", "Type my own"]
|
|
32
|
+
|
|
33
|
+
If "Type my own" → accept free-text goal input.
|
|
34
|
+
|
|
35
|
+
### Step 2: Check for Existing Workflows
|
|
36
|
+
|
|
37
|
+
Call `list_workflows` to check for similar existing workflows.
|
|
38
|
+
|
|
39
|
+
If a similar one is found, ask via AskUserQuestion:
|
|
40
|
+
|
|
41
|
+
- header: "Existing workflow"
|
|
42
|
+
- "'{title}' already exists. Create a new one or improve the existing one?"
|
|
43
|
+
- options: ["Create new", "Improve existing (switch to /bk-improve)"]
|
|
44
|
+
|
|
45
|
+
If "Improve existing" → switch to `/bk-improve` flow.
|
|
46
|
+
|
|
47
|
+
### Step 3: Select Folder
|
|
48
|
+
|
|
49
|
+
Call `list_folders` to get the folder list.
|
|
50
|
+
|
|
51
|
+
Ask via AskUserQuestion:
|
|
52
|
+
|
|
53
|
+
- header: "Save location"
|
|
54
|
+
- "Which folder should this be saved in?"
|
|
55
|
+
- options: folder name list (up to 4) + "My Workspace (default)"
|
|
56
|
+
|
|
57
|
+
### Step 4: Design Workflow Structure
|
|
58
|
+
|
|
59
|
+
Analyze the goal and design the nodes.
|
|
60
|
+
|
|
61
|
+
**Node structure example:**
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"title": "Clarify Goal",
|
|
66
|
+
"instruction": "Analyze the user's stated goal and extract the 3 most important clarifying questions.",
|
|
67
|
+
"node_type": "agent",
|
|
68
|
+
"auto_advance": true,
|
|
69
|
+
"order": 1
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Show the design to the user:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Designed workflow: <title>
|
|
77
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
78
|
+
1. [Clarify Goal] (auto)
|
|
79
|
+
2. [Collect Data] (auto)
|
|
80
|
+
3. [Run Analysis] (auto)
|
|
81
|
+
4. [Review Results] ← pauses here
|
|
82
|
+
5. [Generate Report] (auto)
|
|
83
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
84
|
+
5 steps total
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Ask via AskUserQuestion:
|
|
88
|
+
|
|
89
|
+
- header: "Confirm"
|
|
90
|
+
- "Create the workflow with this structure?"
|
|
91
|
+
- options: ["Create", "Edit", "Cancel"]
|
|
92
|
+
|
|
93
|
+
If "Edit" → accept modification input and redesign.
|
|
94
|
+
|
|
95
|
+
### Step 5: Register Workflow
|
|
96
|
+
|
|
97
|
+
Call `create_workflow`:
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"title": "<workflow title>",
|
|
102
|
+
"description": "<goal summary>",
|
|
103
|
+
"version": "1.0",
|
|
104
|
+
"folder_id": <selected folder id>,
|
|
105
|
+
"nodes": [...]
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Step 6: Report Result
|
|
110
|
+
|
|
111
|
+
On success:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
✅ Workflow registered
|
|
115
|
+
Name: <title> (ID: <id>)
|
|
116
|
+
Steps: <n>
|
|
117
|
+
Version: 1.0
|
|
118
|
+
|
|
119
|
+
Type `/bk-run` to execute it now.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Node Design Guidelines
|
|
123
|
+
|
|
124
|
+
- 3–7 steps is ideal. Consider splitting if more than 10.
|
|
125
|
+
- The first step should always be `auto_advance: false` (user provides initial context).
|
|
126
|
+
- Insert a `gate` node (result review) before the final step.
|
|
127
|
+
- For nodes requiring external API calls, specify `credential_id`. Create credentials first with `/bk-credential`.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bk-improve
|
|
3
|
+
description: BlueKiwi workflow improvement skill. Analyzes an existing workflow, creates a better version, and optionally runs it to compare results. This skill should be used when the user says "/bk-improve", "improve workflow", "make a better version", or wants to refine an existing BlueKiwi workflow.
|
|
4
|
+
user_invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# BlueKiwi Workflow Improve
|
|
8
|
+
|
|
9
|
+
Improve an existing workflow by creating a new version, then optionally execute it to compare results.
|
|
10
|
+
|
|
11
|
+
## Argument Handling
|
|
12
|
+
|
|
13
|
+
- `/bk-improve` → Fetch workflow list, ask user to select.
|
|
14
|
+
- `/bk-improve <workflow name>` → Load that workflow directly.
|
|
15
|
+
|
|
16
|
+
## Execution Steps
|
|
17
|
+
|
|
18
|
+
### Step 1: Select Target Workflow
|
|
19
|
+
|
|
20
|
+
If no argument, call `list_workflows` and ask via AskUserQuestion:
|
|
21
|
+
|
|
22
|
+
- header: "Which workflow?"
|
|
23
|
+
- "Which workflow would you like to improve?"
|
|
24
|
+
- options: workflow title list (up to 4)
|
|
25
|
+
|
|
26
|
+
### Step 2: Understand Improvement Direction
|
|
27
|
+
|
|
28
|
+
Ask via AskUserQuestion:
|
|
29
|
+
|
|
30
|
+
- header: "Improvement goal"
|
|
31
|
+
- "What would you like to improve?"
|
|
32
|
+
- options: ["Set more quantitative goals", "Break steps into finer detail", "Improve accuracy", "Type my own"]
|
|
33
|
+
|
|
34
|
+
If "Type my own" → accept free-text improvement direction.
|
|
35
|
+
|
|
36
|
+
### Step 3: Analyze the Current Workflow
|
|
37
|
+
|
|
38
|
+
Display the current workflow node structure:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Current workflow: <title> v<version>
|
|
42
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
43
|
+
1. [Step name] — <instruction summary>
|
|
44
|
+
2. [Step name] — <instruction summary>
|
|
45
|
+
...
|
|
46
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Review each node against the improvement direction:
|
|
50
|
+
|
|
51
|
+
- Vague goals → add quantitative criteria
|
|
52
|
+
- Oversized steps → split them
|
|
53
|
+
- Missing validation → add it
|
|
54
|
+
- Unnecessary steps → remove them
|
|
55
|
+
|
|
56
|
+
### Step 4: Design Improved Nodes
|
|
57
|
+
|
|
58
|
+
Design the full improved node set.
|
|
59
|
+
|
|
60
|
+
Show a diff of the changes:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Improvements:
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
✏️ Step 1: "Collect keywords" → "Collect top 10 keywords (by search volume)"
|
|
66
|
+
➕ Step 4 added: "Quantitative validation (retry if below threshold)"
|
|
67
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Ask via AskUserQuestion:
|
|
71
|
+
|
|
72
|
+
- header: "Confirm"
|
|
73
|
+
- "Create a new version (v<x.y>) with these improvements?"
|
|
74
|
+
- options: ["Create new version", "Adjust more", "Cancel"]
|
|
75
|
+
|
|
76
|
+
### Step 5: Create New Version
|
|
77
|
+
|
|
78
|
+
Call `update_workflow` with `create_new_version: true`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"workflow_id": <existing id>,
|
|
83
|
+
"create_new_version": true,
|
|
84
|
+
"version": "<new version>",
|
|
85
|
+
"nodes": [<improved node array>]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Step 6: Offer Immediate Execution
|
|
90
|
+
|
|
91
|
+
Ask via AskUserQuestion:
|
|
92
|
+
|
|
93
|
+
- header: "Run now?"
|
|
94
|
+
- "New version v<x.y> created. Run it now to check results?"
|
|
95
|
+
- options: ["Run now", "Run later"]
|
|
96
|
+
|
|
97
|
+
If "Run now" → switch to `/bk-run` flow and start a task with the new version.
|
|
98
|
+
|
|
99
|
+
### Step 7: Report Result
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
✅ New version created
|
|
103
|
+
Workflow: <title>
|
|
104
|
+
Previous: v<old> → New: v<new>
|
|
105
|
+
Improved steps: <n>
|
|
106
|
+
```
|