prizmkit 1.1.145 → 1.1.147

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.
@@ -48,29 +48,43 @@ The user chose this skill intentionally. Respect that choice.
48
48
  4. **NEVER auto-execute** the pipeline, launcher, composite workflow, or any implementation step
49
49
  5. Return the validated list to the caller; only `feature-pipeline-launcher` prepares the runtime command
50
50
 
51
- ## User-Provided Content Priority (Hard Rule)
52
-
53
- When the user provides detailed specifications, rules, or implementation requirements:
54
-
55
- 1. **Verbatim preservation**: The user's exact wording MUST be preserved in `description` and `acceptance_criteria` fields. Do NOT paraphrase, summarize, abstract, or simplify.
56
- 2. **No autonomous simplification**: A 200-word user specification must NOT become a 30-word description. Match the detail level of the user's input.
57
- 3. **Clarify, don't assume**: If any user-provided rule is ambiguous or potentially conflicts with another, ASK the user to clarify. No limit on clarification rounds. Do NOT proceed with unresolved ambiguities.
58
- 4. **Task-scoped `user_context`**: In single-feature planning, write the relevant user-provided materials into that feature's `user_context`. In multi-feature planning, multi-feature `user_context` must contain only the user text, file references, and supplementary materials relevant to that specific feature.
59
- - Preserve the matching user wording verbatim, but scope it to the item it belongs to.
60
- - Do NOT copy the full multi-feature request into every feature.
61
- - Ensure there are no unrelated sibling feature descriptions, file references, screenshots, or supplementary materials in a feature's `user_context`.
62
- - Shared global context may be copied to every item only when it is explicitly applicable to all generated items.
63
- - If a material applies to only one feature, attach it only to that matching feature.
64
- - If applicability is unclear, ask the user to map the material to the correct feature before generating the final list.
65
- 5. **`user_context` format**:
66
- - Feature-specific supplementary content or rules store as-is (verbatim text) on the matching feature only
67
- - Feature-specific file references → store as path string, e.g. `src/auth/login.ts:42-78` or `src/utils/validate.ts — focus on validateEmail function`
68
- - Truly shared global constraints → repeat only when they apply to every generated feature
51
+ ## Fresh-Session Task Contract (Hard Rule)
52
+
53
+ Every new or changed feature is an executable contract for a fresh AI session that has never seen the planning conversation. Do not add new JSON fields, context objects, schema versions, or pipeline runtime structures. Use the existing fields correctly:
54
+
55
+ 1. **Self-contained contract**: The feature's `description` and `acceptance_criteria`, read together, MUST define the objective, current state, desired state, selected decisions, constraints, non-goals, relevant integrations, edge cases, and completion evidence. Preserve detailed user requirements at matching detail; normalization must not simplify substantive rules.
56
+ 2. **Supplementary evidence only**: `user_context` is supplementary evidence only. It may preserve scoped source excerpts and purpose-tagged references, but it MUST NOT expand, replace, or contradict the contract in `description` and `acceptance_criteria`. If `user_context` were removed, a fresh execution session must still know exactly what to implement and how to prove completion.
57
+ 3. **Clarify, do not guess**: Ask the user for clarification whenever requirements conflict or a reference has multiple plausible antecedents. Do not finalize the feature while ambiguity remains.
58
+ 4. **Feature isolation**: In multi-feature planning, each contract and its supplementary evidence contain only material relevant to that feature. Repeat shared context only when it explicitly applies to every affected feature. Ask the user to map material whose applicability is unclear.
59
+
60
+ ### Conversational Context Normalization
61
+
62
+ - Never persist standalone option labels such as `A`, `B`, `C`, `方案A`, or `方案B` as execution context.
63
+ - Expand a selected option into its complete meaning and preserve the original response inline for traceability: `Selected decision: <complete meaning> (original response: "<exact response>")`.
64
+ - Resolve relative statements such as `上面`, `这个`, `按推荐走`, `同前`, `继续这样`, `用刚才的方案`, `same as above`, or `go with your recommendation` only when there is one provable antecedent. If more than one antecedent is plausible, ask the user for clarification; never guess.
65
+ - Exclude conversational authorization such as `所有问题都按你的推荐处理` when it only controls how the planner asks or recommends and does not constrain implementation.
66
+ - Do not present rejected alternatives as active instructions. Retain one only when its rejection defines a necessary non-goal.
67
+
68
+ ### Reference Material Handling
69
+
70
+ - Every retained file path, URL, screenshot, log, stack trace, or document reference must be purpose-tagged: state why it is relevant and what the execution AI must inspect. This applies to paths and URLs in both the task contract and `user_context`.
71
+ - Good: `src/auth/login.ts:42-78 — inspect empty-password validation and the response-status transition`.
72
+ - Bad: `src/auth/login.ts:42-78` with no purpose.
73
+ - For large materials such as issues, PRDs, logs, or documents, record the title/location, explain the purpose, preserve only task-relevant exact excerpts, and move every confirmed requirement into `description` and `acceptance_criteria`.
74
+ - Embed complete large materials only when the execution session cannot access the source and all content is genuinely required. Reference material never substitutes for the task contract.
75
+
76
+ ### Good and Bad Normalization Examples
77
+
78
+ - Bad: `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation` stored alone.
79
+ - Good: `Selected decision: keep saved filters account-scoped and sync them through the existing preferences API (original response: "方案B")`.
80
+ - Good: `Selected decision: use cursor pagination with a 50-item default and preserve current sort order (original response: "use option A")`.
81
+ - Bad: storing `所有问题都按你的推荐处理` as a feature requirement; it is conversational authorization, not execution context.
82
+ - Bad: attaching an entire PRD only to preserve wording. Good: `Billing PRD §4 — inspect retry and idempotency rules`, include the relevant exact excerpt, and restate the confirmed retry behavior in the feature contract.
69
83
 
70
84
  **Multi-feature isolation example:**
