prizmkit 1.1.105 → 1.1.107
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/prizmkit_runtime/gitops.py +0 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runner_bookkeeping.py +83 -12
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +93 -6
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -8
- package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +9 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +421 -61
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +102 -17
- package/bundled/dev-pipeline/scripts/continuation.py +0 -4
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +7 -39
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -31
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -31
- package/bundled/dev-pipeline/templates/agent-prompts/reviewer-review.md +5 -6
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +28 -28
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +36 -52
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +34 -54
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +1 -1
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +3 -3
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +2 -3
- package/bundled/dev-pipeline/templates/sections/log-size-awareness.md +2 -2
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +4 -9
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +4 -10
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +3 -3
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +49 -2
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +17 -0
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +50 -1
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +560 -1
- package/bundled/dev-pipeline/tests/test_unified_cli.py +208 -0
- package/bundled/skills/_metadata.json +1 -1
- package/bundled/skills/prizmkit-code-review/SKILL.md +12 -13
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +10 -10
- package/package.json +1 -1
- package/bundled/dev-pipeline/templates/agent-prompts/dev-fix.md +0 -7
- package/bundled/dev-pipeline/templates/agent-prompts/dev-resume.md +0 -5
- package/bundled/skills/prizmkit-code-review/references/dev-agent-prompt.md +0 -30
|
@@ -659,6 +659,213 @@ def test_session_live_output_prints_paths_and_verbose_cli_output(tmp_path, capsy
|
|
|
659
659
|
assert "[prizmkit] AI session finished" in captured.err
|
|
660
660
|
|
|
661
661
|
|
|
662
|
+
def test_compact_progress_line_includes_stale_and_switches_glyph(tmp_path):
|
|
663
|
+
from prizmkit_runtime.heartbeat import HeartbeatState
|
|
664
|
+
from prizmkit_runtime.sessions import _compact_progress_line
|
|
665
|
+
|
|
666
|
+
session_log = tmp_path / "session.log"
|
|
667
|
+
progress = tmp_path / "progress.json"
|
|
668
|
+
progress.write_text(
|
|
669
|
+
json.dumps(
|
|
670
|
+
{
|
|
671
|
+
"child_total_bytes": 2 * 1024 * 1024,
|
|
672
|
+
"subagent_spawn_count": 5,
|
|
673
|
+
"current_phase": "retrospective",
|
|
674
|
+
"current_tool": "Read",
|
|
675
|
+
"message_count": 465,
|
|
676
|
+
"total_tool_calls": 412,
|
|
677
|
+
}
|
|
678
|
+
),
|
|
679
|
+
encoding="utf-8",
|
|
680
|
+
)
|
|
681
|
+
running = HeartbeatState(last_seen_epoch=1.0, stale=False, details="progress", stale_seconds=0, log_size=4 * 1024 * 1024)
|
|
682
|
+
paused = HeartbeatState(last_seen_epoch=1.0, stale=False, details="no progress", stale_seconds=120, log_size=4 * 1024 * 1024)
|
|
683
|
+
|
|
684
|
+
running_line = _compact_progress_line(0, session_log, progress, running, stale_threshold_seconds=15 * 60)
|
|
685
|
+
paused_line = _compact_progress_line(0, session_log, progress, paused, stale_threshold_seconds=15 * 60)
|
|
686
|
+
|
|
687
|
+
assert "▶ [HEARTBEAT]" in running_line
|
|
688
|
+
assert "log: 4MB" in running_line
|
|
689
|
+
assert "child: 2MB/5" in running_line
|
|
690
|
+
assert "phase: retrospective" in running_line
|
|
691
|
+
assert "tool: Read" in running_line
|
|
692
|
+
assert "msgs: 465" in running_line
|
|
693
|
+
assert "412 tool calls" in running_line
|
|
694
|
+
assert "stale: 0m/15m" in running_line
|
|
695
|
+
assert "⏸ [HEARTBEAT]" in paused_line
|
|
696
|
+
assert "stale: 2m/15m" in paused_line
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
def test_heartbeat_observation_stale_accumulates_and_resets_on_progress(tmp_path):
|
|
700
|
+
from prizmkit_runtime.heartbeat import HeartbeatConfig, observe_heartbeat_state
|
|
701
|
+
|
|
702
|
+
session_log = tmp_path / "session.log"
|
|
703
|
+
progress = tmp_path / "progress.json"
|
|
704
|
+
session_log.write_text("initial\n", encoding="utf-8")
|
|
705
|
+
progress.write_text('{"current_phase":"plan","current_tool":"Read","message_count":1,"total_tool_calls":1}\n', encoding="utf-8")
|
|
706
|
+
config = HeartbeatConfig(
|
|
707
|
+
heartbeat_file=tmp_path / "heartbeat.json",
|
|
708
|
+
session_log=session_log,
|
|
709
|
+
progress_file=progress,
|
|
710
|
+
interval_seconds=60,
|
|
711
|
+
stale_after_seconds=15 * 60,
|
|
712
|
+
)
|
|
713
|
+
|
|
714
|
+
first = observe_heartbeat_state(config)
|
|
715
|
+
stale = observe_heartbeat_state(config, first)
|
|
716
|
+
progress.write_text('{"current_phase":"plan","current_tool":"Edit","message_count":1,"total_tool_calls":2,"child_total_bytes":10}\n', encoding="utf-8")
|
|
717
|
+
reset = observe_heartbeat_state(config, stale)
|
|
718
|
+
|
|
719
|
+
assert first.details == "progress"
|
|
720
|
+
assert first.stale_seconds == 0
|
|
721
|
+
assert stale.details == "no progress"
|
|
722
|
+
assert stale.stale_seconds == 60
|
|
723
|
+
assert reset.details == "progress"
|
|
724
|
+
assert reset.stale_seconds == 0
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
def test_compact_live_heartbeat_stays_out_of_primary_and_backup_logs(tmp_path, capsys, monkeypatch):
|
|
728
|
+
import prizmkit_runtime.sessions as sessions
|
|
729
|
+
|
|
730
|
+
fake_cli = tmp_path / "slow_cli.py"
|
|
731
|
+
fake_cli.write_text(
|
|
732
|
+
"#!/usr/bin/env python3\n"
|
|
733
|
+
"import time\n"
|
|
734
|
+
"print('logged-payload', flush=True)\n"
|
|
735
|
+
"time.sleep(0.45)\n",
|
|
736
|
+
encoding="utf-8",
|
|
737
|
+
)
|
|
738
|
+
fake_cli.chmod(0o755)
|
|
739
|
+
prompt = tmp_path / "prompt.md"
|
|
740
|
+
prompt.write_text("hello", encoding="utf-8")
|
|
741
|
+
session_log = tmp_path / "state" / "sessions" / "sess-heartbeat" / "logs" / "session.log"
|
|
742
|
+
backup_log = tmp_path / "home" / ".prizmkit" / "session-backups" / "sess-heartbeat.log"
|
|
743
|
+
progress = session_log.with_name("progress.json")
|
|
744
|
+
backup_text = {}
|
|
745
|
+
original_recover = sessions.recover_session_log
|
|
746
|
+
|
|
747
|
+
def spy_recover(primary, backup, min_size=1024):
|
|
748
|
+
if backup.is_file():
|
|
749
|
+
backup_text["content"] = backup.read_text(encoding="utf-8")
|
|
750
|
+
return original_recover(primary, backup, min_size)
|
|
751
|
+
|
|
752
|
+
monkeypatch.setattr(sessions, "recover_session_log", spy_recover)
|
|
753
|
+
result = sessions.AISessionLauncher(
|
|
754
|
+
sessions.AISessionConfig(
|
|
755
|
+
cli_command=str(fake_cli),
|
|
756
|
+
platform="codebuddy",
|
|
757
|
+
model=None,
|
|
758
|
+
prompt_path=prompt,
|
|
759
|
+
cwd=tmp_path,
|
|
760
|
+
log_path=session_log,
|
|
761
|
+
backup_log_path=backup_log,
|
|
762
|
+
progress_path=progress,
|
|
763
|
+
live_output=True,
|
|
764
|
+
live_progress_interval_seconds=0.1,
|
|
765
|
+
stale_kill_threshold_seconds=15 * 60,
|
|
766
|
+
)
|
|
767
|
+
).run()
|
|
768
|
+
|
|
769
|
+
captured = capsys.readouterr()
|
|
770
|
+
primary_text = session_log.read_text(encoding="utf-8")
|
|
771
|
+
assert result.exit_code == 0
|
|
772
|
+
assert "[HEARTBEAT]" in captured.err
|
|
773
|
+
assert "stale:" in captured.err
|
|
774
|
+
assert "logged-payload" in primary_text
|
|
775
|
+
assert "[HEARTBEAT]" not in primary_text
|
|
776
|
+
assert "stale:" not in primary_text
|
|
777
|
+
assert "[HEARTBEAT]" not in backup_text.get("content", "")
|
|
778
|
+
assert "stale:" not in backup_text.get("content", "")
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
def test_recovery_sessions_receive_live_heartbeat_configuration(tmp_path, monkeypatch):
|
|
782
|
+
import prizmkit_runtime.runner_recovery as runner_recovery
|
|
783
|
+
|
|
784
|
+
project = tmp_path / "project"
|
|
785
|
+
pipeline = tmp_path / "pipeline"
|
|
786
|
+
recovery_state = tmp_path / "recovery"
|
|
787
|
+
project.mkdir()
|
|
788
|
+
pipeline.mkdir()
|
|
789
|
+
recovery_state.mkdir()
|
|
790
|
+
paths = type(
|
|
791
|
+
"Paths",
|
|
792
|
+
(),
|
|
793
|
+
{"project_root": project, "pipeline_root": pipeline, "recovery_state_dir": recovery_state},
|
|
794
|
+
)()
|
|
795
|
+
captured_config = {}
|
|
796
|
+
|
|
797
|
+
monkeypatch.setattr(
|
|
798
|
+
runner_recovery,
|
|
799
|
+
"run_recovery_detect",
|
|
800
|
+
lambda _paths: (0, "{}", "", {"detected": True, "workflow_type": "feature"}),
|
|
801
|
+
)
|
|
802
|
+
monkeypatch.setattr(
|
|
803
|
+
runner_recovery,
|
|
804
|
+
"load_runtime_config",
|
|
805
|
+
lambda _paths: type(
|
|
806
|
+
"Config",
|
|
807
|
+
(),
|
|
808
|
+
{
|
|
809
|
+
"ai_client": type("Client", (), {"command": "fake-cli", "platform": "codebuddy"})(),
|
|
810
|
+
"model": "model",
|
|
811
|
+
"effort": "high",
|
|
812
|
+
},
|
|
813
|
+
)(),
|
|
814
|
+
)
|
|
815
|
+
monkeypatch.setattr(
|
|
816
|
+
runner_recovery,
|
|
817
|
+
"RunnerEnvironment",
|
|
818
|
+
type(
|
|
819
|
+
"EnvFactory",
|
|
820
|
+
(),
|
|
821
|
+
{
|
|
822
|
+
"from_env": staticmethod(
|
|
823
|
+
lambda: type(
|
|
824
|
+
"Env",
|
|
825
|
+
(),
|
|
826
|
+
{
|
|
827
|
+
"verbose": True,
|
|
828
|
+
"live_output": True,
|
|
829
|
+
"heartbeat_interval_seconds": 7,
|
|
830
|
+
"stale_kill_threshold_seconds": 42,
|
|
831
|
+
},
|
|
832
|
+
)()
|
|
833
|
+
)
|
|
834
|
+
},
|
|
835
|
+
),
|
|
836
|
+
)
|
|
837
|
+
monkeypatch.setattr(runner_recovery, "detect_stream_json_support", lambda *_args: type("Support", (), {"enabled": True})())
|
|
838
|
+
monkeypatch.setattr(
|
|
839
|
+
runner_recovery.subprocess,
|
|
840
|
+
"run",
|
|
841
|
+
lambda *_args, **_kwargs: type("Completed", (), {"returncode": 0, "stdout": "0", "stderr": ""})(),
|
|
842
|
+
)
|
|
843
|
+
monkeypatch.setattr(runner_recovery, "_recovery_outcome", lambda *_args: "no_changes")
|
|
844
|
+
|
|
845
|
+
class FakeLauncher:
|
|
846
|
+
def __init__(self, config):
|
|
847
|
+
captured_config["config"] = config
|
|
848
|
+
|
|
849
|
+
def run(self):
|
|
850
|
+
return type("Result", (), {"exit_code": 0})()
|
|
851
|
+
|
|
852
|
+
monkeypatch.setattr(runner_recovery, "AISessionLauncher", FakeLauncher)
|
|
853
|
+
|
|
854
|
+
code, stdout, stderr = runner_recovery.run_recovery(paths)
|
|
855
|
+
config = captured_config["config"]
|
|
856
|
+
|
|
857
|
+
assert code == 0
|
|
858
|
+
assert stdout == "no_changes\n"
|
|
859
|
+
assert stderr == ""
|
|
860
|
+
assert config.live_output is True
|
|
861
|
+
assert config.verbose is True
|
|
862
|
+
assert config.use_stream_json is True
|
|
863
|
+
assert config.live_progress_interval_seconds == 7
|
|
864
|
+
assert config.stale_kill_threshold_seconds == 42
|
|
865
|
+
assert config.live_banner is False
|
|
866
|
+
assert config.suppress_stream_output is True
|
|
867
|
+
|
|
868
|
+
|
|
662
869
|
def test_session_live_output_does_not_forward_cli_output_without_verbose(tmp_path, capsys):
|
|
663
870
|
from prizmkit_runtime.sessions import AISessionConfig, AISessionLauncher
|
|
664
871
|
|
|
@@ -853,6 +1060,7 @@ def test_git_branch_worktree_plans_preserve_shell_invariants(tmp_path):
|
|
|
853
1060
|
assert ensure.never_fails is True
|
|
854
1061
|
assert any(command.args[:2] == ("rebase", "--abort") for command in ensure.commands)
|
|
855
1062
|
assert any(command.args[:2] == ("add", "-A") for command in ensure.commands)
|
|
1063
|
+
assert not any(command.args[:2] == ("stash", "pop") for command in ensure.commands)
|
|
856
1064
|
assert any(".*/worktrees/**" in " ".join(command.args) for command in save_wip.commands)
|
|
857
1065
|
assert worktree.commands[0].args[:2] == ("worktree", "add")
|
|
858
1066
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "prizmkit-code-review"
|
|
3
|
-
description: "Iterative review-fix loop against spec and plan. Spawns
|
|
3
|
+
description: "Iterative review-fix loop against spec and plan. Spawns the dedicated prizm-dev-team-reviewer agent, filters findings, then the main orchestrator applies accepted fixes directly. Loops until PASS (max 3 rounds). Use after /prizmkit-implement as quality gate. Trigger on: 'review', 'check code', 'code review', 'is it ready to commit'. (project)"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# PrizmKit Code Review
|
|
7
7
|
|
|
8
|
-
An iterative review-fix loop that reviews code changes against the spec and plan, then automatically fixes issues. Uses
|
|
8
|
+
An iterative review-fix loop that reviews code changes against the spec and plan, then automatically fixes accepted issues. Uses two separated roles:
|
|
9
9
|
|
|
10
|
-
- **Reviewer Agent** (read-only): analyzes
|
|
11
|
-
- **Main Agent** (orchestrator): filters Reviewer findings for reasonableness, coordinates the loop
|
|
12
|
-
- **Dev Agent** (read-write): applies fixes for accepted findings
|
|
10
|
+
- **Reviewer Agent** (`prizm-dev-team-reviewer`, read-only): analyzes orchestrator-provided workspace context against spec goals and plan decisions, then produces structured findings
|
|
11
|
+
- **Main Agent** (orchestrator): filters Reviewer findings for reasonableness, applies accepted fixes directly in the active checkout, and coordinates the loop
|
|
13
12
|
|
|
14
13
|
The loop repeats until the Reviewer finds no issues or the max round limit is reached.
|
|
15
14
|
|
|
@@ -36,7 +35,7 @@ The loop repeats until the Reviewer finds no issues or the max round limit is re
|
|
|
36
35
|
- If `{artifact_dir}/test-report-path.txt` exists, read the path, then read that `/prizmkit-test` report.
|
|
37
36
|
- Extract `Scope`, `Generated / Updated Tests`, `In-Scope Failures`, `Baseline Failures`, `Out of Scope Gaps`, `Boundary Matrix` / `Boundary Completion Gate` when present, and `Verdict`.
|
|
38
37
|
- If `context-snapshot.md` contains `## PrizmKit Test Gate`, read that summary too.
|
|
39
|
-
- If this is a feature artifact under `.prizmkit/specs/` and no test report pointer or summary exists, pass `No scoped /prizmkit-test report found` into the Reviewer context
|
|
38
|
+
- If this is a feature artifact under `.prizmkit/specs/` and no test report pointer or summary exists, pass `No scoped /prizmkit-test report found (expected for pre-test review)` into the Reviewer context as informational scope context only. Do not ask the Reviewer to report it as a missing gate unless the calling workflow explicitly requires a prior test report.
|
|
40
39
|
4. **Read dev rules** (if configured): If `.prizmkit/prizm-docs/root.prizm` exists, read it and check for a `RULES:` line. If present, read all referenced `.prizmkit/rules/<layer>-rules.md` files. If `root.prizm` or a referenced rules file does not exist, continue with "No custom dev rules configured — use general best practices."
|
|
41
40
|
5. **Capture workspace diff**: run `git diff` (unstaged) + `git diff --cached` (staged) + `git status` to understand the full scope of changes. For new files in git status, note their paths for the Reviewer to read.
|
|
42
41
|
- If no changes are detected, skip Phase 1 and proceed to Phase 2 with verdict PASS, rounds 0, and an empty findings list. Always write `review-report.md`; downstream pipeline steps use it as the review gate.
|
|
@@ -64,12 +63,12 @@ The script is stateless — no `--reset` or runtime files. Initialize these valu
|
|
|
64
63
|
### Loop Flow
|
|
65
64
|
|
|
66
65
|
```
|
|
67
|
-
1. Spawn Reviewer Agent (
|
|
66
|
+
1. Spawn Reviewer Agent (`subagent_type: prizm-dev-team-reviewer`) → findings or PASS
|
|
68
67
|
2. Parse result:
|
|
69
68
|
- PASS → Call Loop Exit Gate → Phase 2
|
|
70
69
|
- NEEDS_FIXES → count findings → Step 3 (do not call gate yet)
|
|
71
70
|
3. Main Agent filters findings → Call Loop Exit Gate → if endLoop: Phase 2
|
|
72
|
-
4.
|
|
71
|
+
4. Main Agent applies accepted fixes directly in the active checkout
|
|
73
72
|
5. Increment round and return to Step 1
|
|
74
73
|
```
|
|
75
74
|
|
|
@@ -116,7 +115,7 @@ When Python is unavailable, apply these rules exactly — they match the script'
|
|
|
116
115
|
|
|
117
116
|
### Step 1: Spawn Reviewer Agent
|
|
118
117
|
|
|
119
|
-
Include the dev rules read in Phase 0 step
|
|
118
|
+
Include the dev rules read in Phase 0 step 4 and the workspace diff/status captured in Phase 0 step 5 in the Reviewer prompt. In Claude Code, spawn the dedicated PrizmKit Reviewer with `subagent_type: prizm-dev-team-reviewer` and `run_in_background=false`. Do not route the PrizmKit reviewer flow through `Explore` or a generic code-explorer agent. If the current platform has no dedicated Reviewer agent, perform the review pass in the Main Agent without editing files during that pass. Read `${SKILL_DIR}/references/reviewer-agent-prompt.md` for the full prompt template — fill `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning.
|
|
120
119
|
|
|
121
120
|
Round context varies by round:
|
|
122
121
|
- Round 1: "This is the first review. Examine all changes comprehensively."
|
|
@@ -138,16 +137,16 @@ Review each finding and decide whether it's reasonable. This prevents unnecessar
|
|
|
138
137
|
- Would fixing this improve the code without introducing risk? (Reject fixes that require large refactors outside scope.)
|
|
139
138
|
|
|
140
139
|
**Output per finding:**
|
|
141
|
-
- **Accepted**: The finding is reasonable —
|
|
140
|
+
- **Accepted**: The finding is reasonable — queue it for direct Main Agent fix work.
|
|
142
141
|
- **Rejected** (with reason): Brief explanation (e.g., "Out of scope", "Style preference, not a defect").
|
|
143
142
|
|
|
144
143
|
After filtering: call the **Loop Exit Gate** with `{"reviewer_result": "NEEDS_FIXES", "accepted_count": <N>, "findings_count": <total findings this round>, "round": <current_round>, "findings_history": <current_history>, "max_rounds": 3, "filtering_done": true}`. If `endLoop=true`, proceed to Phase 2.
|
|
145
144
|
|
|
146
|
-
### Step 4:
|
|
145
|
+
### Step 4: Main Agent Applies Accepted Fixes
|
|
147
146
|
|
|
148
|
-
|
|
147
|
+
Do not spawn a Dev Agent or any review-fix developer subagent. The Main Agent applies accepted findings directly in the active checkout, using the spec context and filtered findings as the fix list. If an accepted finding cannot be safely fixed within scope, record the reason and carry it into `review-report.md` as unresolved.
|
|
149
148
|
|
|
150
|
-
After
|
|
149
|
+
After direct fixes are complete, record results and return to Step 1 for the next round.
|
|
151
150
|
|
|
152
151
|
## Phase 2: Output
|
|
153
152
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Reviewer Agent Prompt Template
|
|
2
2
|
|
|
3
|
-
Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning the
|
|
3
|
+
Used in Phase 1 Step 1 of `/prizmkit-code-review`. The orchestrator fills `{goals}`, `{plan decisions}`, `{scoped test report}`, `{workspace context}`, `{dev rules}`, `{round N}`, and `{round_context}` before spawning the dedicated `prizm-dev-team-reviewer` agent.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
You are
|
|
6
|
+
You are the dedicated PrizmKit Reviewer agent (`prizm-dev-team-reviewer`). Review workspace changes against the spec goals, plan decisions, scoped test evidence, and per-layer dev rules. Do not modify files and do not apply fixes; the Main Agent will filter findings and apply accepted fixes directly.
|
|
7
7
|
|
|
8
8
|
## Spec Goals
|
|
9
9
|
{goals and acceptance criteria from spec.md}
|
|
@@ -12,7 +12,10 @@ You are a code reviewer. Review workspace changes against the spec goals, plan d
|
|
|
12
12
|
{architecture decisions and task list from plan.md}
|
|
13
13
|
|
|
14
14
|
## Scoped Test Report
|
|
15
|
-
{summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a feature artifact, write "No scoped /prizmkit-test report found."}
|
|
15
|
+
{summary from artifact_dir/test-report-path.txt and test-report.md, including Scope, Generated / Updated Tests, In-Scope Failures, Baseline Failures, Out of Scope Gaps, Boundary Matrix / Boundary Completion Gate if present, and Verdict. If no scoped report exists for a feature artifact, write "No scoped /prizmkit-test report found (expected for pre-test review)." Treat that absence as informational unless the calling workflow explicitly requires a prior test report.}
|
|
16
|
+
|
|
17
|
+
## Workspace Context
|
|
18
|
+
{git status, unstaged diff summary, staged diff summary, and new-file paths captured by the Main Agent in Phase 0. Use this context as the review scope; request targeted file context only when needed instead of re-running broad discovery.}
|
|
16
19
|
|
|
17
20
|
## Dev Rules (per-layer conventions)
|
|
18
21
|
{rules from .prizmkit/rules/<layer>-rules.md, or "No custom dev rules configured — use general best practices."}
|
|
@@ -21,13 +24,10 @@ You are a code reviewer. Review workspace changes against the spec goals, plan d
|
|
|
21
24
|
Round {N}. {round_context}
|
|
22
25
|
|
|
23
26
|
## What to Review
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
For new files shown in git status, read their full content.
|
|
30
|
-
For modified files, read enough surrounding context to understand the change.
|
|
27
|
+
Use the orchestrator-provided workspace context as the source of truth for changed files:
|
|
28
|
+
- For new files listed in workspace status, read their full content.
|
|
29
|
+
- For modified files, read enough surrounding context to understand the change.
|
|
30
|
+
- Do not edit files, stage changes, run test suites, or spawn other agents.
|
|
31
31
|
|
|
32
32
|
## Review Dimensions
|
|
33
33
|
Evaluate the changes across these dimensions (focus on what's relevant):
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"Read {{DEV_SUBAGENT_PATH}}. Fix NEEDS_FIXES issues for feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
2
|
-
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/review-report.md` — contains structured Fix Instructions with exact steps.
|
|
3
|
-
2. Follow Fix Instructions in order (respect Depends On / Blocks dependencies). Each FIX-N has: Root Cause, Fix Strategy, Code Guidance, and Verification criteria.
|
|
4
|
-
3. After each fix, run the Verification command listed in that FIX-N to confirm it works.
|
|
5
|
-
4. Run `{{TEST_CMD}}` to verify no regressions.
|
|
6
|
-
5. Append fix summary to '## Implementation Log' in context-snapshot.md.
|
|
7
|
-
6. Do NOT execute any git commands."
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"Read {{DEV_SUBAGENT_PATH}}. You are resuming implementation of feature {{FEATURE_ID}} (slug: {{FEATURE_SLUG}}).
|
|
2
|
-
1. Read `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` — Section 4 has File Manifest, 'Implementation Log' (if present) shows what was already done.
|
|
3
|
-
2. Run `git diff HEAD` to see actual code changes already made.
|
|
4
|
-
3. Run `/prizmkit-implement` to complete the remaining `[ ]` tasks. Run tests with: `{{TEST_CMD}}`.
|
|
5
|
-
4. Do NOT execute any git commands."
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Dev Agent Prompt Template
|
|
2
|
-
|
|
3
|
-
Used in Phase 1 Step 4 of `/prizmkit-code-review`. The orchestrator fills `{spec context}` and `{accepted findings}` before spawning the Dev Agent.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
You are a developer fixing code review findings. Apply each fix carefully without breaking existing functionality.
|
|
7
|
-
|
|
8
|
-
## Spec Context
|
|
9
|
-
{goals from spec.md for reference}
|
|
10
|
-
|
|
11
|
-
## Findings to Fix
|
|
12
|
-
{accepted findings list — each with Severity, Location, Problem, Suggestion, Verification}
|
|
13
|
-
|
|
14
|
-
## Instructions
|
|
15
|
-
1. Read each finding carefully.
|
|
16
|
-
2. For each finding:
|
|
17
|
-
a. Read the relevant code and understand the context.
|
|
18
|
-
b. Implement the fix based on the suggestion.
|
|
19
|
-
c. If a suggestion is not feasible (would break other functionality, technically impossible), explain why.
|
|
20
|
-
3. After all fixes, report what you did.
|
|
21
|
-
|
|
22
|
-
## Output Format
|
|
23
|
-
For each finding, report:
|
|
24
|
-
- **Finding N**: [fixed | unable-to-fix]
|
|
25
|
-
- **What was done**: Brief description
|
|
26
|
-
- **Files modified**: List of changed files
|
|
27
|
-
(If unable-to-fix, explain why)
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
After the Dev Agent returns, record results and return to Step 1 for the next round.
|