@elyracode/subagents 0.4.8 → 0.5.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 +26 -0
- package/extensions/index.ts +183 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,9 +37,35 @@ Have worker implement this plan, then run reviewer to check it.
|
|
|
37
37
|
/run reviewer review the changes in the last commit
|
|
38
38
|
/run oracle challenge my current approach
|
|
39
39
|
/parallel reviewer 'check correctness' -> reviewer 'check tests' -> reviewer 'check complexity'
|
|
40
|
+
/build-feature add a wallet system with balance tracking
|
|
41
|
+
/ui-review build a registration form with validation
|
|
42
|
+
/deep-review the authentication system
|
|
40
43
|
/agents
|
|
41
44
|
```
|
|
42
45
|
|
|
46
|
+
## Workflows
|
|
47
|
+
|
|
48
|
+
| Workflow | Command | Steps |
|
|
49
|
+
|----------|---------|-------|
|
|
50
|
+
| **Build Feature** | `/build-feature` | scout -> planner -> oracle -> worker -> reviewer -> worker (fix) |
|
|
51
|
+
| **UI Review** | `/ui-review` | worker (build) -> reviewer (screenshot + visual QA) -> worker (fix) -> reviewer (verify) |
|
|
52
|
+
| **Deep Review** | `/deep-review` | reviewer (correctness) -> reviewer (tests) -> reviewer (security) -> oracle (synthesis) |
|
|
53
|
+
| **Git Review** | `/git-review` | review git diff for correctness, security, tests, code debt, design consistency |
|
|
54
|
+
|
|
55
|
+
## Git Integration
|
|
56
|
+
|
|
57
|
+
### Manual review before push
|
|
58
|
+
```
|
|
59
|
+
/git-review
|
|
60
|
+
```
|
|
61
|
+
Reviews your staged and unstaged changes with a go/no-go verdict.
|
|
62
|
+
|
|
63
|
+
### Automatic pre-push hook
|
|
64
|
+
```
|
|
65
|
+
/setup-git-hook
|
|
66
|
+
```
|
|
67
|
+
Installs a `.git/hooks/pre-push` hook that runs Elyra review automatically before every push. If issues are found, the push is blocked. Skip with `git push --no-verify`.
|
|
68
|
+
|
|
43
69
|
### Recommended workflow
|
|
44
70
|
```
|
|
45
71
|
scout -> planner -> worker -> reviewer -> worker (fixes)
|
package/extensions/index.ts
CHANGED
|
@@ -170,6 +170,141 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
170
170
|
ctx.ui.notify(`Available subagents:\n${agentList}`);
|
|
171
171
|
},
|
|
172
172
|
});
|
|
173
|
+
|
|
174
|
+
// -- Tool: orchestrate_workflow --
|
|
175
|
+
elyra.registerTool({
|
|
176
|
+
name: "orchestrate_workflow",
|
|
177
|
+
label: "Orchestrate Multi-Agent Workflow",
|
|
178
|
+
description:
|
|
179
|
+
"Run a predefined multi-agent workflow. Available workflows: " +
|
|
180
|
+
"'build-feature' (scout -> planner -> worker -> reviewer -> fix), " +
|
|
181
|
+
"'ui-review' (worker builds UI, reviewer screenshots and checks visual quality + accessibility), " +
|
|
182
|
+
"'deep-review' (parallel reviewers for correctness, tests, security, then synthesis). " +
|
|
183
|
+
"Use this for complex tasks that benefit from structured multi-agent orchestration.",
|
|
184
|
+
parameters: Type.Object({
|
|
185
|
+
workflow: Type.Union(
|
|
186
|
+
[Type.Literal("build-feature"), Type.Literal("ui-review"), Type.Literal("deep-review")],
|
|
187
|
+
{ description: "The workflow to run" },
|
|
188
|
+
),
|
|
189
|
+
task: Type.String({ description: "Description of the feature or task" }),
|
|
190
|
+
}),
|
|
191
|
+
execute: async (_toolCallId, params) => {
|
|
192
|
+
const workflow = WORKFLOWS[params.workflow];
|
|
193
|
+
if (!workflow) {
|
|
194
|
+
return {
|
|
195
|
+
content: [{ type: "text", text: `Unknown workflow: ${params.workflow}` }],
|
|
196
|
+
details: {},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const instructions = workflow.steps.map((step, i) => {
|
|
201
|
+
const agent = BUILTIN_AGENTS[step.agent];
|
|
202
|
+
const agentDesc = agent ? `(${agent.description})` : "";
|
|
203
|
+
const readOnly = agent?.readOnly ? " [READ-ONLY]" : "";
|
|
204
|
+
const stepTask = step.task.replace("{task}", params.task).replace("{previous}", "the previous step's output");
|
|
205
|
+
return `### Step ${i + 1}: ${step.agent}${readOnly} ${agentDesc}\n${stepTask}`;
|
|
206
|
+
}).join("\n\n");
|
|
207
|
+
|
|
208
|
+
return {
|
|
209
|
+
content: [{
|
|
210
|
+
type: "text",
|
|
211
|
+
text: `# Workflow: ${workflow.name}\n\n` +
|
|
212
|
+
`${workflow.description}\n\n` +
|
|
213
|
+
`Task: ${params.task}\n\n` +
|
|
214
|
+
`## Execution Plan\n\n${instructions}\n\n` +
|
|
215
|
+
`## Rules\n` +
|
|
216
|
+
`- Execute each step in order\n` +
|
|
217
|
+
`- Read-only steps must NOT edit files\n` +
|
|
218
|
+
`- Pass results from each step to the next\n` +
|
|
219
|
+
`- After the final step, provide a summary of everything done`,
|
|
220
|
+
}],
|
|
221
|
+
details: { workflow: params.workflow, steps: workflow.steps.length },
|
|
222
|
+
};
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
// -- Command: /build-feature --
|
|
227
|
+
elyra.registerCommand("build-feature", {
|
|
228
|
+
description: "Orchestrated feature development: scout -> planner -> worker -> reviewer -> fix",
|
|
229
|
+
handler: async (args, _ctx) => {
|
|
230
|
+
if (!args.trim()) {
|
|
231
|
+
elyra.sendUserMessage("Usage: /build-feature <description>\n\nExample: /build-feature add a wallet system with balance tracking and transaction history");
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
elyra.sendUserMessage(`Run the build-feature workflow: ${args}`);
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// -- Command: /ui-review --
|
|
239
|
+
elyra.registerCommand("ui-review", {
|
|
240
|
+
description: "Adversarial UI testing: build UI, then screenshot + visual QA + accessibility check",
|
|
241
|
+
handler: async (args, _ctx) => {
|
|
242
|
+
if (!args.trim()) {
|
|
243
|
+
elyra.sendUserMessage("Usage: /ui-review <description>\n\nExample: /ui-review build a registration form with validation");
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
elyra.sendUserMessage(`Run the ui-review workflow: ${args}`);
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
// -- Command: /deep-review --
|
|
251
|
+
elyra.registerCommand("deep-review", {
|
|
252
|
+
description: "Parallel deep review: correctness + tests + security + synthesis",
|
|
253
|
+
handler: async (args, _ctx) => {
|
|
254
|
+
if (!args.trim()) {
|
|
255
|
+
elyra.sendUserMessage("Usage: /deep-review <what to review>\n\nExample: /deep-review the authentication system");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
elyra.sendUserMessage(`Run the deep-review workflow: ${args}`);
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
// -- Command: /git-review --
|
|
263
|
+
elyra.registerCommand("git-review", {
|
|
264
|
+
description: "Review staged/uncommitted changes before push. Use as a pre-push quality gate.",
|
|
265
|
+
handler: async (_args, _ctx) => {
|
|
266
|
+
elyra.sendUserMessage(
|
|
267
|
+
"Run the git-review workflow on my current changes. " +
|
|
268
|
+
"Get the git diff of staged and unstaged changes, then review for: " +
|
|
269
|
+
"correctness, security issues, missing tests, code debt (TODO/FIXME), " +
|
|
270
|
+
"and Tailwind design consistency (if UI files changed). " +
|
|
271
|
+
"If design_system_check is available, run it on modified frontend files. " +
|
|
272
|
+
"Summarize findings as a go/no-go for pushing.",
|
|
273
|
+
);
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// -- Command: /setup-git-hook --
|
|
278
|
+
elyra.registerCommand("setup-git-hook", {
|
|
279
|
+
description: "Install a git pre-push hook that runs elyra review",
|
|
280
|
+
handler: async (_args, ctx) => {
|
|
281
|
+
const hookScript = `#!/bin/sh
|
|
282
|
+
# Elyra pre-push review hook
|
|
283
|
+
# Runs a quick code review before pushing
|
|
284
|
+
|
|
285
|
+
echo "Running Elyra pre-push review..."
|
|
286
|
+
elyra -p "Review the git diff for this push. Run: git diff @{push}.. and analyze the changes. Check for: bugs, security issues, missing tests, code debt. Output a go/no-go verdict. If no-go, exit with code 1."
|
|
287
|
+
ELYRA_EXIT=$?
|
|
288
|
+
|
|
289
|
+
if [ $ELYRA_EXIT -ne 0 ]; then
|
|
290
|
+
echo "Elyra review found issues. Push blocked."
|
|
291
|
+
echo "Run 'elyra' to fix the issues, or 'git push --no-verify' to skip."
|
|
292
|
+
exit 1
|
|
293
|
+
fi
|
|
294
|
+
|
|
295
|
+
echo "Elyra review passed."
|
|
296
|
+
exit 0
|
|
297
|
+
`;
|
|
298
|
+
|
|
299
|
+
elyra.sendUserMessage(
|
|
300
|
+
"Set up the Elyra pre-push git hook. Write this script to `.git/hooks/pre-push` and make it executable:\n\n" +
|
|
301
|
+
"```bash\n" + hookScript + "```\n\n" +
|
|
302
|
+
"Commands:\n" +
|
|
303
|
+
"```bash\nmkdir -p .git/hooks\n" +
|
|
304
|
+
"# Write the hook file\nchmod +x .git/hooks/pre-push\n```",
|
|
305
|
+
);
|
|
306
|
+
},
|
|
307
|
+
});
|
|
173
308
|
}
|
|
174
309
|
|
|
175
310
|
function formatSubagentPrompt(agent: AgentDefinition, task: string, context?: string): string {
|
|
@@ -186,3 +321,51 @@ function formatSubagentPrompt(agent: AgentDefinition, task: string, context?: st
|
|
|
186
321
|
|
|
187
322
|
return parts.join("\n");
|
|
188
323
|
}
|
|
324
|
+
|
|
325
|
+
// -- Workflow Definitions --
|
|
326
|
+
|
|
327
|
+
interface WorkflowStep {
|
|
328
|
+
agent: string;
|
|
329
|
+
task: string;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
interface Workflow {
|
|
333
|
+
name: string;
|
|
334
|
+
description: string;
|
|
335
|
+
steps: WorkflowStep[];
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const WORKFLOWS: Record<string, Workflow> = {
|
|
339
|
+
"build-feature": {
|
|
340
|
+
name: "Build Feature",
|
|
341
|
+
description: "Full orchestrated feature development: understand the codebase, plan, implement, review, and fix.",
|
|
342
|
+
steps: [
|
|
343
|
+
{ agent: "scout", task: "Analyze the codebase to understand the existing architecture, relevant files, data models, and how {task} should fit in. Report file paths, patterns, and risks." },
|
|
344
|
+
{ agent: "planner", task: "Based on the scout's findings, create a detailed implementation plan for {task}. Include file paths, function signatures, database changes, and test strategy." },
|
|
345
|
+
{ agent: "oracle", task: "Review the planner's implementation plan for {task}. Challenge assumptions, identify risks, edge cases, and security concerns. Recommend the safest approach." },
|
|
346
|
+
{ agent: "worker", task: "Implement {task} following the approved plan. Edit files, create migrations, write code. Validate changes compile and make sense." },
|
|
347
|
+
{ agent: "reviewer", task: "Review the worker's implementation of {task}. Check correctness, tests, security, simplicity. List issues as critical/warning/suggestion." },
|
|
348
|
+
{ agent: "worker", task: "Fix the issues found by the reviewer. Apply only the changes that are critical or clearly beneficial." },
|
|
349
|
+
],
|
|
350
|
+
},
|
|
351
|
+
"ui-review": {
|
|
352
|
+
name: "Adversarial UI Review",
|
|
353
|
+
description: "Build UI, then visually inspect it with screenshots and check for accessibility, design consistency, and responsive issues.",
|
|
354
|
+
steps: [
|
|
355
|
+
{ agent: "worker", task: "Build the UI for {task}. Use the project's component library and Tailwind CSS. Make it responsive and accessible." },
|
|
356
|
+
{ agent: "reviewer", task: "Review the UI code for {task}. If design_preview or screenshot_url tools are available, use them to visually inspect the result. Check: visual alignment, spacing consistency, color contrast (WCAG), responsive layout (test mobile viewport), hover/focus states, dark mode support. If design_system_check is available, run it on the modified files. Report visual issues with specific Tailwind class fixes." },
|
|
357
|
+
{ agent: "worker", task: "Fix the visual and accessibility issues found by the reviewer. Apply the Tailwind class changes recommended." },
|
|
358
|
+
{ agent: "reviewer", task: "Final visual check of {task}. Verify all issues are resolved. Use screenshot_url if available to confirm." },
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
"deep-review": {
|
|
362
|
+
name: "Deep Parallel Review",
|
|
363
|
+
description: "Run three focused review passes in sequence, then synthesize findings.",
|
|
364
|
+
steps: [
|
|
365
|
+
{ agent: "reviewer", task: "CORRECTNESS REVIEW of {task}: Focus exclusively on logical correctness, data handling, error handling, and edge cases. Ignore style and tests." },
|
|
366
|
+
{ agent: "reviewer", task: "TEST REVIEW of {task}: Focus exclusively on test coverage, missing test cases, test quality, and edge case testing. Ignore implementation style." },
|
|
367
|
+
{ agent: "reviewer", task: "SECURITY REVIEW of {task}: Focus exclusively on security: SQL injection, XSS, CSRF, auth bypasses, data leaks, insecure defaults, input validation. Ignore style and tests." },
|
|
368
|
+
{ agent: "oracle", task: "Synthesize all three review reports for {task}. Prioritize findings by impact. Create a single actionable fix list ordered by severity. Recommend which fixes to apply now vs later." },
|
|
369
|
+
],
|
|
370
|
+
},
|
|
371
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyracode/subagents",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Elyra extension for subagent delegation -- scout, reviewer, planner, worker, oracle, and parallel execution",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": ["elyra-package", "subagents", "delegation", "multi-agent", "parallel", "code-review"],
|