prizmkit 1.1.154 → 1.1.156

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.
Files changed (164) hide show
  1. package/bundled/VERSION.json +3 -3
  2. package/bundled/adapters/codex/skill-adapter.js +1 -1
  3. package/bundled/adapters/pi/skill-adapter.js +2 -1
  4. package/bundled/dev-pipeline/.env.example +2 -6
  5. package/bundled/dev-pipeline/README.md +21 -27
  6. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
  7. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
  8. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
  9. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  10. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  11. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
  12. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  13. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
  14. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  15. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  16. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  17. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  18. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  19. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  20. package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
  21. package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
  22. package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
  23. package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
  24. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  25. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  26. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  27. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  28. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  29. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  30. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  31. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  32. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  33. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  34. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  35. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  36. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  37. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  38. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  39. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  40. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  41. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  42. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  43. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  44. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  45. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  46. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  47. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  48. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  49. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  50. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  51. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  53. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  54. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  55. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  56. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
  57. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
  58. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  59. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  60. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
  61. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
  62. package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
  63. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  64. package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
  65. package/bundled/skills/_metadata.json +9 -9
  66. package/bundled/skills/app-planner/SKILL.md +3 -3
  67. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  68. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  69. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  70. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  71. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  72. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  73. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  74. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  75. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  76. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  77. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  78. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  79. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  80. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  81. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  82. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  83. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  84. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  85. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  86. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  87. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  88. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  89. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  90. package/bundled/skills/prizmkit/SKILL.md +17 -18
  91. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  92. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  93. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  94. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  95. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  96. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  97. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  98. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  99. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  100. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  101. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  102. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  103. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  104. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  105. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  106. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  107. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  108. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  109. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  110. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  111. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  112. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  113. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  114. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  115. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +75 -11
  116. package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
  117. package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
  118. package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
  119. package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
  120. package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
  121. package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
  122. package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
  123. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
  124. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  125. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
  126. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  127. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  128. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  129. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  130. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  131. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  132. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  133. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  134. package/bundled/skills/recovery-workflow/SKILL.md +2 -1
  135. package/bundled/skills/recovery-workflow/references/detection.md +4 -3
  136. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
  137. package/bundled/templates/hooks/validate-prizm-docs.py +124 -12
  138. package/package.json +1 -1
  139. package/src/scaffold.js +33 -22
  140. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  141. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  142. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  143. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  144. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  145. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  146. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  147. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  148. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  149. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  150. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  151. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  152. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  153. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  154. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  155. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  156. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  157. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  158. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  159. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  160. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  161. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  162. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  163. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  164. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -1,158 +1,136 @@
1
1
  # Database Rules — {{ project_name }}
2
2
 
3
- > This document was generated by the `database-rules` skill on {{ generated_at }}
4
- > Audience: All project developers + DBAs + all AI coding assistants
5
- >
6
- > **Usage**:
7
- > 1. All AI coding assistants must read this file before generating or modifying any database-related code
8
- > 2. This document takes precedence over "general best practices" in AI training data
9
- > 3. Operations conflicting with this document must not be executed
10
-
11
- ---
12
-
13
- ## 0. TL;DR Key Decisions at a Glance
14
-
15
- | Dimension | Decision |
16
- |-----------|----------|
17
- | Primary Database | {{ database }} |
18
- | Cache Layer | {{ cache }} |
19
- | Primary Key Strategy | {{ pk_strategy }} |
20
- | Soft Delete | {{ soft_delete }} |
21
- | Normalization Level | {{ normalization }} |
22
- | Migration Tool | {{ migration_tool }} |
23
- | Workload Type | {{ workload_type }} |
24
- | Data Scale | {{ data_scale }} |
25
- | Data Sensitivity | {{ data_sensitivity }} |
26
- | Audit Requirements | {{ audit }} |
27
- | Deployment Method | {{ deployment }} |
28
- | Backup Strategy | {{ backup }} |
29
- | High Availability | {{ ha }} |
30
- | AI DDL Permission | {{ ai_ddl_permission }} |
31
- | AI Safety Constraints | {{ ai_safety_constraint }} |
32
-
33
- ---
34
-
35
- ## 1. Schema Design
3
+ > Generated by app-planner Rules Configuration
4
+ > Audience: project contributors, data operators, and AI coding assistants working on persistence
5
+
6
+ This document applies invariant safety principles through the selected datastore and operational decisions. SQL and relational rules are not active for document or embedded stores unless explicitly selected.
7
+
8
+ ## 1. Decision Ledger
9
+
10
+ | Domain | Selected Decision |
11
+ |---|---|
12
+ | Primary datastore | {{ database }} |
13
+ | Cache | {{ cache }} |
14
+ | Identifier strategy | {{ pk_strategy }} |
15
+ | Soft deletion | {{ soft_delete }} |
16
+ | Modeling/normalization | {{ normalization }} |
17
+ | Migration mechanism | {{ migration_tool }} |
18
+ | Workload | {{ workload_type }} |
19
+ | Estimated scale | {{ data_scale }} |
20
+ | Data sensitivity | {{ data_sensitivity }} |
21
+ | Audit/CDC | {{ audit }} |
22
+ | Deployment | {{ deployment }} |
23
+ | Backup | {{ backup }} |
24
+ | Availability | {{ ha }} |
25
+ | AI structure-change permission | {{ ai_ddl_permission }} |
26
+ | AI destructive-operation policy | {{ ai_safety_constraint }} |
27
+
28
+ Deferred and not-applicable decisions remain explicit.
29
+
30
+ ## 2. Data Model and Types
31
+
32
+ ### 2.1 Model invariants
36
33
 