71
85
  - User request includes: `Feature A: add saved filters to the dashboard`, `Feature B: export filtered results as CSV`, and `Shared: preserve existing auth permissions`.
72
- - The saved-filters feature `user_context` includes `Feature A: add saved filters to the dashboard` and the shared auth constraint; it MUST NOT include `Feature B: export filtered results as CSV`.
73
- - The CSV export feature `user_context` includes `Feature B: export filtered results as CSV` and the shared auth constraint; it MUST NOT include `Feature A: add saved filters to the dashboard`.
86
+ - The saved-filters feature contract fully defines saved-filter behavior and includes only matching supplementary evidence plus the shared auth constraint; it MUST NOT include the CSV export request.
87
+ - The CSV export feature contract fully defines export behavior and includes only matching supplementary evidence plus the shared auth constraint; it MUST NOT include the saved-filters request.
74
88
 
75
89
  ## When to Use
76
90
 
@@ -263,14 +277,14 @@ Execute the planning workflow in conversation mode with mandatory checkpoints:
263
277
  >
264
278
  > If none, we'll proceed with what's available in the codebase."
265
279
 
266
- If the user provides materials, read/fetch them all before proceeding to Phase 2. For web links, use web fetch to retrieve and analyze the content. For images, read and analyze them visually. Record what was reviewed for traceability.
280
+ If the user provides materials, require or infer only when unambiguous a task-specific purpose for each material; otherwise ask what the execution AI should inspect. Read/fetch them before Phase 2. For web links, retrieve and analyze the relevant content; for images, analyze the relevant visual evidence. Record purpose-tagged locations and task-relevant exact excerpts for traceability, but do not copy complete large materials into generated items merely to preserve them.
267
281
  2. Confirm constraints and existing architecture
268
282
  3. Propose feature set with dependencies
269
283
  4. Refine descriptions and acceptance criteria
270
- 4.1 **Per-feature clarification** — for each feature, if the description, acceptance criteria, or scope is vague or could be interpreted multiple ways, ask the user to clarify before finalizing.
284
+ 4.1 **Per-feature clarification** — for each feature, if the description, acceptance criteria, selected decision, scope, non-goals, edge cases, integration points, completion evidence, or material purpose is vague or could be interpreted multiple ways, ask the user to clarify before finalizing. Reject conversational shorthand that requires an unseen question, recommendation, or option list.
271
285
  4.2 **Browser interaction** (mandatory for fullstack/frontend projects) — see §Browser Interaction Planning below. Qualifying features get `browser_interaction` by default. Only confirm with the user as a batch summary; do NOT ask per-feature.
272
286
  5. Verify DAG/order/priorities and show the mandatory priority/complexity calibration table with short rationales for every item
273
- 6. Pre-generation completeness review (see §Pre-Generation Completeness Review below)
287
+ 6. Run the pre-generation Headless Context Completeness Gate (see §Pre-Generation Completeness Review below)
274
288
  7. Build or append `.prizmkit/plans/feature-list.json`
275
289
  8. Apply default testing strategy (see §Testing Defaults below)
276
290
  9. Validate and fix until pass
@@ -288,7 +302,7 @@ Checkpoints catch cascading errors early — skipping one means the next phase b
288
302
  | **CP-FP-3** | DAG Validity | No cycles, dependencies resolved (validation dry-run) | 5 |
289
303
  | **CP-FP-3.1** | Browser Interaction Applied | Qualifying features have `browser_interaction` field; user confirmed or opted out | 4 |
290
304
  | **CP-FP-3.2** | Testing Defaults Applied | All features have appropriate testing expectations and no retired `critic`/`critic_count` fields | 7 |
291
- | **CP-FP-3.3** | Completeness Review Passed | All features reviewed for description adequacy and cross-feature gaps | 6 |
305
+ | **CP-FP-3.3** | Completeness Review Passed | Every new or changed feature passes fresh-session simulation from `description` and `acceptance_criteria` without conversation history or `user_context` | 6 |
292
306
  | **CP-FP-4** | `.prizmkit/plans/feature-list.json` Generated | Schema validates, all required keys present | 7-8 |
293
307
  | **CP-FP-5** | Final Validation Pass | Python script returns `"valid": true` with zero errors | 9 |
294
308
  | **CP-FP-6** | Local Plan Review Passed | Local generated-plan review loaded `${SKILL_DIR}/references/generated-plan-review.md`, reviewed only newly added/changed feature entries, applied accepted fixes through draft/source data, regenerated, and revalidated | 10 |
@@ -301,7 +315,7 @@ Before generating `.prizmkit/plans/feature-list.json`, review the full feature s
301
315
 
302
316
  → Read `${SKILL_DIR}/references/completeness-review.md` for the full review process (description adequacy scan, cross-feature completeness check, user presentation, and interactive supplementation).
303
317
 
304
- This gate ensures all features are implementation-ready before output generation. Thin descriptions here cost minutes to fix; misimplemented features downstream cost hours.
318
+ This is the mandatory Headless Context Completeness Gate. It reviews every new or changed feature as if the reviewer has never seen the planning conversation and must return `NEEDS_FIXES` when any required artifact-alone question cannot be answered. It does not bulk-rewrite unchanged historical features. Thin descriptions here cost minutes to fix; misimplemented features downstream cost hours.
305
319
 
306
320
  ## Fast Path (Simple Incremental)
307
321
 
@@ -337,12 +351,13 @@ For simple incremental planning, skip detailed Phase 2-3 analysis:
337
351
  **NEVER proceed without explicit user selection via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
338
352
  3. Generate next sequential feature IDs
339
353
  4. Draft features (title + description + acceptance_criteria + dependencies)
