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
@@ -13,6 +13,11 @@
13
13
 
14
14
  ---
15
15
 
16
+ ## SEMANTIC_FALLBACK_POLICY
17
+
18
+ Every confirmed option is valid input. When no pre-authored block exists, render a complete rule for the selected platform/profile using current official and detected project conventions; do not copy the recommended option's framework, library, navigation, testing, distribution, or permission rules. Render `not required`, `not determined`, flexible, and conditionally skipped choices explicitly instead of leaving placeholders blank.
19
+
20
+ For dual-native mode, evaluate every block against the iOS or Android answer profile before injection. A block without one unambiguous profile owner fails generation. Validate navigation, platform features, testing, distribution, performance, and AI permissions against the decision ledger before output.
16
21
 
17
22
  ## Phase 2 Normalized Semantic Fill Table
18
23
 
@@ -23,7 +28,7 @@ Resolve each selected option or custom reply into the complete semantic value sh
23
28
  | `{{ project_name }}` | Phase 0 auto-read | `my-mobile-app` |
24
29
  | `{{ generated_at }}` | Phase 4, AI writes current date | `2026-05-24` |
25
30
  | `{{ platform }}` | Q1 answer | `Flutter (Dart)` |
26
- | `{{ min_os_version }}` | Q2 answer | `iOS 17+ / Android 14+` |
31
+ | `{{ min_os_version }}` | Q2 answer | `One major release behind the latest stable OS for each active platform, resolved when generated` |
27
32
  | `{{ architecture }}` | Q3 answer | `MVVM` |
28
33
  | `{{ ui_framework }}` | Q4 answer | `Material Design 3` |
29
34
  | `{{ navigation }}` | Q5 answer | `GoRouter` |
@@ -44,7 +49,7 @@ Resolve each selected option or custom reply into the complete semantic value sh
44
49
 
45
50
  ## Trigger Map
46
51
 
47
- **Coverage policy**: 【Recommended】options always have trigger entries with rule blocks. Non-recommended options may or may not have triggers. If a user selects a non-recommended option with no matching trigger, the corresponding rule placeholder is intentionally left empty the TL;DR table still records the user's choice, but no pre-authored derived rules exist for that option. The AI may suggest the user switch to the recommended option for better rule coverage.
52
+ **Coverage policy**: Pre-authored blocks are conveniences, not an allowlist. Recommended and non-recommended options are equally valid. If no matching block exists, apply `SEMANTIC_FALLBACK_POLICY`; do not leave a placeholder empty or pressure the user to change a confirmed decision for better template coverage.
48
53
 
49
54
  **Q13/Q14 note**: Q13 and Q14 are direct-fill only (no derivation rule blocks). The TL;DR table documents the chosen frameworks. Detailed framework-specific rules are not auto-generated — the AI should apply the framework's official best practices.
50
55
 
@@ -122,92 +127,88 @@ Resolve each selected option or custom reply into the complete semantic value sh
122
127
  ### D-FLUTTER-01
123
128
  **Trigger**: Q1 = Flutter | **Inject into**: `{{ tech_stack_rules }}`
124
129
 
125
- - Flutter SDK stable channel. `pubspec.yaml` locks dependency versions with caret constraints.
126
- - Dart analysis: `flutter analyze` must pass with zero errors in CI. Use `dart fix --apply` for auto-fixes.
127
- - Widget tree: prefer composition over inheritance. Forbid creating custom widget subclasses when composition works.
128
- - `const` constructors everywhere possible (improves rebuild performance). CI should warn on missing `const`.
129
- - StatefulWidget only when state is needed. Default to StatelessWidget.
130
+ - Use the project's selected supported Flutter/Dart release and preserve its lockfile/update policy.
131
+ - Run the configured Dart/Flutter analysis without silently suppressing new findings.
132
+ - Prefer widget composition and use immutable/const construction where behavior and the supported SDK allow it.
133
+ - State ownership follows the selected architecture and state-management decision rather than a platform default.
130
134
 
131
135
  ### D-FLUTTER-02
132
136
  **Trigger**: Q1 = Flutter | **Inject into**: `{{ tech_stack_rules }}`