37
34
  {{ FIXED_RULES_SCHEMA }}
38
35
 
39
- {{ schema_rules }}
36
+ ### 2.2 Selected identifier and modeling rules
40
37
 
41
- ---
38
+ {{ schema_rules }}
42
39
 
43
- ## 2. Column Types
40
+ ### 2.3 Type invariants and datastore-specific rules
44
41
 
45
42
  {{ FIXED_RULES_TYPES }}
46
43
 
47
44
  {{ tech_rules }}
48
45
 
49
- ---
46
+ ## 3. Access, Atomicity, and Performance
50
47
 
51
- ## 3. Index Strategy
48
+ ### 3.1 Access paths
52
49
 
53
50
  {{ FIXED_RULES_INDEX }}
54
51
 
55
- ---
56
-
57
- ## 3b. Transaction Isolation
52
+ ### 3.2 Atomicity and concurrency
58
53
 
59
54
  {{ FIXED_RULES_TRANSACTION }}
60
55
 
61
- ---
56
+ ### 3.3 Workload and scale
62
57
 
63
- ## 4. Migration Management
58
+ {{ FIXED_RULES_PERFORMANCE }}
59
+
60
+ {{ performance_rules }}
61
+
62
+ ### 3.4 Client and connection lifecycle
63
+
64
+ {{ FIXED_RULES_CONNECTION }}
65
+
66
+ ## 4. Change Management
64
67
 
65
68
  {{ FIXED_RULES_MIGRATION }}
66
69
 
67
70
  {{ migration_rules }}
68
71
 
69
- ---
72
+ Migration, rollback, and compatibility behavior follows the selected datastore and tool; no SQL-only rollback format is implied for other technologies.
70
73
 
71
- ## 5. Query Standards
74
+ ## 5. Query and Mutation Safety
72
75
 
73
76
  {{ FIXED_RULES_QUERY }}
74
77
 
75
- > **Note**: For data access method rules (ORM/Query Builder/Raw SQL organization), refer to `backend-rules.md` §5 (Database). This document covers SQL-level query standards only.
78
+ Data-access organization may also be described in `backend-rules.md`. Shared datastore and ORM decisions must agree before either file is written.
76
79
 
77
- ---
78
-
79
- ## 6. Security & Permissions
80
+ ## 6. Security and Sensitivity
80
81
 
81
82
  {{ FIXED_RULES_SECURITY }}
82
83
 
83
84
  {{ security_rules }}
84
85
 
85
- ---
86
-
87
- ## 7. Backup & Recovery
86
+ ## 7. Audit and Change Streams
88
87
 
89
- {{ FIXED_RULES_BACKUP }}
90
-
91
- {{ ops_rules }}
88
+ {{ audit_rules }}
92
89
 
93
- ---
90
+ When audit and CDC are not selected, this section states that they are not applicable rather than inheriting enterprise defaults.
94
91
 
95
- ## 8. Performance
92
+ ## 8. Backup, Availability, and Operations
96
93
 
97
- {{ FIXED_RULES_PERFORMANCE }}
94
+ {{ FIXED_RULES_BACKUP }}
98
95
 
99
- {{ performance_rules }}
96
+ {{ ops_rules }}
100
97
 
101
- ---
98
+ The selected backup and availability decisions own this domain. Development-only choices must be labeled and must not silently become production guidance.
102
99
 
103
- ## 8b. Connection Pooling
100
+ ## 9. Cache
104
101
 
105
- {{ FIXED_RULES_CONNECTION }}
102
+ {{ cache_rules }}
106
103
 
107
- ---
104
+ When no cache is selected, render an explicit no-cache decision and omit cache-specific operational requirements.
108
105
 
