prizmkit 1.1.47 → 1.1.49

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 (34) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/dev-pipeline/scripts/update-checkpoint.py +173 -0
  3. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +39 -9
  4. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +7 -1
  5. package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
  6. package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
  7. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +14 -1
  8. package/bundled/dev-pipeline/templates/sections/phase-commit.md +14 -1
  9. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +7 -1
  10. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +7 -1
  11. package/bundled/dev-pipeline/templates/sections/phase-critic-plan-full.md +7 -1
  12. package/bundled/dev-pipeline/templates/sections/phase-critic-plan.md +7 -1
  13. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +7 -1
  14. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -1
  15. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +7 -1
  16. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +7 -1
  17. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +7 -1
  18. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +7 -1
  19. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +7 -1
  20. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +7 -1
  21. package/bundled/dev-pipeline/templates/sections/phase0-init.md +7 -1
  22. package/bundled/dev-pipeline/templates/sections/phase0-test-baseline.md +7 -1
  23. package/bundled/skills/_metadata.json +1 -1
  24. package/bundled/skills/bug-planner/SKILL.md +17 -5
  25. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +234 -64
  26. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +16 -9
  27. package/bundled/skills/feature-pipeline-launcher/SKILL.md +16 -11
  28. package/bundled/skills/feature-planner/SKILL.md +16 -9
  29. package/bundled/skills/feature-planner/references/browser-interaction.md +13 -1
  30. package/bundled/skills/feature-planner/scripts/validate-and-generate.py +82 -0
  31. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +16 -9
  32. package/bundled/skills/refactor-planner/SKILL.md +11 -6
  33. package/bundled/skills/refactor-planner/scripts/validate-and-generate-refactor.py +72 -0
  34. package/package.json +1 -1
@@ -6,12 +6,14 @@ for the dev-pipeline system.
6
6
  Commands:
7
7
  validate Validate an existing .prizmkit/plans/feature-list.json
8
8
  template Generate a blank template .prizmkit/plans/feature-list.json
9
+ generate Validate a draft JSON and generate final feature-list.json with defaults
9
10
  summary Print a summary table of features from a .prizmkit/plans/feature-list.json
10
11
  grade Generate grading results from eval runs (for npm run skill:review)
11
12
 
12
13
  Usage:
13
14
  python3 validate-and-generate.py validate --input .prizmkit/plans/feature-list.json [--output validated.json] [--mode new|incremental]
14
15
  python3 validate-and-generate.py template --output .prizmkit/plans/feature-list.json
16
+ python3 validate-and-generate.py generate --input draft.json --output .prizmkit/plans/feature-list.json [--mode new|incremental]
15
17
  python3 validate-and-generate.py summary --input .prizmkit/plans/feature-list.json [--format markdown|json]
16
18
  python3 validate-and-generate.py grade --workspace /.codebuddy/skill-evals/feature-planner-workspace --iteration iteration-1
17
19
 
@@ -716,6 +718,66 @@ def cmd_template(args):
716
718
  return 0
717
719
 
718
720
 
721
+ def cmd_generate(args):
722
+ """Handle the 'generate' command.
723
+
724
+ Loads a draft JSON (produced by AI), fills in defaults, validates,
725
+ and writes the final feature-list.json.
726
+ """
727
+ if not args.input:
728
+ _err("--input is required for the generate command")
729
+ return 2
730
+ if not args.output:
731
+ _err("--output is required for the generate command")
732
+ return 2
733
+
734
+ # Load draft (supports stdin via '-')
735
+ if args.input == "-":
736
+ try:
737
+ data = json.load(sys.stdin)
738
+ except json.JSONDecodeError as exc:
739
+ _err("Invalid JSON from stdin: {}".format(exc))
740
+ return 2
741
+ else:
742
+ data, load_err = _load_json(args.input)
743
+ if load_err:
744
+ _err(load_err)
745
+ return 2
746
+
747
+ # Fill in defaults
748
+ now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
749
+ data.setdefault("$schema", SCHEMA_VERSION)
750
+ data.setdefault("created_at", now)
751
+ data.setdefault("created_by", "feature-planner")
752
+
753
+ # Ensure project_name from app_name if needed
754
+ if "project_name" not in data and "app_name" in data:
755
+ data["project_name"] = data["app_name"]
756
+
757
+ # Set default status for features without one
758
+ for feature in data.get("features", []):
759
+ feature.setdefault("status", "pending")
760
+
761
+ # Validate
762
+ mode = getattr(args, "mode", "new") or "new"
763
+ result = validate_feature_list(data, planning_mode=mode)
764
+
765
+ # Output validation result
766
+ print(json.dumps(result, indent=2, ensure_ascii=False))
767
+
768
+ if result["valid"]:
769
+ _write_json(args.output, data)
770
+ _info("Generated feature-list written to {}".format(args.output))
771
+ return 0
772
+ else:
773
+ _err("Validation failed with {} error(s)".format(len(result["errors"])))
774
+ for e in result["errors"]:
775
+ _err(" " + e)
776
+ for w in result.get("warnings", []):
777
+ _warn(" " + w)
778
+ return 1
779
+
780
+
719
781
  def cmd_summary(args):