340
- 5. Write draft to `.prizmkit/plans/feature-list.draft.json`, then call the generate script:
354
+ 5. Run the mandatory pre-generation Headless Context Completeness Gate from Phase 6 on every drafted feature; repair the draft until each returns `PASS`.
355
+ 6. Write draft to `.prizmkit/plans/feature-list.draft.json`, then call the generate script:
341
356
  ```bash
342
357
  python3 ${SKILL_DIR}/scripts/validate-and-generate.py generate --input .prizmkit/plans/feature-list.draft.json --output .prizmkit/plans/feature-list.json
343
358
  ```
344
- 6. If valid → run the mandatory Local Generated-Plan Review Gate, then summarize and recommend next step
345
- 7. If invalid → apply fixes to the draft, re-run generate (max 2 attempts, then escalate to full workflow)
359
+ 7. If valid → run the mandatory Local Generated-Plan Review Gate, then summarize and recommend next step
360
+ 8. If invalid → apply fixes to the draft, re-run generate (max 2 attempts, then escalate to full workflow)
346
361
 
347
362
  ## Browser Interaction Planning
348
363
 
@@ -379,7 +394,7 @@ Key requirements:
379
394
  - new items default `status: "pending"`
380
395
  - English feature titles for stable slug generation
381
396
  - `browser_interaction` auto-generated for qualifying frontend features (with `tool` selection: `auto`/`playwright-cli`/`opencli`)
382
- - descriptions: minimum 15 words (error), recommended minimum 30/50/80/100+ for low/medium/high/critical (warning). No upper limit — more detail prevents AI guessing
397
+ - descriptions: minimum 15 words (error), recommended minimum 30/50/80/100+ for low/medium/high/critical (warning). No upper limit — preserve substantive requirements at matching detail so `description` plus `acceptance_criteria` remains complete without `user_context`
383
398
  - `estimated_complexity` records implementation scope and verification risk for planning summaries, ordering, and downstream context. It does not select a fixed agent count or named review topology; every normal feature session receives the runtime's full guidance.
384
399
 
385
400
  **IMPORTANT: Do NOT hand-write the final JSON file.** Instead:
@@ -394,7 +409,7 @@ The script fills in defaults (`$schema`, `created_at`, `created_by`), validates
394
409
 
395
410
  Run this gate after `.prizmkit/plans/feature-list.json` passes generation and validation, and before the final handoff. It applies whenever this session added or changed final feature entries. For validate-only, summary-only, or draft-save flows with no final content change, report that the gate is not applicable.
396
411
 
397
- Read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the single source of truth. Review the actual draft and final artifacts directly because `.prizmkit` files may be gitignored. Keep the review planning-only, apply accepted findings to the draft/source representation, regenerate the final JSON, and require validation to pass again before reporting the review result.
412
+ Read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the single source of truth. Review the actual draft and final artifacts directly because `.prizmkit` files may be gitignored. Repeat the Headless Context Completeness Gate for every reviewed new or changed feature. Keep the review planning-only, apply accepted findings to the draft/source representation, regenerate the final JSON, rerun validation, and repeat the local review until it returns `PASS` before reporting the result.
398
413
 
399
414
  ## Testing Defaults (Phase 8)
400
415
 
@@ -57,19 +57,32 @@ Every description should cover these aspects (adapt per feature type):
57
57
 
58
58
  ### Headless Execution Requirements
59
59
 
60
- Feature descriptions are consumed by **autonomous AI sessions running in headless mode** — no human is available to clarify ambiguities. This raises the bar for description quality:
60
+ Feature entries are consumed by **autonomous AI sessions running in headless mode** — no human is available to clarify ambiguities. Treat `description` plus `acceptance_criteria` as the complete task contract, not as a summary of a conversation.
61
61
 
62
62
  **Must include for headless readiness:**
63
- 1. **Concrete deliverables** — specific files, endpoints, components, or models to create
64
- 2. **Integration points** which existing APIs to call, which models to import, which modules to extend
65
- 3. **Key behaviors** — validation rules, state transitions, error codes, edge cases
63
+ 1. **Objective and current state** — the exact outcome and what exists today
64
+ 2. **Desired state and selected decisions** the complete chosen behavior or approach, never only an option label
65
+ 3. **Constraints and non-goals** — boundaries the implementation must preserve
66
+ 4. **Relevant integrations** — existing APIs, models, modules, services, and dependency outputs
67
+ 5. **Edge cases** — validation, permissions, empty/error states, limits, concurrency, or idempotency when relevant
68
+ 6. **Completion evidence** — observable behavior and deterministic tests/checks that prove the feature is done
69
+
70
+ `user_context` is supplementary evidence only. If `user_context` were removed, `description` and `acceptance_criteria` must still provide all six categories at matching detail.
66
71
 
67
72
  **Dependency descriptions:**
68
73
  When a feature depends on others, explicitly state what it needs from them:
69
- - "Uses the User model (id, email, display_name) from F-001 to create a foreign key user_id on the Project model"
70
- - "depends on F-001" — the AI won't know what F-001 built
74
+ - Good: "Uses the User model (id, email, display_name) from F-001 to create a foreign key user_id on the Project model."
75
+ - Bad: "depends on F-001" — the fresh session cannot infer what F-001 built.
76
+
77
+ **Reference descriptions:**
78
+ - Good: `docs/billing-prd.md §4 — inspect webhook retry and idempotency requirements`; preserve only task-relevant exact excerpts and place confirmed behavior in the task contract.
79
+ - Bad: `docs/billing-prd.md` or a full PRD copied into `user_context` without a purpose.
80
+
81
+ **Decision normalization:**
82
+ - Good: `Selected decision: store saved filters per account through the existing preferences API (original response: "方案B")`.
83
+ - Bad: `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation` with no complete selected meaning.
71
84
 
72
- **Self-test:** Read the description as if you have no other context. Could you implement it without asking a single question? If not, add more detail.
85
+ **Self-test:** Review the entry as if you have never seen the planning conversation. Could you implement it and prove completion without asking a single question or reading `user_context`? If not, return `NEEDS_FIXES` and add the missing detail.
73
86
 
