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
@@ -11,14 +11,14 @@
11
11
  1. **Group order**: G1 → G2 → G3 → G4 → G5 → G6 → G7 → G8 → G9. Do not skip.
12
12
  2. **Shortcut commands** (respond immediately when user types these at any point):
13
13
  - `recommended` / `default` → skip current group, adopt all recommended options
14
- - `all recommended` / `one-click` → skip all remaining groups, adopt all recommended options
14
+ - `all recommended` / `one-click` → explicit authorization to adopt each remaining applicable recommended option; ask any question whose recommendation is ambiguous for the selected stack
15
15
  - `strict` / `strictest` → adopt the strictest option for the current group
16
16
  - `skip` / `don't need this` → mark current group as N/A, note in output that "project does not require this yet"
17
17
  - `custom: xxx` → record user's custom content, do not match against options
18
18
  3. **Abbreviation recognition**: `A` / `a` / `1` all mean option A. `A,C` means multi-select (only for multi-select questions).
19
19
  4. **Follow-up rule**: If the user gives an answer outside the options (e.g., "I use Astro"), first confirm whether to classify as an "other" branch of an existing option before continuing.
20
20
  5. **Forbidden behaviors**:
21
- - Must not make choices for the user before they explicitly answer.
21
+ - Must not make choices for the user before they explicitly answer, except concrete defaults covered by the user's explicit Quick/all-recommended authorization.
22
22
  - Must not fabricate user preferences to complete the answer set.
23
23
  - Must not output more than 3 questions in a single message.
24
24
 
@@ -100,7 +100,7 @@ Total: 20 questions.
100
100
  - **Maps to**: `{{ api_style }}` + `{{ api_rules }}`
101
101
 
102
102
  ### Q6. API Documentation
103
- - **Conditional logic**: If Q5 = GraphQL, auto-select B and skip Q6. If Q5 = gRPC, auto-select C and skip Q6. If Q5 = REST + gRPC hybrid, ask but note that REST endpoints default to A. Only ask Q6 directly when Q5 = RESTful.
103
+ - **Conditional logic**: If Q5 = GraphQL, auto-select B and skip Q6. If Q5 = gRPC, auto-select C and skip Q6. Ask Q6 when Q5 = RESTful or REST + gRPC hybrid; for the hybrid, the answer governs the REST surface while Protobuf remains authoritative for gRPC.
104
104
  - **Options**:
105
105
  - A) OpenAPI/Swagger auto-generated **【Recommended for REST projects】**
106
106
  - B) GraphQL Schema (self-documenting) — auto-selected when Q5 = GraphQL
@@ -138,11 +138,11 @@ Total: 20 questions.
138
138
 
139
139
  ### Q9. Authentication Scheme
140
140
  - **Options**:
141
- - A) JWT (stateless, suitable for APIs/microservices) **【Recommended】**
142
- - B) OAuth2 + OIDC (third-party login/SSO)
143
- - C) Session + Cookie (traditional web apps)
144
- - D) API Key (service-to-service)
145
- - **Note**: Determines middleware selection and token management rules.
141
+ - A) JWT bearer tokens **【Recommended only for stateless API access with an explicit issuance, expiry, rotation, revocation, and audience model】**
142
+ - B) OAuth2 + OIDC **【Recommended for third-party login/SSO】**
143
+ - C) Server session + secure cookie **【Recommended for first-party browser applications】**
144
+ - D) API key or workload identity **【Recommended for constrained service-to-service access】**
145
+ - **Note**: Determines identity, credential storage, revocation, middleware, and transport rules. There is no universal Quick default; infer from a confirmed client/trust model or ask.
146
146
  - **Maps to**: `{{ auth_scheme }}` + `{{ auth_rules }}`
147
147
 
148
148
  ---
@@ -151,20 +151,20 @@ Total: 20 questions.
151
151
 
152
152
  ### Q10. Caching
153
153
  - **Options**:
154
- - A) Redis **【Recommended】**
154
+ - A) Redis **【Recommended when a shared/distributed cache or Redis capability is established】**
155
155
  - B) Memcached