109
- ## 9. AI Vibecoding Behavior Constraints
106
+ ## 10. AI Data-Change Permissions
110
107
 
111
- ### 9.1 Baseline Constraints (project-agnostic, always active)
108
+ ### 10.1 Invariant safety
112
109
 
113
110
  {{ FIXED_RULES_AI_BASE }}
114
111
 
115
- ### 9.2 Project-Specific Hard Constraints
116
-
117
- - **Database structure change permission**: {{ ai_ddl_rule }}
118
- - **Safety operation constraints**: {{ ai_safety_rule }}
119
-
120
- ### 9.3 Mandatory Pre-Actions (before generating any SQL/Migration)
121
-
122
- AI must complete the following in order before performing any database-related operation:
112
+ ### 10.2 Selected permissions
123
113
 
124
- 1. Read this file (`database-rules.md`)
125
- 2. Read existing schema or migration files to confirm table structure
126
- 3. Confirm the target database type and version
127
- 4. If involving indexes/DDL, first assess EXPLAIN and estimated execution time
114
+ - Structure-change permission: {{ ai_ddl_rule }}
115
+ - Destructive-operation policy: {{ ai_safety_rule }}
128
116
 
129
- ---
117
+ If these selected policies conflict, generation fails until the user chooses a coherent combination.
130
118
 
131
- ## 10. Audit & Compliance
132
-
133
- {{ audit_rules }}
134
-
135
- ---
136
-
137
- ## 11. Caching
138
-
139
- {{ cache_rules }}
140
-
141
- ---
142
-
143
- ## Appendix A: Deny List (Quick Reference)
144
-
145
- > This appendix is auto-generated by AI in Phase 4 by extracting all forbidden entries from each section.
119
+ ## Appendix A: Active Deny List
146
120
 
147
121
  {{ deny_list_summary }}
148
122
 
149
- ## Appendix B: Recommended Tools
123
+ Include only prohibitions from active invariant and selected blocks.
150
124
 
151
- > This appendix is auto-generated by AI in Phase 4 to recommend supporting tools based on database selection.
125
+ ## Appendix B: Compatible Recommendations
152
126
 
153
127
  {{ recommended_libs }}
154
128
 
155
- ---
129
+ Recommendations must match the selected datastore, deployment, and AI permission decisions.
130
+
131
+ ## Source Contract
156
132
 
157
- **Version**: v1.0 Generated on {{ generated_at }}
158
- **Next review recommended**: before database upgrades or architecture changes
133
+ - Owner: app-planner Rules Configuration
134
+ - Resource family: `references/rules/database/`
135
+ - Regenerate after a decision or source-contract change.
136
+ - Generation metadata value: {{ generated_at }}
@@ -15,6 +15,11 @@
15
15
 
16
16
  ---
17
17
 
18
+ ## SEMANTIC_FALLBACK_POLICY
19
+
20
+ Every confirmed option is valid input even when this file has no pre-authored block for it. For an unmatched option, render a concise rule that names the selected technology or practice, follows its current official and detected project conventions, preserves brownfield behavior unless migration was selected, and imports no rules from a recommended alternative. For `none`, `not required`, deferred, or conditionally skipped decisions, render an explicit not-applicable or deferred statement. Never leave a rule placeholder blank.
21
+
22
+ Before output, compare all active blocks with the decision ledger. A selected decision owns its policy domain; incompatible blocks fail generation instead of being merged.
18
23
 
19
24
  ## Phase 2 Normalized Semantic Fill Table
20
25
 
@@ -218,7 +223,7 @@ Appendix placeholders are auto-generated by AI in Phase 4:
218
223
  **Trigger**: Q2 = Next.js | **Inject into**: `{{ tech_stack_rules }}`
219
224
 
220
225
  - Images must use `next/image`. Forbid `<img>` (unless SVG inline).
221
- - Fonts must use `next/font`. Forbid external CDN font links.
226
+ - Apply the selected Q4b font strategy consistently. When `next/font` is compatible with that strategy, prefer it for framework integration; do not override a confirmed self-hosted, CDN, system-font, or deferred decision.
222
227
  - Links must use `next/link`. Forbid using `<a>` for internal navigation.
223
228
 
224
229
  ### D-NUXT-01
@@ -238,9 +243,9 @@ Appendix placeholders are auto-generated by AI in Phase 4:
238
243
  ### D-PNPM-01
239
244
  **Trigger**: Q3 = pnpm | **Inject into**: `{{ tech_stack_rules }}`
240
245
 
