prizmkit 1.1.111 → 1.1.113
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/bundled/VERSION.json +3 -3
- package/bundled/adapters/codex/skill-adapter.js +4 -0
- package/bundled/agents/prizm-dev-team-reviewer.md +12 -1
- package/bundled/dev-pipeline/SCHEMA_ANALYSIS.md +10 -10
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -0
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +20 -73
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +290 -421
- package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +1 -1
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +259 -481
- package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +34 -0
- package/bundled/dev-pipeline/scripts/init-pipeline.py +12 -0
- package/bundled/dev-pipeline/scripts/init-refactor-pipeline.py +24 -1
- package/bundled/dev-pipeline/scripts/prompt_framework.py +312 -0
- package/bundled/dev-pipeline/scripts/update-bug-status.py +87 -20
- package/bundled/dev-pipeline/scripts/update-feature-status.py +82 -16
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +68 -28
- package/bundled/dev-pipeline/scripts/utils.py +171 -0
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +7 -1
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +17 -19
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +21 -26
- package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +9 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +11 -8
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +122 -182
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +16 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +12 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +23 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +20 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-manual-verification.md +15 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +29 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +31 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-task-contract.md +40 -0
- package/bundled/dev-pipeline/templates/sections/failure-capture.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +8 -2
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +7 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +7 -1
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +17 -0
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +13 -0
- package/bundled/dev-pipeline/templates/sections/refactor-mission.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +37 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-critic.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +16 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-init.md +9 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +22 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +19 -0
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +11 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +7 -0
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +28 -0
- package/bundled/dev-pipeline/templates/sections/refactor-task-contract.md +52 -0
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +104 -26
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +14 -0
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +239 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +6 -2
- package/bundled/dev-pipeline/tests/test_utils.py +66 -1
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +8 -7
- package/bundled/skills/app-planner/references/project-brief-guide.md +2 -2
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +53 -26
- package/bundled/skills/bug-fix-workflow/SKILL.md +191 -336
- package/bundled/skills/bug-planner/SKILL.md +6 -5
- package/bundled/skills/bug-planner/references/critic-and-verification.md +3 -3
- package/bundled/skills/bug-planner/references/schema-validation.md +2 -1
- package/bundled/skills/bug-planner/scripts/validate-bug-list.py +70 -1
- package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -21
- package/bundled/skills/bugfix-pipeline-launcher/references/configuration.md +2 -2
- package/bundled/skills/feature-pipeline-launcher/SKILL.md +25 -26
- package/bundled/skills/feature-planner/SKILL.md +9 -11
- package/bundled/skills/feature-planner/assets/planning-guide.md +1 -1
- package/bundled/skills/feature-planner/references/decomposition-patterns.md +1 -1
- package/bundled/skills/feature-planner/references/error-recovery.md +2 -1
- package/bundled/skills/feature-planner/references/incremental-feature-planning.md +2 -2
- package/bundled/skills/feature-planner/references/new-project-planning.md +35 -39
- package/bundled/skills/feature-planner/scripts/validate-and-generate.py +1 -1
- package/bundled/skills/feature-workflow/SKILL.md +170 -298
- package/bundled/skills/prizmkit/SKILL.md +103 -57
- package/bundled/skills/prizmkit-code-review/SKILL.md +97 -116
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +1 -0
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +14 -3
- package/bundled/skills/prizmkit-committer/SKILL.md +59 -47
- package/bundled/skills/prizmkit-deploy/SKILL.md +162 -381
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +12 -3
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +220 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +51 -40
- package/bundled/skills/prizmkit-init/SKILL.md +4 -3
- package/bundled/skills/prizmkit-plan/SKILL.md +85 -70
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +94 -73
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +20 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +11 -13
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +18 -14
- package/bundled/skills/prizmkit-retrospective/SKILL.md +56 -48
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +79 -27
- package/bundled/skills/prizmkit-test/SKILL.md +138 -141
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +1 -1
- package/bundled/skills/prizmkit-test/references/examples.md +11 -9
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +1 -1
- package/bundled/skills/prizmkit-test/references/test-report-template.md +2 -2
- package/bundled/skills/recovery-workflow/SKILL.md +195 -256
- package/bundled/skills/recovery-workflow/evals/evals.json +21 -13
- package/bundled/skills/recovery-workflow/references/detection.md +48 -39
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +258 -322
- package/bundled/skills/refactor-pipeline-launcher/SKILL.md +32 -13
- package/bundled/skills/refactor-planner/SKILL.md +2 -2
- package/bundled/skills/refactor-planner/references/behavior-preservation.md +24 -19
- package/bundled/skills/refactor-planner/references/fast-path.md +2 -4
- package/bundled/skills/refactor-planner/references/planning-phases.md +2 -2
- package/bundled/skills/refactor-workflow/SKILL.md +174 -307
- package/package.json +1 -1
- package/src/scaffold.js +5 -0
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +0 -6
- package/bundled/skills/feature-workflow/references/brainstorm-guide.md +0 -137
- package/bundled/skills/refactor-workflow/references/brainstorm-guide.md +0 -116
|
@@ -1,43 +1,95 @@
|
|
|
1
1
|
# Structural Sync — Detailed Steps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 1. Get changed files
|
|
4
|
+
|
|
5
|
+
Get changed files from staged and unstaged changes relative to HEAD:
|
|
6
|
+
|
|
4
7
|
```bash
|
|
5
8
|
git diff HEAD --name-status
|
|
6
9
|
```
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
If the caller supplied an explicit file list, use that list instead and note the source in the report.
|
|
12
|
+
|
|
13
|
+
## 2. Map files to modules
|
|
14
|
+
|
|
15
|
+
Read `.prizmkit/prizm-docs/root.prizm` and map each changed file to MODULE_INDEX or MODULE_GROUPS entries.
|
|
16
|
+
|
|
17
|
+
If a changed source file maps to no module, evaluate whether its directory qualifies as a new module:
|
|
18
|
+
|
|
19
|
+
- Contains source files forming a logical unit
|
|
20
|
+
- Contains entry/config/interface files
|
|
21
|
+
- Contains qualifying submodules
|
|
22
|
+
- Is referenced by multiple modules as a dependency
|
|
23
|
+
|
|
24
|
+
## 3. Classify changes
|
|
25
|
+
|
|
26
|
+
- `A` added → add to KEY_FILES and check for new public interfaces
|
|
27
|
+
- `D` deleted → remove from KEY_FILES and update file counts
|
|
28
|
+
- `M` modified → check public interfaces, dependencies, data flow, and durable traps/decisions
|
|
29
|
+
- `R` renamed → update path references
|
|
30
|
+
|
|
31
|
+
## 4. Decide whether sync is needed
|
|
32
|
+
|
|
33
|
+
Skip structural sync when changes are limited to:
|
|
34
|
+
|
|
35
|
+
- comments, whitespace, or formatting
|
|
36
|
+
- `.prizm` files only
|
|
37
|
+
- internal implementation details with no interface, dependency, data-flow, or module mapping impact
|
|
38
|
+
- test-only changes that reveal no durable boundaries, traps, interface constraints, behavior rules, or regression knowledge
|
|
39
|
+
|
|
40
|
+
Do not skip automatically just because the task is a bug fix or test change. Run the relevant part of retrospective when the change affects structure, interfaces, dependencies, observable behavior, or durable knowledge.
|
|
41
|
+
|
|
42
|
+
## 5. Update affected docs bottom-up
|
|
43
|
+
|
|
44
|
+
### L2
|
|
45
|
+
|
|
46
|
+
If L2 exists, update only sections affected by changed files in that module.
|
|
47
|
+
|
|
48
|
+
If L2 does not exist and the current diff includes Added or Modified source files with meaningful logic, create L2 with:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
MODULE
|
|
52
|
+
FILES
|
|
53
|
+
RESPONSIBILITY
|
|
54
|
+
KEY_FILES
|
|
55
|
+
DEPENDENCIES
|
|
56
|
+
INTERFACES
|
|
57
|
+
TRAPS
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Add DATA_FLOW, RULES, or DECISIONS only when the changed files provide durable information for those sections. Populate from the diff files and targeted source reads, not from an unbounded full-module rescan.
|
|
61
|
+
|
|
62
|
+
### L1
|
|
63
|
+
|
|
64
|
+
Update FILES count, KEY_FILES, SUBDIRS, and DEPENDENCIES when module-level structure changes.
|
|
65
|
+
|
|
66
|
+
L1 does not contain INTERFACES, DATA_FLOW, TRAPS, or DECISIONS; those belong in L2.
|
|
67
|
+
|
|
68
|
+
### L0
|
|
69
|
+
|
|
70
|
+
Update MODULE_INDEX or MODULE_GROUPS only when module structure changed. Preserve any `PROJECT_BRIEF:` line because it is managed by `/prizmkit-init`.
|
|
9
71
|
|
|
10
|
-
|
|
11
|
-
- `A` (added) → add to KEY_FILES, check for new INTERFACES
|
|
12
|
-
- `D` (deleted) → remove from KEY_FILES, update FILE count
|
|
13
|
-
- `M` (modified) → check if public interfaces or dependencies changed
|
|
14
|
-
- `R` (renamed) → update all path references
|
|
72
|
+
## 6. New module handling
|
|
15
73
|
|
|
16
|
-
|
|
74
|
+
If a new directory qualifies as a module and matches no existing module:
|
|
17
75
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
76
|
+
1. Create L1 immediately.
|
|
77
|
+
2. Add it to MODULE_INDEX or MODULE_GROUPS.
|
|
78
|
+
3. Create L2 only when the current diff includes meaningful Added or Modified source files for the module.
|
|
21
79
|
|
|
22
|
-
|
|
80
|
+
## 7. Size limits
|
|
23
81
|
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- If the current diff includes Added or Modified source files with meaningful logic → create L2 immediately. Otherwise defer L2.
|
|
82
|
+
- L0 > 4KB → consolidate MODULE_INDEX or convert to MODULE_GROUPS when module count is high
|
|
83
|
+
- L1 > 4KB → trim KEY_FILES descriptions and keep RULES concise
|
|
84
|
+
- L2 > 5KB → remove derived detail or stale entries; keep durable knowledge only
|
|
28
85
|
|
|
29
|
-
|
|
30
|
-
- L0 > 4KB → if using MODULE_INDEX with > 15 entries, convert to MODULE_GROUPS format (group by functional domain). Otherwise, consolidate MODULE_INDEX descriptions.
|
|
31
|
-
- L1 > 4KB → trim KEY_FILES descriptions, ensure RULES <= 3 entries
|
|
32
|
-
- L2 > 5KB → trim non-essential detail, split oversized cross-cutting detail, or move derived context back to source references
|
|
86
|
+
## 8. TRAPS staleness check
|
|
33
87
|
|
|
34
|
-
|
|
88
|
+
Run only when an L2 doc's TRAPS section has more than 10 entries.
|
|
35
89
|
|
|
36
|
-
|
|
90
|
+
Process at most 5 oldest TRAPS per L2 doc:
|
|
37
91
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
2. If a TRAP has `REF:` → check if the referenced file still exists and the REF commit is less than 180 days old (via `git log --since="180 days ago" <hash> 2>/dev/null`). If the file is deleted OR the REF commit is older than 180 days → prepend `[REVIEW]` to the severity, signaling it needs verification during the next retrospective Job 2
|
|
41
|
-
3. Process at most 5 of the oldest TRAPS per L2 doc per session (to bound context cost)
|
|
92
|
+
1. If a TRAP has `STALE_IF:` and matched files no longer exist, delete the TRAP.
|
|
93
|
+
2. If a TRAP has `REF:` and the referenced file is gone or the commit is older than the review horizon, mark it `[REVIEW]` for the next knowledge pass.
|
|
42
94
|
|
|
43
|
-
This
|
|
95
|
+
This bounds context cost and prevents unbounded trap accumulation.
|
|
@@ -1,204 +1,199 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-test"
|
|
3
|
-
description: "
|
|
3
|
+
description: "Risk-triggered full-stack test generation and orchestration. Detects architecture, runs existing tests, analyzes coverage gaps, generates missing unit/integration/E2E tests, validates boundary coverage, and writes a unified report. Use after development when behavior, public interfaces, data models, security/permission/payment logic, deployment readiness, or user-requested quality verification warrants testing. Supports full-project, module, feature selection, and generic change-artifact `scope=this-change`. Trigger on: 'test', 'run tests', 'verify code', 'quality check', 'test coverage', 'boundary tests', 'edge cases', 'add tests'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Test
|
|
7
7
|
|
|
8
|
-
A
|
|
8
|
+
A risk-triggered test generation and orchestration skill. It discovers existing tests, runs them, compares coverage against project interfaces and task acceptance criteria, generates missing tests, validates business-specific boundary coverage, and produces a unified report.
|
|
9
|
+
|
|
10
|
+
`/prizmkit-test` is not mandatory for every lifecycle path. Run it when risk or user intent warrants verification.
|
|
9
11
|
|
|
10
12
|
### When to Use
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
13
|
+
- Behavior changes that need verification
|
|
14
|
+
- Public API/interface changes
|
|
15
|
+
- Data model, schema, migration, persistence, or serialization changes
|
|
16
|
+
- Security, permission, authentication, payment, billing, entitlement, or ownership logic
|
|
17
|
+
- Deployment readiness checks
|
|
18
|
+
- First-time test generation for a project with a test framework
|
|
19
|
+
- User says "test", "run tests", "verify", "quality check", "add tests", or asks about coverage/boundaries
|
|
15
20
|
|
|
16
21
|
### When NOT to Use
|
|
17
|
-
-
|
|
18
|
-
-
|
|
22
|
+
- Pure documentation edits
|
|
23
|
+
- Formatting-only changes
|
|
24
|
+
- Internal renames with no behavior impact
|
|
25
|
+
- Tiny config tweaks with no runtime behavior change
|
|
26
|
+
- Project has no test framework and no code to test
|
|
19
27
|
|
|
20
28
|
## Precondition
|
|
21
29
|
|
|
22
30
|
| Required State | Check | If Missing |
|
|
23
31
|
|---|---|---|
|
|
24
32
|
| `.prizmkit/prizm-docs/root.prizm` exists | File exists | Run `/prizmkit-init` first |
|
|
25
|
-
| Test framework installed | Dependency in package.json or equivalent | Offer to skip or
|
|
33
|
+
| Test framework installed | Dependency in package.json or equivalent | Offer to skip, install manually, or generate a plan to add tests |
|
|
34
|
+
|
|
35
|
+
If Prizm docs may be stale, warn that gap analysis accuracy depends on current docs. Continue only if the user accepts the risk or the run uses explicit changed files.
|
|
36
|
+
|
|
37
|
+
## Scope Model
|
|
38
|
+
|
|
39
|
+
| Scope | Meaning |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `full-project` | Analyze and test the whole project. |
|
|
42
|
+
| `module:<name>` | Analyze one module from Prizm docs. |
|
|
43
|
+
| `feature:<slug>` | Interactive selection of a historical feature/spec directory. |
|
|
44
|
+
| `this-change` | Analyze the current change artifact and changed files only. |
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
A **change artifact** is any artifact directory containing `spec.md` + `plan.md`, regardless of whether the work is a feature, bug fix, refactor, or migration. `scope=this-change` is not feature-only.
|
|
47
|
+
|
|
48
|
+
Compatibility guard: Do not automatically apply `scope=this-change` to `.prizmkit/bugfix/<BUG_ID>/` or `.prizmkit/refactor/<REFACTOR_ID>/` by directory name alone. Treat those directories as change artifacts only when the caller provides `artifact_dir` and the directory contains `spec.md` + `plan.md` plus a changed-files source.
|
|
28
49
|
|
|
29
50
|
## Context Loading
|
|
30
51
|
|
|
31
52
|
Before execution, load context once:
|
|
32
53
|
|
|
33
|
-
1.
|
|
34
|
-
2.
|
|
35
|
-
3.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- `artifact_dir/
|
|
41
|
-
-
|
|
42
|
-
- `artifact_dir/context-snapshot.md` if present
|
|
43
|
-
- `artifact_dir/review-report.md` if present
|
|
44
|
-
- changed source files and directly related existing tests
|
|
54
|
+
1. Architecture context: `root.prizm`, relevant L1 docs, and relevant L2 docs when scope requires interface or boundary detail.
|
|
55
|
+
2. Project config: `.prizmkit/config.json` if present.
|
|
56
|
+
3. Dependency manifest: `package.json`, `pyproject.toml`, `requirements.txt`, `go.mod`, or equivalent.
|
|
57
|
+
4. For `scope=this-change`:
|
|
58
|
+
- `artifact_dir/spec.md`
|
|
59
|
+
- `artifact_dir/plan.md`
|
|
60
|
+
- `artifact_dir/context-snapshot.md` if present
|
|
61
|
+
- `artifact_dir/review-report.md` if present
|
|
62
|
+
- changed source files and directly related tests
|
|
45
63
|
|
|
46
|
-
Do not load
|
|
64
|
+
Do not load every module or every spec merely because they exist.
|
|
47
65
|
|
|
48
66
|
## Input
|
|
49
67
|
|
|
50
68
|
| Parameter | Required | Description |
|
|
51
69
|
|-----------|----------|-------------|
|
|
52
|
-
| `scope` | No | `full-project`, `module:<name>`, `feature:<slug>`, or `this-change`.
|
|
53
|
-
| `artifact_dir` | No |
|
|
54
|
-
| `diff_base` | No | Git ref used to compute changed files for this
|
|
70
|
+
| `scope` | No | `full-project`, `module:<name>`, `feature:<slug>`, or `this-change`. |
|
|
71
|
+
| `artifact_dir` | No | Change artifact directory. For `scope=this-change`, it must contain `spec.md` and `plan.md`. |
|
|
72
|
+
| `diff_base` | No | Git ref used to compute changed files for this change. |
|
|
55
73
|
| `changed_files` | No | Explicit caller-provided changed file list. Takes precedence over `diff_base`. |
|
|
56
|
-
| `generation_policy` | No | Defaults to `in-scope-only` for `scope=this-change
|
|
74
|
+
| `generation_policy` | No | Defaults to `in-scope-only` for `scope=this-change`; full-project can generate broader coverage. |
|
|
75
|
+
|
|
76
|
+
Headless default:
|
|
77
|
+
- If `scope=this-change` is provided, require a valid `artifact_dir` with `spec.md` + `plan.md`.
|
|
78
|
+
- If a valid `artifact_dir` is provided without `scope`, treat it as `scope=this-change`.
|
|
79
|
+
- If neither scope nor artifact directory is provided, default to `full-project`.
|
|
57
80
|
|
|
58
81
|
## Execution
|
|
59
82
|
|
|
60
83
|
### Phase 0: Architecture Detection
|
|
61
84
|
|
|
62
|
-
1.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- Vitest → `npx vitest run`
|
|
74
|
-
- pytest → `python -m pytest`
|
|
75
|
-
- Go testing → `go test ./...`
|
|
76
|
-
- Multiple frameworks found → use the one with the most test files; list all in report
|
|
77
|
-
- Custom `npm test` script → use `npm test`
|
|
78
|
-
|
|
79
|
-
3. **Interactive mode**: Show "Detected: {type}, test framework: {name}. Correct?"
|
|
80
|
-
**Headless mode**: Auto-proceed with detected values, note assumptions in report.
|
|
85
|
+
1. Classify project type from loaded context and dependencies:
|
|
86
|
+
- Frontend
|
|
87
|
+
- Backend
|
|
88
|
+
- Fullstack
|
|
89
|
+
- Library/CLI
|
|
90
|
+
- Unknown
|
|
91
|
+
2. Detect test framework:
|
|
92
|
+
- Jest, Vitest, pytest, Go test, Playwright, or custom `npm test`
|
|
93
|
+
- If multiple frameworks exist, use the one with the most relevant test files and list all detected frameworks in the report
|
|
94
|
+
3. Interactive mode: show detected architecture/framework and ask for correction when uncertain.
|
|
95
|
+
4. Headless mode: proceed with detected assumptions and record them in the report.
|
|
81
96
|
|
|
82
97
|
### Phase 1: Scope Selection
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
Interactive mode options:
|
|
85
100
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
101
|
+
1. Full project
|
|
102
|
+
2. Single module
|
|
103
|
+
3. Single historical feature/spec directory
|
|
104
|
+
4. Current change artifact when an artifact directory is available
|
|
89
105
|
|
|
90
|
-
|
|
91
|
-
1. If `scope=this-change`, require `artifact_dir=.prizmkit/specs/<FEATURE_SLUG>/` and run in feature-scoped mode.
|
|
92
|
-
2. If `artifact_dir=.prizmkit/specs/<FEATURE_SLUG>/` is provided without `scope`, treat it as `scope=this-change`.
|
|
93
|
-
3. If `scope=full-project` is explicitly provided, run full-project mode even if an artifact directory exists.
|
|
94
|
-
4. If `artifact_dir` points to `.prizmkit/bugfix/` or `.prizmkit/refactor/`, do not infer `scope=this-change`.
|
|
95
|
-
5. If neither `scope` nor feature `artifact_dir` is provided, default to full project.
|
|
106
|
+
For `scope=this-change`, build the in-scope source set using this priority:
|
|
96
107
|
|
|
97
|
-
|
|
108
|
+
1. `changed_files` parameter
|
|
109
|
+
2. `git diff --name-only <diff_base>`
|
|
110
|
+
3. files/tasks listed in `artifact_dir/plan.md`
|
|
111
|
+
4. file manifest in `artifact_dir/context-snapshot.md`
|
|
112
|
+
5. file/module mapping from `artifact_dir/spec.md`
|
|
113
|
+
|
|
114
|
+
If no changed file source can be determined for `scope=this-change`, stop with a clear error and ask for `changed_files` or `diff_base`.
|
|
98
115
|
|
|
99
116
|
### Phase 2: Run Existing Tests
|
|
100
117
|
|
|
101
|
-
1. Find test
|
|
118
|
+
1. Find test files using project conventions: `tests/`, `__tests__/`, `*.test.*`, `*.spec.*`, or language-specific patterns.
|
|
119
|
+
2. Run the detected test command in scope.
|
|
120
|
+
3. Capture pass/fail counts, failed details, and raw output in the report directory.
|
|
121
|
+
4. For `scope=this-change`, classify failures:
|
|
122
|
+
- In-Scope Failures: changed tests, tests mapped to in-scope source, or acceptance-criteria tests without baseline evidence.
|
|
123
|
+
- Baseline Failures: unrelated pre-existing failures.
|
|
124
|
+
5. If `scope=this-change` has unexplained In-Scope Failures, final verdict must be `NEEDS_FIXES` or `BLOCKED`.
|
|
125
|
+
|
|
126
|
+
### Phase 3: Coverage Gap Analysis
|
|
102
127
|
|
|
103
|
-
|
|
104
|
-
- Pass/fail counts and failed test details
|
|
105
|
-
- Which test files exist (for gap analysis)
|
|
106
|
-
- Raw output (saved to report directory)
|
|
128
|
+
For `scope=this-change`, analyze only:
|
|
107
129
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
130
|
+
- changed/new public interfaces
|
|
131
|
+
- acceptance criteria from the change artifact
|
|
132
|
+
- directly affected integration boundaries
|
|
133
|
+
- directly affected UI/E2E flows
|
|
112
134
|
|
|
113
|
-
|
|
135
|
+
Record unrelated historical gaps under `Out of Scope Gaps`; do not generate tests for them and do not fail the verdict because of them.
|
|
114
136
|
|
|
115
|
-
|
|
137
|
+
For other scopes, compare existing tests against expected coverage across:
|
|
116
138
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
1. Build the in-scope source set using this priority:
|
|
122
|
-
- `changed_files` parameter
|
|
123
|
-
- `git diff --name-only <diff_base>`
|
|
124
|
-
- files/tasks listed in `artifact_dir/plan.md`
|
|
125
|
-
- File Manifest in `artifact_dir/context-snapshot.md`
|
|
126
|
-
- direct file/module mapping from `artifact_dir/spec.md` acceptance criteria
|
|
127
|
-
2. Build the in-scope test set:
|
|
128
|
-
- tests already changed in this feature
|
|
129
|
-
- tests matching in-scope source files by project naming convention
|
|
130
|
-
- directly affected integration/E2E tests for feature acceptance criteria
|
|
131
|
-
3. Analyze only:
|
|
132
|
-
- changed/new public interfaces
|
|
133
|
-
- feature acceptance criteria from `artifact_dir/spec.md`
|
|
134
|
-
- integration boundaries directly affected by in-scope files
|
|
135
|
-
- UI/E2E flows directly affected by this feature
|
|
136
|
-
4. For unrelated historical gaps, record them under `Out of Scope Gaps`; do not generate tests and do not fail the feature verdict because of them.
|
|
137
|
-
|
|
138
|
-
For other scopes, compare what exists against what should exist, across three levels:
|
|
139
|
-
|
|
140
|
-
**Unit test gaps** — for each module in scope:
|
|
141
|
-
- Read the corresponding L2 `.prizm` doc INTERFACES section to get exported functions/classes. If no L2 doc exists for a module, analyze source files directly to identify exported functions/classes.
|
|
142
|
-
- Check if each has a corresponding test file (match project's test naming: `foo.test.ts`, `foo.spec.ts`, `test_foo.py`)
|
|
143
|
-
- Flag uncovered interfaces
|
|
144
|
-
|
|
145
|
-
**Integration test gaps** (skip if project has no API/DB layer — pure library/CLI tool):
|
|
146
|
-
- Read L1 doc DEPENDENCIES section for cross-module interactions
|
|
147
|
-
- Check if tests exist covering module boundaries, API endpoints, DB operations
|
|
148
|
-
- Flag missing integration coverage
|
|
149
|
-
|
|
150
|
-
**E2E test gaps** (skip if project has no UI):
|
|
151
|
-
- Collect acceptance criteria from all spec.md files in scope
|
|
152
|
-
- Check existing E2E test files against these criteria
|
|
153
|
-
- Flag uncovered criteria
|
|
139
|
+
- Unit tests for exported functions/classes and changed logic
|
|
140
|
+
- Integration tests for module boundaries, API endpoints, DB operations, and external service seams
|
|
141
|
+
- E2E tests for user-visible acceptance criteria when a UI exists
|
|
154
142
|
|
|
155
143
|
### Phase 4: Boundary Coverage Matrix
|
|
156
144
|
|
|
157
|
-
|
|
145
|
+
Build the **Boundary Coverage Matrix** before generating tests. Happy-path coverage alone is not enough, and the boundary completion gate determines whether coverage is complete.
|
|
158
146
|
|
|
159
|
-
|
|
147
|
+
Read `${SKILL_DIR}/references/boundary-coverage-protocol.md` for matrix format, category definitions, and completion gate.
|
|
160
148
|
|
|
161
|
-
|
|
149
|
+
For each in-scope interface or endpoint, classify applicable categories such as:
|
|
162
150
|
|
|
163
|
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
151
|
+
- request validation
|
|
152
|
+
- auth / permission / ownership
|
|
153
|
+
- domain invariants
|
|
154
|
+
- collection / pagination
|
|
155
|
+
- date/time boundaries
|
|
156
|
+
- state transitions
|
|
157
|
+
- dependency failures
|
|
158
|
+
- response contract
|
|
168
159
|
|
|
169
|
-
|
|
160
|
+
Mark each category as:
|
|
161
|
+
|
|
162
|
+
- `covered`
|
|
163
|
+
- `generated`
|
|
164
|
+
- `needs-review`
|
|
165
|
+
- `skipped` with reason
|
|
166
|
+
- `boundary-missing`
|
|
170
167
|
|
|
171
168
|
### Phase 5: Generate Missing and Boundary Tests
|
|
172
169
|
|
|
173
|
-
Read `${SKILL_DIR}/references/test-generation-steps.md` for
|
|
170
|
+
Read `${SKILL_DIR}/references/test-generation-steps.md` for detailed generation rules.
|
|
174
171
|
|
|
175
|
-
When generating unit tests for service-like functions or API/integration tests
|
|
172
|
+
When generating unit tests for service-like functions or API/integration tests with business-specific behavior, use `${SKILL_DIR}/references/service-boundary-test-catalog.md`.
|
|
176
173
|
|
|
177
|
-
|
|
178
|
-
- Generate
|
|
174
|
+
Rules:
|
|
175
|
+
- Generate tests only for the selected scope.
|
|
179
176
|
- Check for equivalent existing tests before writing new tests.
|
|
180
|
-
- Do not create tests for unrelated modules just because coverage is missing.
|
|
181
|
-
- Do not refactor unrelated tests.
|
|
182
177
|
- Do not modify unrelated production code.
|
|
183
|
-
- Do not
|
|
184
|
-
-
|
|
178
|
+
- Do not add empty assertions or mock-success-only tests.
|
|
179
|
+
- If a valid generated test reveals behavior mismatch, mark it `needs-review` rather than changing production code inside this skill.
|
|
185
180
|
|
|
186
181
|
### Phase 6: Unified Report and Boundary Validation
|
|
187
182
|
|
|
188
|
-
Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/`
|
|
183
|
+
Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS}_testresult/` and write `test-report.md` using `${SKILL_DIR}/references/test-report-template.md`.
|
|
189
184
|
|
|
190
|
-
For `scope=this-change`,
|
|
191
|
-
- `## Scope` with mode, artifact dir, diff base, changed-files source, generation policy, in-scope source files, and in-scope test files
|
|
192
|
-
- `## Existing Tests Run`
|
|
193
|
-
- `## Generated / Updated Tests`
|
|
194
|
-
- `## In-Scope Failures`
|
|
195
|
-
- `## Baseline Failures`
|
|
196
|
-
- `## Out of Scope Gaps`
|
|
197
|
-
- `## Verdict` with `PASS`, `NEEDS_FIXES`, or `BLOCKED`
|
|
185
|
+
For `scope=this-change`, include:
|
|
198
186
|
|
|
199
|
-
|
|
187
|
+
- mode, artifact dir, diff base, changed-files source
|
|
188
|
+
- in-scope source and test files
|
|
189
|
+
- existing tests run
|
|
190
|
+
- generated/updated tests
|
|
191
|
+
- in-scope failures
|
|
192
|
+
- baseline failures
|
|
193
|
+
- out-of-scope gaps
|
|
194
|
+
- verdict: `PASS`, `NEEDS_FIXES`, or `BLOCKED`
|
|
200
195
|
|
|
201
|
-
|
|
196
|
+
Run the deterministic boundary-report validator when the project has an OpenAPI file or the report contains a Boundary Matrix:
|
|
202
197
|
|
|
203
198
|
```bash
|
|
204
199
|
python3 ${SKILL_DIR}/scripts/validate_boundary_report.py \
|
|
@@ -206,22 +201,24 @@ python3 ${SKILL_DIR}/scripts/validate_boundary_report.py \
|
|
|
206
201
|
--openapi openapi.yaml
|
|
207
202
|
```
|
|
208
203
|
|
|
209
|
-
If
|
|
204
|
+
If no OpenAPI file exists, omit `--openapi`. If validation fails, keep the report but do not claim boundary coverage is complete.
|
|
210
205
|
|
|
211
206
|
## Output
|
|
212
207
|
|
|
213
208
|
- Test report: `.prizmkit/test/{timestamp}_testresult/test-report.md`
|
|
214
|
-
- Generated
|
|
215
|
-
-
|
|
209
|
+
- Generated or updated test files
|
|
210
|
+
- Raw existing-test output, generated-test copies, E2E artifacts, and boundary validation output in the report directory
|
|
216
211
|
|
|
217
212
|
## Recovery
|
|
218
213
|
|
|
219
|
-
If
|
|
220
|
-
|
|
221
|
-
-
|
|
214
|
+
If interrupted:
|
|
215
|
+
|
|
216
|
+
- Check `.prizmkit/test/` for the most recent report directory.
|
|
217
|
+
- Re-run `/prizmkit-test`; it starts fresh but can reuse passing tests and existing generated files.
|
|
218
|
+
- Preserve any `needs-review` findings in the next report.
|
|
222
219
|
|
|
223
220
|
## Examples
|
|
224
221
|
|
|
225
|
-
Read `${SKILL_DIR}/references/examples.md` for worked examples of full-project,
|
|
222
|
+
Read `${SKILL_DIR}/references/examples.md` for worked examples of full-project, module, feature selection, and change-artifact runs.
|
|
226
223
|
|
|
227
|
-
**HANDOFF:** Independent skill
|
|
224
|
+
**HANDOFF:** Independent skill. If tests fail, boundary validation fails, or generated tests are marked `needs-review`, fix issues manually or run another targeted `/prizmkit-test` pass. Proceed to `/prizmkit-committer` only when testing was required and the report verdict allows it.
|
|
@@ -4,7 +4,7 @@ Use this protocol during `/prizmkit-test` Phase 4 and update it during Phase 5.
|
|
|
4
4
|
|
|
5
5
|
## Required Boundary Matrix
|
|
6
6
|
|
|
7
|
-
Build this matrix before writing tests and update it after generated tests pass or produce `needs-review` findings. In `scope=this-change`, build the matrix only for in-
|
|
7
|
+
Build this matrix before writing tests and update it after generated tests pass or produce `needs-review` findings. In `scope=this-change`, build the matrix only for interfaces/endpoints in the reviewed change artifact or changed-file set; unrelated interfaces are recorded under `Out of Scope Gaps` and do not trigger generated tests.
|
|
8
8
|
|
|
9
9
|
| Module | Interface | Service Type | Happy Path | Request Validation | Auth / Permission / Ownership | Domain Invariants | Collection / Pagination | Date / Time | State Transitions | Dependency Failure | Response Contract | N/A Reasons | Final Status |
|
|
10
10
|
|--------|-----------|--------------|------------|--------------------|-------------------------------|-------------------|-------------------------|-------------|-------------------|-------------------|-------------------|-------------|--------------|
|
|
@@ -42,9 +42,9 @@ Report: .prizmkit/test/2026_05_23_14_30_00_testresult/test-report.md
|
|
|
42
42
|
Needs human review: processPayment (returns 400 for negative amounts, expected 422), refund (missing authorization header causes 500 instead of 401)
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
## Example 2: Single
|
|
45
|
+
## Example 2: Single Feature/Spec Targeted Test
|
|
46
46
|
|
|
47
|
-
This is an interactive
|
|
47
|
+
This is an interactive selection of one existing spec directory. It is different from headless `scope=this-change`, which is driven by a current change artifact plus changed files.
|
|
48
48
|
|
|
49
49
|
**User**: `/prizmkit-test`
|
|
50
50
|
|
|
@@ -114,27 +114,29 @@ Generate tests for:
|
|
|
114
114
|
Do not report `user` as covered just because both endpoints have success tests.
|
|
115
115
|
|
|
116
116
|
|
|
117
|
-
## Example
|
|
117
|
+
## Example 4: Change Artifact this-change Run
|
|
118
118
|
|
|
119
119
|
**Caller**: `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`
|
|
120
120
|
|
|
121
|
+
For non-feature changes, use the same command shape with any explicit change artifact directory that contains `spec.md` + `plan.md` and has a changed-files source. The `{{FEATURE_SLUG}}` path below is a compatibility example for existing feature artifacts; it does not limit `scope=this-change` to feature work.
|
|
122
|
+
|
|
121
123
|
**Expected behavior**:
|
|
122
|
-
- Reads
|
|
123
|
-
- Builds in-scope files from changed files and
|
|
124
|
-
- Generates or updates only tests for this
|
|
124
|
+
- Reads the change artifact's `spec.md`, `plan.md`, and optional `context-snapshot.md`.
|
|
125
|
+
- Builds in-scope files from changed files and the change artifact.
|
|
126
|
+
- Generates or updates only tests for this change's files, public interfaces, and acceptance criteria.
|
|
125
127
|
- Records unrelated historical gaps under `Out of Scope Gaps`.
|
|
126
128
|
- Does not generate tests for unrelated modules.
|
|
127
|
-
-
|
|
129
|
+
- The change artifact may represent a feature, bug fix, refactor, migration, or other scoped change.
|
|
128
130
|
|
|
129
131
|
**Report excerpt**:
|
|
130
132
|
```markdown
|
|
131
133
|
## Scope
|
|
132
134
|
- Mode: this-change
|
|
133
|
-
- Artifact Dir: .prizmkit/specs/{{
|
|
135
|
+
- Artifact Dir: .prizmkit/specs/{{CHANGE_SLUG}}/
|
|
134
136
|
- Generation Policy: in-scope-only
|
|
135
137
|
|
|
136
138
|
## Out of Scope Gaps
|
|
137
|
-
- payment: missing legacy tests, but this
|
|
139
|
+
- payment: missing legacy tests, but this change did not affect payment code.
|
|
138
140
|
|
|
139
141
|
## Verdict
|
|
140
142
|
PASS
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Before generating any test, determine whether the run is `scope=this-change`.
|
|
6
6
|
|
|
7
|
-
For `scope=this-change`, use `generation_policy=in-scope-only` by default. Generate tests only for the in-scope source/test set built from the
|
|
7
|
+
For `scope=this-change`, use `generation_policy=in-scope-only` by default. Generate tests only for the in-scope source/test set built from the change artifact and changed files. If a missing test is unrelated to the current change, record it in `Out of Scope Gaps` and do not generate it. A change artifact is any directory with `spec.md` and `plan.md`; it may represent a feature, bug fix, refactor, migration, or other scoped change. Do not infer this-change scope from `.prizmkit/bugfix/` or `.prizmkit/refactor/` by directory name alone; require an explicit artifact directory and changed-files source.
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
Generate tests from the Phase 4 Boundary Coverage Matrix in priority order: unit → integration → E2E. After each batch, run immediately.
|
|
@@ -8,14 +8,14 @@ Used in Phase 6 of `/prizmkit-test`. Create `.prizmkit/test/{YYYY_MM_DD_HH_MM_SS
|
|
|
8
8
|
# Test Report — {timestamp}
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
|
-
- Scope: {full / module: name / feature: ###-name}
|
|
11
|
+
- Scope: {full / module: name / feature: ###-name / this-change}
|
|
12
12
|
- Architecture: {frontend / backend / fullstack}
|
|
13
13
|
- Test framework: {name}
|
|
14
14
|
- Mode: {interactive / headless}
|
|
15
15
|
|
|
16
16
|
## Scope
|
|
17
17
|
- Mode: {full-project / module:<name> / feature:<slug> / this-change}
|
|
18
|
-
- Artifact Dir: {none / .
|
|
18
|
+
- Artifact Dir: {none / path to change artifact containing spec.md + plan.md}
|
|
19
19
|
- Diff Base: {ref or none}
|
|
20
20
|
- Changed Files Source: {changed_files / diff_base / plan.md / context-snapshot.md / spec.md / not applicable}
|
|
21
21
|
- Generation Policy: {in-scope-only / full-project}
|