156
156
  - C) In-memory cache (single instance only)
157
- - D) No caching needed
158
- - **Note**: Determines cache key conventions, expiry strategy, and penetration/avalanche protection rules.
157
+ - D) No caching needed **【Recommended until a measured cache use case exists】**
158
+ - **Note**: Determines cache key, expiry, invalidation, and failure behavior. Quick mode must not add cache infrastructure solely because a cache option exists.
159
159
  - **Maps to**: `{{ cache }}` + `{{ cache_rules }}`
160
160
 
161
161
  ### Q11. Message Queue
162
162
  - **Options**:
163
- - A) RabbitMQ
164
- - B) Kafka **【Recommended: high-throughput/event sourcing】**
165
- - C) Redis Stream/BullMQ (lightweight task queues)
166
- - D) No message queue needed
167
- - **Note**: Determines async processing, idempotency, and retry strategy rules. B is the default recommendation for most projects. Choose C only for lightweight task needs.
163
+ - A) RabbitMQ **【Recommended for brokered work queues/routing requirements】**
164
+ - B) Kafka **【Recommended for confirmed high-throughput event streams or durable replay】**
165
+ - C) Redis Stream/BullMQ **【Recommended for an existing Redis-backed lightweight task need】**
166
+ - D) No message queue needed **【Recommended until an asynchronous delivery requirement exists】**
167
+ - **Note**: Determines async processing, delivery semantics, idempotency, and retry behavior. Quick mode never provisions messaging without a confirmed workload.
168
168
  - **Maps to**: `{{ mq }}` + `{{ mq_rules }}`
169
169
 
170
170
  ### Q12. Containerization & Deployment
@@ -197,7 +197,7 @@ Total: 20 questions.
197
197
  - For Rust: A) Built-in test **【Recommended】** — B) proptest
198
198
  - **Maps to**: `{{ test_framework }}`
199
199
 
200
- ### Q15. Mock Strategy
200
+ ### Q15. Mock Strategy (only ask if Q13 ≠ D)
201
201
  - **Options**:
202
202
  - A) Mock all external deps, use testcontainers or in-memory DB for database **【Recommended】**
203
203
  - B) Mock all external deps including database
@@ -211,18 +211,18 @@ Total: 20 questions.
211
211
 
212
212
  ### Q16. Logging
213
213
  - **Options**:
214
- - A) Structured JSON logging + centralized collection (ELK/Loki) **【Recommended】**
215
- - B) Structured logging + local files
216
- - C) Simple text logs, good enough
217
- - **Note**: Determines log format and field specifications.
214
+ - A) Structured event logging + selected centralized collection **【Recommended for multi-instance production services】**
215
+ - B) Structured logging to the deployment's standard stream/file collector **【Recommended for small or platform-managed deployments】**
216
+ - C) Simple text logs (development-only)
217
+ - **Note**: Determines log format and collection boundary without forcing one observability vendor.
218
218
  - **Maps to**: `{{ logging }}` + `{{ observability_rules }}`
219
219
 
220
220
  ### Q17. Monitoring & Tracing
221
221
  - **Options**:
222
- - A) OpenTelemetry + Prometheus + Grafana **【Recommended】**
223
- - B) Health check endpoints + system monitoring only
224
- - C) Not needed yet
225
- - **Note**: Determines instrumentation and alerting rules.
222
+ - A) OpenTelemetry plus compatible metrics/visualization **【Recommended when distributed tracing or a managed telemetry pipeline is required】**
223
+ - B) Health/readiness signals + deployment monitoring **【Recommended baseline for a small service】**
224
+ - C) Not needed yet (explicit development risk acceptance)
225
+ - **Note**: Determines instrumentation and alerting rules; it does not make one vendor stack universal.
226
226
  - **Maps to**: `{{ monitoring }}` + `{{ observability_rules }}`
227
227
 
228
228
  ---
