prizmkit 1.1.146 → 1.1.148
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/skills/_metadata.json +1 -1
- package/bundled/skills/app-planner/SKILL.md +69 -17
- package/bundled/skills/app-planner/references/brainstorm-guide.md +1 -1
- package/bundled/skills/app-planner/references/generated-plan-review.md +33 -3
- package/bundled/skills/app-planner/references/project-brief-guide.md +28 -5
- package/bundled/skills/app-planner/references/project-conventions-discovery.md +1 -1
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +4 -2
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +1 -1
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +4 -2
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +1 -1
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +4 -4
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +6 -6
- package/bundled/skills/app-planner/references/rules/frontend/template.md +1 -1
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +4 -2
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +1 -1
- package/bundled/skills/app-planner/references/rules-configuration.md +5 -1
- package/bundled/skills/bug-planner/SKILL.md +74 -37
- package/bundled/skills/bug-planner/references/generated-plan-review.md +34 -6
- package/bundled/skills/feature-planner/SKILL.md +55 -31
- package/bundled/skills/feature-planner/assets/planning-guide.md +22 -7
- package/bundled/skills/feature-planner/references/completeness-review.md +62 -39
- package/bundled/skills/feature-planner/references/generated-plan-review.md +35 -6
- package/bundled/skills/refactor-planner/SKILL.md +54 -29
- package/bundled/skills/refactor-planner/references/fast-path.md +4 -3
- package/bundled/skills/refactor-planner/references/generated-plan-review.md +34 -6
- package/bundled/skills/refactor-planner/references/planning-phases.md +28 -8
- package/package.json +1 -1
|
@@ -1,57 +1,80 @@
|
|
|
1
1
|
# Pre-Generation Completeness Review
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Headless Context Completeness Gate
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
Scan all AI-visible fields and sections, not only the main contract. Every generated natural-language value in `project_description`, `global_context`, item fields, `user_context`, evidence, comments, and parentheticals must stand alone. Review changed root prose even when no feature item changed. Return `NEEDS_FIXES` for dialogue-role/chronology labels, question IDs, answer tokens, planning-option recommendation markers, checkpoint provenance, or raw internal answer-map content.
|
|
16
10
|
|
|
17
|
-
|
|
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
|
+
## Step 1: Artifact-Alone Fresh-Session Simulation
|
|
20
12
|
|
|
21
|
-
|
|
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
|
+
For each new or changed feature, answer all of these from `description` and `acceptance_criteria` alone:
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+
1. What exact problem or outcome is this feature responsible for?
|
|
16
|
+
2. What exists today and what must change?
|
|
17
|
+
3. Which approach was selected, expressed by meaning rather than an option label?
|
|
18
|
+
4. What constraints and non-goals must be preserved?
|
|
19
|
+
5. Which existing modules, APIs, data, dependencies, or other relevant integrations are involved?
|
|
20
|
+
6. Which edge cases, errors, permissions, limits, state transitions, or failure modes matter?
|
|
21
|
+
7. How can completion be verified with observable behavior or deterministic evidence?
|
|
22
|
+
8. Does any phrase require an unseen earlier question, recommendation, or option list?
|
|
23
|
+
9. Why is each reference material relevant, and what should the execution AI inspect?
|
|
24
|
+
10. Do quoted source materials agree with the final task decision?
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
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.
|
|
27
|
+
|
|
28
|
+
## Step 2: Contract and Material Checks
|
|
29
|
+
|
|
30
|
+
- Preserve substantive user requirements, rationale, and constraints at matching detail; normalization must not collapse a detailed specification into a short summary.
|
|
31
|
+
- Expand option shorthand into complete selected meaning, for example: `Selected decision: use cursor pagination with a 50-item default`.
|
|
32
|
+
- Do not emit transcript annotations such as `(original response: "...")`; parenthetical content must also be independently intelligible and materially useful.
|
|
33
|
+
- Resolve `方案B`, `按推荐走`, `same as above`, or `go with your recommendation` only when there is one provable antecedent. Otherwise ask the user for clarification.
|
|
34
|
+
- Exclude `所有问题都按你的推荐处理`, `全部按照推荐`, `use all recommendations`, and equivalent blanket recommendation approval when it controls planning but does not constrain implementation; never repeat it once per accepted recommendation.
|
|
35
|
+
- Do not present rejected alternatives as active requirements; retain them only as necessary non-goals.
|
|
36
|
+
- Require purpose-tagged paths and URLs when they identify stable execution targets.
|
|
37
|
+
- Do not retain non-code planning-source paths such as `.agents/brainstorm/<note>.md`, uploads, screenshots, or ad-hoc logs. Instead, copy or normalize the task-relevant content into the contract, which must not depend on that source file still existing.
|
|
38
|
+
- For large materials, preserve purpose and task-relevant exact excerpts; move confirmed requirements into the task contract rather than embedding the entire source, and retain a location only when it is a stable execution-time source of truth.
|
|
39
|
+
- If `user_context` were removed, `description` and `acceptance_criteria` must remain sufficient for execution and verification.
|
|
40
|
+
|
|
41
|
+
### Good and Bad Examples
|
|
42
|
+
|
|
43
|
+
- Bad: `方案B` or `Selected decision: keep saved filters account-scoped (original response: "方案B")`.
|
|
44
|
+
- Good: `Selected decision: keep saved filters account-scoped and sync through the existing preferences API`.
|
|
45
|
+
- Bad: repeating `(original response: "全部按照推荐")` after each accepted default; write each concrete default and omit the blanket approval.
|
|
46
|
+
- Bad: `same as above` when multiple earlier decisions exist.
|
|
47
|
+
- Good: ask which earlier decision applies, then record its complete meaning.
|
|
48
|
+
- Bad: `.agents/brainstorm/search.md — inspect ranking choices`.
|
|
49
|
+
- Good: state the selected ranking tie-breakers and empty-query behavior in the task contract; retain only a purpose-tagged stable code or interface path when execution must inspect it.
|
|
50
|
+
- Bad: copy a complete issue into `user_context` while leaving the feature description as `implement the issue`.
|
|
51
|
+
- Good: retain the issue URL and relevant exact excerpts as evidence, then state all confirmed behavior and completion checks in the feature contract.
|
|
52
|
+
|
|
53
|
+
## Step 3: Cross-Feature Completeness Check
|
|
28
54
|
|
|
29
55
|
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
56
|
|
|
34
|
-
|
|
57
|
+
- **Implied functionality gaps**: Does one feature assume a capability that no feature provides?
|
|
58
|
+
- **Missing integration seams**: If two features share data or interact at runtime, is the interface specified by meaning?
|
|
59
|
+
- **Dependency context**: Does each dependent feature state exactly which predecessor output it consumes?
|
|
60
|
+
- **Scope leaks**: Does a description activate rejected or out-of-scope functionality?
|
|
61
|
+
- **Source conflict**: Does an excerpt describe an earlier alternative that conflicts with the selected final decision?
|
|
35
62
|
|
|
36
|
-
|
|
63
|
+
## Step 4: Present Review and Repair
|
|
37
64
|
|
|
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
|
-
```
|
|
65
|
+
Show a structured summary:
|
|
46
66
|
|
|
47
|
-
|
|
67
|
+
```text
|
|
68
|
+
Feature | Artifact-Alone Answers | References | Cross-Feature Issues | Verdict
|
|
69
|
+
F-001 | complete | purposeful | none | PASS
|
|
70
|
+
F-002 | missing current state | URL vague | none | NEEDS_FIXES
|
|
71
|
+
```
|
|
48
72
|
|
|
49
|
-
|
|
73
|
+
For each `NEEDS_FIXES` item:
|
|
50
74
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
4. Re-check: does the supplement resolve the gap?
|
|
75
|
+
1. Ask targeted clarification when the missing meaning cannot be proven from one antecedent.
|
|
76
|
+
2. Update the draft/source feature, not only `user_context`.
|
|
77
|
+
3. Re-run this gate on the changed item.
|
|
78
|
+
4. Continue until every new or changed feature returns `PASS`.
|
|
56
79
|
|
|
57
|
-
|
|
80
|
+
Only then may generation proceed. Structural validation after generation does not replace this semantic gate.
|
|
@@ -20,8 +20,8 @@ Do not rely on `git status`, `git diff`, or `git diff --cached` to decide whethe
|
|
|
20
20
|
## Review Scope
|
|
21
21
|
|
|
22
22
|
1. If a pre-session final list exists, compare by stable feature IDs (`F-*`).
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
23
|
+
2. Root project prose is reviewable content, not generator metadata. Review new or changed `project_description` and `global_context` even when no feature item changed. Ignore root generator metadata and formatting-only differences such as `$schema`, `created_at`, and `created_by`.
|
|
24
|
+
3. Treat features as changed only when item fields changed; review newly added feature IDs and changed feature IDs.
|
|
25
25
|
4. Preserve unchanged historical features. Read unchanged entries only when needed to verify dependency references from reviewed features.
|
|
26
26
|
5. If no snapshot exists, review all feature entries produced by the current generation flow.
|
|
27
27
|
|
|
@@ -31,13 +31,41 @@ 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
|
+
- Artifact-wide readability: every generated natural-language value across all AI-visible fields and sections—including `project_description`, `global_context`, titles, rationales, `user_context`, evidence, comments, and parentheticals—is a standalone domain statement without dialogue-role labels, question IDs, answer tokens, planning-option recommendation markers, or planning provenance
|
|
35
36
|
- Acceptance criteria specificity, measurability, and coverage of the described behavior
|
|
36
|
-
- User-provided
|
|
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 task contract; if `user_context` were removed, execution and verification remain unambiguous
|
|
37
39
|
- 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
|
|
40
|
+
- Purpose-tagged stable code, configuration, machine-consumed interface, and URL references; transient non-code planning/evidence paths are replaced by inline task-relevant decisions and excerpts, and large materials are bounded rather than injected in full
|
|
38
41
|
- 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
42
|
- Browser interaction fields for qualifying frontend/fullstack features when applicable
|
|
40
43
|
|
|
44
|
+
## Headless Context Completeness Gate
|
|
45
|
+
|
|
46
|
+
Repeat the pre-generation simulation for every reviewed new or changed feature as if the reviewer has never seen the planning conversation. First scan all AI-visible fields and sections; machine metadata is exempt, but every generated natural-language value must be session-independent. From the artifact alone, answer:
|
|
47
|
+
|
|
48
|
+
1. What exact problem or outcome is this task responsible for?
|
|
49
|
+
2. What exists today and what must change?
|
|
50
|
+
3. Which approach was selected, expressed by meaning rather than an option label?
|
|
51
|
+
4. What constraints and non-goals must be preserved?
|
|
52
|
+
5. Why is each reference material relevant?
|
|
53
|
+
6. How can completion be verified?
|
|
54
|
+
7. Does any phrase require an unseen earlier question, recommendation, or option list?
|
|
55
|
+
8. Do quoted source materials agree with the final task decision?
|
|
56
|
+
|
|
57
|
+
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`. Parenthetical notes are part of the artifact and must pass the same fresh-session test. Do not emit transcript annotations such as `(original response: "...")`; raw shorthand is not independently intelligible and materially useful. Preserve substantive rationale in the durable task contract. Treat `所有问题都按你的推荐处理`, `全部按照推荐`, `use all recommendations`, and equivalent blanket recommendation approval as conversational authorization: write the concrete accepted decisions, omit the raw approval, and never repeat it once per accepted recommendation. Do not retain non-code planning-source paths such as `.agents/brainstorm/<note>.md`; copy or normalize the task-relevant content into the contract, which must not depend on that source file still existing. Ask the user for clarification when there is not one provable antecedent.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
### Good and Bad Review Examples
|
|
62
|
+
|
|
63
|
+
- Bad: `same as above` or a complete API decision followed by `(original response: "same as above")`; Good: record only the complete selected API behavior after its single antecedent is proven.
|
|
64
|
+
- Bad: repeating `(original response: "全部按照推荐")` on accepted defaults; Good: omit the blanket approval after normalizing each default into concrete behavior.
|
|
65
|
+
- Bad: a bare URL; Good: `https://example.test/search-rfc — inspect ranking tie-breakers and empty-query behavior` plus only task-relevant exact excerpts.
|
|
66
|
+
- Bad: `.agents/brainstorm/search.md — inspect selected behavior` in a final contract; Good: write the selected behavior inline and omit the transient planning path.
|
|
67
|
+
- Bad: `所有问题都按你的推荐处理` as an implementation rule; Good: omit it as conversational authorization unless a concrete selected decision was separately confirmed.
|
|
68
|
+
|
|
41
69
|
## Fix Loop
|
|
42
70
|
|
|
43
71
|
1. Present findings with IDs, severity, evidence, and suggested draft/source changes.
|
|
@@ -50,14 +78,15 @@ python3 ${SKILL_DIR}/scripts/validate-and-generate.py generate --input .prizmkit
|
|
|
50
78
|
```
|
|
51
79
|
|
|
52
80
|
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.
|
|
81
|
+
6. Repeat the local review and Headless Context Completeness Gate only for entries changed by accepted fixes.
|
|
82
|
+
7. Do not report `PASS` until every required fresh-session answer is available and final validation passes after regeneration.
|
|
54
83
|
|
|
55
84
|
## Report Format
|
|
56
85
|
|
|
57
86
|
Report in the final handoff summary:
|
|
58
87
|
|
|
59
88
|
- `Local generated-plan review: PASS` or `NEEDS_FIXES`
|
|
60
|
-
- Reviewed feature IDs
|
|
89
|
+
- Reviewed feature IDs and reviewed root prose (`project_description` / `global_context`) when applicable
|
|
61
90
|
- Accepted fixes, or `none`
|
|
62
91
|
- Final validation result
|
|
63
92
|
- Note when review was not applicable because no new final planning content was written
|
|
@@ -45,29 +45,53 @@ 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
|
-
##
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
1. **
|
|
53
|
-
2. **
|
|
54
|
-
3. **
|
|
55
|
-
4. **
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
+
### Artifact-Wide AI Readability
|
|
59
|
+
|
|
60
|
+
- Every generated natural-language value must be a standalone domain statement. This applies to all AI-visible fields and sections, including `project_description`, `global_context`, titles, descriptions, scope explanations, complexity/priority rationale, `behavior_preservation`, `completion_notes`, acceptance criteria, `user_context`, verification goals, comments, appendices, and parentheticals.
|
|
61
|
+
- Machine metadata such as schema markers, stable IDs, statuses, enums, and timestamps is exempt. Natural-language metadata is not exempt.
|
|
62
|
+
- Never emit dialogue-role or chronology labels such as `user said`, `user answered`, `original request`, `this round`, `previous discussion`, `as discussed earlier`, `用户本轮回答`, or `如前面讨论`. Never emit planning question IDs, answer tokens, planning-option recommendation markers, checkpoint provenance, or raw internal answer-map entries as domain content.
|
|
63
|
+
- `user_context` may hold independently intelligible evidence, not transcript fragments. Rewrite every confirmed turn into direct current/target architecture, scope, constraints, rationale, preservation, or verification evidence before generation.
|
|
64
|
+
|
|
65
|
+
### Conversational Context Normalization
|
|
66
|
+
|
|
67
|
+
- Never persist standalone option labels such as `A`, `B`, `C`, `方案A`, or `方案B` as execution context.
|
|
68
|
+
- Expand a selected option into complete meaning and preserve substantive user rationale and constraints in durable prose at matching detail.
|
|
69
|
+
- Do not emit transcript annotations such as `(original response: "...")` in final refactor artifacts. Bare option labels and relative shorthand are not independently intelligible and materially useful exact wording.
|
|
70
|
+
- Resolve `上面`, `这个`, `按推荐走`, `同前`, `继续这样`, `用刚才的方案`, `same as above`, or `go with your recommendation` only when there is one provable antecedent. Otherwise ask the user for clarification; never guess.
|
|
71
|
+
- Treat `所有问题都按你的推荐处理`, `全部按照推荐`, `use all recommendations`, and equivalent blanket recommendation approval as conversational authorization. Apply the concrete accepted recommendations, then omit the raw approval; never repeat it once per accepted recommendation.
|
|
72
|
+
- Do not present rejected architectures as active instructions; preserve one only when it defines a necessary non-goal or compatibility boundary. Retain exact user wording only when it is independently intelligible and materially useful.
|
|
73
|
+
|
|
74
|
+
### Reference Material Handling
|
|
75
|
+
|
|
76
|
+
- Every retained stable code, configuration, machine-consumed interface, or URL 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`.
|
|
77
|
+
- Do not retain non-code planning-source paths such as `.agents/brainstorm/<note>.md`, uploaded-analysis paths, screenshot paths, or ad-hoc log paths in durable refactor contracts. Instead, copy or normalize the task-relevant content into `description` and `acceptance_criteria`; the item must not depend on that source file still existing.
|
|
78
|
+
- Good: `src/auth/validation.ts — inspect exported signatures and current error semantics before extracting middleware`; Bad: `src/auth/validation.ts` alone.
|
|
79
|
+
- For large materials, preserve purpose and only task-relevant exact excerpts, and move confirmed target architecture, scope boundaries, constraints, and preservation decisions into `description` and `acceptance_criteria`. Retain a location only when it is a stable execution-time source of truth.
|
|
80
|
+
- Embed complete large materials only when the execution session cannot access the source and all content is genuinely required.
|
|
81
|
+
|
|
82
|
+
### Good and Bad Normalization Examples
|
|
83
|
+
|
|
84
|
+
- Bad: `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation` stored as the target architecture.
|
|
85
|
+
- Bad: `Selected decision: extract auth validation (original response: "方案B")`; the annotation still requires an unseen option list.
|
|
86
|
+
- Good: `Selected decision: extract validation behind an auth-owned middleware interface while preserving all handler exports`.
|
|
87
|
+
- Good: `Selected decision: migrate imports in one compatibility-preserving phase and remove no public paths`.
|
|
88
|
+
- Bad: storing or repeating `全部按照推荐` / `所有问题都按你的推荐处理` as a preservation rule; it is conversational authorization.
|
|
89
|
+
- Bad: attaching a full architecture RFC or `.agents/brainstorm/refactor.md` path while saying only `apply this`. Good: copy the relevant architecture, scope, and preservation decisions into the item contract and omit the transient planning path.
|
|
66
90
|
|
|
67
91
|
**Multi-refactor isolation example:**
|
|
68
92
|
- 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
|
|
70
|
-
- The chart
|
|
93
|
+
- 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.
|
|
94
|
+
- 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
95
|
|
|
72
96
|
## When to Use
|
|
73
97
|
- "Plan refactoring", "Scope a restructuring"
|
|
@@ -162,7 +186,7 @@ Execute the planning workflow in conversation mode with mandatory checkpoints:
|
|
|
162
186
|
>
|
|
163
187
|
> If none, we'll proceed with what's available in the codebase."
|
|
164
188
|
|
|
165
|
-
If the user provides materials,
|
|
189
|
+
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. Material ingestion follows the same durability rule as final output: copy or normalize task-relevant requirements and exact evidence, omit transient non-code paths, and retain only purpose-tagged stable execution-time sources. Do not inject complete large materials merely to preserve them. This context is critical for understanding the target architecture and constraints.
|
|
166
190
|
|
|
167
191
|
**CHECKPOINT CP-RP-0**: Project context loaded, tech stack and test suite status known.
|
|
168
192
|
|
|
@@ -190,9 +214,10 @@ Support 4 input formats (users may mix formats):
|
|
|
190
214
|
> "The database layer is tightly coupled to the HTTP layer"
|
|
191
215
|
|
|
192
216
|
For each input, ask clarifying questions:
|
|
193
|
-
- What is the specific target (files, modules, patterns)?
|
|
194
|
-
- What is the desired end state?
|
|
195
|
-
-
|
|
217
|
+
- What is the specific target (files, modules, patterns), and what should the execution AI inspect at each purpose-tagged target path?
|
|
218
|
+
- What is the complete desired target architecture or end state?
|
|
219
|
+
- What are the scope boundaries and non-goals (must preserve API, must not touch certain files, rejected architecture that must stay rejected)?
|
|
220
|
+
- Which behavior-preservation decisions and completion evidence prove the refactor is safe?
|
|
196
221
|
- What is the motivation (maintainability, performance, testability)?
|
|
197
222
|
|
|
198
223
|
Continue collecting goals until the user says they're done. There is no limit on rounds.
|
|
@@ -246,13 +271,13 @@ See `${SKILL_DIR}/references/planning-phases.md` for the display template and co
|
|
|
246
271
|
|
|
247
272
|
**CHECKPOINT CP-RP-4**: All items confirmed by user.
|
|
248
273
|
|
|
249
|
-
### Phase 6: Completeness
|
|
274
|
+
### Phase 6: Headless Context Completeness Gate
|
|
250
275
|
|
|
251
|
-
**Goal**: Check
|
|
276
|
+
**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
277
|
|
|
253
278
|
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
279
|
|
|
255
|
-
**CHECKPOINT CP-RP-5**: Completeness
|
|
280
|
+
**CHECKPOINT CP-RP-5**: Headless Context Completeness Gate passed for every new or changed item, all issues resolved without relying on `user_context`.
|
|
256
281
|
|
|
257
282
|
### Phase 7: Generate & Validate
|
|
258
283
|
|
|
@@ -290,7 +315,7 @@ See `${SKILL_DIR}/references/planning-phases.md` for the full 5-step review chec
|
|
|
290
315
|
|
|
291
316
|
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
317
|
|
|
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
|
|
318
|
+
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
319
|
|
|
295
320
|
## Output Rules
|
|
296
321
|
|
|
@@ -400,5 +425,5 @@ After successful validation and the Local Generated-Plan Review Gate, report:
|
|
|
400
425
|
2. Total refactor items
|
|
401
426
|
3. Dependency ordering highlights (which items must run first)
|
|
402
427
|
4. Behavior preservation strategy distribution (N items with test-gate, M with snapshot, etc.)
|
|
403
|
-
5. Local generated-plan review result: verdict, reviewed refactor IDs, accepted fixes (or "none"), and final validation result
|
|
428
|
+
5. Local generated-plan review result: verdict, reviewed refactor IDs plus reviewed root prose when applicable, accepted fixes (or "none"), and final validation result
|
|
404
429
|
6. Recommended next action: `refactor-pipeline-launcher`
|
|
@@ -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.
|
|
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
|
-
|
|
38
|
-
|
|
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
|
|
@@ -20,8 +20,8 @@ Do not rely on `git status`, `git diff`, or `git diff --cached` to decide whethe
|
|
|
20
20
|
## Review Scope
|
|
21
21
|
|
|
22
22
|
1. If a pre-session final list exists, compare by stable refactor IDs (`R-*`).
|
|
23
|
-
2.
|
|
24
|
-
3.
|
|
23
|
+
2. Root project prose is reviewable content, not generator metadata. Review new or changed `project_description` and `global_context` even when no refactor item changed. Ignore root generator metadata and formatting-only differences such as `$schema`, `created_at`, and `created_by`.
|
|
24
|
+
3. Treat refactors as changed only when item fields changed; review newly added refactor IDs and changed refactor IDs.
|
|
25
25
|
4. Preserve unchanged historical refactors. Read unchanged entries only when needed to verify dependency references or behavior-preservation interactions with reviewed refactors.
|
|
26
26
|
5. If no snapshot exists, review all refactor entries produced by the current generation flow.
|
|
27
27
|
|
|
@@ -31,13 +31,40 @@ 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
|
|
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
|
+
- Artifact-wide readability: every generated natural-language value across all AI-visible fields and sections—including `project_description`, `global_context`, scope explanations, rationales, behavior-preservation/evidence text, `user_context`, comments, and parentheticals—is a standalone domain statement without dialogue-role labels, question IDs, answer tokens, planning-option recommendation markers, or planning provenance
|
|
35
36
|
- Acceptance criteria specificity and measurable behavior-preservation verification
|
|
36
37
|
- `behavior_preservation` strategy quality and consistency with target scope and existing tests
|
|
37
|
-
- User-provided
|
|
38
|
+
- User-provided detail preservation at matching detail after conversational normalization
|
|
39
|
+
- `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
40
|
- 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
|
|
41
|
+
- Purpose-tagged stable code, configuration, machine-consumed interface, and URL targets; transient non-code planning/evidence paths are replaced by inline task-relevant decisions and excerpts, and large materials are bounded rather than injected in full
|
|
39
42
|
- 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
43
|
|
|
44
|
+
## Headless Context Completeness Gate
|
|
45
|
+
|
|
46
|
+
Repeat the pre-generation simulation for every reviewed new or changed refactor as if the reviewer has never seen the planning conversation. First scan all AI-visible fields and sections; machine metadata is exempt, but every generated natural-language value must be session-independent. From the artifact alone, answer:
|
|
47
|
+
|
|
48
|
+
1. What exact problem or outcome is this task responsible for?
|
|
49
|
+
2. What current architecture exists and what target architecture must replace it?
|
|
50
|
+
3. Which approach was selected, expressed by meaning rather than an option label?
|
|
51
|
+
4. What scope boundaries, constraints, and non-goals must be preserved?
|
|
52
|
+
5. Why is each reference material and target path relevant?
|
|
53
|
+
6. How can completion and behavior preservation be verified?
|
|
54
|
+
7. Does any phrase require an unseen earlier question, recommendation, or option list?
|
|
55
|
+
8. Do quoted source materials agree with the final task decision?
|
|
56
|
+
|
|
57
|
+
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`. Parenthetical notes are part of the artifact and must pass the same fresh-session test. Do not emit transcript annotations such as `(original response: "...")`; raw shorthand is not independently intelligible and materially useful. Preserve substantive rationale in the durable refactor contract. Treat `所有问题都按你的推荐处理`, `全部按照推荐`, `use all recommendations`, and equivalent blanket recommendation approval as conversational authorization: write the concrete accepted decisions, omit the raw approval, and never repeat it once per accepted recommendation. Do not retain non-code planning-source paths such as `.agents/brainstorm/<note>.md`; copy or normalize the task-relevant content into the contract, which must not depend on that source file still existing. Ask the user for clarification when there is not one provable antecedent.
|
|
58
|
+
|
|
59
|
+
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.
|
|
60
|
+
|
|
61
|
+
### Good and Bad Review Examples
|
|
62
|
+
|
|
63
|
+
- Bad: `go with your recommendation` as target architecture or as `(original response: "go with your recommendation")`; Good: `Selected decision: reverse the auth/user dependency through a shared identity interface and retain existing public imports`.
|
|
64
|
+
- Bad: repeating `(original response: "全部按照推荐")`; Good: omit the blanket approval after writing each concrete accepted decision.
|
|
65
|
+
- Bad: bare `src/auth/`; Good: `src/auth/ — inspect public exports, dependency direction, and compatibility call sites before restructuring`.
|
|
66
|
+
- Bad: an entire RFC pasted into evidence or `.agents/brainstorm/refactor.md` retained as a requirement; Good: inline task-relevant excerpts and all confirmed target decisions, then omit the transient planning path.
|
|
67
|
+
|
|
41
68
|
## Fix Loop
|
|
42
69
|
|
|
43
70
|
1. Present findings with IDs, severity, evidence, and suggested draft/source changes.
|
|
@@ -50,14 +77,15 @@ python3 ${SKILL_DIR}/scripts/validate-and-generate-refactor.py generate --input
|
|
|
50
77
|
```
|
|
51
78
|
|
|
52
79
|
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.
|
|
80
|
+
6. Repeat the local review and Headless Context Completeness Gate only for entries changed by accepted fixes.
|
|
81
|
+
7. Do not report `PASS` until every required fresh-session answer is available and final validation passes after regeneration.
|
|
54
82
|
|
|
55
83
|
## Report Format
|
|
56
84
|
|
|
57
85
|
Report in the final handoff summary:
|
|
58
86
|
|
|
59
87
|
- `Local generated-plan review: PASS` or `NEEDS_FIXES`
|
|
60
|
-
- Reviewed refactor IDs
|
|
88
|
+
- Reviewed refactor IDs and reviewed root prose (`project_description` / `global_context`) when applicable
|
|
61
89
|
- Accepted fixes, or `none`
|
|
62
90
|
- Final validation result
|
|
63
91
|
- Note when review was not applicable because no new final planning content was written
|
|
@@ -47,13 +47,33 @@ Offer `Accept`, `Modify`, and `Skip` as selectable options. Re-display modified
|
|
|
47
47
|
2. **Behavior preservation check**: Every item must have a declared preservation strategy. Flag any item with `manual` strategy and no test coverage.
|
|
48
48
|
3. **Gap detection**: Are there intermediate steps needed between items? Does item A's output match item B's input assumption?
|
|
49
49
|
4. **Cross-module impact**: Do any items affect modules outside the declared scope?
|
|
50
|
-
5. **Headless
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
5. **Headless Context Completeness Gate**: Review every new or changed item as if the reviewer has never seen the planning conversation. Preserve unchanged historical items. Scan all AI-visible fields and sections first: every generated natural-language value in `project_description`, `global_context`, item fields, scope explanations, behavior-preservation/evidence text, `user_context`, comments, and parentheticals must be session-independent, with no dialogue-role labels, question IDs, answer tokens, planning-option recommendation markers, or planning provenance. Review changed root prose even when no refactor item changed. Then assess `description` plus `acceptance_criteria` without `user_context` and answer from the artifact alone:
|
|
51
|
+
1. What exact problem or outcome is this task responsible for?
|
|
52
|
+
2. What current architecture exists and what target architecture must replace it?
|
|
53
|
+
3. Which approach was selected, expressed by meaning rather than an option label?
|
|
54
|
+
4. What scope boundaries, constraints, and non-goals must be preserved?
|
|
55
|
+
5. Why is each reference material and target path relevant, and what should be inspected?
|
|
56
|
+
6. Which integrations, consumers, import paths, and edge cases are affected?
|
|
57
|
+
7. Which behavior-preservation decisions and completion evidence prove equivalence?
|
|
58
|
+
8. Does any phrase require an unseen earlier question, recommendation, or option list?
|
|
59
|
+
9. Do quoted source materials agree with the final task decision?
|
|
60
|
+
|
|
61
|
+
Return `NEEDS_FIXES` whenever any answer is missing, ambiguous, or available only in `user_context`. Parenthetical notes must pass the same gate. Do not emit transcript annotations such as `(original response: "...")`; preserve substantive rationale, but omit bare selection tokens and `全部按照推荐` or equivalent blanket recommendation approval after normalization. Ask the user for clarification when a relative statement has more than one plausible antecedent; never guess.
|
|
62
|
+
|
|
63
|
+
- **Scope clarity**: List all affected files and explain each file or coherent group as purpose-tagged target paths.
|
|
64
|
+
- **Target architecture**: State concrete module ownership, interfaces, dependency direction, compatibility boundaries, and desired end state.
|
|
65
|
+
- **Behavior preservation**: State what tests, snapshots, or reproducible checks run and which observable behavior must remain equivalent.
|
|
66
|
+
- **Dependency context**: State which exact earlier refactor output this item consumes.
|
|
67
|
+
- **Good**: `Extract validateEmail, validatePhone, and validateUrl from src/utils/helpers.ts into src/utils/validation.ts; update all 12 import sites; preserve signatures and error semantics. src/utils/helpers.ts — inspect current exports and callers before extraction.`
|
|
68
|
+
- **Bad**: `Clean up the utils module`, `方案B`, `按推荐走`, `use option A`, `same as above`, or `go with your recommendation`.
|
|
69
|
+
- **Bad normalization**: append `(original response: "方案B")` to a complete architecture decision; the annotation is not independently intelligible and materially useful.
|
|
70
|
+
- **Good normalization**: `Selected decision: introduce an auth-owned validation module while retaining existing public imports through compatibility re-exports`.
|
|
71
|
+
- **Bad material handling**: embed an entire architecture RFC while saying `apply this`, or retain `.agents/brainstorm/refactor.md` as a final requirement source.
|
|
72
|
+
- Do not retain non-code planning-source paths in the final contract.
|
|
73
|
+
- **Good material handling**: copy or normalize the task-relevant content and exact excerpts into the contract; retain only purpose-tagged stable execution targets. The item must not depend on that source file still existing.
|
|
74
|
+
- Exclude `所有问题都按你的推荐处理`, `全部按照推荐`, and equivalent conversational authorization when it does not constrain implementation; never repeat it once per accepted recommendation.
|
|
75
|
+
- `user_context` is supplementary evidence only. If `user_context` were removed, execution and verification must remain unambiguous at matching detail.
|
|
76
|
+
- Do not add new JSON fields, context objects, schema versions, or pipeline runtime structures.
|
|
57
77
|
|
|
58
78
|
### Review Summary Table Format
|
|
59
79
|
|
|
@@ -67,7 +87,7 @@ R-003 | low | Local readability only | low | One file, no AP
|
|
|
67
87
|
R-004 | medium | Reduces bounded coupling | medium | 2 modules + snapshot check | OK | snapshot | - | Ready
|
|
68
88
|
```
|
|
69
89
|
|
|
70
|
-
If issues found, discuss with user and
|
|
90
|
+
If issues are found, discuss with the user, apply fixes to the draft/source item, and rerun the Headless Context Completeness Gate until every new or changed item returns `PASS` before proceeding.
|
|
71
91
|
|
|
72
92
|
---
|
|
73
93
|
|