241
- - Package manager locked to pnpm. Commit `pnpm-lock.yaml` to the repository root. Forbid committing `package-lock.json` / `yarn.lock`.
242
- - `package.json` declares `"packageManager": "pnpm@x.y.z"`. CI validates.
243
- - Monorepo uses `pnpm workspace`. Forbid global dependencies.
246
+ - Use pnpm as selected and preserve one authoritative `pnpm-lock.yaml` according to repository policy.
247
+ - Record the resolved pnpm version in package metadata/tooling when the project uses that mechanism; never emit an `x.y.z` placeholder.
248
+ - Use pnpm workspaces only when the repository is a selected/detected monorepo; do not invent a workspace from the package-manager choice.
244
249
 
245
250
  ### D-TAILWIND-01
246
251
  **Trigger**: Q4 = Tailwind | **Inject into**: `{{ style_specific_rules }}`
@@ -433,9 +438,8 @@ Appendix placeholders are auto-generated by AI in Phase 4:
433
438
  ### D-DARK-NONE-01
434
439
  **Trigger**: Q10 = No dark mode | **Inject into**: `{{ dark_mode_rules }}`
435
440
 
436
- - Dark mode not supported at the current stage.
437
- - But Semantic Tokens must be defined using CSS variables to reserve expansion space for future switching.
438
- - Forbid hardcoding colors in components. All colors must go through Semantic Tokens.
441
+ - Dark mode is not supported in the current scope; do not emit theme-switching controls, alternate-value requirements, or expansion infrastructure.
442
+ - Continue to follow the separately selected token-layering and styling decisions.
439
443
 
440
444
  ### D-RESP-MF-01
441
445
  **Trigger**: Q11 = Mobile-first | **Inject into**: `{{ breakpoint_rules }}`
@@ -476,19 +480,15 @@ Appendix placeholders are auto-generated by AI in Phase 4:
476
480
  ### D-I18N-01
477
481
  **Trigger**: Q13 = Multi-language | **Inject into**: `{{ i18n_rules }}`
478
482
 
479
- - i18n solution: React projects use `react-i18next` or `next-intl`. Vue projects use `vue-i18n`.
480
- - **Forbid hardcoding any user-visible text in JSX/templates**. Must use i18n keys.
481
- - Key naming convention: `<page>.<section>.<element>` three-segment format.
482
- - Example: `login.form.submitButton`, `order.detail.priceLabel`.
483
- - Translation files split by language: `locales/zh-CN.json`, `locales/en-US.json`.
484
- - Plurals, dates, and currency use ICU MessageFormat. Forbid string concatenation.
485
- - Missing keys must cause CI errors. Translation files sorted by key for easy diffing.
483
+ - Use the confirmed existing or dependency-authorized i18n framework compatible with Q1/Q2; do not add a React/Vue library to another stack.
484
+ - Centralize user-visible text under one documented key and locale-file convention and include the explicitly selected locales.
485
+ - Use locale-aware plural, date, number, and currency formatting and define missing-key behavior appropriate to build/runtime risk.
486
486
 
487
487
  ### D-I18N-NONE-01
488
488
  **Trigger**: Q13 = Single-language, centralized | **Inject into**: `{{ i18n_rules }}`
489
489
 
490
- - The current project does not need multi-language support, but user-visible text must still be **centrally managed** in `src/i18n/<lang>.ts`.
491
- - Forbid hardcoding text in JSX/templates to prepare for future i18n adoption.
490
+ - Keep the selected single language centralized through the project's confirmed text catalog boundary.
491
+ - Record the actual stable catalog path; do not invent `src/i18n/<lang>.ts` or install a full runtime framework unless separately authorized.
492
492
 
493
493
  ### D-I18N-HARDCODE-01
494
494
  **Trigger**: Q13 = Single-language, hardcoding | **Inject into**: `{{ i18n_rules }}`
@@ -507,30 +507,21 @@ Appendix placeholders are auto-generated by AI in Phase 4:
507
507
 
508
508
  ### D-TEST-01 (Dynamically Assembled)
509
509
  **Trigger**: Q15 + Q16 + Q17 combination | **Inject into**: `{{ test_rules }}`
510
- **Generation rule**: Dynamically assemble based on user selection. Omit the corresponding framework line when not asked (Q16 is only asked for Q15=A/B; Q17 is only asked for Q15=A/C).
510
+ **Generation rule**: Dynamically assemble based on user selection. When Q15 selects `Not required yet`, render only an explicit deferred-testing statement and inject no framework or coverage requirements. Otherwise omit the corresponding framework line when not asked (Q16 is only asked for Q15=A/B; Q17 is only asked for Q15=A/C).
511
511
 
512
512
  - Testing strategy: {{ Q15 description }}
