spets 0.1.52 → 0.1.53
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 +54 -295
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -262,195 +262,53 @@ async function listPlugins() {
|
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
264
|
function getClaudeSkillContent() {
|
|
265
|
-
return `# Spets
|
|
265
|
+
return `# Spets Workflow Executor
|
|
266
266
|
|
|
267
|
-
Execute
|
|
268
|
-
|
|
269
|
-
---
|
|
267
|
+
Orchestrator-controlled workflow. Execute commands, parse JSON response, run \`onComplete\`.
|
|
270
268
|
|
|
271
269
|
## Constraints
|
|
272
270
|
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
- **NO** subprocess spawning for AI calls
|
|
276
|
-
- **IMMEDIATELY** execute commands, no planning
|
|
277
|
-
|
|
278
|
-
---
|
|
271
|
+
- NO EnterPlanMode, TaskCreate/TaskUpdate, subprocess spawning
|
|
272
|
+
- Execute immediately - no planning
|
|
279
273
|
|
|
280
|
-
##
|
|
274
|
+
## Execution Loop
|
|
281
275
|
|
|
282
276
|
\`\`\`bash
|
|
283
277
|
npx spets orchestrate init "$ARGUMENTS"
|
|
284
278
|
\`\`\`
|
|
285
279
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## Command Table
|
|
291
|
-
|
|
292
|
-
### \`type: "phase"\`
|
|
293
|
-
|
|
294
|
-
| \`phase\` | Action |
|
|
295
|
-
|---------|--------|
|
|
296
|
-
| \`explore\` | [ACTION_EXPLORE](#action_explore) |
|
|
297
|
-
| \`clarify\` | [ACTION_CLARIFY](#action_clarify) |
|
|
298
|
-
| \`execute\` | [ACTION_EXECUTE](#action_execute) |
|
|
299
|
-
| \`verify\` | [ACTION_VERIFY](#action_verify) |
|
|
300
|
-
|
|
301
|
-
### \`type: "checkpoint"\`
|
|
302
|
-
|
|
303
|
-
| \`checkpoint\` | Action |
|
|
304
|
-
|--------------|--------|
|
|
305
|
-
| \`clarify\` | [ACTION_ASK_QUESTIONS](#action_ask_questions) |
|
|
306
|
-
| \`approve\` | [ACTION_ASK_APPROVAL](#action_ask_approval) |
|
|
280
|
+
Loop until \`type: "complete"\` or \`type: "error"\`:
|
|
307
281
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
| \`completed\` | Print: "Workflow complete. Outputs: {outputs}" |
|
|
313
|
-
| \`stopped\` | Print: "Workflow paused. Resume with: npx spets resume --task {taskId}" |
|
|
314
|
-
| \`rejected\` | Print: "Workflow rejected." |
|
|
315
|
-
|
|
316
|
-
### \`type: "error"\`
|
|
317
|
-
|
|
318
|
-
Print: "Error: {error}" \u2192 STOP
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Action Definitions
|
|
323
|
-
|
|
324
|
-
**IMPORTANT:** Each phase response includes a \`prompt\` field containing the exact instructions to follow.
|
|
325
|
-
This ensures identical behavior across CLI, Claude Code, and GitHub modes.
|
|
326
|
-
|
|
327
|
-
### ACTION_EXPLORE
|
|
328
|
-
|
|
329
|
-
\`\`\`
|
|
330
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
331
|
-
2. The prompt tells you:
|
|
332
|
-
- What to search for
|
|
333
|
-
- How to analyze the codebase
|
|
334
|
-
- The exact JSON output format required
|
|
335
|
-
3. Bash: npx spets orchestrate explore-done {taskId} '{exploreJson}'
|
|
336
|
-
4. Parse response \u2192 next action
|
|
337
|
-
\`\`\`
|
|
338
|
-
|
|
339
|
-
### ACTION_CLARIFY
|
|
340
|
-
|
|
341
|
-
\`\`\`
|
|
342
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
343
|
-
2. The prompt tells you:
|
|
344
|
-
- What context to analyze
|
|
345
|
-
- How to generate questions
|
|
346
|
-
- The exact JSON output format required
|
|
347
|
-
3. Bash: npx spets orchestrate clarify-done {taskId} '{questionsJson}'
|
|
348
|
-
- Format: [{"id":"q1","question":"..."},...]
|
|
349
|
-
- Empty if no questions: []
|
|
350
|
-
4. Parse response \u2192 next action
|
|
351
|
-
\`\`\`
|
|
352
|
-
|
|
353
|
-
### ACTION_EXECUTE
|
|
354
|
-
|
|
355
|
-
\`\`\`
|
|
356
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
357
|
-
2. The prompt tells you:
|
|
358
|
-
- The instruction and template to follow
|
|
359
|
-
- The explore output and answers to use
|
|
360
|
-
- Where to save the document/code (context.output)
|
|
361
|
-
- Any revision/verify feedback to address
|
|
362
|
-
3. Write the document/code to context.output
|
|
363
|
-
4. Bash: npx spets orchestrate execute-done {taskId}
|
|
364
|
-
5. Parse response \u2192 next action
|
|
365
|
-
\`\`\`
|
|
366
|
-
|
|
367
|
-
### ACTION_VERIFY
|
|
368
|
-
|
|
369
|
-
\`\`\`
|
|
370
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
371
|
-
2. The prompt tells you:
|
|
372
|
-
- The document to verify (already included in prompt)
|
|
373
|
-
- The requirements and template to check against
|
|
374
|
-
- The scoring criteria and pass conditions
|
|
375
|
-
- The exact JSON output format required
|
|
376
|
-
3. Bash: npx spets orchestrate verify-done {taskId} '{verifyJson}'
|
|
377
|
-
4. Parse response \u2192 next action
|
|
378
|
-
- If passed: goes to human review
|
|
379
|
-
- If failed (attempts < 3): goes back to draft phase (auto-fix)
|
|
380
|
-
- If failed (attempts >= 3): goes to human review with warning
|
|
381
|
-
\`\`\`
|
|
382
|
-
|
|
383
|
-
### ACTION_ASK_QUESTIONS
|
|
384
|
-
|
|
385
|
-
\`\`\`
|
|
386
|
-
1. AskUserQuestion(
|
|
387
|
-
questions: [
|
|
388
|
-
FOR EACH q IN questions:
|
|
389
|
-
{
|
|
390
|
-
question: q.question,
|
|
391
|
-
header: "Q{index}",
|
|
392
|
-
options: q.options OR [
|
|
393
|
-
{label: "Provide answer", description: "Type your answer"}
|
|
394
|
-
]
|
|
395
|
-
}
|
|
396
|
-
]
|
|
397
|
-
)
|
|
398
|
-
|
|
399
|
-
2. Collect answers into: [{"questionId":"q1","answer":"..."},...]
|
|
400
|
-
|
|
401
|
-
3. Bash: npx spets orchestrate clarified {taskId} '{answersJson}'
|
|
402
|
-
|
|
403
|
-
4. Parse response \u2192 next action
|
|
404
|
-
\`\`\`
|
|
282
|
+
1. Parse JSON response
|
|
283
|
+
2. Execute action based on \`type\` and \`phase\`/\`checkpoint\`
|
|
284
|
+
3. Run the \`onComplete\` command from response
|
|
285
|
+
4. Parse next response \u2192 repeat
|
|
405
286
|
|
|
406
|
-
|
|
287
|
+
## Actions
|
|
407
288
|
|
|
408
|
-
|
|
409
|
-
1. Read(specPath)
|
|
289
|
+
### type: "phase"
|
|
410
290
|
|
|
411
|
-
|
|
291
|
+
| phase | Action |
|
|
292
|
+
|-------|--------|
|
|
293
|
+
| explore | Follow \`response.prompt\` \u2192 run \`onComplete\` with JSON result |
|
|
294
|
+
| clarify | Follow \`response.prompt\` \u2192 run \`onComplete\` with questions JSON |
|
|
295
|
+
| execute | Follow \`response.prompt\` \u2192 write to \`context.output\` \u2192 run \`onComplete\` |
|
|
296
|
+
| verify | Follow \`response.prompt\` \u2192 run \`onComplete\` with verify JSON |
|
|
412
297
|
|
|
413
|
-
|
|
414
|
-
questions: [{
|
|
415
|
-
question: "Review {step} document. What would you like to do?",
|
|
416
|
-
header: "Review",
|
|
417
|
-
options: [
|
|
418
|
-
{label: "Approve", description: "Continue to next step"},
|
|
419
|
-
{label: "Revise", description: "Request changes"},
|
|
420
|
-
{label: "Reject", description: "Stop workflow"},
|
|
421
|
-
{label: "Stop", description: "Pause for later"}
|
|
422
|
-
]
|
|
423
|
-
}]
|
|
424
|
-
)
|
|
298
|
+
### type: "checkpoint"
|
|
425
299
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
- Bash: npx spets orchestrate revise {taskId} "{feedback}"
|
|
431
|
-
- "Reject": Bash: npx spets orchestrate reject {taskId}
|
|
432
|
-
- "Stop": Bash: npx spets orchestrate stop {taskId}
|
|
300
|
+
| checkpoint | Action |
|
|
301
|
+
|------------|--------|
|
|
302
|
+
| clarify | AskUserQuestion for each \`response.questions\` \u2192 run \`onComplete\` with answers |
|
|
303
|
+
| approve | Read \`specPath\`, summarize, AskUserQuestion (Approve/Revise/Reject/Stop) \u2192 run matching \`onComplete\` |
|
|
433
304
|
|
|
434
|
-
|
|
435
|
-
\`\`\`
|
|
305
|
+
### type: "complete"
|
|
436
306
|
|
|
437
|
-
|
|
307
|
+
Print message and stop.
|
|
438
308
|
|
|
439
|
-
|
|
309
|
+
### type: "error"
|
|
440
310
|
|
|
441
|
-
|
|
442
|
-
# New 5-phase workflow
|
|
443
|
-
npx spets orchestrate init "<description>"
|
|
444
|
-
npx spets orchestrate explore-done <taskId> '<json>'
|
|
445
|
-
npx spets orchestrate clarify-done <taskId> '<json>'
|
|
446
|
-
npx spets orchestrate clarified <taskId> '<json>'
|
|
447
|
-
npx spets orchestrate execute-done <taskId>
|
|
448
|
-
npx spets orchestrate verify-done <taskId> '<json>'
|
|
449
|
-
npx spets orchestrate approve <taskId>
|
|
450
|
-
npx spets orchestrate revise <taskId> "<feedback>"
|
|
451
|
-
npx spets orchestrate reject <taskId>
|
|
452
|
-
npx spets orchestrate stop <taskId>
|
|
453
|
-
\`\`\`
|
|
311
|
+
Print error and stop.
|
|
454
312
|
|
|
455
313
|
---
|
|
456
314
|
|
|
@@ -461,147 +319,51 @@ description: Task description for the workflow
|
|
|
461
319
|
function getCodexSkillContent() {
|
|
462
320
|
return `---
|
|
463
321
|
name: spets
|
|
464
|
-
description: SDD workflow executor -
|
|
322
|
+
description: SDD workflow executor - orchestrator-controlled spec-driven development
|
|
465
323
|
---
|
|
466
324
|
|
|
467
|
-
# Spets
|
|
325
|
+
# Spets Workflow Executor
|
|
468
326
|
|
|
469
|
-
Execute
|
|
327
|
+
Orchestrator-controlled workflow. Execute commands, parse JSON response, run \`onComplete\`.
|
|
470
328
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
## Constraints
|
|
474
|
-
|
|
475
|
-
- **IMMEDIATELY** execute commands, no planning
|
|
476
|
-
- **DO NOT** explore or search on your own - ONLY follow response.prompt
|
|
477
|
-
|
|
478
|
-
---
|
|
479
|
-
|
|
480
|
-
## Start
|
|
329
|
+
## Execution Loop
|
|
481
330
|
|
|
482
331
|
\`\`\`bash
|
|
483
332
|
npx spets orchestrate init "$ARGUMENTS"
|
|
484
333
|
\`\`\`
|
|
485
334
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
---
|
|
489
|
-
|
|
490
|
-
## Command Table
|
|
491
|
-
|
|
492
|
-
### \`type: "phase"\`
|
|
335
|
+
Loop until \`type: "complete"\` or \`type: "error"\`:
|
|
493
336
|
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
| \`execute\` | [ACTION_EXECUTE](#action_execute) |
|
|
499
|
-
| \`verify\` | [ACTION_VERIFY](#action_verify) |
|
|
337
|
+
1. Parse JSON response
|
|
338
|
+
2. Execute action based on \`type\` and \`phase\`/\`checkpoint\`
|
|
339
|
+
3. Run the \`onComplete\` command from response
|
|
340
|
+
4. Parse next response \u2192 repeat
|
|
500
341
|
|
|
501
|
-
|
|
342
|
+
## Actions
|
|
502
343
|
|
|
503
|
-
|
|
504
|
-
|--------------|--------|
|
|
505
|
-
| \`clarify\` | [ACTION_ASK_QUESTIONS](#action_ask_questions) |
|
|
506
|
-
| \`approve\` | [ACTION_ASK_APPROVAL](#action_ask_approval) |
|
|
344
|
+
### type: "phase"
|
|
507
345
|
|
|
508
|
-
|
|
346
|
+
| phase | Action |
|
|
347
|
+
|-------|--------|
|
|
348
|
+
| explore | Follow \`response.prompt\` \u2192 run \`onComplete\` with JSON result |
|
|
349
|
+
| clarify | Follow \`response.prompt\` \u2192 run \`onComplete\` with questions JSON |
|
|
350
|
+
| execute | Follow \`response.prompt\` \u2192 write to \`context.output\` \u2192 run \`onComplete\` |
|
|
351
|
+
| verify | Follow \`response.prompt\` \u2192 run \`onComplete\` with verify JSON |
|
|
509
352
|
|
|
510
|
-
|
|
511
|
-
|----------|--------|
|
|
512
|
-
| \`completed\` | Print: "Workflow complete. Outputs: {outputs}" |
|
|
513
|
-
| \`stopped\` | Print: "Workflow paused. Resume with: npx spets resume --task {taskId}" |
|
|
514
|
-
| \`rejected\` | Print: "Workflow rejected." |
|
|
353
|
+
### type: "checkpoint"
|
|
515
354
|
|
|
516
|
-
|
|
355
|
+
| checkpoint | Action |
|
|
356
|
+
|------------|--------|
|
|
357
|
+
| clarify | Ask user each \`response.questions\` \u2192 run \`onComplete\` with answers |
|
|
358
|
+
| approve | Read \`specPath\`, summarize, ask user (Approve/Revise/Reject/Stop) \u2192 run matching \`onComplete\` |
|
|
517
359
|
|
|
518
|
-
|
|
360
|
+
### type: "complete"
|
|
519
361
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
## Action Definitions
|
|
523
|
-
|
|
524
|
-
**IMPORTANT:** Each phase response includes a \`prompt\` field containing the exact instructions to follow.
|
|
525
|
-
You MUST follow the prompt EXACTLY. Do NOT explore or search on your own.
|
|
362
|
+
Print message and stop.
|
|
526
363
|
|
|
527
|
-
###
|
|
364
|
+
### type: "error"
|
|
528
365
|
|
|
529
|
-
|
|
530
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
531
|
-
2. The prompt tells you:
|
|
532
|
-
- What to search for
|
|
533
|
-
- How to analyze the codebase
|
|
534
|
-
- The exact JSON output format required
|
|
535
|
-
3. Run: npx spets orchestrate explore-done {taskId} '{exploreJson}'
|
|
536
|
-
4. Parse response \u2192 next action
|
|
537
|
-
\`\`\`
|
|
538
|
-
|
|
539
|
-
### ACTION_CLARIFY
|
|
540
|
-
|
|
541
|
-
\`\`\`
|
|
542
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
543
|
-
2. The prompt tells you:
|
|
544
|
-
- What context to analyze
|
|
545
|
-
- How to generate questions
|
|
546
|
-
- The exact JSON output format required
|
|
547
|
-
3. Run: npx spets orchestrate clarify-done {taskId} '{questionsJson}'
|
|
548
|
-
- Format: [{"id":"q1","question":"..."},...]
|
|
549
|
-
- Empty if no questions: []
|
|
550
|
-
4. Parse response \u2192 next action
|
|
551
|
-
\`\`\`
|
|
552
|
-
|
|
553
|
-
### ACTION_EXECUTE
|
|
554
|
-
|
|
555
|
-
\`\`\`
|
|
556
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
557
|
-
2. The prompt tells you:
|
|
558
|
-
- The instruction and template to follow
|
|
559
|
-
- The explore output and answers to use
|
|
560
|
-
- Where to save the document/code (context.output)
|
|
561
|
-
- Any revision/verify feedback to address
|
|
562
|
-
3. Write the document/code to context.output
|
|
563
|
-
4. Run: npx spets orchestrate execute-done {taskId}
|
|
564
|
-
5. Parse response \u2192 next action
|
|
565
|
-
\`\`\`
|
|
566
|
-
|
|
567
|
-
### ACTION_VERIFY
|
|
568
|
-
|
|
569
|
-
\`\`\`
|
|
570
|
-
1. Follow the instructions in response.prompt EXACTLY
|
|
571
|
-
2. The prompt tells you:
|
|
572
|
-
- The document to verify (already included in prompt)
|
|
573
|
-
- The requirements and template to check against
|
|
574
|
-
- The scoring criteria and pass conditions
|
|
575
|
-
- The exact JSON output format required
|
|
576
|
-
3. Run: npx spets orchestrate verify-done {taskId} '{verifyJson}'
|
|
577
|
-
4. Parse response \u2192 next action
|
|
578
|
-
- If passed: goes to human review
|
|
579
|
-
- If failed (attempts < 3): goes back to draft phase (auto-fix)
|
|
580
|
-
- If failed (attempts >= 3): goes to human review with warning
|
|
581
|
-
\`\`\`
|
|
582
|
-
|
|
583
|
-
### ACTION_ASK_QUESTIONS
|
|
584
|
-
|
|
585
|
-
\`\`\`
|
|
586
|
-
1. Ask user each question from response.questions
|
|
587
|
-
2. Collect answers into: [{"questionId":"q1","answer":"..."},...]
|
|
588
|
-
3. Run: npx spets orchestrate clarified {taskId} '{answersJson}'
|
|
589
|
-
4. Parse response \u2192 next action
|
|
590
|
-
\`\`\`
|
|
591
|
-
|
|
592
|
-
### ACTION_ASK_APPROVAL
|
|
593
|
-
|
|
594
|
-
\`\`\`
|
|
595
|
-
1. Read the document at context.output
|
|
596
|
-
2. Summarize document (2-3 sentences)
|
|
597
|
-
3. Ask user: "Review {step} document. Approve / Revise / Reject / Stop?"
|
|
598
|
-
4. Based on answer:
|
|
599
|
-
- Approve: npx spets orchestrate approve {taskId}
|
|
600
|
-
- Revise: Ask for feedback, then: npx spets orchestrate revise {taskId} "{feedback}"
|
|
601
|
-
- Reject: npx spets orchestrate reject {taskId}
|
|
602
|
-
- Stop: npx spets orchestrate stop {taskId}
|
|
603
|
-
5. Parse response \u2192 next action
|
|
604
|
-
\`\`\`
|
|
366
|
+
Print error and stop.
|
|
605
367
|
|
|
606
368
|
---
|
|
607
369
|
|
|
@@ -610,10 +372,7 @@ description: Task description for the workflow
|
|
|
610
372
|
`;
|
|
611
373
|
}
|
|
612
374
|
function getOpenCodeSkillContent() {
|
|
613
|
-
return getCodexSkillContent()
|
|
614
|
-
"runs spec-driven development workflows within Codex CLI",
|
|
615
|
-
"runs spec-driven development workflows within OpenCode"
|
|
616
|
-
);
|
|
375
|
+
return getCodexSkillContent();
|
|
617
376
|
}
|
|
618
377
|
|
|
619
378
|
// src/commands/init.ts
|