133
137
 
134
- - Project structure: `lib/features/<domain>/` with `screens/`, `widgets/`, `models/`, `services/`.
135
- - Assets declared in `pubspec.yaml` under `flutter: assets:`. Forbid hardcoded asset paths in code (use an `Assets` class or code-gen).
136
- - Use `flutter_lints` or `very_good_analysis` for lint rules. Forbid disabling lint rules without a comment explaining why.
137
- - Platform channels: isolate in a single `platform/` service layer. Forbid scattering `MethodChannel` calls across widgets.
138
+ - Organize Flutter code through the selected architecture; do not inject one directory taxonomy solely from the platform choice.
139
+ - Declare assets through Flutter's supported project mechanism and centralize identifiers when the project selects generation or a wrapper.
140
+ - Preserve the existing lint selection unless a dependency/config change is separately authorized.
141
+ - Isolate platform channels behind explicit adapters rather than calling them throughout UI code.
138
142
 
139
143
  ### D-RN-01
140
144
  **Trigger**: Q1 = React Native | **Inject into**: `{{ tech_stack_rules }}`
141
145
 
142
- - React Native with TypeScript strict mode. Forbid `any` in new code.
143
- - Use Hermes JS engine (default in RN 0.70+). Test with Hermes enabled.
144
- - Platform-specific code: use `Platform.OS` checks or `.ios.ts` / `.android.ts` file extensions. Forbid platform-specific imports leaking into shared code.
145
- - Metro bundler config: commit `metro.config.js`. Custom resolvers documented.
146
+ - Preserve the project's selected React Native release, language/type-checking mode, JavaScript engine, and lockfile policy.
147
+ - Keep platform-specific behavior behind explicit adapters, platform files, or narrow capability checks.
148
+ - Change Metro or native build configuration only under the selected AI configuration/dependency permissions and document custom resolution behavior.
146
149
 
147
150
  ### D-RN-02
148
151
  **Trigger**: Q1 = React Native | **Inject into**: `{{ tech_stack_rules }}`
149
152
 
150
- - Project structure: `src/features/<domain>/` with `screens/`, `components/`, `hooks/`, `api/`.
151
- - Native modules: wrap in a thin TypeScript adapter. Forbid using native module APIs directly in screens.
152
- - Use `react-native-mmkv` for fast KV storage over AsyncStorage for performance-critical data.
153
+ - Organize React Native code through the selected architecture rather than a platform-owned folder mandate.
154
+ - Wrap native modules behind a typed shared boundary and keep direct native calls out of screen orchestration.
155
+ - Use only the persistence technology selected by Q8; React Native selection does not implicitly add MMKV or replace an existing store.
153
156
 
154
157
  ### D-IOS-01
155
158
  **Trigger**: Q1 = iOS native | **Inject into**: `{{ tech_stack_rules }}`
156
159
 
157
- - Swift 5.9+. Use Swift Concurrency (`async/await`) for all async work. Forbid completion-handler-based APIs for new code.
158
- - Swift Package Manager for dependencies. Forbid Carthage. CocoaPods allowed only for legacy deps without SPM support.
159
- - All public API must have documentation comments (`///`). CI validates with `swift-docc-plugin`.
160
- - `swiftlint` must pass with zero errors. Config committed to repo root.
160
+ - Use the Swift/Xcode toolchain compatible with the resolved minimum OS and existing project.
161
+ - Prefer structured Swift concurrency for new owned async boundaries while adapting required callback APIs safely.
162
+ - Preserve the selected dependency manager and lint/documentation tooling unless a migration or dependency/config change is authorized.
163
+ - Public shared contracts document behavior and availability according to repository conventions.
161
164
 
162
165
  ### D-IOS-02
163
166
  **Trigger**: Q1 = iOS native | **Inject into**: `{{ tech_stack_rules }}`
164
167
 
165
- - Xcode project settings managed via `.xcconfig` files. Forbid hardcoding build settings in the project file.
166
- - Version and build number managed by CI. Forbid manual increment.
167
- - App delegate/scene delegate minimal. Use feature-based app initialization.
168
+ - Keep build settings, signing, and version ownership consistent with the selected repository/distribution workflow; adopting `.xcconfig` or CI versioning is a separate migration decision.
169
+ - Keep application lifecycle entrypoints focused on platform lifecycle and composition responsibilities.
168
170
 