513
- - Unit test framework: {{ Q16 choice }} (only if Q15=A or B; if Vitest: supplement with "use `vitest` + `@testing-library/{{ framework }}` + `@testing-library/jest-dom`")
514
- - E2E framework: {{ Q17 choice }} (only if Q15=A or C; if Playwright: supplement with "E2E cases in `e2e/` directory, named `*.spec.ts`, run headless in CI, `--ui` for local debugging")
515
- - Coverage targets: shared components 80%, business components 50%, utility functions 90%.
516
- - Unit test principles:
517
- - Test behavior, not implementation.
518
- - Prefer `getByRole` / `getByLabelText`, then `getByText`. Avoid `getByTestId` (unless no semantics available).
519
- - Async assertions use `findBy*` or `waitFor`. Forbid `setTimeout`.
520
- - E2E principles (if enabled):
521
- - Cases cover critical business paths (login, checkout, payment, etc.).
522
- - Data isolation. Each case has independent setup/teardown.
523
- - Screenshot comparison only for core visual components.
513
+ - Unit test framework: {{ Q16 choice }} (only if Q15=A or B; use its compatible project-native component/DOM testing boundary without silently adding dependencies)
514
+ - E2E framework: {{ Q17 choice }} (only if Q15=A or C; execute headlessly in CI through the repository's selected layout/configuration)
515
+ - Do not invent numeric coverage thresholds. Add them only when explicitly confirmed outside the tier choice.
516
+ - Unit tests assert behavior and accessible semantics, isolate unstable dependencies, and use deterministic async assertions.
517
+ - E2E tests cover product-defined critical flows rather than generic login/checkout/payment examples, with isolated data and deterministic setup/teardown.
524
518
 
525
519
  ### D-AI-DEP-STRICT-01
526
520
  **Trigger**: Q19 = No, forbid self-initiated | **Inject into**: `{{ ai_dependency_rule }}`
527
521
 
528
- - AI **must not modify** `dependencies` / `devDependencies` in `package.json` on its own.
529
- - If a new dependency is truly needed, AI must:
530
- 1. List in the PR description: package name, version, purpose, alternative comparison.
531
- 2. Await human review approval.
532
- 3. After approval, human executes `pnpm add`.
533
- - Exception: lockfile updates (`pnpm-lock.yaml`) may be modified by AI.
522
+ - AI must not modify dependency declarations or lockfiles without the explicit review/approval required by this selected option.
523
+ - A proposal states package, version/range, purpose, alternatives, security/license, and size/runtime impact.
524
+ - After approval, use the Q3-selected package manager; never hardcode `pnpm` or exempt one lockfile.
534
525
 
535
526
  ### D-AI-DEP-ANNOUNCE-01
536
527
  **Trigger**: Q19 = Yes, with declaration | **Inject into**: `{{ ai_dependency_rule }}`
@@ -554,10 +545,7 @@ Appendix placeholders are auto-generated by AI in Phase 4:
554
545
  1. Full-text search for callers in the repository (grep / IDE reference finder).
555
546
  2. List **all affected files** in the change description.
556
547
  3. Assess whether existing usage is broken (API signature, behavior).
557
- - If it is a breaking change, must:
558
- - Provide a codemod or migration guide.
559
- - Prefix the PR title with `[BREAKING]`.
560
- - Bump the major version number.
548
+ - If it is a breaking change, provide the repository's selected consumer migration or compatibility plan and follow its existing version/release conventions.
561
549
 
562
550
  ### D-AI-BREAK-LOOSE-01
563
551
  **Trigger**: Q20 = No | **Inject into**: `{{ ai_breaking_change_rule }}`
@@ -567,18 +555,16 @@ Appendix placeholders are auto-generated by AI in Phase 4:
567
555
  ### D-AI-INDEX-STRICT-01
568
556
  **Trigger**: Q18 = Enforce index sync | **Inject into**: `{{ ai_index_rule }}`
569
557
 
570
- - After adding any new shared component, it must be added to `src/components/index.ts` in the same commit.
571
- - Index file maintained in alphabetical order. New entries must include a JSDoc comment (one-line description of the component's purpose).
572
- - When deleting a component, it must be removed from the index synchronously, and all callers must be searched.
573
- - Before creating a new component, AI **must** first read `components/index.ts` to confirm there is no reusable component already.
574
- - CI should have a script to validate: all `*.tsx` files under `components/` must appear in `index.ts` exports (orphan files treated as build failure).
558
+ - Record the detected/confirmed authoritative component export-registry path as part of this selected decision.
559
+ - Synchronize additions, removals, and renames with that registry and follow its existing ordering/comment conventions.
560
+ - Search the registry and component ownership area before creating a duplicate.
561
+ - Add registry validation only when existing tooling supports it or the dependency/config permission authorizes the change.
575
562
 
576
563
  ### D-AI-INDEX-LOOSE-01
577
564
  **Trigger**: Q18 = Not required | **Inject into**: `{{ ai_index_rule }}`
578
565
 
579
- - New components may temporarily not be written to `components/index.ts`, but it is recommended to list new component additions in the PR description.
580
- - Before creating a new component, AI should still **search the `src/components/` directory** to avoid duplicating work.
581
- - The team should periodically (recommended: each milestone) organize `components/index.ts` and archive stable components.
566
+ - No central component registry is required. Update direct exports and affected consumers through the repository's existing structure.
567
+ - Search the relevant component ownership areas before creating a duplicate; do not invent or periodically maintain an unselected index file.
582
568
 
583
569
  ### D-AI-LINES-01
584
570
  **Trigger**: Q22 = N | **Inject into**: `{{ ai_max_lines }}`
@@ -587,39 +573,29 @@ Appendix placeholders are auto-generated by AI in Phase 4:
587
573
  ### D-PERF-25-01
588
574
  **Trigger**: Q23 = LCP < 2.5s | **Inject into**: `{{ performance_rules }}`
589
575
 
590
- - First screen LCP (Largest Contentful Paint) target < 2.5s (real 4G / mid-range device).
591
- - INP (Interaction to Next Paint) target < 200ms.
592
- - CLS (Cumulative Layout Shift) target < 0.1.
593
- - Critical path optimization:
594
- - Critical CSS inlined. Non-critical CSS loaded asynchronously.
595
- - First screen images `loading="eager"`. Others `loading="lazy"`.
596
- - Fonts use `font-display: swap`. Preload critical fonts (`<link rel="preload">`).
597
- - CI integrates Lighthouse validation. PRs blocked if performance regresses by > 10%.
576
+ - Measure first-screen LCP against the selected <2.5s target under a documented device/network/cache scenario.
577
+ - Diagnose render, asset, font, server, and JavaScript contributors before selecting a compatible optimization.
578
+ - Add CI measurement or regression thresholds only when the environment is stable and configuration/dependency permission allows it; do not inject unselected INP/CLS targets.
598
579
 
599
580
  ### D-PERF-15-01
600
581
  **Trigger**: Q23 = LCP < 1.5s | **Inject into**: `{{ performance_rules }}`
601
582
 
602
- - Extreme performance requirements. On top of D-PERF-25-01, additionally:
603
- - LCP < 1.5s.
604
- - First screen JS bundle < 100KB gzipped.
605
- - Must use SSR / SSG pre-rendering.
606
- - Images must use AVIF/WebP and have LQIP placeholders.
607
- - CDN enables HTTP/3, Brotli compression.
583
+ - Measure first-screen LCP against the selected <1.5s target under a documented scenario.
584
+ - Select optimizations compatible with Q2, deployment, image/browser support, and Q4b. Do not force SSR/SSG, a CDN protocol, image format, or an extra bundle target from the LCP choice alone.
585
+ - If the selected architecture cannot meet the target with acceptable evidence, fail the conflict/feasibility gate and return to clarification.
608
586
 
609
587
  ### D-CHUNK-300-01
610
588
  **Trigger**: Q24 = chunk < 300KB | **Inject into**: `{{ performance_rules }}`
611
589
 
612
- - Single chunk gzipped size < 300KB. Beyond this, must code-split (`React.lazy` / dynamic `import()`).
613
- - Route-level lazy loading is the default requirement.
614
- - CI integrates `rollup-plugin-visualizer` / `vite-bundle-visualizer` for bundle size analysis.
615
- - Large dependencies (chart libraries, rich text editors, map SDKs) must be loaded on demand.
590
+ - Enforce the selected single-chunk target: <300KB uncompressed and <100KB compressed under the recorded measurement tool.
591
+ - Split only boundaries that exceed or materially threaten the target, using the selected framework's compatible lazy-loading mechanism.
592
+ - Reuse existing bundle analysis tooling or request authorization before adding/configuring a visualizer dependency.
616
593
 
617
594
  ### D-CHUNK-500-01
618
595
  **Trigger**: Q24 = chunk < 500KB | **Inject into**: `{{ performance_rules }}`
619
596
 
620
- - Single chunk gzipped size < 500KB.
621
- - Route-level lazy loading recommended.
622
- - CI integrates bundle size analysis.
597
+ - Enforce the selected single-chunk target of <500KB using a recorded compressed/uncompressed interpretation.
598
+ - Introduce compatible lazy-loading boundaries where evidence requires them and add CI analysis only under selected config/dependency permissions.
623
599
 
624
600
  ### D-BEM-01
625
601
  **Trigger**: Q4 = Plain CSS + BEM | **Inject into**: `{{ style_specific_rules }}`
@@ -653,10 +629,9 @@ Appendix placeholders are auto-generated by AI in Phase 4:
653
629
  ### D-CUSTOM-FETCH-01
654
630
  **Trigger**: Q6 = Custom fetch hook wrapper | **Inject into**: `{{ server_state_rules }}`
655
631
 
656
- - Custom fetch hooks must be in `src/hooks/api/`.
657
- - Each hook must return `{ data, error, loading, refetch }`.
658
- - Forbid fetch calls directly in components.
659
- - Request cancellation via AbortController on unmount.
632
+ - Put custom data access behind one documented project boundary rather than inventing a universal `src/hooks/api/` path.
633
+ - Define its data, pending, error, refresh/revalidation, and cancellation contract from consumer needs.
634
+ - Keep raw transport calls out of presentation code except at an explicitly selected framework data boundary.
660
635
 
661
636
  ### D-TYPES-MANUAL-01
662
637
  **Trigger**: Q7 = Hand-written .d.ts | **Inject into**: `{{ server_state_rules }}`
@@ -668,9 +643,8 @@ Appendix placeholders are auto-generated by AI in Phase 4:
668
643
  ### D-TYPES-MONOREPO-01
669
644
  **Trigger**: Q7 = Shared monorepo type package | **Inject into**: `{{ server_state_rules }}`
670
645
 
671
- - Types imported from shared monorepo package `@project/shared-types`.
672
- - Forbid local re-declaration of shared types.
673
- - Type package version bumps must be coordinated.
646
+ - Import contracts from the confirmed stable shared-package path; do not invent `@project/shared-types`.
647
+ - Avoid divergent local redeclarations and coordinate compatibility/version changes with backend consumers.
674
648
 
675
649
  ### D-RESP-DESKTOP-ONLY-01
676
650
  **Trigger**: Q11 = Desktop only | **Inject into**: `{{ breakpoint_rules }}`
@@ -708,27 +682,26 @@ Appendix placeholders are auto-generated by AI in Phase 4:
708
682
  ### D-SPA-01
709
683
  **Trigger**: Q2 = Plain SPA (Vite) | **Inject into**: `{{ tech_stack_rules }}`
710
684
 
711
- - Plain SPA with Vite. No SSR/SSG.
712
- - Routing via react-router-dom or equivalent.
713
- - All rendering client-side.
685
+ - Use the selected plain Vite SPA boundary with client-side rendering.
686
+ - Add a routing library only when navigation requirements and dependency permission authorize it; otherwise use the existing project router/boundary.
714
687
 
715
688
  ### D-NPM-01
716
689
  **Trigger**: Q3 = npm | **Inject into**: `{{ tech_stack_rules }}`
717
690
 
718
- - Package manager locked to npm. Commit `package-lock.json` to the repository root. Forbid committing `yarn.lock` / `pnpm-lock.yaml`.
719
- - `package.json` declares `"packageManager": "npm@x.y.z"`. CI validates.
691
+ - Use npm as selected and preserve one authoritative npm lockfile according to repository policy.
692
+ - Record the resolved npm version in package metadata/tooling when the project uses that mechanism; never emit an `x.y.z` placeholder.
720
693
 
721
694
  ### D-YARN-01
722
695
  **Trigger**: Q3 = yarn | **Inject into**: `{{ tech_stack_rules }}`
723
696
 
724
- - Package manager locked to yarn. Commit `yarn.lock` to the repository root. Forbid committing `package-lock.json` / `pnpm-lock.yaml`.
725
- - `package.json` declares `"packageManager": "yarn@x.y.z"`. CI validates.
697
+ - Use Yarn as selected and preserve one authoritative Yarn lockfile according to repository policy.
698
+ - Record the resolved Yarn version in package metadata/tooling when the project uses that mechanism; never emit an unresolved version placeholder.
726
699
 
727
700
  ### D-BUN-01
728
701
  **Trigger**: Q3 = bun | **Inject into**: `{{ tech_stack_rules }}`
729
702
 
730
- - Package manager locked to bun. Commit `bun.lockb` to the repository root. Forbid committing `package-lock.json` / `yarn.lock` / `pnpm-lock.yaml`.
731
- - `package.json` declares `"packageManager": "bun@x.y.z"`. CI validates.
703
+ - Use Bun as selected and preserve its authoritative lockfile format for the resolved Bun version according to repository policy.
704
+ - Record the resolved version when the project uses package-manager metadata; never emit an unresolved version placeholder.
732
705
 
733
706
  ### D-A11Y-AA-01
734
707
  **Trigger**: Q14 = WCAG 2.1 AA | **Inject into**: `{{ a11y_extra_rules }}`
@@ -760,7 +733,7 @@ Appendix placeholders are auto-generated by AI in Phase 4:
760
733
 
761
734
  ## Template Placeholder Coverage Self-Check Table (Mandatory Check Before Phase 4 Rendering)
762
735
 
763
- > This table lists **all** placeholders from [frontend-rules.template.md](../templates/frontend-rules.template.md) with their fill sources. The AI must check each item before Phase 4 rendering: every placeholder must hit at least one source. Otherwise, it's treated as an alignment failure.
736
+ > This table documents placeholder fill sources for `template.md`. The deterministic `scripts/validate-rules-configuration.py` check is authoritative for placeholder-set alignment; every placeholder must still resolve to active invariant, selected, fallback, not-applicable, auto-generated, or metadata content before rendering.
764
737
 
765
738
  | Placeholder | Fill Source | Source Type |
766
739
  |-------------|------------|-------------|
@@ -803,17 +776,17 @@ Appendix placeholders are auto-generated by AI in Phase 4:
803
776
  | `{{ ai_breaking_change_rule }}` | D-AI-BREAK-{STRICT/LOOSE}-01 | Derivation |
804
777
  | `{{ ai_config_rule }}` | D-AI-CONFIG-FRONTEND-{STRICT/LOOSE}-01 | Derivation |
805
778
  | `{{ ai_index_rule }}` | D-AI-INDEX-{STRICT/LOOSE}-01 | Derivation |
806
- | `{{ FIXED_RULES_COMPONENT_CONTRACT }}` | fixed-rules.md F3.1 | Fixed injection |
807
- | `{{ FIXED_RULES_I18N_BASELINE }}` | fixed-rules.md F4 | Fixed injection |
808
- | `{{ FIXED_RULES_ERROR_HANDLING }}` | fixed-rules.md F5 | Fixed injection |
809
- | `{{ FIXED_RULES_DENY_LIST }}` | fixed-rules.md F2 full body | Fixed injection |
810
- | `{{ FIXED_RULES_TYPESCRIPT }}` | fixed-rules.md F1.1 full body | Fixed injection |
811
- | `{{ FIXED_RULES_NAMING }}` | fixed-rules.md F1.3 full body | Fixed injection |
812
- | `{{ FIXED_RULES_A11Y }}` | fixed-rules.md F6 full body | Fixed injection |
813
- | `{{ FIXED_RULES_PERFORMANCE }}` | fixed-rules.md F10 full body | Fixed injection |
814
- | `{{ FIXED_RULES_AI_BASE }}` | fixed-rules.md F9 full body | Fixed injection |
815
- | `{{ FIXED_RULES_GIT }}` | fixed-rules.md F7 full body | Fixed injection |
816
- | `{{ FIXED_RULES_SECURITY }}` | fixed-rules.md F8 full body | Fixed injection |
779
+ | `{{ FIXED_RULES_COMPONENT_CONTRACT }}` | fixed-rules.md I4 | Invariant injection |
780
+ | `{{ FIXED_RULES_I18N_BASELINE }}` | fixed-rules.md I5 | Invariant injection |
781
+ | `{{ FIXED_RULES_ERROR_HANDLING }}` | fixed-rules.md I6 | Invariant injection |
782
+ | `{{ FIXED_RULES_DENY_LIST }}` | fixed-rules.md I3 | Invariant injection |
783
+ | `{{ FIXED_RULES_TYPESCRIPT }}` | fixed-rules.md I1 | Invariant injection |
784
+ | `{{ FIXED_RULES_NAMING }}` | fixed-rules.md I2 | Invariant injection |
785
+ | `{{ FIXED_RULES_A11Y }}` | fixed-rules.md I7 | Invariant injection |
786
+ | `{{ FIXED_RULES_PERFORMANCE }}` | fixed-rules.md I8 | Invariant injection |
787
+ | `{{ FIXED_RULES_AI_BASE }}` | fixed-rules.md I9 | Invariant injection |
788
+ | `{{ FIXED_RULES_GIT }}` | fixed-rules.md I10 | Invariant injection |
789
+ | `{{ FIXED_RULES_SECURITY }}` | fixed-rules.md I11 | Invariant injection |
817
790
  | `{{ deny_list_summary }}` | Phase 4 auto-extract all ❌ entries from §1.5/§3/§7.4/§9 | Auto-generated |
818
791
  | `{{ recommended_libs }}` | Phase 4 recommend based on framework + style_solution + state_lib | Auto-generated |
819
792