@@ -1,9 +1,18 @@
1
1
  {
2
- "schema_version": "app-planner-question-manifest-v1",
2
+ "schema_version": "app-planner-question-manifest-v2",
3
3
  "layer": "backend",
4
4
  "total_questions": 20,
5
5
  "_doc": "Machine-readable structure for backend question-bank.md. Question TEXT/options/Recommended/Notes are authoritative in question-bank.md; this file carries ONLY structure: group membership, quick-mode, question->placeholder mapping, and conditional logic. Keep Qids and group ids in sync with question-bank.md. The AI reads this as its asking checklist (Phase A) and self-check expected-set (Phase D).",
6
- "_conditions": "required_if / auto_derived_when use simple expressions over recorded answers, e.g. 'Q5 == RESTful', 'Q13 != D', 'Q5 in [GraphQL, gRPC]'. options_vary_by names a prior answer that changes the OPTION LIST only (question is still asked; never affects required).",
6
+ "_conditions": "required_if / auto_derived_when use option IDs over recorded answers, e.g. 'Q5 in [A, D]' and 'Q13 != D'. options_vary_by names a prior answer that changes the OPTION LIST only (question is still asked; never affects required).",
7
+ "render_contract": {
8
+ "fixed_rules_policy": "invariants_only",
9
+ "selected_decision_precedence": true,
10
+ "quick_mode_requires_explicit_authorization": true,
11
+ "unmapped_option_policy": "semantic_fallback",
12
+ "not_applicable_policy": "explicit_statement",
13
+ "conflict_policy": "fail_generation",
14
+ "semantic_fallback_questions": ["Q1", "Q2", "Q3", "Q4", "Q5", "Q6", "Q7", "Q8", "Q9", "Q10", "Q11", "Q12", "Q13", "Q14", "Q15", "Q16", "Q17", "Q18", "Q19", "Q20"]
15
+ },
7
16
  "groups": [
8
17
  { "id": "G1", "topic": "Language & Runtime", "quick_mode": true },
9
18
  { "id": "G2", "topic": "Framework & Architecture", "quick_mode": true },
@@ -18,19 +27,19 @@
18
27
  "questions": [
19
28
  { "id": "Q1", "group": "G1", "topic": "Programming Language", "maps_to": ["language", "tech_stack_rules"], "required": true },
20
29
  { "id": "Q2", "group": "G1", "topic": "Runtime Version", "maps_to": ["runtime_version"], "required": true },
21
- { "id": "Q3", "group": "G2", "topic": "Web Framework", "maps_to": ["framework", "tech_stack_rules"], "required": true, "options_vary_by": "Q1", "note_open_ended_when": "Q1 == Custom" },
30
+ { "id": "Q3", "group": "G2", "topic": "Web Framework", "maps_to": ["framework", "tech_stack_rules"], "required": true, "options_vary_by": "Q1", "note_open_ended_when": "Q1 == F" },
22
31
  { "id": "Q4", "group": "G2", "topic": "Architecture Pattern", "maps_to": ["architecture", "arch_rules"], "required": true },
23
32
  { "id": "Q5", "group": "G3", "topic": "API Style", "maps_to": ["api_style", "api_rules"], "required": true },
24
- { "id": "Q6", "group": "G3", "topic": "API Documentation", "maps_to": ["api_docs"], "required": true, "required_if": "Q5 == RESTful", "auto_derived_when": "Q5 in [GraphQL, gRPC]" },
25
- { "id": "Q7", "group": "G4", "topic": "ORM / Data Access", "maps_to": ["orm", "data_rules"], "required": true, "options_vary_by": "Q1", "note_open_ended_when": "Q1 == Custom" },
26
- { "id": "Q8", "group": "G4", "topic": "Database", "maps_to": ["database"], "required": true },
33
+ { "id": "Q6", "group": "G3", "topic": "API Documentation", "maps_to": ["api_docs", "api_rules"], "required": true, "required_if": "Q5 in [A, D]", "auto_derived_when": "Q5 in [B, C]" },
34
+ { "id": "Q7", "group": "G4", "topic": "ORM / Data Access", "maps_to": ["orm", "data_rules"], "required": true, "options_vary_by": "Q1", "note_open_ended_when": "Q1 == F" },
35
+ { "id": "Q8", "group": "G4", "topic": "Database", "maps_to": ["database", "data_rules"], "required": true },
27
36
  { "id": "Q9", "group": "G5", "topic": "Authentication Scheme", "maps_to": ["auth_scheme", "auth_rules"], "required": true },
28
37
  { "id": "Q10", "group": "G6", "topic": "Caching", "maps_to": ["cache", "cache_rules"], "required": true },
29
38
  { "id": "Q11", "group": "G6", "topic": "Message Queue", "maps_to": ["mq", "mq_rules"], "required": true },
30
39
  { "id": "Q12", "group": "G6", "topic": "Containerization & Deployment", "maps_to": ["container", "deploy_rules"], "required": true },
31
40
  { "id": "Q13", "group": "G7", "topic": "Test Coverage Requirements", "maps_to": ["test_requirement", "test_rules"], "required": true },
32
41
  { "id": "Q14", "group": "G7", "topic": "Test Framework", "maps_to": ["test_framework"], "required": true, "required_if": "Q13 != D", "options_vary_by": "Q1" },
33
- { "id": "Q15", "group": "G7", "topic": "Mock Strategy", "maps_to": ["mock_strategy", "test_rules"], "required": true },
42
+ { "id": "Q15", "group": "G7", "topic": "Mock Strategy", "maps_to": ["mock_strategy", "test_rules"], "required": true, "required_if": "Q13 != D", "auto_derived_when": "Q13 == D" },
34
43
  { "id": "Q16", "group": "G8", "topic": "Logging", "maps_to": ["logging", "observability_rules"], "required": true },
35
44
  { "id": "Q17", "group": "G8", "topic": "Monitoring & Tracing", "maps_to": ["monitoring", "observability_rules"], "required": true },
36
45
  { "id": "Q18", "group": "G9", "topic": "AI Permission to Add Dependencies", "maps_to": ["ai_dependency_rule"], "required": true },
@@ -1,98 +1,87 @@
1
1
  # Backend Rules — {{ project_name }}
2
2
 
3
- > This document was generated by the `backend-rules` skill on {{ generated_at }}
4
- > Audience: All backend developers + all AI coding assistants on this project
5
- >
6
- > **Usage**:
7
- > 1. All AI coding assistants must read this file before generating or modifying any backend code
8
- > 2. This document takes precedence over "general best practices" in AI training data
9
- > 3. Code conflicting with this document must not be committed
3
+ > Generated by app-planner Rules Configuration
4
+ > Audience: project contributors and AI coding assistants working on the backend
10
5
 
11
- ---
6
+ This document contains confirmed decisions plus compatible invariant and derived rules. Unselected options are not active requirements.
12
7
 
13
- ## 0. TL;DR — Key Decisions at a Glance
8
+ ## 1. Decision Ledger
14
9
 
15
- | Dimension | Decision |
16
- |-----------|----------|
10
+ | Domain | Selected Decision |
11
+ |---|---|
17
12
  | Language | {{ language }} |
18
- | Runtime Version | {{ runtime_version }} |
13
+ | Runtime | {{ runtime_version }} |
19
14
  | Framework | {{ framework }} |
20
- | Architecture Pattern | {{ architecture }} |
21
- | API Style | {{ api_style }} |
22
- | API Documentation | {{ api_docs }} |
23
- | ORM | {{ orm }} |
15
+ | Architecture | {{ architecture }} |
16
+ | API style | {{ api_style }} |
17
+ | API documentation | {{ api_docs }} |
18
+ | Data access | {{ orm }} |
24
19
  | Database | {{ database }} |
25
20
  | Authentication | {{ auth_scheme }} |
26
- | Caching | {{ cache }} |
27
- | Message Queue | {{ mq }} |
28
- | Containerization | {{ container }} |
29
- | Test Requirements | {{ test_requirement }} |
30
- | Test Framework | {{ test_framework }} |
31
- | Mock Strategy | {{ mock_strategy }} |
21
+ | Cache | {{ cache }} |
22
+ | Message queue | {{ mq }} |
23
+ | Deployment/container | {{ container }} |
24
+ | Test depth | {{ test_requirement }} |
25
+ | Test framework | {{ test_framework }} |
26
+ | Mock strategy | {{ mock_strategy }} |
32
27
  | Logging | {{ logging }} |
33
- | Monitoring | {{ monitoring }} |
28
+ | Monitoring/tracing | {{ monitoring }} |
34
29
 
35
- ---
30
+ Deferred and not-applicable decisions remain explicit.
36
31
 
37
- ## 1. Project Structure
32
+ ## 2. Structure and Stack
33
+
34
+ ### 2.1 Invariant ownership
38
35
 
39
36
  {{ FIXED_RULES_STRUCTURE }}
40
37
 
38
+ ### 2.2 Selected architecture
39
+
41
40
  {{ arch_rules }}
42
41
 
43
- ---
42
+ ### 2.3 Selected language, runtime, and framework
44
43
 
45
- ## 2. API Design
44
+ {{ tech_stack_rules }}
45
+
46
+ ## 3. API Contract
46
47
 
47
48
  {{ FIXED_RULES_API }}
48
49
 
49
50
  {{ api_rules }}
50
51
 
51
- ---
52
+ HTTP-specific conventions apply only to selected HTTP surfaces. GraphQL and gRPC surfaces use their own active derivation rules.
52
53
 
53
- ## 3. Error Handling
54
+ ## 4. Error and Security Boundaries
54
55
 
55
- {{ FIXED_RULES_ERROR }}
56
+ ### 4.1 Error integrity
56
57
 
57
- ---
58
+ {{ FIXED_RULES_ERROR }}
58
59
 
59
- ## 4. Security
60
+ ### 4.2 Security invariants and selected authentication
60
61
 
61
62
  {{ FIXED_RULES_SECURITY }}
62
63
 
63
64
  {{ auth_rules }}
64
65
 
65
- {{ FIXED_RULES_RATE_LIMITING }}
66
-
67
- ---
66
+ ### 4.3 Abuse protection
68
67
 
69
- ## 5. Database
68
+ {{ FIXED_RULES_RATE_LIMITING }}
70
69
 
71
- For schema design standards (normalization, column types, indexing, migration management), refer to `database-rules.md` (generated separately by the `database-rules` skill). This section covers backend-perspective database concerns only.
70
+ ## 5. Data Access
72
71
 
73
72
  {{ FIXED_RULES_DATABASE }}
74
73
 
75
74
  {{ data_rules }}
76
75
 
77
- ---
76
+ Detailed datastore modeling rules, when separately configured by app-planner, live in `database-rules.md`. Shared decisions must agree; a mismatch blocks generation rather than creating two sources of truth.
78
77
 
79
- ## 6. Observability
78
+ ## 6. Cache and Messaging
80
79
 
81
- {{ FIXED_RULES_OBSERVABILITY }}
80
+ ### 6.1 Cache
82
81
 
83
- {{ FIXED_RULES_TRACING }}
84
-
85
- {{ observability_rules }}
86
-
87
- ---
88
-
89
- ## 7. Configuration Management
90
-
91
- {{ FIXED_RULES_CONFIG }}
92
-
93
- ---
82
+ {{ cache_rules }}
94
83
 
95
- ## 8. Async & Message Queues
84
+ ### 6.2 Async work and message delivery
96
85
 
97
86
  {{ FIXED_RULES_ASYNC }}
98
87
 
@@ -100,74 +89,67 @@ For schema design standards (normalization, column types, indexing, migration ma
100
89
 
101
90
  {{ mq_rules }}
102
91
 
103
- ---
92
+ When cache or messaging is not selected, the corresponding section states that it is not applicable.
104
93
 
105
- ## 8b. Graceful Shutdown
94
+ ## 7. Observability and Lifecycle
106
95
 
107
- {{ FIXED_RULES_GRACEFUL_SHUTDOWN }}
96
+ ### 7.1 Observability
108
97
 
109
- ---
98
+ {{ FIXED_RULES_OBSERVABILITY }}
110
99
 
111
- ## 9. Testing
100
+ {{ FIXED_RULES_TRACING }}
112
101
 
113
- {{ FIXED_RULES_TEST }}
102
+ {{ observability_rules }}
114
103
 
115
- {{ test_rules }}
104
+ ### 7.2 Configuration
116
105
 
117
- ---
106
+ {{ FIXED_RULES_CONFIG }}
118
107
 
119
- ## 10. AI Vibecoding Behavior Constraints
108
+ ### 7.3 Graceful shutdown
120
109
 
121
- ### 10.1 Baseline Constraints (project-agnostic, always active)
110
+ {{ FIXED_RULES_GRACEFUL_SHUTDOWN }}
122
111
 
123
- {{ FIXED_RULES_AI_BASE }}
112
+ ## 8. Testing
124
113
 
125
- ### 10.2 Project-Specific Hard Constraints
114
+ {{ FIXED_RULES_TEST }}
126
115
 
127
- - **Adding dependencies**: {{ ai_dependency_rule }}
128
- - **Modifying shared modules**: {{ ai_breaking_change_rule }}
129
- - **Modifying configuration**: {{ ai_config_rule }}
116
+ {{ test_rules }}
130
117
 
131
- ### 10.3 Mandatory Pre-Actions (before every code generation)
118
+ Only test tiers and thresholds selected in the decision ledger are mandatory.
132
119
 
133
- AI must complete the following in order before generating or modifying any backend code:
120
+ ## 9. AI Change Permissions
134
121
 
135
- 1. Read this file (`backend-rules.md`)
136
- 2. Read existing files in the target module's directory to confirm whether similar functionality already exists
137
- 3. If modifying shared utils / middleware / service, search all callers
138
- 4. If modifying API contracts, assess impact on frontend/clients
122
+ ### 9.1 Invariant change safety
139
123
 
140
- ---
124
+ {{ FIXED_RULES_AI_BASE }}
141
125
 
142
- ## 11. Tech Stack Lock-in
126
+ ### 9.2 Selected permissions
143
127
 
144
- {{ tech_stack_rules }}
128
+ - Dependency changes: {{ ai_dependency_rule }}
129
+ - Shared-module impact analysis: {{ ai_breaking_change_rule }}
130
+ - Configuration and environment changes: {{ ai_config_rule }}
145
131
 
146
- ---
132
+ These selected blocks own their domains; no appendix or invariant may override them.
147
133
 
148
- ## 12. Containerization & Deployment
134
+ ## 10. Deployment
149
135
 
150
136
  {{ deploy_rules }}
151
137
 
152
- ## 13. Caching Strategy
153
-
154
- {{ cache_rules }}
155
-
156
- ---
157
-
158
- ## Appendix A: Deny List (Quick Reference)
159
-
160
- > This appendix is auto-generated by AI in Phase 4 by extracting all forbidden entries from each section.
138
+ ## Appendix A: Active Deny List
161
139
 
162
140
  {{ deny_list_summary }}
163
141
 
164
- ## Appendix B: Recommended Libraries & Tools
142
+ Include only prohibitions from active invariant and selected blocks.
165
143
 
166
- > This appendix is auto-generated by AI in Phase 4 to recommend the supporting ecosystem based on the tech stack.
144
+ ## Appendix B: Compatible Recommendations
167
145
 
168
146
  {{ recommended_libs }}
169
147
 
170
- ---
148
+ Recommendations must match the selected language, framework, data, deployment, and dependency-permission decisions.
149
+
150
+ ## Source Contract
171
151
 
172
- **Version**: v1.0 Generated on {{ generated_at }}
173
- **Next review recommended**: before tech stack changes or infrastructure migrations
152
+ - Owner: app-planner Rules Configuration
153
+ - Resource family: `references/rules/backend/`
154
+ - Regenerate after a decision or source-contract change.
155
+ - Generation metadata value: {{ generated_at }}