720
782
  """Handle the 'summary' command."""
721
783
  if not args.input:
@@ -857,6 +919,7 @@ def main():
857
919
  " %(prog)s validate --input .prizmkit/plans/feature-list.json --mode incremental\n"
858
920
  " %(prog)s validate --input .prizmkit/plans/feature-list.json --output validated.json\n"
859
921
  " %(prog)s template --output .prizmkit/plans/feature-list.json\n"
922
+ " %(prog)s generate --input draft.json --output .prizmkit/plans/feature-list.json\n"
860
923
  " %(prog)s summary --input .prizmkit/plans/feature-list.json\n"
861
924
  " %(prog)s summary --input .prizmkit/plans/feature-list.json --format json\n"
862
925
  ),
@@ -891,6 +954,24 @@ def main():
891
954
  "--output", required=True, help="Path to write template file"
892
955
  )
893
956
 
957
+ # -- generate --
958
+ p_generate = subparsers.add_parser(
959
+ "generate",
960
+ help="Validate a draft and generate final feature-list.json with defaults filled in",
961
+ )
962
+ p_generate.add_argument(
963
+ "--input", required=True, help="Path to draft JSON (or '-' for stdin)"
964
+ )
965
+ p_generate.add_argument(
966
+ "--output", required=True, help="Path to write final feature-list.json"
967
+ )
968
+ p_generate.add_argument(
969
+ "--mode",
970
+ choices=["new", "incremental"],
971
+ default="new",
972
+ help="Validation mode (default: new)",
973
+ )
974
+
894
975
  # -- summary --
