prizmkit 1.1.69 → 1.1.70
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/dev-pipeline/scripts/generate-bootstrap-prompt.py +11 -12
- package/bundled/dev-pipeline/templates/agent-prompts/dev-implement.md +36 -22
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +1 -1
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +24 -21
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +13 -26
- package/bundled/dev-pipeline/templates/sections/ac-verification-checklist.md +4 -10
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -0
- package/bundled/dev-pipeline/templates/sections/feature-context.md +16 -11
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-auto.md +17 -26
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification-opencli.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-browser-verification.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-base.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +2 -9
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +2 -9
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +8 -17
- package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +1 -1
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +1 -1
- package/bundled/dev-pipeline/templates/sections/task-contract.md +34 -0
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +27 -46
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +27 -37
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +13 -0
- package/bundled/dev-pipeline-windows/scripts/generate-bootstrap-prompt.py +11 -12
- package/bundled/dev-pipeline-windows/templates/agent-prompts/dev-implement.md +36 -22
- package/bundled/dev-pipeline-windows/templates/agent-prompts/reviewer-review.md +1 -1
- package/bundled/dev-pipeline-windows/templates/bugfix-bootstrap-prompt.md +24 -21
- package/bundled/dev-pipeline-windows/templates/refactor-bootstrap-prompt.md +13 -26
- package/bundled/dev-pipeline-windows/templates/sections/ac-verification-checklist.md +4 -10
- package/bundled/dev-pipeline-windows/templates/sections/context-budget-rules.md +1 -0
- package/bundled/dev-pipeline-windows/templates/sections/feature-context.md +16 -11
- package/bundled/dev-pipeline-windows/templates/sections/phase-browser-verification-auto.md +22 -10
- package/bundled/dev-pipeline-windows/templates/sections/phase-context-snapshot-base.md +1 -1
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-agent.md +2 -9
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-full.md +2 -9
- package/bundled/dev-pipeline-windows/templates/sections/phase-implement-lite.md +8 -19
- package/bundled/dev-pipeline-windows/templates/sections/phase-plan-lite.md +1 -1
- package/bundled/dev-pipeline-windows/templates/sections/phase-review-full.md +1 -1
- package/bundled/dev-pipeline-windows/templates/sections/phase-specify-plan-full.md +1 -1
- package/bundled/dev-pipeline-windows/templates/sections/task-contract.md +34 -0
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-agent.md +27 -46
- package/bundled/dev-pipeline-windows/templates/sections/test-failure-recovery-lite.md +27 -37
- package/bundled/skills/_metadata.json +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ ls .prizmkit/specs/{{FEATURE_SLUG}}/ 2>/dev/null
|
|
|
19
19
|
Identify the top-level source directories from the results.
|
|
20
20
|
3. Scan the detected source directories for files related to this feature; read each one
|
|
21
21
|
4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
22
|
-
- **Section 1 — Task
|
|
22
|
+
- **Section 1 — Task Contract**: Objective, scope rule, non-scope rule, and Verification Gates from the Task Contract above
|
|
23
23
|
- **Section 2 — Project Structure**: run the following to get a visual directory tree, then paste output:
|
|
24
24
|
```bash
|
|
25
25
|
find . -maxdepth 2 -type d -not -path '*/node_modules/*' -not -path '*/.git/*' -not -path '*/dist/*' -not -path '*/build/*' -not -path '*/__pycache__/*' -not -path '*/vendor/*' | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Task Contract
|
|
2
|
+
|
|
3
|
+
This section defines the only work that belongs to this session.
|
|
4
|
+
|
|
5
|
+
### Objective
|
|
6
|
+
|
|
7
|
+
Implement {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
8
|
+
|
|
9
|
+
{{FEATURE_DESCRIPTION}}
|
|
10
|
+
|
|
11
|
+
### Scope Rule
|
|
12
|
+
|
|
13
|
+
Current scope is limited to the intersection of:
|
|
14
|
+
|
|
15
|
+
1. The Objective above
|
|
16
|
+
2. The Verification Gates below
|
|
17
|
+
3. Dependencies required to complete those gates
|
|
18
|
+
|
|
19
|
+
Raw user context, project brief, and completed dependency notes are authoritative context, but they do not expand scope by themselves.
|
|
20
|
+
|
|
21
|
+
### Non-Scope Rule
|
|
22
|
+
|
|
23
|
+
Do NOT implement unrelated backlog items, already completed features, or adjacent modules unless they are required by the Objective or a Verification Gate.
|
|
24
|
+
|
|
25
|
+
### Verification Gates
|
|
26
|
+
|
|
27
|
+
These gates are generated from `feature.acceptance_criteria` and are the only acceptance requirements for this session.
|
|
28
|
+
|
|
29
|
+
{{AC_CHECKLIST}}
|
|
30
|
+
|
|
31
|
+
Gate rule:
|
|
32
|
+
- `[x]` means verified with implementation or test evidence.
|
|
33
|
+
- Any remaining `[ ]` means the feature is incomplete.
|
|
34
|
+
- If a gate is blocked, document the reason in `failure-log.md`; blocked is not success.
|
|
@@ -1,67 +1,48 @@
|
|
|
1
1
|
## Test Failure Recovery Protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this protocol whenever implementation or review tests fail. Its purpose is to distinguish tolerated pre-existing failures from blockers introduced by this session.
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
1. **Run tests and record results**:
|
|
8
|
-
- Count total failures and note which tests failed
|
|
9
|
-
- Compare against baseline (BASELINE_FAILURES) — exclude pre-existing failures
|
|
10
|
-
|
|
11
|
-
2. **Check termination conditions** (evaluate BEFORE each fix attempt):
|
|
12
|
-
- **All tests pass** → Done. Exit recovery loop.
|
|
13
|
-
- **Plateau detected** — same failure count AND same failing tests for 3 consecutive rounds → AI cannot resolve these failures. Document and exit.
|
|
14
|
-
- **Still making progress** — failure count decreased compared to previous round → Continue fixing.
|
|
15
|
-
- **First round** — no history yet → Proceed to fix.
|
|
16
|
-
|
|
17
|
-
3. **Fix and iterate**:
|
|
18
|
-
- Analyze remaining failures: root cause (code bug vs. test brittleness vs. environment issue)
|
|
19
|
-
- Categorize:
|
|
20
|
-
- **Pre-existing baseline failure**: Expected, do NOT fix
|
|
21
|
-
- **New regression**: Fix the code
|
|
22
|
-
- **Brittle test**: Fix the test or environment setup
|
|
23
|
-
- Apply fix, re-run `($TEST_CMD)`, go back to step 1
|
|
5
|
+
### Failure Classes
|
|
24
6
|
|
|
25
|
-
|
|
7
|
+
| Class | Meaning | Required Action | May Continue? |
|
|
8
|
+
|-------|---------|-----------------|---------------|
|
|
9
|
+
| Baseline failure | Existed before this session | Document in Implementation Log or review notes | Yes |
|
|
10
|
+
| New regression | Introduced by this session | Fix before reporting success | No |
|
|
11
|
+
| Brittle test | Test expectation/setup is wrong for the intended behavior | Fix the test or environment setup, then rerun | Only after fixed or documented as blocked |
|
|
12
|
+
| Environment/tooling failure | External tool, network, install, or local environment prevents verification | Document in `failure-log.md` with impact on gates | Only if no Verification Gate is blocked |
|
|
26
13
|
|
|
27
|
-
|
|
14
|
+
### Recovery Loop
|
|
28
15
|
|
|
29
|
-
|
|
16
|
+
1. Run tests and record: failing test names, failure count, and class for each failure.
|
|
17
|
+
2. Compare with `BASELINE_FAILURES`; never blame baseline failures on this feature.
|
|
18
|
+
3. Fix new regressions and brittle tests while progress is being made.
|
|
19
|
+
4. Stop after a plateau: same failure count and same failing tests for 3 consecutive rounds.
|
|
20
|
+
5. If failures decrease, reset the plateau counter.
|
|
30
21
|
|
|
31
|
-
###
|
|
22
|
+
### Success Rule
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
- Dev appends failure details to Implementation Log
|
|
35
|
-
- Reviewer agent runs full test suite in Phase 5
|
|
36
|
-
- If Reviewer confirms NEW regressions (not in baseline): mark verdict as `NEEDS_FIXES`
|
|
37
|
-
- If Reviewer confirms only baseline failures remain: proceed with `PASS_WITH_WARNINGS`
|
|
24
|
+
Proceed to review only when:
|
|
38
25
|
|
|
39
|
-
|
|
26
|
+
1. all new regressions are fixed;
|
|
27
|
+
2. baseline failures are documented;
|
|
28
|
+
3. every Verification Gate is verified.
|
|
40
29
|
|
|
41
|
-
|
|
42
|
-
- If Implementation Log section in context-snapshot.md already confirms "all tests passing"
|
|
43
|
-
- → Skip Phase 5 test suite re-run (Reviewer will verify baseline log instead)
|
|
44
|
-
- This avoids rebuilding/re-running tests when already verified
|
|
30
|
+
Blocked gates are not success. If any gate cannot be verified, follow the Blocked Rule.
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
- If Implementation Log is missing or incomplete
|
|
48
|
-
- If any new code was added after the last test run
|
|
49
|
-
- If Reviewer suspects brittleness or environment drift
|
|
32
|
+
### Blocked Rule
|
|
50
33
|
|
|
51
|
-
|
|
34
|
+
If a remaining failure prevents any Verification Gate from being verified, the feature is incomplete. Write `failure-log.md` and do not report success.
|
|
52
35
|
|
|
53
|
-
|
|
36
|
+
### Failure Capture Format
|
|
54
37
|
|
|
55
|
-
```
|
|
38
|
+
```markdown
|
|
56
39
|
## Test Failures Encountered
|
|
57
40
|
|
|
58
41
|
- **Test**: [test name/path]
|
|
59
42
|
- Root Cause: [explanation]
|
|
60
|
-
- Category: [
|
|
43
|
+
- Category: [baseline failure | new regression | brittle test | environment/tooling]
|
|
61
44
|
- Rounds Attempted: [N rounds, plateau at round M]
|
|
62
|
-
- Status: [
|
|
45
|
+
- Status: [fixed | still failing | blocked]
|
|
63
46
|
|
|
64
|
-
- **Impact on
|
|
47
|
+
- **Impact on Verification Gates**: [verified | not affected | blocked + reason]
|
|
65
48
|
```
|
|
66
|
-
|
|
67
|
-
**Rule**: If any AC cannot be verified due to test failure, the feature is incomplete. Document in failure-log.md for next session.
|
|
@@ -1,58 +1,48 @@
|
|
|
1
1
|
## Test Failure Recovery Protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use this protocol whenever implementation tests fail. Its purpose is to distinguish tolerated pre-existing failures from blockers introduced by this session.
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
1. **Run tests and record results**:
|
|
8
|
-
- Count total failures and note which tests failed
|
|
9
|
-
- Compare against baseline (BASELINE_FAILURES) — exclude pre-existing failures
|
|
10
|
-
|
|
11
|
-
2. **Check termination conditions** (evaluate BEFORE each fix attempt):
|
|
12
|
-
- **All tests pass** → Done. Exit recovery loop.
|
|
13
|
-
- **Plateau detected** — same failure count AND same failing tests for 3 consecutive rounds → AI cannot resolve these failures. Document and exit.
|
|
14
|
-
- **Still making progress** — failure count decreased compared to previous round → Continue fixing.
|
|
15
|
-
- **First round** — no history yet → Proceed to fix.
|
|
5
|
+
### Failure Classes
|
|
16
6
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- Apply fix, re-run `($TEST_CMD)`, go back to step 1
|
|
7
|
+
| Class | Meaning | Required Action | May Continue? |
|
|
8
|
+
|-------|---------|-----------------|---------------|
|
|
9
|
+
| Baseline failure | Existed before this session | Document in Implementation Log | Yes |
|
|
10
|
+
| New regression | Introduced by this session | Fix before reporting success | No |
|
|
11
|
+
| Brittle test | Test expectation/setup is wrong for the intended behavior | Fix the test or environment setup, then rerun | Only after fixed or documented as blocked |
|
|
12
|
+
| Environment/tooling failure | External tool, network, install, or local environment prevents verification | Document in `failure-log.md` with impact on gates | Only if no Verification Gate is blocked |
|
|
24
13
|
|
|
25
|
-
###
|
|
14
|
+
### Recovery Loop
|
|
26
15
|
|
|
27
|
-
|
|
16
|
+
1. Run tests and record: failing test names, failure count, and class for each failure.
|
|
17
|
+
2. Compare with `BASELINE_FAILURES`; never blame baseline failures on this feature.
|
|
18
|
+
3. Fix new regressions and brittle tests while progress is being made.
|
|
19
|
+
4. Stop after a plateau: same failure count and same failing tests for 3 consecutive rounds.
|
|
20
|
+
5. If failures decrease, reset the plateau counter.
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
### Success Rule
|
|
30
23
|
|
|
31
|
-
|
|
24
|
+
Proceed only when:
|
|
32
25
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- **Do NOT block commit** — unresolved test failures are deferred to next session
|
|
26
|
+
1. all new regressions are fixed;
|
|
27
|
+
2. baseline failures are documented;
|
|
28
|
+
3. every Verification Gate is verified.
|
|
37
29
|
|
|
38
|
-
|
|
30
|
+
Blocked gates are not success. If any gate cannot be verified, follow the Blocked Rule.
|
|
39
31
|
|
|
40
|
-
|
|
32
|
+
### Blocked Rule
|
|
41
33
|
|
|
42
|
-
|
|
34
|
+
If a remaining failure prevents any Verification Gate from being verified, the feature is incomplete. Write `failure-log.md` and do not report success.
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
### Failure Capture Format
|
|
45
37
|
|
|
46
|
-
```
|
|
38
|
+
```markdown
|
|
47
39
|
## Test Failures Encountered
|
|
48
40
|
|
|
49
41
|
- **Test**: [test name/path]
|
|
50
42
|
- Root Cause: [explanation]
|
|
51
|
-
- Category: [
|
|
43
|
+
- Category: [baseline failure | new regression | brittle test | environment/tooling]
|
|
52
44
|
- Rounds Attempted: [N rounds, plateau at round M]
|
|
53
|
-
- Status: [
|
|
45
|
+
- Status: [fixed | still failing | blocked]
|
|
54
46
|
|
|
55
|
-
- **Impact on
|
|
47
|
+
- **Impact on Verification Gates**: [verified | not affected | blocked + reason]
|
|
56
48
|
```
|
|
57
|
-
|
|
58
|
-
**Rule**: If any AC cannot be verified due to test failure, the feature is incomplete. Document in failure-log.md for next session.
|
|
@@ -6,6 +6,7 @@ from generate_bootstrap_prompt import (
|
|
|
6
6
|
compute_feature_slug,
|
|
7
7
|
find_feature,
|
|
8
8
|
format_acceptance_criteria,
|
|
9
|
+
format_ac_checklist,
|
|
9
10
|
format_global_context,
|
|
10
11
|
get_completed_dependencies,
|
|
11
12
|
determine_pipeline_mode,
|
|
@@ -73,6 +74,18 @@ class TestFormatAcceptanceCriteria:
|
|
|
73
74
|
assert "- Password reset works" in result
|
|
74
75
|
|
|
75
76
|
|
|
77
|
+
class TestFormatAcChecklist:
|
|
78
|
+
def test_empty_does_not_create_unchecked_gate(self):
|
|
79
|
+
result = format_ac_checklist([])
|
|
80
|
+
assert result == "- (no Verification Gates specified)"
|
|
81
|
+
assert "[ ]" not in result
|
|
82
|
+
|
|
83
|
+
def test_items_are_unchecked_verification_gates(self):
|
|
84
|
+
result = format_ac_checklist(["Users can log in", "Password reset works"])
|
|
85
|
+
assert "- [ ] Users can log in" in result
|
|
86
|
+
assert "- [ ] Password reset works" in result
|
|
87
|
+
|
|
88
|
+
|
|
76
89
|
# ---------------------------------------------------------------------------
|
|
77
90
|
# format_global_context
|
|
78
91
|
# ---------------------------------------------------------------------------
|
|
@@ -286,7 +286,7 @@ def extract_baseline_failures(test_commands, project_root):
|
|
|
286
286
|
def format_ac_checklist(acceptance_criteria):
|
|
287
287
|
"""Format acceptance criteria as a markdown checkbox list."""
|
|
288
288
|
if not acceptance_criteria:
|
|
289
|
-
return "-
|
|
289
|
+
return "- (no Verification Gates specified)"
|
|
290
290
|
lines = []
|
|
291
291
|
for item in acceptance_criteria:
|
|
292
292
|
lines.append("- [ ] {}".format(item))
|
|
@@ -323,10 +323,10 @@ def format_user_context(user_context):
|
|
|
323
323
|
if not items:
|
|
324
324
|
return ""
|
|
325
325
|
lines = [
|
|
326
|
-
"
|
|
327
|
-
""
|
|
328
|
-
"
|
|
329
|
-
"
|
|
326
|
+
"> These materials were provided by the user and are authoritative "
|
|
327
|
+
"when they clarify or constrain this feature. They do not expand "
|
|
328
|
+
"the current scope by themselves; use the Task Contract to decide "
|
|
329
|
+
"what belongs to this session.",
|
|
330
330
|
"",
|
|
331
331
|
]
|
|
332
332
|
for item in items:
|
|
@@ -970,6 +970,10 @@ def assemble_sections(pipeline_mode, sections_dir, init_done, is_resume,
|
|
|
970
970
|
mission += "\n\n" + tier_desc
|
|
971
971
|
sections.append(("mission", mission))
|
|
972
972
|
|
|
973
|
+
# --- Task Contract: single source of current scope and gates ---
|
|
974
|
+
sections.append(("task-contract",
|
|
975
|
+
load_section(sections_dir, "task-contract.md")))
|
|
976
|
+
|
|
973
977
|
# --- Feature Context (XML-wrapped, optimization 3) ---
|
|
974
978
|
sections.append(("feature-context",
|
|
975
979
|
load_section(sections_dir, "feature-context.md")))
|
|
@@ -1079,13 +1083,8 @@ def assemble_sections(pipeline_mode, sections_dir, init_done, is_resume,
|
|
|
1079
1083
|
load_section(sections_dir,
|
|
1080
1084
|
"test-failure-recovery-agent.md")))
|
|
1081
1085
|
|
|
1082
|
-
#
|
|
1083
|
-
|
|
1084
|
-
if os.path.isfile(ac_checklist_path):
|
|
1085
|
-
sections.append(("ac-verification-checklist",
|
|
1086
|
-
load_section(sections_dir,
|
|
1087
|
-
"ac-verification-checklist.md")))
|
|
1088
|
-
|
|
1086
|
+
# Verification Gates are included in Task Contract. Keep AC in one place so
|
|
1087
|
+
# background context and implementation prompts cannot redefine scope.
|
|
1089
1088
|
# --- Review (only for agent tiers) ---
|
|
1090
1089
|
if pipeline_mode == "full":
|
|
1091
1090
|
sections.append(("phase-review",
|
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
"Read {{DEV_SUBAGENT_PATH}}. Implement feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
2
|
-
**IMPORTANT**: Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` FIRST — Section 3 has Prizm Context (TRAPS/RULES), Section 4 has File Manifest with paths and interfaces.
|
|
3
|
-
⚠️ DO NOT re-read source files already listed in Section 4 File Manifest unless you need implementation detail beyond the interface summary.
|
|
4
|
-
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` for full context.
|
|
5
|
-
2. Run `/prizmkit-implement` to execute the tasks in plan.md. Run tests with: `{{TEST_CMD}}`. Known baseline failures (pre-existing, not your fault): `{{BASELINE_FAILURES}}`.
|
|
6
|
-
3. If plan.md has more than 5 tasks: run `/compact` after completing every 3 tasks to manage context budget. If `/compact` is unavailable, continue without it.
|
|
7
|
-
4. After implement completes, verify the '## Implementation Log' section was written to context-snapshot.md.
|
|
8
2
|
|
|
9
|
-
##
|
|
3
|
+
## Required Inputs
|
|
10
4
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
- Document any AC that cannot be verified due to test failures
|
|
5
|
+
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` first.
|
|
6
|
+
2. Use Section 4 File Manifest for targeted reads.
|
|
7
|
+
3. Do not expand scope beyond the Task Contract and Verification Gates.
|
|
8
|
+
4. Do not re-read source files already listed in Section 4 unless implementation details are missing from the manifest.
|
|
16
9
|
|
|
17
|
-
##
|
|
10
|
+
## Work
|
|
18
11
|
|
|
19
|
-
|
|
12
|
+
Run `/prizmkit-implement` to execute `plan.md`.
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
3. **Fix and iterate**: analyze, apply fix, re-run `{{TEST_CMD}}`, go back to step 1
|
|
14
|
+
Test command:
|
|
15
|
+
`{{TEST_CMD}}`
|
|
24
16
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
**If any AC cannot be verified** due to test failure: the feature is incomplete, add to failure notes.
|
|
17
|
+
Known baseline failures:
|
|
18
|
+
`{{BASELINE_FAILURES}}`
|
|
28
19
|
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
If plan.md has more than 5 tasks, run `/compact` after completing every 3 tasks to manage context budget. If `/compact` is unavailable, continue without it.
|
|
21
|
+
|
|
22
|
+
## Required Outputs
|
|
23
|
+
|
|
24
|
+
Before returning, append `## Implementation Log` to `context-snapshot.md` with:
|
|
25
|
+
- files changed/created
|
|
26
|
+
- key decisions
|
|
27
|
+
- deviations from plan
|
|
28
|
+
- test results
|
|
29
|
+
- Verification Gate status
|
|
30
|
+
- unresolved blockers, if any
|
|
31
|
+
|
|
32
|
+
## Protocol References
|
|
33
|
+
|
|
34
|
+
- Follow the global Context Budget Rules.
|
|
35
|
+
- Carry forward the Dev-isolated subset: skip scaffold/generated files listed in `context-snapshot.md`; verify dependency versions before install/build commands that resolve dependencies; after build/compile commands, ensure outputs are ignored and never commit generated artifacts.
|
|
36
|
+
- If tests fail, follow this Test Failure Recovery subset: classify failures as baseline, new regression, brittle test, or environment/tooling; fix new regressions and brittle tests while progress is being made; document baseline failures; write `failure-log.md` for blockers.
|
|
37
|
+
- Do not run git commands; staging and commit are handled by the orchestrator.
|
|
38
|
+
|
|
39
|
+
Do not return success unless:
|
|
40
|
+
1. implementation tasks are complete;
|
|
41
|
+
2. `## Implementation Log` exists;
|
|
42
|
+
3. every Verification Gate is verified.
|
|
43
|
+
|
|
44
|
+
If any Verification Gate is blocked, write `failure-log.md` and return a blocked/incomplete result instead of success."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"Read {{REVIEWER_SUBAGENT_PATH}}. For feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}):
|
|
2
|
-
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md` (if it exists) for goals and
|
|
2
|
+
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/spec.md` (if it exists) for goals and Verification Gates; if spec.md does not exist, read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` Section 1 Task Contract instead
|
|
3
3
|
2. Read `.prizmkit/specs/{{FEATURE_SLUG}}/plan.md` for architecture decisions and completed tasks
|
|
4
4
|
3. Run /prizmkit-code-review with artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/. The skill will run its internal review-fix loop (Reviewer → filter → Dev fix, max 3 rounds) and write review-report.md.
|
|
5
5
|
4. Run the full test suite using `{{TEST_CMD}}`. When running tests: `({{TEST_CMD}}) 2>&1 | Tee-Object (Join-Path $env:TEMP "review-test-out.txt") | Select-Object -Last 20`, then Select-String (Join-Path $env:TEMP "review-test-out.txt") for details — do NOT re-run the suite multiple times.
|
|
@@ -84,12 +84,12 @@ New-Item -ItemType Directory -Force -Path .prizmkit/bugfix/{{BUG_ID}} | Out-Null
|
|
|
84
84
|
|
|
85
85
|
{{IF_BROWSER_INTERACTION}}
|
|
86
86
|
|
|
87
|
-
#### Browser Verification
|
|
87
|
+
#### Browser Verification Protocol
|
|
88
88
|
|
|
89
|
-
The bug may be reproducible via the UI
|
|
89
|
+
The bug may be reproducible via the UI. Use this single browser protocol for planning, implementation, review, and final reporting:
|
|
90
90
|
|
|
91
91
|
{{IF_BROWSER_TOOL_AUTO}}
|
|
92
|
-
- **Browser Tool**:
|
|
92
|
+
- **Browser Tool**: Auto-select at runtime based on error type and dev server configuration
|
|
93
93
|
{{END_IF_BROWSER_TOOL_AUTO}}
|
|
94
94
|
|
|
95
95
|
{{IF_BROWSER_TOOL_PLAYWRIGHT}}
|
|
@@ -103,10 +103,7 @@ The bug may be reproducible via the UI using browser tools:
|
|
|
103
103
|
**Browser Verification Goals**:
|
|
104
104
|
{{BROWSER_VERIFY_STEPS}}
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
1. Reproduce the bug in a running dev server
|
|
108
|
-
2. Verify the fix after implementation
|
|
109
|
-
3. Smoke-test related UI flows for regression
|
|
106
|
+
Use this protocol only when the bug is UI/frontend-reproducible. Evidence must cover: original bug reproduction, post-fix behavior, related UI regression smoke tests, tool used, and any manual verification steps.
|
|
110
107
|
|
|
111
108
|
{{END_IF_BROWSER_INTERACTION}}
|
|
112
109
|
|
|
@@ -141,7 +138,7 @@ Run `/prizmkit-plan` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
|
|
|
141
138
|
- Resolve any `[NEEDS CLARIFICATION]` markers autonomously — do NOT pause
|
|
142
139
|
|
|
143
140
|
{{IF_BROWSER_INTERACTION}}
|
|
144
|
-
- **Browser Verification**: If the bug is UI-reproducible, plan.md should
|
|
141
|
+
- **Browser Verification**: If the bug is UI-reproducible, plan.md should reference the Browser Verification Protocol above instead of redefining browser steps.
|
|
145
142
|
{{END_IF_BROWSER_INTERACTION}}
|
|
146
143
|
|
|
147
144
|
**DECISION GATE — Fast Path Check**:
|
|
@@ -171,11 +168,7 @@ Run `/prizmkit-implement` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
|
|
|
171
168
|
|
|
172
169
|
{{IF_BROWSER_INTERACTION}}
|
|
173
170
|
|
|
174
|
-
**Browser Verification During Implementation**:
|
|
175
|
-
- After each code fix, you may optionally use browser tools to verify the behavior
|
|
176
|
-
- Reproduce the original bug steps and confirm they no longer occur
|
|
177
|
-
- Test related UI flows to ensure no regression
|
|
178
|
-
- Document any manual verification steps in the implementation notes
|
|
171
|
+
**Browser Verification During Implementation**: If the bug is UI-reproducible, apply the Browser Verification Protocol above and document evidence in the implementation notes.
|
|
179
172
|
|
|
180
173
|
{{END_IF_BROWSER_INTERACTION}}
|
|
181
174
|
|
|
@@ -196,20 +189,30 @@ After implement completes, verify:
|
|
|
196
189
|
If `FAST_PATH=true` (≤ 2 tasks, obvious root cause), skip this phase entirely.
|
|
197
190
|
|
|
198
191
|
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/bugfix/{{BUG_ID}}/`:
|
|
199
|
-
- The skill runs an internal review-fix loop (Reviewer → filter → Dev fix, max 3 rounds) and writes review-report.md
|
|
200
|
-
-
|
|
201
|
-
|
|
192
|
+
- The skill runs an internal review-fix loop (Reviewer → filter → Dev fix, max 3 rounds) and writes `review-report.md`
|
|
193
|
+
- `review-report.md` must contain `## Verdict`
|
|
194
|
+
|
|
195
|
+
**Gate Check — Review Report**:
|
|
196
|
+
After `/prizmkit-code-review` returns, verify the review report:
|
|
197
|
+
```powershell
|
|
198
|
+
if (Select-String -Path .prizmkit/bugfix/{{BUG_ID}}/review-report.md -Pattern "## Verdict" -Quiet) { "GATE:PASS" } else { "GATE:MISSING" }
|
|
199
|
+
```
|
|
200
|
+
If GATE:MISSING:
|
|
201
|
+
- Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.
|
|
202
|
+
- Perform one bounded status check; retry `/prizmkit-code-review` at most once only if the missing report appears caused by a transient team/config/lock error.
|
|
203
|
+
- If the report is still missing after that single check/retry, write `failure-log.md` with the spawn/skill error and last observable state, then either perform a safe inline fallback review (spec/plan/diff/tests → write `review-report.md` with `## Verdict`) or stop with a clear recovery failure.
|
|
204
|
+
|
|
205
|
+
Read `review-report.md` and check the Verdict:
|
|
206
|
+
- `PASS` → proceed
|
|
207
|
+
- `NEEDS_FIXES` → the skill exhausted its max rounds; log remaining findings and proceed
|
|
202
208
|
|
|
203
209
|
{{IF_BROWSER_INTERACTION}}
|
|
204
210
|
|
|
205
|
-
**Code Review — Browser Verification Check**:
|
|
206
|
-
- Verify that browser-based reproduction steps (if applicable) are clearly documented
|
|
207
|
-
- Confirm that the fix maintains the expected UI behavior for all affected flows
|
|
208
|
-
- Validate that any manual verification steps have been completed successfully
|
|
211
|
+
**Code Review — Browser Verification Check**: Confirm that UI-reproducible bug evidence follows the Browser Verification Protocol above.
|
|
209
212
|
|
|
210
213
|
{{END_IF_BROWSER_INTERACTION}}
|
|
211
214
|
|
|
212
|
-
**CP-3**: Code review complete, all tests green.
|
|
215
|
+
**CP-3**: Code review complete, `review-report.md` written, and all tests green.
|
|
213
216
|
|
|
214
217
|
**Checkpoint update**: Set step `prizmkit-code-review` to `"completed"`.
|
|
215
218
|
|
|
@@ -16,7 +16,7 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
|
|
|
16
16
|
|
|
17
17
|
**NON-INTERACTIVE MODE**: You are running in headless non-interactive mode. There is NO human on the other end. NEVER ask for user confirmation, NEVER wait for user input, NEVER use interactive prompts (e.g. "Would you like me to…"). If a skill has an interactive step (e.g. offer remediation, ask for approval), skip it and proceed autonomously. Make decisions based on the data available and move forward.
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
**NORMAL-PATH TEAM REQUIREMENT**: Use the `prizm-dev-team` agents (Dev + Reviewer) for implementation and review. You are the orchestrator — handle coordination, planning, and commit phases directly. If a required agent cannot be spawned after the bounded retry policy below, follow the documented recovery exception instead of looping forever.
|
|
20
20
|
|
|
21
21
|
**REFACTOR DOCUMENTATION POLICY**:
|
|
22
22
|
- **DEFAULT**: Run `/prizmkit-retrospective` with full sync (Job 1 + Job 2), because refactoring changes code structure and interfaces.
|
|
@@ -83,7 +83,8 @@ You are the **refactor session orchestrator**. Execute Refactor {{REFACTOR_ID}}:
|
|
|
83
83
|
**Agent spawn failure policy (all Agent tool calls)**:
|
|
84
84
|
- If spawning Dev or Reviewer fails with team/config/lock errors, retry at most once.
|
|
85
85
|
- If the second attempt fails, do not keep spawning variants and do not enter artifact polling for Implementation Log, review-report, or refactor-report markers.
|
|
86
|
-
-
|
|
86
|
+
- Recovery exception: complete remaining refactor work directly in the orchestrator only when the action is safe and bounded; otherwise write `failure-log.md` with the spawn error and last observable state before stopping for recovery.
|
|
87
|
+
- Any recovery exception must be recorded in the required report or session status so downstream runs know the normal team path was unavailable.
|
|
87
88
|
- Apply the same cap to any re-spawn for report repair or resume prompts; do not burn multiple minutes on identical team/config/lock failures.
|
|
88
89
|
|
|
89
90
|
## Workflow Checkpoint System
|
|
@@ -131,32 +132,26 @@ Resolve any `[NEEDS CLARIFICATION]` markers using the refactor description — d
|
|
|
131
132
|
|
|
132
133
|
{{IF_BROWSER_INTERACTION}}
|
|
133
134
|
|
|
134
|
-
#### Browser
|
|
135
|
+
#### Browser Behavior Preservation Protocol
|
|
135
136
|
|
|
136
|
-
The refactor may affect UI behavior.
|
|
137
|
-
- **UI Render**: UI components render identically after refactoring
|
|
138
|
-
- **User Interactions**: Navigation, form submissions, and workflows function as before
|
|
139
|
-
- **Feature Coverage**: Refactored features work end-to-end in real browser environment
|
|
137
|
+
The refactor may affect UI behavior. Use this single browser protocol for planning, implementation, review, and final reporting:
|
|
140
138
|
|
|
141
139
|
{{IF_BROWSER_TOOL_AUTO}}
|
|
142
|
-
Browser
|
|
140
|
+
- **Browser Tool**: Auto-select at runtime based on dev server and feature complexity.
|
|
143
141
|
{{END_IF_BROWSER_TOOL_AUTO}}
|
|
144
142
|
|
|
145
143
|
{{IF_BROWSER_TOOL_PLAYWRIGHT}}
|
|
146
|
-
**Tool
|
|
144
|
+
- **Browser Tool**: playwright-cli — local isolated browser instance for dev server verification.
|
|
147
145
|
{{END_IF_BROWSER_TOOL_PLAYWRIGHT}}
|
|
148
146
|
|
|
149
147
|
{{IF_BROWSER_TOOL_OPENCLI}}
|
|
150
|
-
**Tool
|
|
148
|
+
- **Browser Tool**: opencli — Chrome session with existing login for OAuth/third-party integrations.
|
|
151
149
|
{{END_IF_BROWSER_TOOL_OPENCLI}}
|
|
152
150
|
|
|
153
151
|
**Verification Goals**:
|
|
154
152
|
{{BROWSER_VERIFY_STEPS}}
|
|
155
153
|
|
|
156
|
-
|
|
157
|
-
- Which UI flows should be smoke-tested after refactoring?
|
|
158
|
-
- Any specific user journeys affected by the structural changes?
|
|
159
|
-
- Should verification be part of review phase or implementation phase?
|
|
154
|
+
Evidence must cover affected UI render, primary user interactions, behavior-sensitive workflows, tool used, and whether verification belongs in implementation, review, or both.
|
|
160
155
|
|
|
161
156
|
{{END_IF_BROWSER_INTERACTION}}
|
|
162
157
|
|
|
@@ -170,7 +165,7 @@ Include browser verification approach in plan.md:
|
|
|
170
165
|
**Goal**: Execute all tasks from plan.md while preserving existing behavior.
|
|
171
166
|
|
|
172
167
|
- Spawn Dev agent (Agent tool, subagent_type="prizm-dev-team-dev", run_in_background=false)
|
|
173
|
-
|
|
168
|
+
Apply the all-agent spawn failure policy above for this Dev spawn: for team/config/lock errors, retry at most once; if the second attempt fails, do not poll for `## Implementation Log`; use the bounded recovery exception.
|
|
174
169
|
Prompt: "Read {{DEV_SUBAGENT_PATH}}. For refactor {{REFACTOR_ID}} ('{{REFACTOR_TITLE}}'):
|
|
175
170
|
1. Read `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` and `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md`
|
|
176
171
|
2. Read `.prizmkit/prizm-docs/` for affected modules (TRAPS, RULES, PATTERNS)
|
|
@@ -185,11 +180,7 @@ Include browser verification approach in plan.md:
|
|
|
185
180
|
|
|
186
181
|
{{IF_BROWSER_INTERACTION}}
|
|
187
182
|
|
|
188
|
-
6.
|
|
189
|
-
- Use browser tools to verify UI still renders correctly
|
|
190
|
-
- Test the primary user flows affected by the refactoring
|
|
191
|
-
- Confirm no visual or interactive regressions
|
|
192
|
-
- Document any manual browser verification steps in implementation notes
|
|
183
|
+
6. Apply the Browser Behavior Preservation Protocol above after major refactor tasks and document evidence in implementation notes.
|
|
193
184
|
|
|
194
185
|
{{END_IF_BROWSER_INTERACTION}}
|
|
195
186
|
|
|
@@ -208,7 +199,7 @@ Include browser verification approach in plan.md:
|
|
|
208
199
|
**Goal**: Verify refactoring quality and behavior preservation.
|
|
209
200
|
|
|
210
201
|
- Spawn Reviewer agent (Agent tool, subagent_type="prizm-dev-team-reviewer", run_in_background=false)
|
|
211
|
-
|
|
202
|
+
Apply the all-agent spawn failure policy above for this Reviewer spawn.
|
|
212
203
|
Prompt: "Read {{REVIEWER_SUBAGENT_PATH}}. For refactor {{REFACTOR_ID}}:
|
|
213
204
|
1. Read `.prizmkit/refactor/{{REFACTOR_ID}}/spec.md` for goals and behavior preservation contracts
|
|
214
205
|
2. Read `.prizmkit/refactor/{{REFACTOR_ID}}/plan.md` for architecture decisions and completed tasks
|
|
@@ -217,11 +208,7 @@ Include browser verification approach in plan.md:
|
|
|
217
208
|
|
|
218
209
|
{{IF_BROWSER_INTERACTION}}
|
|
219
210
|
|
|
220
|
-
5.
|
|
221
|
-
- Verify that critical user workflows still function end-to-end in browser
|
|
222
|
-
- Confirm UI renders consistently after structural changes
|
|
223
|
-
- Validate any behavior-sensitive components behave identically
|
|
224
|
-
- Document browser verification findings in review-report.md
|
|
211
|
+
5. Verify the Browser Behavior Preservation Protocol evidence and document findings in `review-report.md`.
|
|
225
212
|
|
|
226
213
|
{{END_IF_BROWSER_INTERACTION}}
|
|
227
214
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
##
|
|
1
|
+
## Verification Gates Compatibility Note
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This section file is retained for compatibility with older bootstrap templates.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
**Verification Gates**:
|
|
8
|
-
1. All [x] items confirmed by Dev agent during implementation
|
|
9
|
-
2. Reviewer agent verifies checklist is 100% complete before clearing PASS verdict
|
|
10
|
-
3. Any unmet AC ([ ] remaining) marks feature as incomplete
|
|
11
|
-
|
|
12
|
-
---
|
|
5
|
+
Current section assembly renders Verification Gates only inside `task-contract.md` so the feature scope and acceptance requirements have a single source of truth.
|
|
13
6
|
|
|
7
|
+
Do not add this section separately unless you intentionally want to duplicate the gates outside the Task Contract.
|
|
@@ -31,3 +31,4 @@ You are running in **headless non-interactive mode** with a FINITE context windo
|
|
|
31
31
|
(c) Use no version constraint (e.g., `"express": "*"`)
|
|
32
32
|
- **This is a BLOCKING gate**: do NOT run `npm install` / `pip install` / `cargo build` / `go mod tidy` until ALL versions in the manifest have been verified or use open constraints
|
|
33
33
|
- Batch version lookups: query multiple packages in parallel to save time (e.g., run multiple `npm view` commands concurrently)
|
|
34
|
+
10. **Build artifact hygiene** — After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary, build directory, generated bundle, or cache directory is ignored by git before the commit phase. Never commit compiled binaries, build output, or generated artifacts.
|