create-quiver 0.14.1 → 0.15.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.
Files changed (51) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +4 -0
  3. package/README_FOR_AI.md +8 -2
  4. package/ROADMAP.md +8 -2
  5. package/docs/CLI_UX_GUIDE.md +64 -4
  6. package/docs/COMMANDS.md.template +7 -1
  7. package/docs/reference/commands.md +4 -0
  8. package/package.json +1 -1
  9. package/specs/quiver-v30-interactive-cli-ux-agent-selection/EVIDENCE_REPORT.md +213 -0
  10. package/specs/quiver-v30-interactive-cli-ux-agent-selection/EXECUTION_PLAN.md +85 -0
  11. package/specs/quiver-v30-interactive-cli-ux-agent-selection/SPEC.md +213 -0
  12. package/specs/quiver-v30-interactive-cli-ux-agent-selection/STATUS.md +31 -0
  13. package/specs/quiver-v30-interactive-cli-ux-agent-selection/pr.md +103 -0
  14. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/CLOSURE_BRIEF.md +33 -0
  15. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/EXECUTION_BRIEF.md +56 -0
  16. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-00-spec-foundation/slice.json +71 -0
  17. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/CLOSURE_BRIEF.md +31 -0
  18. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/EXECUTION_BRIEF.md +54 -0
  19. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-01-cli-ux-runtime-progress-engine/slice.json +69 -0
  20. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/CLOSURE_BRIEF.md +33 -0
  21. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/EXECUTION_BRIEF.md +56 -0
  22. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-02-agent-profile-selection-selectors/slice.json +81 -0
  23. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/CLOSURE_BRIEF.md +32 -0
  24. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/EXECUTION_BRIEF.md +54 -0
  25. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-03-provider-model-selection-contract/slice.json +75 -0
  26. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/CLOSURE_BRIEF.md +32 -0
  27. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/EXECUTION_BRIEF.md +57 -0
  28. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-04-planner-ia-progress-flows/slice.json +85 -0
  29. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/CLOSURE_BRIEF.md +33 -0
  30. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/EXECUTION_BRIEF.md +57 -0
  31. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-05-executor-pr-progress-flows/slice.json +85 -0
  32. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/CLOSURE_BRIEF.md +35 -0
  33. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/EXECUTION_BRIEF.md +55 -0
  34. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-06-doctor-visual-json-contract/slice.json +81 -0
  35. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/CLOSURE_BRIEF.md +34 -0
  36. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/EXECUTION_BRIEF.md +55 -0
  37. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-07-interactive-init-spec-create/slice.json +85 -0
  38. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/CLOSURE_BRIEF.md +34 -0
  39. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/EXECUTION_BRIEF.md +59 -0
  40. package/specs/quiver-v30-interactive-cli-ux-agent-selection/slices/slice-08-tests-docs-cross-platform-release/slice.json +95 -0
  41. package/src/create-quiver/commands/ai.js +364 -81
  42. package/src/create-quiver/commands/spec.js +106 -6
  43. package/src/create-quiver/index.js +533 -70
  44. package/src/create-quiver/lib/agent-profiles.js +111 -10
  45. package/src/create-quiver/lib/ai/execution-plan.js +106 -8
  46. package/src/create-quiver/lib/ai/executor.js +284 -28
  47. package/src/create-quiver/lib/ai/providers.js +71 -1
  48. package/src/create-quiver/lib/cli/selectors.js +107 -0
  49. package/src/create-quiver/lib/cli/theme.js +5 -2
  50. package/src/create-quiver/lib/cli/ux-flags.js +18 -0
  51. package/src/create-quiver/lib/cli/ux.js +100 -5
@@ -3,6 +3,7 @@ const path = require('node:path');
3
3
 
4
4
  const { checkHandoff } = require('../lib/handoff');
5
5
  const { openEditor } = require('../lib/cli/editor');
6
+ const { selectOption } = require('../lib/cli/selectors');
6
7
  const { createUx } = require('../lib/cli/ux');
7
8
  const { parseJsonWithComments } = require('../lib/json');
8
9
  const { assertPathInsideRoot, validateProjectRelativePaths } = require('../lib/paths');
@@ -399,6 +400,104 @@ function createSpecReviewFile(preview, options = {}) {
399
400
  return reviewPath;
400
401
  }
401
402
 