169
171
  ### D-ANDROID-01
170
172
  **Trigger**: Q1 = Android native | **Inject into**: `{{ tech_stack_rules }}`
171
173
 
172
- - Kotlin 2.0+. Use Kotlin Coroutines + Flow for async. Forbid raw `Thread` / `AsyncTask` (deprecated).
173
- - Gradle Version Catalog (`libs.versions.toml`) for dependency management. Forbid declaring versions directly in module `build.gradle`.
174
- - `detekt` must pass with zero errors. Config committed to repo root.
175
- - Min SDK, target SDK, compile SDK declared in a single `config.gradle` or convention plugin.
174
+ - Use the Kotlin/Android toolchain compatible with the resolved minimum/target APIs and existing project.
175
+ - Prefer structured coroutines for new owned async work and avoid deprecated thread/task APIs.
176
+ - Preserve the selected Gradle dependency and lint/configuration model unless a migration or config change is authorized.
177
+ - Keep SDK declarations consistent across modules through the project's existing authoritative configuration boundary.
176
178
 
177
179
  ### D-ANDROID-02
178
180
  **Trigger**: Q1 = Android native | **Inject into**: `{{ tech_stack_rules }}`
179
181
 
180
- - Project structure by feature: `app/src/main/java/<package>/<feature>/` with `ui/`, `data/`, `domain/`.
181
- - Dependency injection via Hilt (recommended) or Koin. Forbid manual DI / service locator in application code.
182
- - ProGuard/R8 rules committed. Add rules for each reflection-using library.
182
+ - Organize Android code through the selected architecture rather than a platform-owned folder taxonomy.
183
+ - Use the dependency-injection approach already selected by the project; Android choice alone does not add Hilt or Koin.
184
+ - Keep release shrinker/obfuscation rules synchronized with libraries that require reflection metadata when shrinking is enabled.
183
185
 
184
186
  ### D-BOTH-NATIVE-01
185
187
  **Trigger**: Q1 = Both native | **Inject into**: `{{ tech_stack_rules }}`
186
188
 
187
- - Dual native codebases (Swift + Kotlin). iOS rules apply to the Swift codebase. Android rules apply to the Kotlin codebase.
188
- - Shared business logic must be documented in a shared spec no code-level sharing between the two platforms.
189
- - Each platform follows its own native conventions independently.
190
- - Both platform-specific rule sets (D-IOS-* and D-ANDROID-*) apply to their respective codebases.
189
+ - Maintain distinct `ios` and `android` decision profiles. Apply Swift/iOS blocks only to iOS and Kotlin/Android blocks only to Android.
190
+ - Keep shared product contracts and behavior documented. Code-level sharing is neither required nor forbidden unless the user separately confirms a supported sharing boundary.
191
+ - Differences between profile decisions are intentional output, not drift to be normalized away.
191
192
 
192
193
  ### D-OS-LATEST-1-01
193
194
  **Trigger**: Q2 = Latest - 1 | **Inject into**: `{{ tech_stack_rules }}`
194
195
 
195
- - Target API level: latest stable - 1. minSdk = latest - 3 (or latest - 2 for platforms with faster adoption).
196
- - Forbid using APIs introduced in the latest OS version without `@available` / `@RequiresApi` guards.
197
- - Deprecated APIs in target version must be migrated within one release cycle.
196
+ - Resolve concrete minimum OS/API versions from current stable releases for each active profile and record the resolution basis.
197
+ - Guard APIs newer than that profile's minimum and provide a compatible fallback or explicit capability limitation.
198
+ - Prioritize deprecated API migration by removal timeline and product risk rather than a universal one-release deadline.
198
199
 
199
200
  ### D-OS-LATEST-2-01
200
201
  **Trigger**: Q2 = Latest - 2 | **Inject into**: `{{ tech_stack_rules }}`
201
202
 