74
87
  ---
75
88
 
@@ -1,57 +1,75 @@
1
1
  # Pre-Generation Completeness Review
2
2
 
3
- Before generating `.prizmkit/plans/feature-list.json`, review the full feature set holistically. Individual features may look fine in isolation but have gaps when viewed together.
3
+ ## Headless Context Completeness Gate
4
4
 
5
- ## Step 1: Description Adequacy Scan
5
+ Before generating `.prizmkit/plans/feature-list.json`, review every new or changed feature as if the reviewer has never seen the planning conversation. Preserve unchanged historical entries; do not bulk-rewrite them. Individual features may look plausible in the original dialogue but still be unusable in a fresh session.
6
6
 
7
- For each feature, evaluate against the word-count thresholds in `planning-guide.md`:
8
- - Does the description cover: what to build, key behaviors, integration points, data model (if applicable), error/edge cases?
9
- - Is the description specific enough for an AI coding session to implement without guessing?
10
- - Flag any feature below the recommended minimum word count for its complexity level (30+/50+/80+/100+ words for low/medium/high/critical). There is no upper limit — more detail is always better.
7
+ The review input is the proposed artifact entry itself. `user_context` is supplementary evidence only: first assess `description` plus `acceptance_criteria` without it, then inspect supplementary evidence for scope and consistency.
11
8
 
12
- **Implementation clarity check** Every feature description will be consumed by an autonomous AI session. Verify each description specifies:
13
- 1. Concrete deliverables (files to create, endpoints to build, components to implement, models to define)
14
- 2. Key behaviors and business rules (validation, state transitions, error handling)
15
- 3. Integration points with other modules (which APIs to call, which models to use)
9
+ ## Step 1: Artifact-Alone Fresh-Session Simulation
16
10
 
17
- **Dependency context check** If the feature depends on others, the description should reference what it needs from them:
18
- - Good: "Uses User model from F-001 to link projects to users via userId foreign key"
19
- - Bad: "depends on F-001" (too vague)
11
+ For each new or changed feature, answer all of these from `description` and `acceptance_criteria` alone:
20
12
 
21
- **Ambiguity check** Flag vague phrases:
22
- - Bad: "Create a nice dashboard" (what components? what data? what layout?)
23
- - Good: "Create dashboard at /dashboard with: (1) summary cards showing total projects count, active tasks count; (2) recent activity feed (last 10 items); (3) quick-access project list (5 most recent). Fetch data via GET /api/dashboard/summary."
13
+ 1. What exact problem or outcome is this feature responsible for?
14
+ 2. What exists today and what must change?
15
+ 3. Which approach was selected, expressed by meaning rather than an option label?
16
+ 4. What constraints and non-goals must be preserved?
17
+ 5. Which existing modules, APIs, data, dependencies, or other relevant integrations are involved?
18
+ 6. Which edge cases, errors, permissions, limits, state transitions, or failure modes matter?
19
+ 7. How can completion be verified with observable behavior or deterministic evidence?
20
+ 8. Does any phrase require an unseen earlier question, recommendation, or option list?
21
+ 9. Why is each reference material relevant, and what should the execution AI inspect?
22
+ 10. Do quoted source materials agree with the final task decision?
24
23
 
25
- If any feature description is unclear, **expand it now** before generating the output file.
24
+ If any answer is unavailable, ambiguous, or present only in `user_context`, the verdict is `NEEDS_FIXES`. Never infer a missing decision from conversation memory.
26
25
 
27
- ## Step 2: Cross-Feature Completeness Check
26
+ ## Step 2: Contract and Material Checks
27
+
28
+ - Preserve substantive user requirements at matching detail; normalization must not collapse a detailed specification into a short summary.
29
+ - Expand option shorthand into complete selected meaning with inline traceability, for example: `Selected decision: use cursor pagination with a 50-item default (original response: "use option A")`.
30
+ - Resolve `方案B`, `按推荐走`, `same as above`, or `go with your recommendation` only when there is one provable antecedent. Otherwise ask the user for clarification.
31
+ - Exclude conversational authorization that controls planning but does not constrain implementation.
32
+ - Do not present rejected alternatives as active requirements; retain them only as necessary non-goals.
33
+ - Require purpose-tagged paths and URLs, screenshots, logs, stack traces, and documents.
34
+ - For large materials, preserve title/location, purpose, and task-relevant exact excerpts; move confirmed requirements into the task contract rather than embedding the entire source.
35
+ - If `user_context` were removed, `description` and `acceptance_criteria` must remain sufficient for execution and verification.
36
+
37
+ ### Good and Bad Examples
38
+
39
+ - Bad: `方案B`.
40
+ - Good: `Selected decision: keep saved filters account-scoped and sync through the existing preferences API (original response: "方案B")`.
41
+ - Bad: `same as above` when multiple earlier decisions exist.
42
+ - Good: ask which earlier decision applies, then record its complete meaning.
43
+ - Bad: `docs/search-rfc.md`.
44
+ - Good: `docs/search-rfc.md §3 — inspect ranking tie-breakers and empty-query behavior`.
45
+ - Bad: copy a complete issue into `user_context` while leaving the feature description as `implement the issue`.
46
+ - Good: retain the issue URL and relevant exact excerpts as evidence, then state all confirmed behavior and completion checks in the feature contract.
47
+
48
+ ## Step 3: Cross-Feature Completeness Check
28
49
 
29
50
  Look at the feature set as a whole:
30
- - **Implied functionality gaps**: Does feature A's acceptance criteria assume a capability that no other feature provides?
31
- - **Missing integration seams**: If two features share data or interact at runtime, is the interface specified?
32
- - **Scope leaks**: Does any feature's description reference functionality outside the agreed scope?
33
51
 