403
+ const SPEC_METHODOLOGY_OPTIONS = Object.freeze([
404
+ {
405
+ label: 'WDD + SDD',
406
+ value: 'wdd-sdd',
407
+ hint: 'Workflow Driven Development + Spec Driven Development',
408
+ default: true,
409
+ },
410
+ ]);
411
+
412
+ async function resolveInteractiveSpecCreateOptions(repoRoot, preview, options = {}) {
413
+ if (options.interactive !== true) {
414
+ return options;
415
+ }
416
+
417
+ const ux = options.ux || createUx({
418
+ interactive: true,
419
+ promptConfirm: options.promptConfirm,
420
+ stdinIsTTY: options.stdinIsTTY,
421
+ stdoutIsTTY: options.stdoutIsTTY,
422
+ stderrIsTTY: options.stderrIsTTY,
423
+ write: options.write,
424
+ });
425
+
426
+ if (!ux.mode.usePrompts) {
427
+ throw new Error(formatError('spec create --interactive requires an interactive TTY. Use --input, --spec, --review, and --dry-run for non-interactive automation.'));
428
+ }
429
+
430
+ const selectorOptions = {
431
+ env: options.env,
432
+ input: options.inputStream,
433
+ interactive: true,
434
+ noColor: options.noColor,
435
+ output: options.output,
436
+ prompts: options.prompts,
437
+ promptSelect: options.promptSelect,
438
+ stderrIsTTY: options.stderrIsTTY,
439
+ stdinIsTTY: options.stdinIsTTY,
440
+ stdoutIsTTY: options.stdoutIsTTY,
441
+ };
442
+ const selectedMethodology = await selectOption('¿Qué metodología aplica esta spec?', SPEC_METHODOLOGY_OPTIONS, {
443
+ ...selectorOptions,
444
+ defaultValue: 'wdd-sdd',
445
+ flag: '--methodology',
446
+ name: 'methodology',
447
+ value: options.methodology || '',
448
+ });
449
+ const selectedInput = await selectOption('¿Qué plan aprobado querés usar?', [
450
+ {
451
+ label: preview.inputPath,
452
+ value: preview.inputPath,
453
+ hint: 'Plan técnico revisado y aprobado',
454
+ default: true,
455
+ },
456
+ ], {
457
+ ...selectorOptions,
458
+ defaultValue: preview.inputPath,
459
+ flag: '--input',
460
+ name: 'approved technical plan input',
461
+ value: options.input || '',
462
+ });
463
+ const selectedReview = await selectOption('¿Cómo querés revisar antes de escribir?', [
464
+ {
465
+ label: 'Crear despues de confirmar',
466
+ value: 'direct',
467
+ hint: 'Muestra resumen y pide aprobacion final',
468
+ default: options.review !== true,
469
+ },
470
+ {
471
+ label: 'Abrir preview de review',
472
+ value: 'review',
473
+ hint: 'Usa $VISUAL o $EDITOR antes de escribir',
474
+ default: options.review === true,
475
+ },
476
+ ], {
477
+ ...selectorOptions,
478
+ defaultValue: options.review === true ? 'review' : 'direct',
479
+ flag: '--review',
480
+ name: 'spec create review mode',
481
+ });
482
+
483
+ ux.summary([
484
+ { label: 'Spec', value: preview.manifest.slug },
485
+ { label: 'Metodologia', value: selectedMethodology.label },
486
+ { label: 'Input', value: selectedInput.value },
487
+ { label: 'Target', value: preview.relativeSpecDir },
488
+ { label: 'Archivos planificados', value: preview.preview.files.length },
489
+ { label: 'Revision', value: selectedReview.value === 'review' ? 'abrir preview' : 'confirmacion directa' },
490
+ ], { title: 'Spec create' });
491
+
492
+ return {
493
+ ...options,
494
+ input: selectedInput.value,
495
+ methodology: selectedMethodology.value,
496
+ review: selectedReview.value === 'review',
497
+ ux,
498
+ };
499
+ }
500
+
402
501
  async function confirmSpecCreate(message, options = {}) {
403
502
  if (options.interactive !== true) {
404
503
  return;
@@ -444,9 +543,10 @@ async function reviewSpecCreatePreview(repoRoot, preview, options = {}) {
444
543
 
445
544
  async function runCreateSpec(repoRoot, options = {}) {
446
545
  const preview = buildSpecCreatePreview(repoRoot, options);
546
+ const resolvedOptions = await resolveInteractiveSpecCreateOptions(repoRoot, preview, options);
447
547
 
448
- if (options.dryRun) {
449
- process.stdout.write(formatSpecCreateDryRun({ ...preview, reviewRequested: options.review === true }));
548
+ if (resolvedOptions.dryRun) {
549
+ process.stdout.write(formatSpecCreateDryRun({ ...preview, reviewRequested: resolvedOptions.review === true }));
450
550
  return {
451
551
  task: 'spec-create',
452
552
  dryRun: true,
@@ -456,12 +556,12 @@ async function runCreateSpec(repoRoot, options = {}) {
456
556
  };
457
557
  }
458
558
 
459
- const reviewPath = await reviewSpecCreatePreview(repoRoot, preview, options);
460
- await confirmSpecCreate(`Create spec '${preview.manifest.slug}'?`, options);
559
+ const reviewPath = await reviewSpecCreatePreview(repoRoot, preview, resolvedOptions);
560
+ await confirmSpecCreate(`Create spec '${preview.manifest.slug}'?`, resolvedOptions);
461
561
 
462
562
  const result = generateSpecArtifacts(repoRoot, {
463
- input: preview.inputPath,
464
- specSlug: options.specSlug,
563
+ input: resolvedOptions.input || preview.inputPath,
564
+ specSlug: resolvedOptions.specSlug,
465
565
  });
466
566
  process.stdout.write(formatSpecCreateResult(result, repoRoot));
467
567