202
- - Target API level: latest stable - 2. Wider compatibility, more devices covered.
203
- - `@available(iOS 16, *)` / `@RequiresApi(Build.VERSION_CODES.UPSIDE_DOWN_CAKE)` for latest APIs.
204
- - Test on oldest supported OS version as part of CI or manual QA checklist.
203
+ - Resolve and record the concrete minimum for each active profile from latest stable minus two.
204
+ - Guard newer APIs with the active platform's availability mechanism; do not hardcode stale release constants from this reference.
205
+ - Include the oldest supported OS in the selected automated device/simulator verification matrix, or report the unavailable environment as a release-evidence gap.
205
206
 
206
207
  ### D-OS-LATEST-3-01
207
208
  **Trigger**: Q2 = Latest - 3 | **Inject into**: `{{ tech_stack_rules }}`
208
209
 
209
- - Wide compatibility mode. Must test on oldest supported OS version for every release.
210
- - More `@available` checks needed. Document which features degrade gracefully on older OS versions.
210
+ - Resolve and record the concrete minimum for each active profile from latest stable minus three.
211
+ - Include the oldest supported OS in release verification and document capability fallbacks for features unavailable there.
211
212
 
212
213
  ### D-MVVM-01
213
214
  **Trigger**: Q3 = MVVM | **Inject into**: `{{ arch_rules }}`
@@ -268,11 +269,11 @@ Resolve each selected option or custom reply into the complete semantic value sh
268
269
  - Design tokens in `src/theme/tokens.ts`. All components reference tokens via `useTheme()` or import.
269
270
 
270
271
  ### D-NATIVEWIND-01
271
- **Trigger**: Q4 = Tamagui / NativeWind | **Inject into**: `{{ ui_rules }}`
272
+ **Trigger**: Q4 = Tamagui or Q4 = NativeWind | **Inject into**: `{{ ui_rules }}`
272
273
 
273
- - Use Tamagui or NativeWind as the UI foundation. Forbid mixing with raw StyleSheet.
274
- - Design tokens in `tamagui.config.ts` or `tailwind.config.js`. Theme centralized.
275
- - Optimizing compiler (Tamagui) or Tailwind JIT must be configured for production builds.
274
+ - Resolve whether the selected option means Tamagui or NativeWind for this profile; never emit both configurations from one answer.
275
+ - Use the selected library's theme/token boundary consistently and define the allowed interop boundary with React Native core styles.
276
+ - Configure only build integration required by the selected library and supported project version.
276
277
 
277
278
  ### D-SWIFTUI-01
278
279
  **Trigger**: Q4 = SwiftUI | **Inject into**: `{{ ui_rules }}`
@@ -307,12 +308,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
307
308
  ### D-DEEP-LINK-01
308
309
  **Trigger**: Q5 = Platform-default | **Inject into**: `{{ navigation_rules }}`
309
310
 
310
- - Navigation uses platform defaults with deep linking support:
311
- - Flutter: GoRouter with `ShellRoute` for tab-based navigation.
312
- - React Native: React Navigation with linking config.
313
- - iOS: NavigationStack with `navigationDestination(for:)`.
314
- - Android: Compose Navigation with NavDeepLink.
315
- - Every screen must have a unique route path. Forbid ambiguous routes.
311
+ - Use the active profile's selected/default navigation mechanism with an explicit deep-link mapping; do not inject other platforms' libraries.
312
+ - Validate external routes, map each supported route unambiguously, and define authenticated/deferred navigation behavior.
313
+ - A specific routing dependency is added only when compatible with the platform and dependency permission decisions.
316
314
 
317
315
  ### D-URL-ROUTING-01
318
316
  **Trigger**: Q5 = URL-based routing | **Inject into**: `{{ navigation_rules }}`
@@ -324,9 +322,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
324
322
  ### D-STACK-NAV-01
325
323
  **Trigger**: Q5 = Simple stack | **Inject into**: `{{ navigation_rules }}`
326
324
 
