prizmkit 1.1.119 → 1.1.121
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/bin/create-prizmkit.js +1 -5
- package/bundled/VERSION.json +3 -3
- package/bundled/dev-pipeline/README.md +41 -38
- package/bundled/dev-pipeline/assets/skill-subagent-integration.md +76 -0
- package/bundled/dev-pipeline/prizmkit_runtime/config.py +2 -8
- package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +1 -1
- package/bundled/dev-pipeline/prizmkit_runtime/platform_detection.py +3 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +23 -25
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +8 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +10 -1
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +88 -32
- package/bundled/dev-pipeline/prizmkit_runtime/sessions.py +28 -6
- package/bundled/dev-pipeline/scripts/continuation.py +51 -6
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +60 -102
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +1 -19
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +1 -19
- package/bundled/dev-pipeline/scripts/{init-dev-team.py → init-change-artifact.py} +6 -16
- package/bundled/dev-pipeline/scripts/parse-stream-progress.py +364 -76
- package/bundled/dev-pipeline/scripts/update-bug-status.py +57 -14
- package/bundled/dev-pipeline/scripts/update-feature-status.py +54 -5
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +57 -14
- package/bundled/dev-pipeline/scripts/utils.py +1 -1
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +2 -2
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +9 -11
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +2 -1
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +1 -1
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -1
- package/bundled/dev-pipeline/templates/sections/critical-paths-full.md +0 -2
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -1
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +6 -7
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +6 -7
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +4 -2
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +5 -3
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +20 -0
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
- package/bundled/dev-pipeline/tests/test_auto_skip.py +5 -5
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +214 -144
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +25 -12
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +11 -14
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +235 -32
- package/bundled/dev-pipeline/tests/test_unified_cli.py +219 -16
- package/bundled/skills/_metadata.json +4 -4
- package/bundled/skills/app-planner/SKILL.md +2 -2
- package/bundled/skills/app-planner/references/architecture-decisions.md +1 -3
- package/bundled/skills/prizmkit-code-review/SKILL.md +50 -47
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +13 -8
- package/bundled/skills/prizmkit-code-review/references/reviewer-agent-prompt.md +47 -33
- package/bundled/skills/prizmkit-code-review/references/reviewer-workspace-protocol.md +90 -0
- package/bundled/skills/prizmkit-implement/SKILL.md +21 -1
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +67 -0
- package/bundled/skills/prizmkit-test/SKILL.md +159 -155
- package/bundled/skills/prizmkit-test/assets/authoritative-records.schema.json +420 -0
- package/bundled/skills/prizmkit-test/assets/behavior-risk-matrix.schema.json +116 -0
- package/bundled/skills/prizmkit-test/assets/evidence-manifest.schema.json +112 -0
- package/bundled/skills/prizmkit-test/assets/evidence-package-template.json +97 -0
- package/bundled/skills/prizmkit-test/references/boundary-coverage-protocol.md +76 -192
- package/bundled/skills/prizmkit-test/references/contract-mock-protocol.md +65 -0
- package/bundled/skills/prizmkit-test/references/evidence-protocol.md +194 -0
- package/bundled/skills/prizmkit-test/references/evidence-request-protocol.md +78 -0
- package/bundled/skills/prizmkit-test/references/examples.md +65 -108
- package/bundled/skills/prizmkit-test/references/service-boundary-test-catalog.md +10 -7
- package/bundled/skills/prizmkit-test/references/test-generation-steps.md +90 -82
- package/bundled/skills/prizmkit-test/references/test-report-template.md +77 -98
- package/bundled/skills/prizmkit-test/references/trusted-evidence-execution.md +97 -0
- package/bundled/skills/prizmkit-test/scripts/build_test_evidence.py +723 -0
- package/bundled/skills/prizmkit-test/scripts/validate_test_evidence.py +1426 -0
- package/package.json +1 -1
- package/src/clean.js +12 -8
- package/src/config.js +24 -42
- package/src/index.js +1 -10
- package/src/manifest.js +3 -9
- package/src/metadata.js +0 -26
- package/src/prompts.js +0 -13
- package/src/scaffold.js +76 -201
- package/src/upgrade.js +16 -33
- package/bundled/adapters/claude/agent-adapter.js +0 -96
- package/bundled/adapters/claude/team-adapter.js +0 -183
- package/bundled/adapters/codebuddy/agent-adapter.js +0 -42
- package/bundled/adapters/codebuddy/team-adapter.js +0 -46
- package/bundled/adapters/codex/agent-adapter.js +0 -38
- package/bundled/adapters/codex/team-adapter.js +0 -37
- package/bundled/agents/prizm-dev-team-dev.md +0 -123
- package/bundled/agents/prizm-dev-team-reviewer.md +0 -113
- package/bundled/dev-pipeline/assets/prizm-dev-team-integration.md +0 -65
- package/bundled/dev-pipeline/templates/bootstrap-tier1.md +0 -436
- package/bundled/dev-pipeline/templates/bootstrap-tier2.md +0 -510
- package/bundled/skills/prizmkit-test/scripts/validate_boundary_report.py +0 -347
- package/bundled/team/prizm-dev-team.json +0 -27
|
@@ -1,436 +0,0 @@
|
|
|
1
|
-
# Dev-Pipeline Session Bootstrap — Tier 1 (Single Agent)
|
|
2
|
-
|
|
3
|
-
## Session Context
|
|
4
|
-
|
|
5
|
-
- **Feature ID**: {{FEATURE_ID}} | **Session**: {{SESSION_ID}} | **Run**: {{RUN_ID}}
|
|
6
|
-
- **Complexity**: {{COMPLEXITY}}
|
|
7
|
-
- **Init**: {{INIT_DONE}} | Artifacts: spec={{HAS_SPEC}} plan={{HAS_PLAN}}
|
|
8
|
-
|
|
9
|
-
## Your Mission
|
|
10
|
-
|
|
11
|
-
You are the **session orchestrator**. Implement Feature {{FEATURE_ID}}: "{{FEATURE_TITLE}}".
|
|
12
|
-
|
|
13
|
-
**CRITICAL**: You MUST NOT exit until ALL work is complete and committed.
|
|
14
|
-
|
|
15
|
-
**Tier 1 — Single Agent**: You handle everything directly. No normal work subagents. No TeamCreate.
|
|
16
|
-
|
|
17
|
-
### Feature Description
|
|
18
|
-
|
|
19
|
-
{{FEATURE_DESCRIPTION}}
|
|
20
|
-
|
|
21
|
-
{{USER_CONTEXT}}
|
|
22
|
-
|
|
23
|
-
### Acceptance Criteria
|
|
24
|
-
|
|
25
|
-
{{ACCEPTANCE_CRITERIA}}
|
|
26
|
-
|
|
27
|
-
### Project Brief
|
|
28
|
-
|
|
29
|
-
> Product ideas checklist from planning. Lines marked [x] are already implemented. When your feature touches any [ ] item, ensure alignment. After implementation, mark relevant items [x] and append the key file/directory paths.
|
|
30
|
-
|
|
31
|
-
{{PROJECT_BRIEF}}
|
|
32
|
-
|
|
33
|
-
### Dependencies (Already Completed)
|
|
34
|
-
|
|
35
|
-
{{COMPLETED_DEPENDENCIES}}
|
|
36
|
-
|
|
37
|
-
### App Global Context
|
|
38
|
-
|
|
39
|
-
{{GLOBAL_CONTEXT}}
|
|
40
|
-
|
|
41
|
-
## ⚠️ Context Budget Rules (CRITICAL — read before any phase)
|
|
42
|
-
|
|
43
|
-
You are running in **headless non-interactive mode** with a FINITE context window. Exceeding it will crash the session and lose all work. Follow these rules strictly:
|
|
44
|
-
|
|
45
|
-
0. **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.
|
|
46
|
-
|
|
47
|
-
1. **context-snapshot.md is your single source of truth** — After Phase 1 builds it, ALWAYS read context-snapshot.md instead of re-reading individual source files
|
|
48
|
-
2. **Never re-read your own writes** — After you create/modify a file, do NOT read it back to verify. Trust your write was correct.
|
|
49
|
-
3. **Never re-read unmodified files** — Once you have read a file into context, do NOT read it again unless it was modified by an Edit/Write operation after your last read. Use platform file/search tools for targeted lookup; when shell-free helper lookup is needed, run `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<pattern>" --json`, then read only the smallest bounded range with the platform file-reading tool instead of full-file Read. Before issuing a Read, ask yourself: "Have I read this file before, and has it changed since?" If the answer is "no, it hasn't changed" — do NOT read it. This applies to all files including those summarized in context-snapshot.md Section 4. Reviewer subagents must receive context-snapshot.md and rely on it rather than independently re-reading the same files the orchestrator already read.
|
|
50
|
-
4. **Stay focused** — Do NOT explore code unrelated to this feature. No curiosity-driven reads.
|
|
51
|
-
4. **One task at a time** — In Phase 3 (implement), complete and test one task before starting the next.
|
|
52
|
-
5. **Minimize tool output** — Never load full command output into context. First capture command output to a temp file using the command/tool output option or the host-appropriate redirection, then inspect only the final relevant lines and use targeted search helpers to extract the information needed for the current task. Only read the filtered result — never the raw full output.
|
|
53
|
-
6. **No intermediate commits** — Do NOT run `git add`/`git commit` during Phase 1-3. All changes are committed once at the end in Phase 4 via `/prizmkit-committer`.
|
|
54
|
-
7. **Capture test output once** — When running test suites, capture output once to `/tmp/test-out.txt` using the command/tool output option or the host-appropriate redirection, surface only the final relevant lines, then search `/tmp/test-out.txt` for details. Never re-run the suite just to apply a different filter.
|
|
55
|
-
9. **Package version verification (BLOCKING)** — Before writing ANY dependency version, verify it exists via registry query (`npm view <pkg> dist-tags.latest`, `pip index versions <pkg>`, etc.). NEVER guess version numbers.
|
|
56
|
-
10. **Build artifact hygiene** — After build/compile, ensure output is in `.gitignore`. Never commit binaries/build output.
|
|
57
|
-
11. **Read offset safety (BLOCKING)** — If Read returns "shorter than offset"/"File is empty"/"Wasted call" — do NOT retry same offset. Use the platform file-reading tool to refresh bounded line information, or locate an anchor with `{{RUNTIME_HELPER_CMD}} text search <file> --pattern "<anchor>" --json` before reading a small bounded range. 2 consecutive offset errors → STOP Reading that file. Never guess offsets or prescribe POSIX-only lookup commands.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## PrizmKit Directory Convention
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
|
|
65
|
-
.prizmkit/specs/{{FEATURE_SLUG}}/plan.md ← includes Tasks section
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Execution
|
|
71
|
-
|
|
72
|
-
{{IF_INIT_NEEDED}}
|
|
73
|
-
### Phase 0: Project Bootstrap
|
|
74
|
-
- Run `/prizmkit-init` (invoke the prizmkit-init skill)
|
|
75
|
-
- Run `{{PYTHON_CMD}} {{INIT_SCRIPT_PATH}} --project-root {{PROJECT_ROOT}} --feature-id {{FEATURE_ID}} --feature-slug {{FEATURE_SLUG}}`
|
|
76
|
-
- **CP-0**: Verify `.prizmkit/prizm-docs/root.prizm`, `.prizmkit/config.json` exist
|
|
77
|
-
{{END_IF_INIT_NEEDED}}
|
|
78
|
-
{{IF_INIT_DONE}}
|
|
79
|
-
### Phase 0: SKIP (already initialized)
|
|
80
|
-
{{END_IF_INIT_DONE}}
|
|
81
|
-
|
|
82
|
-
### Phase 1: Build Context Snapshot
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
If MISSING — build it now:
|
|
89
|
-
1. Read `.prizmkit/prizm-docs/root.prizm` and relevant L1 prizm docs
|
|
90
|
-
2. Detect source code directories from KEY_FILES and STRUCTURE sections in `root.prizm`; if root docs are unavailable, use the helper to list likely source files:
|
|
91
|
-
```bash
|
|
92
|
-
{{RUNTIME_HELPER_CMD}} artifact source-files . --json
|
|
93
|
-
```
|
|
94
|
-
Identify the top-level source directories from the helper output.
|
|
95
|
-
3. Scan the detected source directories for files related to this feature; read each one
|
|
96
|
-
4. Write `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md`:
|
|
97
|
-
- **Section 1 — Feature Brief**: feature description + acceptance criteria (copy from above)
|
|
98
|
-
- **Section 2 — Project Structure**: run the helper to get a visual directory tree, then paste output:
|
|
99
|
-
```bash
|
|
100
|
-
{{RUNTIME_HELPER_CMD}} artifact tree . --max-depth 2
|
|
101
|
-
```
|
|
102
|
-
- **Section 3 — Prizm Context**: content of root.prizm and relevant L1/L2 docs
|
|
103
|
-
- **Section 4 — Existing Source Files**: **full verbatim content** of each related file in fenced code blocks (with `### path/to/file` heading and line count). Include ALL files needed for implementation and review — downstream phases read this section instead of re-reading individual source files
|
|
104
|
-
- **Section 5 — Existing Tests**: full content of related test files as code block
|
|
105
|
-
|
|
106
|
-
### Phase 2: Plan & Tasks
|
|
107
|
-
|
|
108
|
-
```bash
|
|
109
|
-
{{RUNTIME_HELPER_CMD}} artifact exists .prizmkit/specs/{{FEATURE_SLUG}}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
If plan.md missing, run `/prizmkit-plan` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` to generate `plan.md`:
|
|
113
|
-
- The plan.md should include: key components, data flow, files to create/modify, and a Tasks section with `[ ]` checkboxes (each task = one implementable unit). Keep under 80 lines.
|
|
114
|
-
- Resolve uncertain requirements from the feature description, existing code, and conservative existing-project patterns.
|
|
115
|
-
|
|
116
|
-
**Database Design Gate** (if feature involves data persistence — new tables, schema changes, new entities):
|
|
117
|
-
Before proceeding past CP-1:
|
|
118
|
-
1. Scan for existing schema files (`*.prisma`, `*.sql`, `migrations/`, `models/`, `*.entity.*`) and read them
|
|
119
|
-
2. Ensure new tables/fields follow existing naming conventions and constraint patterns
|
|
120
|
-
3. Resolve all uncertain DB design decisions before writing Tasks — document choices in plan.md
|
|
121
|
-
|
|
122
|
-
**CP-1**: plan.md exists with Tasks section.
|
|
123
|
-
|
|
124
|
-
### Phase 3: Implement
|
|
125
|
-
|
|
126
|
-
**Build artifacts**: After any build/compile command (`go build`, `npm run build`, `tsc`, etc.), ensure the output binary or build directory is in `.gitignore`:
|
|
127
|
-
```bash
|
|
128
|
-
# Example for Go
|
|
129
|
-
{{RUNTIME_HELPER_CMD}} text contains .gitignore --pattern "/binary-name" --found-marker IGNORED --missing-marker NEEDS_IGNORE_ENTRY
|
|
130
|
-
```
|
|
131
|
-
If the helper prints `NEEDS_IGNORE_ENTRY`, edit `.gitignore` and add `/binary-name` as a single line. Never commit compiled binaries, build output, or generated artifacts.
|
|
132
|
-
|
|
133
|
-
**3a.** Run `/prizmkit-implement` — this handles the implementation cycle:
|
|
134
|
-
- Reads plan.md Tasks section from `.prizmkit/specs/{{FEATURE_SLUG}}/`
|
|
135
|
-
- Reads context from `context-snapshot.md` (Prizm docs, TRAPS, file manifest)
|
|
136
|
-
- Implements task-by-task, marking each `[x]` immediately
|
|
137
|
-
- Creates/updates L2 `.prizm` docs when creating new modules or significantly modifying existing ones — AI selectively decides which modules warrant L2 based on complexity and importance
|
|
138
|
-
- Does not run the scoped/full test gate; testing happens after code review in the PrizmKit Test phase
|
|
139
|
-
- Writes '## Implementation Log' to `context-snapshot.md`
|
|
140
|
-
|
|
141
|
-
**3b.** After implement completes, verify:
|
|
142
|
-
1. All tasks in plan.md are `[x]`
|
|
143
|
-
2. **Verification Gate Self-Check**: for each acceptance criterion, write one line of evidence (test name / file:line / fixture path). Any gate without evidence is BLOCKED, not success.
|
|
144
|
-
3. Use only tiny targeted checks when needed for local debugging; the scoped feature test gate runs after review.
|
|
145
|
-
4. If any criterion is not met, fix it within this feature scope before proceeding.
|
|
146
|
-
|
|
147
|
-
**CP-2**: All acceptance criteria met or blocked gates documented in `failure-log.md`. Test execution is deferred until after code review.
|
|
148
|
-
|
|
149
|
-
### Review — Code Review
|
|
150
|
-
|
|
151
|
-
Review the completed implementation before the scoped feature test gate runs. Use `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` so the code-review skill can read spec, plan, context snapshot, implementation log, and current diff artifacts. Do not require or read a prior `/prizmkit-test` report here; test generation and test-fix looping happen in the next phase.
|
|
152
|
-
|
|
153
|
-
Run `/prizmkit-code-review` with `artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/`.
|
|
154
|
-
|
|
155
|
-
The skill runs an internal review-fix loop (Reviewer Agent → filter → orchestrator fix, max 3 rounds) and writes `review-report.md` to the artifact directory.
|
|
156
|
-
|
|
157
|
-
**Gate Check — Review Report**:
|
|
158
|
-
After `/prizmkit-code-review` returns, verify the review report:
|
|
159
|
-
```bash
|
|
160
|
-
{{RUNTIME_HELPER_CMD}} text contains .prizmkit/specs/{{FEATURE_SLUG}}/review-report.md --pattern "## Verdict"
|
|
161
|
-
```
|
|
162
|
-
If GATE:MISSING:
|
|
163
|
-
- Do not re-run `/prizmkit-code-review` in an unbounded report-repair loop.
|
|
164
|
-
- Perform one bounded status check; retry at most once: inspect the skill output, `review-report.md` path, and any Reviewer agent spawn messages.
|
|
165
|
-
- If the missing report is caused by Reviewer agent spawn or review skill error, retry `/prizmkit-code-review` at most once only if it appears transient.
|
|
166
|
-
- 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.
|
|
167
|
-
|
|
168
|
-
Read `review-report.md` and check the Verdict:
|
|
169
|
-
- `PASS` → proceed to next phase
|
|
170
|
-
- `NEEDS_FIXES` → the skill exhausted its max rounds; log the remaining findings and proceed (do not retry externally)
|
|
171
|
-
|
|
172
|
-
**CP-3**: Review complete, report written.
|
|
173
|
-
|
|
174
|
-
### Scoped Feature Test Gate — PrizmKit Test
|
|
175
|
-
|
|
176
|
-
Run `/prizmkit-test scope=this-change artifact_dir=.prizmkit/specs/{{FEATURE_SLUG}}/` after review and before commit.
|
|
177
|
-
|
|
178
|
-
Before invoking the skill, create a current-run marker so stale reports are ignored:
|
|
179
|
-
```bash
|
|
180
|
-
{{RUNTIME_HELPER_CMD}} artifact ensure-dir .prizmkit/specs/{{FEATURE_SLUG}}
|
|
181
|
-
{{RUNTIME_HELPER_CMD}} artifact touch .prizmkit/specs/{{FEATURE_SLUG}}/.prizmkit-test-started
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
Gate requirements:
|
|
185
|
-
- Generate or update tests only for this feature's changed files, changed public interfaces, and acceptance criteria.
|
|
186
|
-
- Do NOT use `.prizmkit/bugfix/` or `.prizmkit/refactor/` artifact directories.
|
|
187
|
-
- Record unrelated historical gaps under `Out of Scope Gaps`; do not generate tests for them and do not fail this feature because of them.
|
|
188
|
-
- Accept only a current-run `.prizmkit/test/*/test-report.md` whose `Scope` mode is `this-change`, whose `Artifact Dir` matches `.prizmkit/specs/{{FEATURE_SLUG}}/`, whose `Verdict` is `PASS`, whose `Boundary Completion Gate` reports `Completion gate passed: yes` with zero `Boundary-missing` and zero `Happy-path-only`, and whose `Boundary Validation` result is `passed`.
|
|
189
|
-
- Only after a valid `PASS`, write the report path to `.prizmkit/specs/{{FEATURE_SLUG}}/test-report-path.txt` and append a 3-5 bullet `## PrizmKit Test Gate` summary to `context-snapshot.md`.
|
|
190
|
-
- If the report verdict is `NEEDS_FIXES`, fix in-scope implementation/test issues and rerun `/prizmkit-test`. If the report is `BLOCKED`, missing, stale, or for the wrong scope/artifact dir, write `failure-log.md` and stop for recovery.
|
|
191
|
-
|
|
192
|
-
{{IF_BROWSER_INTERACTION}}
|
|
193
|
-
### Phase 3.5: Browser Verification — MANDATORY
|
|
194
|
-
|
|
195
|
-
You MUST execute this phase. Do NOT skip it.
|
|
196
|
-
|
|
197
|
-
**Browser Tool**: {{BROWSER_TOOL}}
|
|
198
|
-
|
|
199
|
-
{{IF_BROWSER_TOOL_PLAYWRIGHT}}
|
|
200
|
-
**Using: playwright-cli**
|
|
201
|
-
|
|
202
|
-
**CRITICAL CONSTRAINT — playwright-cli ONLY, NO Playwright MCP**:
|
|
203
|
-
- You MUST use `playwright-cli` (the CLI tool) for ALL browser interactions in this phase
|
|
204
|
-
- **NEVER** use Playwright MCP server, Playwright MCP tools, or any MCP-based browser automation
|
|
205
|
-
- If you have Playwright MCP configured, IGNORE it entirely — use the CLI command `playwright-cli` exclusively
|
|
206
|
-
- All browser actions go through `playwright-cli <command>` in the Bash tool, not through any MCP tool call
|
|
207
|
-
|
|
208
|
-
**Step 0 — Playwright CLI Readiness Check (BLOCKING — must pass before any browser action)**:
|
|
209
|
-
|
|
210
|
-
0a. Check if `playwright-cli` is installed:
|
|
211
|
-
```bash
|
|
212
|
-
{{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
|
|
213
|
-
```
|
|
214
|
-
If output is `NOT_INSTALLED`, install it:
|
|
215
|
-
```bash
|
|
216
|
-
npm install -g @playwright/cli@latest
|
|
217
|
-
```
|
|
218
|
-
Then verify installation succeeded: `{{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version`. If installation fails, log `## Browser Verification: SKIPPED — playwright-cli installation failed` in context-snapshot.md and proceed to the next phase.
|
|
219
|
-
|
|
220
|
-
0b. Learn playwright-cli usage (run once per session):
|
|
221
|
-
```bash
|
|
222
|
-
playwright-cli --help
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
0c. Check if playwright-cli skill is installed for the current AI platform:
|
|
226
|
-
```bash
|
|
227
|
-
{{RUNTIME_HELPER_CMD}} platform skill playwright-cli --prefix
|
|
228
|
-
```
|
|
229
|
-
If `SKILL_MISSING`: run `playwright-cli install --skills`. If current platform is NOT claude, copy the installed skill from the Claude user skills directory to the path shown by the helper output for the current platform.
|
|
230
|
-
|
|
231
|
-
0d. Read the installed playwright-cli skill (SKILL.md) for workflow guidance. Use its recommended patterns to construct your verification flow.
|
|
232
|
-
|
|
233
|
-
**Step 1 — Start Dev Server**:
|
|
234
|
-
|
|
235
|
-
You know this project's tech stack. Detect and start the dev server yourself:
|
|
236
|
-
|
|
237
|
-
1. Identify the dev server start command from project config (`package.json` scripts, `Makefile`, `docker-compose.yml`, etc.)
|
|
238
|
-
2. Determine the dev server port from the pre-detected pipeline value (`{{DEV_PORT}}`) or project config. Do NOT hardcode or guess the port. Record it as `DEV_PORT` in your notes.
|
|
239
|
-
3. Verify the port is available:
|
|
240
|
-
```bash
|
|
241
|
-
{{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}
|
|
242
|
-
```
|
|
243
|
-
4. Start the dev server in background, capture PID:
|
|
244
|
-
```bash
|
|
245
|
-
{{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>
|
|
246
|
-
```
|
|
247
|
-
5. Wait for server to be ready: run `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:{{DEV_PORT}} --timeout 30 --interval 2`
|
|
248
|
-
6. Open the app in playwright-cli: `playwright-cli open http://localhost:{{DEV_PORT}}`
|
|
249
|
-
7. If the page requires authentication, use playwright-cli to register a test user and log in first
|
|
250
|
-
|
|
251
|
-
**Step 2 — Verification**:
|
|
252
|
-
|
|
253
|
-
Use `playwright-cli snapshot` on the running app to discover actual element refs, then verify these goals:
|
|
254
|
-
{{BROWSER_VERIFY_STEPS}}
|
|
255
|
-
|
|
256
|
-
Construct your verification workflow based on: (1) the playwright-cli skill documentation, (2) the `--help` output, (3) the current task's acceptance criteria. Decide the concrete playwright-cli actions yourself. Take a final screenshot: `playwright-cli screenshot`.
|
|
257
|
-
|
|
258
|
-
**Step 3 — Cleanup (REQUIRED — you started it, you stop it)**:
|
|
259
|
-
|
|
260
|
-
1. Close the playwright-cli browser: `playwright-cli close`
|
|
261
|
-
2. Kill the dev server process: `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
|
|
262
|
-
3. Verify port is released: `{{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}`
|
|
263
|
-
{{END_IF_BROWSER_TOOL_PLAYWRIGHT}}
|
|
264
|
-
{{IF_BROWSER_TOOL_OPENCLI}}
|
|
265
|
-
**Using: opencli** (reuses Chrome logged-in sessions)
|
|
266
|
-
|
|
267
|
-
**CRITICAL CONSTRAINT — opencli browser ONLY**:
|
|
268
|
-
- You MUST use `opencli browser` for ALL browser interactions in this phase
|
|
269
|
-
- All browser actions go through `opencli browser <command>` in the Bash tool
|
|
270
|
-
|
|
271
|
-
**Step 0 — OpenCLI Readiness Check (BLOCKING)**:
|
|
272
|
-
|
|
273
|
-
0a. Check if `opencli` is installed:
|
|
274
|
-
```bash
|
|
275
|
-
{{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
|
|
276
|
-
```
|
|
277
|
-
If `NOT_INSTALLED`: `npm install -g @jackwener/opencli@latest`. If installation fails, log `## Browser Verification: SKIPPED — opencli installation failed` and proceed.
|
|
278
|
-
|
|
279
|
-
0b. Verify Browser Bridge: `opencli doctor`. If fails, log skip and proceed.
|
|
280
|
-
|
|
281
|
-
0c. Learn usage: `opencli browser --help`
|
|
282
|
-
|
|
283
|
-
**Step 1 — Start Dev Server**:
|
|
284
|
-
1. Determine `DEV_PORT` from the pipeline value (`{{DEV_PORT}}`) or project config; do not guess.
|
|
285
|
-
2. Verify port available: `{{RUNTIME_HELPER_CMD}} port check <DEV_PORT>`
|
|
286
|
-
3. Start server: `{{RUNTIME_HELPER_CMD}} process start --pid-file .prizmkit/state/browser-dev-server.pid -- <start-command tokens>`
|
|
287
|
-
4. Wait for ready: `{{RUNTIME_HELPER_CMD}} web wait-ready --url http://localhost:<DEV_PORT> --timeout 30 --interval 2`
|
|
288
|
-
5. Open: `opencli browser open http://localhost:<DEV_PORT>`; then inspect: `opencli browser state`
|
|
289
|
-
|
|
290
|
-
**Step 2 — Verification**:
|
|
291
|
-
|
|
292
|
-
Use `opencli browser state` to discover elements with `[N]` indices, then verify:
|
|
293
|
-
{{BROWSER_VERIFY_STEPS}}
|
|
294
|
-
|
|
295
|
-
Run page-changing commands sequentially, then run `opencli browser state` to refresh indices.
|
|
296
|
-
|
|
297
|
-
**Step 3 — Cleanup**:
|
|
298
|
-
1. `opencli browser close`
|
|
299
|
-
2. `{{RUNTIME_HELPER_CMD}} process cleanup-pid <pid-from-.prizmkit/state/browser-dev-server.pid>`
|
|
300
|
-
3. `{{RUNTIME_HELPER_CMD}} port check {{DEV_PORT}}`
|
|
301
|
-
{{END_IF_BROWSER_TOOL_OPENCLI}}
|
|
302
|
-
{{IF_BROWSER_TOOL_AUTO}}
|
|
303
|
-
**Tool Selection**: Choose the best browser tool at runtime.
|
|
304
|
-
|
|
305
|
-
**Step 0 — Detect available tools**:
|
|
306
|
-
```bash
|
|
307
|
-
{{RUNTIME_HELPER_CMD}} executable version playwright-cli --arg=--version
|
|
308
|
-
{{RUNTIME_HELPER_CMD}} executable version opencli --arg=--version
|
|
309
|
-
```
|
|
310
|
-
If opencli is installed, run `opencli doctor`. If it fails, mark OpenCLI unusable and choose playwright-cli or skip browser verification.
|
|
311
|
-
|
|
312
|
-
**Decision table**:
|
|
313
|
-
| Condition | Tool |
|
|
314
|
-
|-----------|------|
|
|
315
|
-
| Only playwright-cli available | playwright-cli |
|
|
316
|
-
| Only opencli available (doctor passes) | opencli |
|
|
317
|
-
| Both — local dev server, forms, components | playwright-cli |
|
|
318
|
-
| Both — needs real login state (OAuth/SSO) | opencli |
|
|
319
|
-
| Both — third-party integration verification | opencli |
|
|
320
|
-
| Neither available | Install playwright-cli as default |
|
|
321
|
-
|
|
322
|
-
Then follow the corresponding tool's workflow above (Steps 1-3).
|
|
323
|
-
{{END_IF_BROWSER_TOOL_AUTO}}
|
|
324
|
-
|
|
325
|
-
**Step 4 — Reporting**:
|
|
326
|
-
|
|
327
|
-
Append results to `context-snapshot.md`:
|
|
328
|
-
```
|
|
329
|
-
## Browser Verification
|
|
330
|
-
Tool: <playwright-cli or opencli>
|
|
331
|
-
URL: http://localhost:{{DEV_PORT}}
|
|
332
|
-
Dev Server Command: <actual command used>
|
|
333
|
-
Tool version: <version>
|
|
334
|
-
Steps executed: [list of commands used]
|
|
335
|
-
Screenshot: [path]
|
|
336
|
-
Result: PASS / FAIL (reason)
|
|
337
|
-
Server cleanup: confirmed
|
|
338
|
-
Browser cleanup: confirmed
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
Browser blocking policy: `{{BROWSER_BLOCKING}}`.
|
|
342
|
-
|
|
343
|
-
If verification fails:
|
|
344
|
-
- If `{{BROWSER_BLOCKING}}` is `true`: mark checkpoint step `browser-verification` as `failed`, write `failure-log.md` with browser evidence, clean up the dev server/browser, and stop before commit.
|
|
345
|
-
- If `{{BROWSER_BLOCKING}}` is `false`: log the failure details, mark checkpoint step `browser-verification` according to the evidence, clean up the dev server/browser, and continue.
|
|
346
|
-
|
|
347
|
-
You MUST attempt verification and MUST clean up the dev server in both cases.
|
|
348
|
-
{{END_IF_BROWSER_INTERACTION}}
|
|
349
|
-
|
|
350
|
-
### Phase 4: Architecture Sync & Commit (SINGLE COMMIT)
|
|
351
|
-
|
|
352
|
-
**4a.** Run `/prizmkit-retrospective` — maintains `.prizmkit/prizm-docs/` (architecture index):
|
|
353
|
-
1. **Structural sync**: Use `git diff --cached --name-status` to locate changed modules, update KEY_FILES/INTERFACES/DEPENDENCIES/file counts in affected `.prizmkit/prizm-docs/` files
|
|
354
|
-
2. **Architecture knowledge** (feature sessions only): Extract TRAPS/RULES/DECISIONS from completed work into `.prizmkit/prizm-docs/`
|
|
355
|
-
3. **L2 coverage check**: For any module/sub-module with source files created or significantly modified in this session but no L2 `.prizm` doc — evaluate whether L2 is warranted and create if so. The current session has the best context for accurate KEY_FILES, TRAPS, and DECISIONS.
|
|
356
|
-
4. Stage doc changes: `git add .prizmkit/prizm-docs/`
|
|
357
|
-
⚠️ Do NOT commit here. Only stage.
|
|
358
|
-
|
|
359
|
-
**4b.** Stage all feature code explicitly (NEVER use `git add -A` or `git add .`):
|
|
360
|
-
```bash
|
|
361
|
-
git add <specific-files-created-or-modified>
|
|
362
|
-
git add .prizmkit/prizm-docs/
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
**4c.** Run `/prizmkit-committer` → THE ONLY commit for this feature:
|
|
366
|
-
`feat({{FEATURE_ID}}): {{FEATURE_TITLE}}`
|
|
367
|
-
This single commit includes: feature code + tests + .prizmkit/prizm-docs/ updates. Do NOT push.
|
|
368
|
-
- MANDATORY: commit must be done via `/prizmkit-committer` skill. Do NOT run manual `git add`/`git commit` as a substitute.
|
|
369
|
-
- Do NOT run `update-feature-status.py` here — the pipeline runner handles feature-list.json updates automatically after session exit.
|
|
370
|
-
|
|
371
|
-
**4d.** Final verification:
|
|
372
|
-
```bash
|
|
373
|
-
git status --short
|
|
374
|
-
```
|
|
375
|
-
Working tree MUST be clean after this step. If any feature-related files remain, stage them explicitly and amend the SAME commit with `git commit --amend --no-edit`; do NOT create a separate commit.
|
|
376
|
-
|
|
377
|
-
**Exception**: `session-summary.md` in the artifact directory is a local cross-session artifact generated by `/prizmkit-committer` — it is NOT committed to git. Ignore it in the clean-tree check.
|
|
378
|
-
|
|
379
|
-
**4e.** Write completion summary for downstream dependency context:
|
|
380
|
-
|
|
381
|
-
Write `.prizmkit/specs/{{FEATURE_SLUG}}/completion-summary.json` with the key changes from this session. This file is NOT committed to git — the pipeline runner reads it to propagate context to dependent features.
|
|
382
|
-
|
|
383
|
-
```json
|
|
384
|
-
{
|
|
385
|
-
"completion_notes": [
|
|
386
|
-
"<each item: one key change, API, model, or integration point that downstream features may need>",
|
|
387
|
-
"Example: Added User model (id, email, password_hash, display_name) in prisma/schema.prisma",
|
|
388
|
-
"Example: POST /api/auth/register and POST /api/auth/login endpoints in src/api/auth.ts",
|
|
389
|
-
"Example: Auth middleware in src/middleware/auth.ts — validates JWT on protected routes"
|
|
390
|
-
]
|
|
391
|
-
}
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
Rules for writing completion notes:
|
|
395
|
-
- Focus on **what downstream features need to know**: new APIs, models, exported functions, key file paths
|
|
396
|
-
- Each note should be self-contained and concise (one line, under 120 characters preferred)
|
|
397
|
-
- Include 3-8 notes covering the most important changes
|
|
398
|
-
- Do NOT include test files, config changes, or internal implementation details unless they affect other features
|
|
399
|
-
- If this feature has no downstream dependents, still write the summary (it serves as documentation)
|
|
400
|
-
|
|
401
|
-
## Critical Paths
|
|
402
|
-
|
|
403
|
-
| Resource | Path |
|
|
404
|
-
|----------|------|
|
|
405
|
-
| Feature Artifacts Dir | `.prizmkit/specs/{{FEATURE_SLUG}}/` |
|
|
406
|
-
| Context Snapshot | `.prizmkit/specs/{{FEATURE_SLUG}}/context-snapshot.md` |
|
|
407
|
-
| Project Root | {{PROJECT_ROOT}} |
|
|
408
|
-
|
|
409
|
-
## Failure Capture Protocol
|
|
410
|
-
|
|
411
|
-
If you encounter an unrecoverable error, context overflow, or are about to exit without completing all phases:
|
|
412
|
-
|
|
413
|
-
1. Write `.prizmkit/specs/{{FEATURE_SLUG}}/failure-log.md` BEFORE exiting:
|
|
414
|
-
```
|
|
415
|
-
FAILURE_TYPE: timeout | test_failure | review_rejected | context_overflow | unknown
|
|
416
|
-
PHASE: <which phase failed>
|
|
417
|
-
ROOT_CAUSE: <1-2 sentence explanation>
|
|
418
|
-
ATTEMPTED: <approaches already tried>
|
|
419
|
-
SUGGESTION: <what the next session should try differently>
|
|
420
|
-
DISCOVERED_TRAPS:
|
|
421
|
-
- [CRITICAL|HIGH|LOW] <gotcha discovered during this failed session> | FIX: <approach>
|
|
422
|
-
```
|
|
423
|
-
|
|
424
|
-
2. This file is intentionally lightweight — write it BEFORE context runs out.
|
|
425
|
-
|
|
426
|
-
## Reminders
|
|
427
|
-
|
|
428
|
-
- Tier 1: you handle everything directly — no subagents needed
|
|
429
|
-
- MANDATORY skills: `/prizmkit-retrospective`, `/prizmkit-committer` — never skip these
|
|
430
|
-
- Build context-snapshot.md FIRST; use it throughout instead of re-reading files
|
|
431
|
-
- `/prizmkit-committer` is mandatory — do NOT skip the commit phase, and do NOT replace it with manual git commit commands
|
|
432
|
-
- Do NOT run `git add`/`git commit` during Phase 1-3 — all changes are committed once in Phase 4
|
|
433
|
-
- If any files remain after the commit, amend the existing commit — do NOT create a follow-up commit
|
|
434
|
-
- When staging files, always use explicit file names — NEVER use `git add -A` or `git add .`
|
|
435
|
-
- **NEVER delete, modify, or touch any file under `.prizmkit/state/`** — those are pipeline runtime files managed by the runner
|
|
436
|
-
- NEVER run `rm -rf`, `git clean`, or any destructive filesystem operations
|