895
976
  p_summary = subparsers.add_parser(
896
977
  "summary",
@@ -931,6 +1012,7 @@ def main():
931
1012
  dispatch = {
932
1013
  "validate": cmd_validate,
933
1014
  "template": cmd_template,
1015
+ "generate": cmd_generate,
934
1016
  "summary": cmd_summary,
935
1017
  "grade": cmd_grade,
936
1018
  }
@@ -130,23 +130,30 @@ Detect user intent from their message, then follow the corresponding workflow:
130
130
 
131
131
  Wait for user confirmation before proceeding.
132
132
 
133
- 5. **Ask execution mode** (first user decision):
133
+ 5. **Ask execution mode** (first user decision — SEPARATE `AskUserQuestion` call):
134
134
 
135
- Present the three modes and ask the user to choose:
136
- - **(1) Foreground** (recommended) — pipeline runs in the current session via `run-refactor.sh run`. Visible output and direct error feedback.
137
- - **(2) Background daemon** — pipeline runs fully detached via `launch-refactor-daemon.sh`. Survives AI CLI session closure.
138
- - **(3) Manual** — display the final assembled commands only. Do not execute anything. User runs them on their own.
135
+ **This MUST be its own standalone `AskUserQuestion` call.** Do NOT combine execution mode with step 6 config questions. The execution mode question is asked ALONE, user responds, THEN you proceed to step 6.
139
136
 
140
- 6. **Ask configuration options** ⚠️ MANDATORY INTERACTIVE STEP — applies to ALL execution modes (Foreground, Background, AND Manual). You MUST ask the user to configure options and WAIT for their response BEFORE proceeding to step 7. Do NOT skip this step or merge it with step 7.
137
+ Use `AskUserQuestion` with exactly 1 question:
141
138
 
142
- **HARD STOP**: You MUST call `AskUserQuestion` with the questions below and WAIT for the user's response. You MUST NOT:
139
+ **Question 1 Execution mode** (multiSelect: false):
140
+ - Foreground (Recommended) — pipeline runs in the current session via `run-refactor.sh run`. Visible output and direct error feedback.
141
+ - Background daemon — pipeline runs fully detached via `launch-refactor-daemon.sh`. Survives AI CLI session closure.
142
+ - Manual — display the final assembled commands only. Do not execute anything. User runs them on their own.
143
+
144
+ ⚠️ STOP HERE and wait for user response before continuing to step 6.
145
+
146
+ 6. **Ask configuration options** ⚠️ MANDATORY INTERACTIVE STEP — applies to ALL execution modes (Foreground, Background, AND Manual). This is a SEPARATE `AskUserQuestion` call from step 5. You MUST ask the user to configure options and WAIT for their response BEFORE proceeding to step 7.
147
+
148
+ ⛔ **HARD STOP**: You MUST call `AskUserQuestion` with the 4 questions below and WAIT for the user's response. You MUST NOT:
149
+ - Combine step 5 and step 6 into one `AskUserQuestion` call (this is the most common violation — execution mode MUST be asked separately in step 5)
143
150
  - Skip this step and jump to step 7
144
151
  - Merge step 6 and step 7 into one response
145
152
  - Assume default values and show the command without asking
146
153
  - Show the command as text and ask "ready?" without presenting the options
147
- If you find yourself writing the final command before the user has answered these questions, STOP — you are violating this rule.
154
+ If you find yourself writing the final command before the user has answered these 4 questions, STOP — you are violating this rule.
148
155
 
149
- Use `AskUserQuestion` to present the following configuration choices. Each question is a separate selectable option:
156
+ Use `AskUserQuestion` to present ALL 4 configuration choices (the full 4-question budget goes to config, NOT shared with execution mode):
150
157
 
151
158
  **Question 1 — Verbose logging** (multiSelect: false):
152
159
  - On (default) — Detailed AI session logs including tool calls and subagent activity
@@ -293,12 +293,14 @@ If issues found, discuss with user and resolve before proceeding.
293
293
 
294
294
  **Goal**: Produce `.prizmkit/plans/refactor-list.json` and validate it.
295
295
 
296
- 1. Generate `.prizmkit/plans/refactor-list.json` at `.prizmkit/plans/`
297
- 2. Run validation:
296
+ **IMPORTANT: Do NOT hand-write the final JSON file.** Instead:
297
+ 1. Write a draft JSON to `.prizmkit/plans/refactor-list.draft.json` with all collected refactor data.
298
+ 2. Call the generate script to validate and produce the final file:
298
299
  ```bash
299
- python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json
300
+ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input .prizmkit/plans/refactor-list.draft.json --output .prizmkit/plans/refactor-list.json
300
301
  ```
301
- 3. If validation fails -> fix issues and re-validate (max 3 attempts)
302
+ The script fills in defaults (`$schema`, `created_at`, `created_by`), validates all fields, and writes the final file only if validation passes.
303
+ 3. If validation fails -> fix the draft and retry (max 3 attempts)
302
304
  4. If validation passes -> present final summary
303
305
 
304
306
  **CHECKPOINT CP-RP-6**: `.prizmkit/plans/refactor-list.json` generated and validated.
@@ -380,9 +382,12 @@ For simple refactoring with minimal scope:
380
382
 
381
383
  **NEVER proceed without explicit user selection via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
382
384
  3. Draft items (title + type + scope + description + acceptance_criteria + behavior_preservation + dependencies)
383
- 4. Run validation script immediately
385
+ 4. Write draft to `.prizmkit/plans/refactor-list.draft.json`, then call the generate script:
386
+ ```bash
387
+ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input .prizmkit/plans/refactor-list.draft.json --output .prizmkit/plans/refactor-list.json
388
+ ```
384
389
  5. If valid -> summarize and recommend next step
385
- 6. If invalid -> apply fixes, re-validate (max 2 attempts, then escalate to full workflow)
390
+ 6. If invalid -> apply fixes to the draft, re-run generate (max 2 attempts, then escalate to full workflow)
386
391
 
387
392
  ### When NOT to Use Fast Path
388
393
  - More than 2 refactor items
@@ -6,11 +6,13 @@ for the dev-pipeline system.
6
6
  Commands:
7
7
  validate Validate an existing .prizmkit/plans/refactor-list.json
8
8
  template Generate a blank template .prizmkit/plans/refactor-list.json
9
+ generate Validate a draft JSON and generate final refactor-list.json with defaults
9
10
  summary Print a summary table of refactors from a .prizmkit/plans/refactor-list.json
10
11
 
11
12
  Usage:
12
13
  python3 validate-and-generate-refactor.py validate --input .prizmkit/plans/refactor-list.json [--output validated.json]
13
14
  python3 validate-and-generate-refactor.py template --output .prizmkit/plans/refactor-list.json
15
+ python3 validate-and-generate-refactor.py generate --input draft.json --output .prizmkit/plans/refactor-list.json
14
16
  python3 validate-and-generate-refactor.py summary --input .prizmkit/plans/refactor-list.json [--format markdown|json]
15
17
 
16
18
  Python 3.6+ required. No external dependencies.
@@ -22,6 +24,7 @@ import json
22
24
  import os
23
25
  import re
24
26
  import sys
27
+ from datetime import datetime, timezone
25
28
 
26
29
  # ---------------------------------------------------------------------------
27
30
  # Constants
@@ -687,6 +690,61 @@ def cmd_template(args):
687
690
  return 0
688
691
 
689
692
 
693
+ def cmd_generate(args):
694
+ """Handle the 'generate' command.
695
+
696
+ Loads a draft JSON (produced by AI), fills in defaults, validates,
697
+ and writes the final refactor-list.json.
698
+ """
699
+ if not args.input:
700
+ _err("--input is required for the generate command")
701
+ return 2
702
+ if not args.output:
703
+ _err("--output is required for the generate command")
704
+ return 2
705
+
706
+ # Load draft (supports stdin via '-')
707
+ if args.input == "-":
708
+ try:
709
+ data = json.load(sys.stdin)
710
+ except json.JSONDecodeError as exc:
711
+ _err("Invalid JSON from stdin: {}".format(exc))
712
+ return 2
713
+ else:
714
+ data, load_err = _load_json(args.input)
715
+ if load_err:
716
+ _err(load_err)
717
+ return 2
718
+
719
+ # Fill in defaults
720
+ now = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
721
+ data.setdefault("$schema", SCHEMA_VERSION)
722
+ data.setdefault("created_at", now)
723
+ data.setdefault("created_by", "refactor-planner")
724
+
725
+ # Set default status for refactors without one
726
+ for refactor in data.get("refactors", []):
727
+ refactor.setdefault("status", "pending")
728
+
729
+ # Validate
730
+ result = validate_refactor_list(data)
731
+
732
+ # Output validation result
733
+ print(json.dumps(result, indent=2, ensure_ascii=False))
734
+
735
+ if result["valid"]:
736
+ _write_json(args.output, data)
737
+ _info("Generated refactor-list written to {}".format(args.output))
738
+ return 0
739
+ else:
740
+ _err("Validation failed with {} error(s)".format(len(result["errors"])))
741
+ for e in result["errors"]:
742
+ _err(" " + e)
743
+ for w in result.get("warnings", []):
744
+ _warn(" " + w)
745
+ return 1
746
+
747
+
690
748
  def cmd_summary(args):
691
749
  """Handle the 'summary' command."""
692
750
  if not args.input:
@@ -719,6 +777,7 @@ def main():
719
777
  " %(prog)s validate --input .prizmkit/plans/refactor-list.json\n"
720
778
  " %(prog)s validate --input .prizmkit/plans/refactor-list.json --output validated.json\n"
721
779
  " %(prog)s template --output .prizmkit/plans/refactor-list.json\n"
780
+ " %(prog)s generate --input draft.json --output .prizmkit/plans/refactor-list.json\n"
722
781
  " %(prog)s summary --input .prizmkit/plans/refactor-list.json\n"
723
782
  " %(prog)s summary --input .prizmkit/plans/refactor-list.json --format json\n"
724
783
  ),
@@ -747,6 +806,18 @@ def main():
747
806
  "--output", required=True, help="Path to write template file"
748
807
  )
749
808
 
809
+ # -- generate --
810
+ p_generate = subparsers.add_parser(
811
+ "generate",
812
+ help="Validate a draft and generate final refactor-list.json with defaults",
813
+ )
814
+ p_generate.add_argument(
815
+ "--input", required=True, help="Path to draft JSON (or '-' for stdin)"
816
+ )
817
+ p_generate.add_argument(
818
+ "--output", required=True, help="Path to write final refactor-list.json"
819
+ )
820
+
750
821
  # -- summary --
751
822
  p_summary = subparsers.add_parser(
752
823
  "summary",
@@ -771,6 +842,7 @@ def main():
771
842
  dispatch = {
772
843
  "validate": cmd_validate,
773
844
  "template": cmd_template,
845
+ "generate": cmd_generate,
774
846
  "summary": cmd_summary,
775
847
  }
776
848
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prizmkit",
3
- "version": "1.1.47",
3
+ "version": "1.1.49",
4
4
  "description": "Create a new PrizmKit-powered project with clean initialization — no framework dev files, just what you need.",
5
5
  "type": "module",
6
6
  "bin": {