327
- - Simple push/pop stack navigation. No deep linking.
328
- - Forbid programmatic navigation to arbitrary stack positions (push-only from current top).
329
- - Suitable for prototype/simple apps. Plan deep linking migration path for production.
325
+ - Use a simple stack with no deep-link capability, as selected.
326
+ - Keep push/pop/back behavior deterministic and document restoration expectations.
327
+ - Do not inject a deep-link migration merely because the app may later be distributed; revisit Q5 only when a product flow requires it.
330
328
 
331
329
  ### D-RIVERPOD-01
332
330
  **Trigger**: Q6 = Riverpod | **Inject into**: `{{ state_rules }}`
@@ -361,17 +359,16 @@ Resolve each selected option or custom reply into the complete semantic value sh
361
359
  ### D-ZUSTAND-MOBILE-01
362
360
  **Trigger**: Q6 = Zustand | **Inject into**: `{{ state_rules }}`
363
361
 
364
- - Zustand stores: one per domain. Forbid massive global store.
365
- - Store selectors prevent unnecessary re-renders: `useStore(state => state.specificField)`.
366
- - Async actions in store via `set`. Forbid calling `set` outside of store actions.
367
- - Persist middleware for session state: `zustand/middleware persist` with MMKV storage adapter.
362
+ - Scope Zustand stores to owned domains and use selectors to avoid unrelated rerenders.
363
+ - Keep mutations behind store actions and make async side effects observable.
364
+ - Persist only state classified as durable through the Q8-selected storage; Zustand selection does not authorize MMKV.
368
365
 
369
366
  ### D-REDUX-MOBILE-01
370
367
  **Trigger**: Q6 = Redux Toolkit | **Inject into**: `{{ state_rules }}`
371
368
 
372
- - Redux Toolkit with `createSlice` + `createAsyncThunk`.
373
- - Middleware: `redux-persist` with MMKV storage engine for session persistence.
374
- - Forbid dispatching actions directly from components use typed hooks (`useAppDispatch`, `useAppSelector`).
369
+ - Use Redux Toolkit's supported slice and async/effect mechanisms and typed access hooks.
370
+ - Persist only selected durable state through the Q8 storage decision; Redux selection does not add redux-persist or MMKV automatically.
371
+ - Components dispatch user/domain events through the project's typed boundary.
375
372
 
376
373
  ### D-SWIFT-STATE-01
377
374
  **Trigger**: Q6 = @Observable / @State | **Inject into**: `{{ state_rules }}`
@@ -403,17 +400,16 @@ Resolve each selected option or custom reply into the complete semantic value sh
403
400
  ### D-DIO-01
404
401
  **Trigger**: Q7 = Dio | **Inject into**: `{{ networking_rules }}`
405
402
 
406
- - Dio instance singleton configured with base URL, interceptors, timeout (connect: 10s, receive: 30s).
407
- - Interceptors: auth token injection, refresh token retry, logging (debug only).
408
- - Response typed via `dio.withJson<T>()` or manual `fromJson` factories. Forbid `dynamic` response types.
409
- - Certificate pinning via `HttpClientAdapter` with custom `SecurityContext` for release builds.
403
+ - Centralize the Dio client boundary and set timeout/cancellation/retry behavior from endpoint and product requirements.
404
+ - Add authentication, refresh, logging, or certificate pinning interceptors only when separately required by the API and threat model.
405
+ - Decode responses through typed/validated models and keep debug network logging free of secrets.
410
406
 
411
407
  ### D-AXIOS-MOBILE-01
412
408
  **Trigger**: Q7 = Axios | **Inject into**: `{{ networking_rules }}`
413
409
 
414
- - Axios instance with base URL, interceptors, timeout (30s default).
415
- - Request interceptor: attach auth token. Response interceptor: handle 401 refresh, global error normalization.
416
- - API functions in `src/api/` return typed Promise. Forbid `axios.get<any>(...)`.
410
+ - Centralize the Axios client boundary and configure timeout/cancellation/retry behavior from endpoint requirements.
411
+ - Add authentication/refresh interceptors only when the API contract selected those flows; always normalize errors without exposing secrets.
412
+ - API functions return typed, runtime-validated results at untrusted boundaries.
417
413
 
418
414
  ### D-URLSESSION-01
419
415
  **Trigger**: Q7 = URLSession + async/await | **Inject into**: `{{ networking_rules }}`