34
- ## Step 3: Present Review to User
52
+ - **Implied functionality gaps**: Does one feature assume a capability that no feature provides?
53
+ - **Missing integration seams**: If two features share data or interact at runtime, is the interface specified by meaning?
54
+ - **Dependency context**: Does each dependent feature state exactly which predecessor output it consumes?
55
+ - **Scope leaks**: Does a description activate rejected or out-of-scope functionality?
56
+ - **Source conflict**: Does an excerpt describe an earlier alternative that conflicts with the selected final decision?
35
57
 
36
- Show a structured summary table:
58
+ ## Step 4: Present Review and Repair
37
59
 
38
- ```
39
- Feature | Description | Cross-Feature | Recommendation
40
- | Adequacy | Issues |
41
- F-001 | ✓ (65 words)| — | Ready
42
- F-002 | ⚠ (28 words)| — | Expand: add API endpoints, error handling
43
- F-003 | ✓ (52 words)| Assumes email from | Clarify: who sends the notification?
44
- | | F-006 (not yet defined)|
45
- ```
60
+ Show a structured summary:
46
61
 
47
- Then ask if any features need further discussion.
62
+ ```text
63
+ Feature | Artifact-Alone Answers | References | Cross-Feature Issues | Verdict
64
+ F-001 | complete | purposeful | none | PASS
65
+ F-002 | missing current state | URL vague | none | NEEDS_FIXES
66
+ ```
48
67
 
49
- ## Step 4: Interactive Supplementation
68
+ For each `NEEDS_FIXES` item:
50
69
 
51
- For each feature the user wants to discuss:
52
- 1. Ask targeted questions about the unclear aspects
53
- 2. Propose concrete description supplements
54
- 3. Update the feature description with agreed details
55
- 4. Re-check: does the supplement resolve the gap?
70
+ 1. Ask targeted clarification when the missing meaning cannot be proven from one antecedent.
71
+ 2. Update the draft/source feature, not only `user_context`.
72
+ 3. Re-run this gate on the changed item.
73
+ 4. Continue until every new or changed feature returns `PASS`.
56
74
 
57
- Continue until the user confirms all features are implementation-ready. Fixing thin descriptions here costs minutes; fixing misimplemented features downstream costs hours.
75
+ Only then may generation proceed. Structural validation after generation does not replace this semantic gate.
@@ -31,13 +31,38 @@ For every reviewed feature entry, check:
31
31
 
32
32
  - Schema compatibility with `dev-pipeline-feature-list-v1` and `.prizmkit/dev-pipeline/templates/feature-list-schema.json`
33
33
  - Dependency/DAG soundness: dependencies exist, no cycles, no poorly ordered prerequisite chains
34
- - Description completeness and headless execution readiness
34
+ - Description completeness and headless execution readiness: `description` plus `acceptance_criteria` defines objective, current state, desired state, selected decisions, constraints, non-goals, relevant integrations, edge cases, and completion evidence without conversation history
35
35
  - Acceptance criteria specificity, measurability, and coverage of the described behavior
36
- - User-provided wording preservation in `description`, `acceptance_criteria`, and `user_context`
36
+ - User-provided detail preservation at matching detail after conversational normalization
37
+ - `user_context` is supplementary evidence only: it does not expand, replace, or contradict the task contract; if `user_context` were removed, execution and verification remain unambiguous
37
38
  - Task-scoped `user_context` isolation: no unrelated sibling feature descriptions, file references, or supplementary materials; shared context appears on multiple items only when explicitly global
39
+ - Purpose-tagged paths and URLs, screenshots, logs, stack traces, and documents; large materials retain title/location, purpose, and task-relevant exact excerpts rather than full-content injection
38
40
  - Priority/complexity calibration: every reviewed feature has short priority and complexity rationales, medium/low assignments are allowed when criteria fit, and high/high is not used merely because work is framework-related, multi-file, or user-requested
39
41
  - Browser interaction fields for qualifying frontend/fullstack features when applicable
40
42
 
43
+ ## Headless Context Completeness Gate
44
+
45
+ Repeat the pre-generation simulation for every reviewed new or changed feature as if the reviewer has never seen the planning conversation. From the artifact alone, answer:
46
+
47
+ 1. What exact problem or outcome is this task responsible for?
48
+ 2. What exists today and what must change?
49
+ 3. Which approach was selected, expressed by meaning rather than an option label?
50
+ 4. What constraints and non-goals must be preserved?
51
+ 5. Why is each reference material relevant?
52
+ 6. How can completion be verified?
53
+ 7. Does any phrase require an unseen earlier question, recommendation, or option list?
54
+ 8. Do quoted source materials agree with the final task decision?
55
+
56
+ Return `NEEDS_FIXES` if any answer is missing, ambiguous, available only in `user_context`, or dependent on shorthand such as `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation`. Accept an expanded decision only when it includes complete meaning and inline traceability such as `(original response: "方案B")`. Exclude conversational authorization that does not constrain implementation. Ask the user for clarification when there is not one provable antecedent.
57
+
58
+ Do not add new JSON fields, context objects, schema versions, or pipeline runtime structures. Apply this stricter gate prospectively to new or changed entries and preserve unchanged historical plans.
59
+
60
+ ### Good and Bad Review Examples
61
+
62
+ - Bad: `same as above`; Good: the complete selected API behavior plus `(original response: "same as above")` after its single antecedent is proven.
63
+ - Bad: a bare URL; Good: `https://example.test/search-rfc — inspect ranking tie-breakers and empty-query behavior` plus only task-relevant exact excerpts.
64
+ - Bad: `所有问题都按你的推荐处理` as an implementation rule; Good: omit it as conversational authorization unless a concrete selected decision was separately confirmed.
65
+
41
66
  ## Fix Loop
42
67
 
43
68
  1. Present findings with IDs, severity, evidence, and suggested draft/source changes.