@@ -426,18 +422,16 @@ Resolve each selected option or custom reply into the complete semantic value sh
426
422
  ### D-RETROFIT-01
427
423
  **Trigger**: Q7 = Retrofit + OkHttp | **Inject into**: `{{ networking_rules }}`
428
424
 
429
- - Retrofit interfaces with `suspend` functions returning `Response<T>` or `Result<T>`.
430
- - OkHttp client singleton with interceptors: auth token, logging (debug), caching.
431
- - Moshi or kotlinx.serialization for JSON. Forbid Gson (unmaintained, slower).
432
- - Timeout: connect 10s, read 30s, write 30s.
425
+ - Define Retrofit interfaces with suspend/streaming behavior appropriate to each endpoint and a typed result boundary.
426
+ - Configure OkHttp authentication, logging, cache, timeout, and retry behavior only from confirmed API/product needs.
427
+ - Use the serialization mechanism already selected or detected by the project unless a dependency migration is authorized.
433
428
 
434
429
  ### D-DRIFT-01
435
430
  **Trigger**: Q8 = Drift | **Inject into**: `{{ persistence_rules }}`
436
431
 
437
- - Drift (SQLite, type-safe). Table definitions via Dart classes extending `Table`.
438
- - DAO (Data Access Object) classes for query logic. Forbid raw SQL in widgets/services.
439
- - Migration strategy: `onUpgrade` with versioned migration callbacks. Test migrations.
440
- - Database singleton provided via Riverpod/Provider. Forbid opening database directly.
432
+ - Use Drift's typed schema/query and migration mechanisms, keeping persistence calls behind the selected architecture boundary.
433
+ - Version and test model migrations from supported prior versions.
434
+ - Provide the database through the Q6-selected composition/state mechanism; Drift selection does not authorize Riverpod or Provider.
441
435
 
442
436
  ### D-HIVE-01
443
437
  **Trigger**: Q8 = Hive | **Inject into**: `{{ persistence_rules }}`
@@ -493,10 +487,9 @@ Resolve each selected option or custom reply into the complete semantic value sh
493
487
  ### D-BG-TASK-01
494
488
  **Trigger**: Q10 = Yes, needed | **Inject into**: `{{ platform_features_rules }}`
495
489
 
496
- - Flutter: `workmanager` plugin. React Native: `react-native-background-fetch`.
497
- - iOS: BGAppRefreshTask (short) or BGProcessingTask (long). Android: WorkManager with constraints (network, charging).
498
- - Background task ID registered in Info.plist (iOS) and AndroidManifest.xml.
499
- - Forbid running UI updates from background tasks. Persist results, update UI on next foreground.
490
+ - Select only the active profile's supported background mechanism and add a cross-platform plugin only when dependency permission allows it.
491
+ - Register only required platform capabilities/identifiers and state scheduling, cancellation, retry, duplicate-work, and termination behavior.
492
+ - Background workers do not mutate UI directly; persist or publish results through the selected state/data boundary.
500
493
 
501
494
  ### D-PERM-ASK-ON-USE-01
502
495
  **Trigger**: Q11 = Ask-on-use | **Inject into**: `{{ platform_features_rules }}`
@@ -514,37 +507,36 @@ Resolve each selected option or custom reply into the complete semantic value sh
514
507
  ### D-MOBILE-TEST-01
515
508
  **Trigger**: Q12 = All tiers | **Inject into**: `{{ test_rules }}`
516
509
 
517
- - Three-tier testing: unit (ViewModel/Bloc/UseCase), widget/component (individual UI), integration (critical flows).
518
- - Unit test coverage: ViewModel/Bloc layer 80%. Widget/component tests for shared components 60%.
519
- - Integration tests cover: login, registration, core CRUD, payment (if applicable).
510
+ - Include unit, widget/component, and integration behavior for the active profile and selected architecture.
511
+ - Derive test subjects from actual product flows and boundaries; do not invent login, payment, CRUD, or numeric coverage thresholds.
512
+ - Use the Q13/Q14 framework selected for each platform profile.
520
513
 
521
514
  ### D-MOBILE-TEST-02