@@ -50,7 +75,8 @@ python3 ${SKILL_DIR}/scripts/validate-and-generate.py generate --input .prizmkit
50
75
  ```
51
76
 
52
77
  5. Re-run validation/generation until valid. Do not hand-patch `.prizmkit/plans/feature-list.json` as the source of truth.
53
- 6. Repeat the local review only for entries changed by accepted fixes.
78
+ 6. Repeat the local review and Headless Context Completeness Gate only for entries changed by accepted fixes.
79
+ 7. Do not report `PASS` until every required fresh-session answer is available and final validation passes after regeneration.
54
80
 
55
81
  ## Report Format
56
82
 
@@ -45,29 +45,43 @@ The user chose this skill intentionally. Respect that choice.
45
45
  5. **NEVER auto-execute** the pipeline, launcher, composite workflow, or any implementation step
46
46
  6. Return the validated refactor list to the caller; only `refactor-pipeline-launcher` prepares the runtime command
47
47
 
48
- ## User-Provided Content Priority (Hard Rule)
49
-
50
- When the user provides detailed specifications, rules, or implementation requirements:
51
-
52
- 1. **Verbatim preservation**: The user's exact wording MUST be preserved in `description` and `acceptance_criteria` fields. Do NOT paraphrase, summarize, abstract, or simplify.
53
- 2. **No autonomous simplification**: A 200-word user specification must NOT become a 30-word description. Match the detail level of the user's input.
54
- 3. **Clarify, don't assume**: If any user-provided rule is ambiguous or potentially conflicts with another, ASK the user to clarify. No limit on clarification rounds. Do NOT proceed with unresolved ambiguities.
55
- 4. **Task-scoped `user_context`**: In single-refactor planning, write the relevant user-provided materials into that refactor item's `user_context`. In multi-refactor planning, multi-refactor `user_context` must contain only the user text, file references, goals, and constraints relevant to that specific refactor item.
56
- - Preserve the matching user wording verbatim, but scope it to the item it belongs to.
57
- - Do NOT copy the full multi-refactor request into every item.
58
- - Ensure there are no unrelated sibling refactor goals, target files, constraints, desired end states, or supplementary materials in a refactor item's `user_context`.
59
- - Shared global context may be copied to every item only when it is explicitly applicable to all generated items.
60
- - If a goal, constraint, target file, or architecture note applies to only one refactor item, attach it only to that matching item.
61
- - If applicability is unclear, ask the user to map the material to the correct refactor item before generating the final list.
62
- 5. **`user_context` format**:
63
- - Refactor-specific supplementary content, goals, or constraints store as-is (verbatim text) on the matching refactor item only
64
- - Refactor-specific file references store as path string, e.g. `src/auth/login.ts:42-78` or `src/utils/validate.ts focus on validateEmail function`
65
- - Truly shared global constraints → repeat only when they apply to every generated refactor item
48
+ ## Fresh-Session Task Contract (Hard Rule)
49
+
50
+ Every new or changed refactor item is an executable contract for a fresh AI session that has never seen the planning conversation. Do not add new JSON fields, context objects, schema versions, or pipeline runtime structures. Use the existing fields correctly:
51
+
52
+ 1. **Self-contained contract**: The item's `description` and `acceptance_criteria`, read together, MUST define the objective, current state, desired target architecture, selected decisions, scope boundaries, constraints, non-goals, relevant integrations and consumers, edge cases, behavior-preservation decisions, and completion evidence. Preserve substantive user requirements at matching detail.
53
+ 2. **Supplementary evidence only**: `user_context` is supplementary evidence only. It may contain scoped exact excerpts and purpose-tagged references, but it MUST NOT expand, replace, or contradict the contract. If `user_context` were removed, a fresh refactor session must still know the current structure, target architecture, allowed scope, forbidden changes, preservation strategy, and verification evidence.
54
+ 3. **Purposeful scope**: Every path in `scope.files` and every related path reference must be a purpose-tagged target path in the task contract or supplementary evidence, stating what to inspect or change. The scope array may remain schema-compatible path strings, while `description` explains each path or coherent path group's role.
55
+ 4. **Clarify, do not guess**: Ask the user for clarification whenever target architecture, scope boundaries, preservation behavior, material applicability, or a relative reference has multiple plausible meanings.
56
+ 5. **Item isolation**: Each refactor contract and its supplementary evidence contain only relevant goals, paths, constraints, desired end state, and preservation evidence.
57
+
58
+ ### Conversational Context Normalization
59
+
60
+ - Never persist standalone option labels such as `A`, `B`, `C`, `方案A`, or `方案B` as execution context.
61
+ - Expand a selected option into complete meaning with inline traceability: `Selected decision: <complete meaning> (original response: "<exact response>")`.
62
+ - Resolve `上面`, `这个`, `按推荐走`, `同前`, `继续这样`, `用刚才的方案`, `same as above`, or `go with your recommendation` only when there is one provable antecedent. Otherwise ask the user for clarification; never guess.
63
+ - Exclude conversational authorization such as `所有问题都按你的推荐处理` when it controls planning behavior but does not constrain implementation.
64
+ - Do not present rejected architectures as active instructions; preserve one only when it defines a necessary non-goal or compatibility boundary.
65
+
66
+ ### Reference Material Handling
67
+
68
+ - Every retained file path, URL, screenshot, log, dependency graph, analysis, or document reference must be purpose-tagged: state why it is relevant and what the execution AI should inspect. This applies to paths and URLs in the task contract and `user_context`.
69
+ - Good: `src/auth/validation.ts — inspect exported signatures and current error semantics before extracting middleware`; Bad: `src/auth/validation.ts` alone.
70
+ - For large materials, record title/location and purpose, preserve only task-relevant exact excerpts, and move confirmed target architecture, scope boundaries, constraints, and preservation decisions into `description` and `acceptance_criteria`.
71
+ - Embed complete large materials only when the execution session cannot access the source and all content is genuinely required.
72
+
73
+ ### Good and Bad Normalization Examples
74
+
75
+ - Bad: `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation` stored as the target architecture.
76
+ - Good: `Selected decision: extract validation behind an auth-owned middleware interface while preserving all handler exports (original response: "方案B")`.
77
+ - Good: `Selected decision: migrate imports in one compatibility-preserving phase and remove no public paths (original response: "use option A")`.
78
+ - Bad: storing `所有问题都按你的推荐处理` as a preservation rule; it is conversational authorization.
79
+ - Bad: attaching a full architecture RFC while saying only `apply this`. Good: retain purpose-tagged RFC sections and relevant exact excerpts, then state the complete selected target architecture and non-goals in the item contract.
66
80
 
67
81
  **Multi-refactor isolation example:**
68
82
  - User request includes: `Refactor A: extract auth validation into middleware`, `Refactor B: split dashboard chart utilities`, and `Shared: preserve all public APIs`.
69
- - The auth middleware refactor `user_context` includes `Refactor A: extract auth validation into middleware` and the shared API constraint; it MUST NOT include `Refactor B: split dashboard chart utilities`.
70
- - The chart utilities refactor `user_context` includes `Refactor B: split dashboard chart utilities` and the shared API constraint; it MUST NOT include `Refactor A: extract auth validation into middleware`.
83
+ - The auth item contract fully defines its current and target structure and includes only matching evidence plus the shared API constraint; it MUST NOT include chart-utility scope.
84
+ - The chart item contract fully defines its current and target structure and includes only matching evidence plus the shared API constraint; it MUST NOT include auth scope.
71
85
 
72
86
  ## When to Use
73
87
  - "Plan refactoring", "Scope a restructuring"
@@ -162,7 +176,7 @@ Execute the planning workflow in conversation mode with mandatory checkpoints:
162
176
  >
163
177
  > If none, we'll proceed with what's available in the codebase."
164
178
 
165
- If the user provides materials, read/fetch them all before proceeding to Phase 2. For web links, use web fetch to retrieve and analyze the content. For images, read and analyze them visually. This context is critical for refactoring — understanding the target architecture and constraints prevents risky structural changes.
179
+ If the user provides materials, require or infer only when unambiguous a refactor-specific purpose for each material; otherwise ask what the execution AI should inspect. Read/fetch the relevant material before Phase 2. For web links, retrieve the relevant content; for images, analyze the relevant visual evidence. Preserve purpose-tagged locations and task-relevant exact excerpts, but do not inject complete large materials merely for verbatim preservation. This context is critical for understanding the target architecture and constraints.
166
180
 
167
181
  **CHECKPOINT CP-RP-0**: Project context loaded, tech stack and test suite status known.
168
182
 
@@ -190,9 +204,10 @@ Support 4 input formats (users may mix formats):
190
204
  > "The database layer is tightly coupled to the HTTP layer"
191
205
 
192
206
  For each input, ask clarifying questions:
193
- - What is the specific target (files, modules, patterns)?
194
- - What is the desired end state?
195
- - Are there constraints (must preserve API, must not touch certain files)?
207
+ - What is the specific target (files, modules, patterns), and what should the execution AI inspect at each purpose-tagged target path?
208
+ - What is the complete desired target architecture or end state?
209
+ - What are the scope boundaries and non-goals (must preserve API, must not touch certain files, rejected architecture that must stay rejected)?
210
+ - Which behavior-preservation decisions and completion evidence prove the refactor is safe?
196
211
  - What is the motivation (maintainability, performance, testability)?
197
212
 
198
213
  Continue collecting goals until the user says they're done. There is no limit on rounds.
@@ -246,13 +261,13 @@ See `${SKILL_DIR}/references/planning-phases.md` for the display template and co
246
261
 
247
262
  **CHECKPOINT CP-RP-4**: All items confirmed by user.
248
263
 
249
- ### Phase 6: Completeness Review
264
+ ### Phase 6: Headless Context Completeness Gate
250
265
 
251
- **Goal**: Check the full item set for consistency, gaps, and headless execution readiness.
266
+ **Goal**: Check every new or changed item as if the reviewer has never seen the planning conversation, including consistency, gaps, target architecture, scope boundaries, purpose-tagged target paths, behavior-preservation decisions, and completion evidence. Return `NEEDS_FIXES` for any unanswered artifact-alone question and preserve unchanged historical items.
252
267
 
253
268
  See `${SKILL_DIR}/references/planning-phases.md` for the full 5-step review checklist (DAG validation, preservation check, gap detection, cross-module impact, headless readiness criteria) and review summary table format.
254
269
 
255
- **CHECKPOINT CP-RP-5**: Completeness review passed, all issues resolved.
270
+ **CHECKPOINT CP-RP-5**: Headless Context Completeness Gate passed for every new or changed item, all issues resolved without relying on `user_context`.
256
271
 
257
272
  ### Phase 7: Generate & Validate
258
273
 
@@ -290,7 +305,7 @@ See `${SKILL_DIR}/references/planning-phases.md` for the full 5-step review chec
290
305
 
291
306
  Run this gate after `.prizmkit/plans/refactor-list.json` passes generation and validation, and before the final handoff. It applies whenever this session added or changed final refactor entries. For validate-only, summary-only, or draft-save flows with no final content change, report that the gate is not applicable.
292
307
 
293
- Read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the single source of truth. Review the actual draft and final artifacts directly because `.prizmkit` files may be gitignored. Keep the review planning-only, apply accepted findings to the draft/source representation, regenerate the final JSON, and require validation to pass again before reporting the review result.
308
+ Read `${SKILL_DIR}/references/generated-plan-review.md` and follow it as the single source of truth. Review the actual draft and final artifacts directly because `.prizmkit` files may be gitignored. Repeat the Headless Context Completeness Gate for every reviewed new or changed refactor. Keep the review planning-only, apply accepted findings to the draft/source representation, regenerate the final JSON, rerun validation, and repeat local review until it returns `PASS` before reporting the result.
294
309
 
295
310
  ## Output Rules
296
311
 
@@ -30,12 +30,13 @@ For simple refactoring with minimal scope.
30
30
 
31
31
  **NEVER proceed without explicit user selection via `AskUserQuestion`. Do NOT render options as plain text — the user must be able to click/select.**
32
32
  3. Draft items (title + type + scope + description + acceptance_criteria + behavior_preservation + dependencies)
33
- 4. Write draft to `.prizmkit/plans/refactor-list.draft.json`, then call the generate script:
33
+ 4. Run the mandatory Phase 6 Headless Context Completeness Gate on every drafted item; repair the draft until each returns `PASS` without conversation history or `user_context`.
34
+ 5. Write draft to `.prizmkit/plans/refactor-list.draft.json`, then call the generate script:
34
35
  ```bash
35
36
  python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input .prizmkit/plans/refactor-list.draft.json --output .prizmkit/plans/refactor-list.json
36
37
  ```
37
- 5. If valid -> run the mandatory Local Generated-Plan Review Gate from the main `refactor-planner` skill before summarizing or recommending `refactor-pipeline-launcher`.
38
- 6. If invalid -> apply fixes to the draft, re-run generate (max 2 attempts, then escalate to full workflow)
38
+ 6. If valid -> run the mandatory Local Generated-Plan Review Gate from the main `refactor-planner` skill before summarizing or recommending `refactor-pipeline-launcher`.
39
+ 7. If invalid -> apply fixes to the draft, re-run generate (max 2 attempts, then escalate to full workflow)
39
40
 
40
41
  ## When NOT to Use Fast Path
41
42
  - More than 2 refactor items
@@ -31,13 +31,38 @@ For every reviewed refactor entry, check:
31
31
 
32
32
  - Schema compatibility with `dev-pipeline-refactor-list-v1` and `.prizmkit/dev-pipeline/templates/refactor-list-schema.json`
33
33
  - Dependency/DAG soundness, including safe behavior-preserving order
34
- - Description completeness, target scope clarity, and headless execution readiness
34
+ - Description completeness: objective, current state, desired target architecture, selected decisions, scope boundaries, constraints, non-goals, relevant integrations and consumers, edge cases, behavior-preservation decisions, completion evidence, and headless execution readiness
35
35
  - Acceptance criteria specificity and measurable behavior-preservation verification
36
36
  - `behavior_preservation` strategy quality and consistency with target scope and existing tests
37
- - User-provided wording preservation in `description`, `acceptance_criteria`, and `user_context`
37
+ - User-provided detail preservation at matching detail after conversational normalization
38
+ - `user_context` is supplementary evidence only: it does not expand, replace, or contradict the refactor contract; if `user_context` were removed, execution and verification remain unambiguous
38
39
  - Task-scoped `user_context` isolation: no unrelated sibling refactor goals, target files, constraints, desired end states, or supplementary materials; shared context appears on multiple items only when explicitly global
40
+ - Purpose-tagged target paths and URLs, diagrams, analyses, and documents; large materials retain title/location, purpose, and task-relevant exact excerpts rather than full-content injection
39
41
  - Priority/complexity calibration: every reviewed refactor has short priority and complexity rationales, medium/low assignments are allowed when criteria fit, and high/high is not used merely because the work is cleanup, framework-related, multi-file, or user-requested
40
42
 
43
+ ## Headless Context Completeness Gate
44
+
45
+ Repeat the pre-generation simulation for every reviewed new or changed refactor as if the reviewer has never seen the planning conversation. From the artifact alone, answer:
46
+
47
+ 1. What exact problem or outcome is this task responsible for?
48
+ 2. What current architecture exists and what target architecture must replace it?
49
+ 3. Which approach was selected, expressed by meaning rather than an option label?
50
+ 4. What scope boundaries, constraints, and non-goals must be preserved?
51
+ 5. Why is each reference material and target path relevant?
52
+ 6. How can completion and behavior preservation be verified?
53
+ 7. Does any phrase require an unseen earlier question, recommendation, or option list?
54
+ 8. Do quoted source materials agree with the final task decision?
55
+
56
+ Return `NEEDS_FIXES` if any answer is missing, ambiguous, available only in `user_context`, or dependent on shorthand such as `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation`. Accept an expanded decision only when it states complete meaning with inline traceability such as `(original response: "方案B")`. Exclude conversational authorization that does not constrain implementation. Ask the user for clarification when there is not one provable antecedent.
57
+
58
+ Do not add new JSON fields, context objects, schema versions, or pipeline runtime structures. Apply this stricter gate prospectively to new or changed entries and preserve unchanged historical refactors.
59
+
60
+ ### Good and Bad Review Examples
61
+
62
+ - Bad: `go with your recommendation` as target architecture; Good: `Selected decision: reverse the auth/user dependency through a shared identity interface and retain existing public imports (original response: "go with your recommendation")`.
63
+ - Bad: bare `src/auth/`; Good: `src/auth/ — inspect public exports, dependency direction, and compatibility call sites before restructuring`.
64
+ - Bad: an entire RFC pasted into evidence; Good: a purpose-tagged RFC location, task-relevant exact excerpts, and all confirmed target decisions in the task contract.
65
+
41
66
  ## Fix Loop
42
67
 
43
68
  1. Present findings with IDs, severity, evidence, and suggested draft/source changes.
@@ -50,7 +75,8 @@ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input
50
75
  ```
51
76
 
52
77
  5. Re-run validation/generation until valid. Do not hand-patch `.prizmkit/plans/refactor-list.json` as the source of truth.
53
- 6. Repeat the local review only for entries changed by accepted fixes.
78
+ 6. Repeat the local review and Headless Context Completeness Gate only for entries changed by accepted fixes.
79
+ 7. Do not report `PASS` until every required fresh-session answer is available and final validation passes after regeneration.
54
80
 
55
81
  ## Report Format
56
82