522
515
  **Trigger**: Q12 = Unit + Widget | **Inject into**: `{{ test_rules }}`
523
516
 
524
- - Unit tests + widget/component tests. No integration/E2E tests.
525
- - Coverage: ViewModel/Bloc layer 80%. Shared widgets 60%.
526
- - Recommend adding integration tests for critical flows before production.
517
+ - Require the selected unit and widget/component tiers through each active profile's Q13 framework.
518
+ - Do not inject numeric coverage or mandatory integration tests that Q12 did not select; record the accepted integration-evidence gap.
527
519
 
528
520
  ### D-MOBILE-TEST-03
529
521
  **Trigger**: Q12 = Critical path only | **Inject into**: `{{ test_rules }}`
530
522
 
531
- - Integration tests for critical flows only (login, core CRUD, payment).
532
- - No coverage thresholds enforced project-wide. Critical paths must have 1 test each.
523
+ - Require integration tests only for product-defined critical flows through each active profile's Q14 framework.
524
+ - Do not invent generic login, CRUD, or payment flows; map tests to the confirmed app brief and acceptance criteria.
533
525
 
534
526
  ### D-APP-STORE-01
535
527
  **Trigger**: Q15 = App Store + Google Play | **Inject into**: `{{ distribution_rules }}`
536
528
 
537
- - iOS: archive via Xcode Cloud or Fastlane. Upload to App Store Connect via `deliver` or Xcode.
538
- - Android: signed app bundle via `./gradlew bundleRelease`. Upload to Google Play Console.
539
- - Staged rollout default: 10% 50% 100% over 48 hours. Monitor crash-free rate at each stage.
540
- - Code signing: iOS uses automatic signing (Xcode managed). Android uses `signingConfigs` in Gradle with keystore in CI secrets.
529
+ - Apply public-store build, signing, submission, and rollout rules only to active platform profiles: App Store Connect/TestFlight for iOS and Google Play testing/release tracks for Android.
530
+ - A single-platform project must not receive the other platform's release requirements.
531
+ - Choose staged rollout percentages and observation windows from product risk and store capability; record the selected rollout rather than imposing one universal schedule.
532
+ - Keep signing credentials in the approved CI or managed signing boundary, never in source control.
541
533
 
542
534
  ### D-ENTERPRISE-DIST-01
543
535
  **Trigger**: Q15 = Enterprise distribution | **Inject into**: `{{ distribution_rules }}`
544
536
 
545
- - iOS: enterprise certificate + provisioning profile. OTA distribution via HTTPS server with manifest.plist.
546
- - Android: signed APK distributed via private channel or MDM.
547
- - No App Store Review process. Internal compliance review replaces it. Document compliance criteria.
537
+ - Apply enterprise/private distribution only to active profiles and through the organization's selected MDM/private-store capability.
538
+ - Keep signing material outside source control and document installation, update, revocation, device eligibility, and compliance ownership.
539
+ - Do not emit iOS certificate/manifest rules for Android-only projects or Android package rules for iOS-only projects.
548
540
 
549
541
  ### D-PERF-60FPS-01
550
542
  **Trigger**: Q16 = 60fps | **Inject into**: `{{ performance_rules }}`
@@ -644,7 +636,7 @@ Resolve each selected option or custom reply into the complete semantic value sh
644
636
  | `{{ ai_dependency_rule }}` | D-AI-DEP-STRICT/ANNOUNCE-MOBILE | Derivation |
645
637
  | `{{ ai_breaking_change_rule }}` | D-AI-BREAK-STRICT-MOBILE | Derivation |
646
638
  | `{{ ai_platform_rule }}` | D-AI-PLATFORM-STRICT | Derivation |
647
- | `{{ FIXED_RULES_* }}` | fixed-rules.md (14 chapters) | Fixed injection |
639
+ | `{{ FIXED_RULES_* }}` | fixed-rules.md (13 invariant blocks) | Invariant injection |
648
640
  | `{{ deny_list_summary }}` | Phase 4 auto-extract | Auto-generated |
649
641
  | `{{ recommended_libs }}` | Phase 4 platform+tools recommendation | Auto-generated |
650
642