prizmkit 1.1.153 → 1.1.155

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 (178) 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 +120 -113
  6. package/bundled/dev-pipeline/assets/skill-subagent-integration.md +1 -1
  7. package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +355 -15
  8. package/bundled/dev-pipeline/prizmkit_runtime/cli.py +189 -110
  9. package/bundled/dev-pipeline/prizmkit_runtime/commands.py +146 -111
  10. package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +4 -20
  11. package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
  12. package/bundled/dev-pipeline/prizmkit_runtime/interoperability.py +0 -1
  13. package/bundled/dev-pipeline/prizmkit_runtime/paths.py +0 -3
  14. package/bundled/dev-pipeline/prizmkit_runtime/reset.py +122 -15
  15. package/bundled/dev-pipeline/prizmkit_runtime/reset_preserve.py +1 -1
  16. package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
  17. package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +1 -10
  18. package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
  19. package/bundled/dev-pipeline/prizmkit_runtime/runners.py +139 -74
  20. package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
  21. package/bundled/dev-pipeline/prizmkit_runtime/status.py +106 -1
  22. package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
  23. package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
  24. package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
  25. package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
  26. package/bundled/dev-pipeline/scripts/init-bugfix-pipeline.py +2 -2
  27. package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
  28. package/bundled/dev-pipeline/scripts/update-bug-status.py +197 -71
  29. package/bundled/dev-pipeline/scripts/update-checkpoint.py +77 -16
  30. package/bundled/dev-pipeline/scripts/update-feature-status.py +46 -121
  31. package/bundled/dev-pipeline/scripts/update-refactor-status.py +46 -123
  32. package/bundled/dev-pipeline/scripts/utils.py +119 -0
  33. package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
  34. package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
  35. package/bundled/dev-pipeline/templates/bug-fix-list-schema.json +3 -2
  36. package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
  37. package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
  38. package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
  39. package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
  40. package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
  41. package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
  42. package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
  43. package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
  44. package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
  45. package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
  46. package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
  47. package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
  48. package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
  49. package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
  50. package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
  51. package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
  52. package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
  53. package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
  54. package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
  55. package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
  56. package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
  57. package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
  58. package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
  59. package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
  60. package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
  61. package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
  62. package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
  63. package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
  64. package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
  65. package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
  66. package/bundled/dev-pipeline/tests/test_auto_skip.py +111 -32
  67. package/bundled/dev-pipeline/tests/test_checkpoint_state.py +617 -30
  68. package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -194
  69. package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
  70. package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
  71. package/bundled/dev-pipeline/tests/test_python_runner_parity.py +281 -206
  72. package/bundled/dev-pipeline/tests/test_recovery_workflow.py +322 -0
  73. package/bundled/dev-pipeline/tests/test_reset_modes.py +935 -0
  74. package/bundled/dev-pipeline/tests/test_reset_preserve.py +5 -7
  75. package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
  76. package/bundled/dev-pipeline/tests/test_unified_cli.py +617 -188
  77. package/bundled/skills/_metadata.json +9 -9
  78. package/bundled/skills/app-planner/SKILL.md +3 -3
  79. package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
  80. package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
  81. package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
  82. package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
  83. package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
  84. package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
  85. package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
  86. package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
  87. package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
  88. package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
  89. package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
  90. package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
  91. package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
  92. package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
  93. package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
  94. package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
  95. package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
  96. package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
  97. package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
  98. package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
  99. package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
  100. package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
  101. package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
  102. package/bundled/skills/bug-planner/references/schema-validation.md +1 -1
  103. package/bundled/skills/bug-planner/scripts/validate-bug-list.py +1 -1
  104. package/bundled/skills/bugfix-pipeline-launcher/SKILL.md +21 -13
  105. package/bundled/skills/feature-pipeline-launcher/SKILL.md +22 -14
  106. package/bundled/skills/prizmkit/SKILL.md +17 -18
  107. package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
  108. package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
  109. package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
  110. package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
  111. package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
  112. package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
  113. package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
  114. package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
  115. package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
  116. package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
  117. package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
  118. package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
  119. package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
  120. package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
  121. package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
  122. package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
  123. package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
  124. package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
  125. package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
  126. package/bundled/skills/prizmkit-init/SKILL.md +4 -0
  127. package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
  128. package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
  129. package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
  130. package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
  131. package/bundled/skills/prizmkit-prizm-docs/SKILL.md +11 -1
  132. package/bundled/skills/prizmkit-retrospective/SKILL.md +63 -77
  133. package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
  134. package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
  135. package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +17 -23
  136. package/bundled/skills/prizmkit-test/SKILL.md +64 -51
  137. package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
  138. package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
  139. package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
  140. package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
  141. package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
  142. package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
  143. package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
  144. package/bundled/skills/recovery-workflow/SKILL.md +9 -6
  145. package/bundled/skills/recovery-workflow/evals/evals.json +2 -2
  146. package/bundled/skills/recovery-workflow/references/detection.md +7 -6
  147. package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +16 -6
  148. package/bundled/skills/refactor-pipeline-launcher/SKILL.md +21 -13
  149. package/bundled/templates/project-memory-template.md +19 -11
  150. package/package.json +1 -1
  151. package/src/scaffold.js +33 -22
  152. package/bundled/dev-pipeline/prizmkit_runtime/runner_recovery.py +0 -228
  153. package/bundled/dev-pipeline/scripts/generate-recovery-prompt.py +0 -767
  154. package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
  155. package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
  156. package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
  157. package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
  158. package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
  159. package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
  160. package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
  161. package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
  162. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
  163. package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
  164. package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
  165. package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
  166. package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
  167. package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
  168. package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
  169. package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
  170. package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
  171. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
  172. package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
  173. package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
  174. package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
  175. package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
  176. package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
  177. package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
  178. package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
@@ -1,285 +1,130 @@
1
- # Fixed Rules — Complete Backend Fixed Rules
2
-
3
- > This file is read by the `backend-rules` skill in Phase 1 and injected directly into `backend-rules.md`.
4
- > These rules are industry consensus / best practices — **do not ask the user**.
5
- > Every rule includes RATIONALE so the AI understands intent, not just constraints.
6
-
7
- ---
8
-
9
- ## F1. Project Structure
10
-
11
- ### F1.1 Layered Architecture (Mandatory)
12
-
13
- - **Rule**: Must use one of the following layering patterns, and be consistent across the project:
14
- - Classic three-tier: `controller → service → repository`
15
- - DDD-style: `handler → usecase → repository` (Go) / `router → service → dao` (Node)
16
- - **Rule**: Upper layers must not bypass lower layers (controller must not call repository directly).
17
- - **Rule**: Each layer does only its own job — controller handles request validation and response formatting, service handles business logic, repository handles data access.
18
- - **RATIONALE**: Mixed layer boundaries are the #1 cause of backend code rot. When AI can't tell which layer does what, business logic scatters into controllers.
19
-
20
- ### F1.2 Directory Conventions
21
-
22
- - **Rule**: The project root structure must clearly reflect the layering.
23
- - **Rule**: Shared utilities (utils) must be isolated from business code.
24
- - **Rule**: Config, constants, and type definitions are centrally managed.
25
- - **Forbidden**: Turning `utils/` into a dumping ground for anything without a clear home.
26
- - **RATIONALE**: The directory structure is the project's first piece of documentation. A new developer (including AI) should know where a function belongs just by reading it.
27
-
28
- ### F1.3 Module Boundaries
29
-
30
- - **Rule**: Organize by business domain, not by technical layer (types/services/models cross-domain).
31
- - **Rule**: Modules communicate through explicit interfaces. Do not access another module's internal implementation directly.
32
- - **Forbidden**: Circular dependencies (module A imports B, B imports A).
33
- - **RATIONALE**: Technical-layer organization scatters code for a single feature across 4–5 directories. Changing one feature requires jumping across directories.
34
- - **Note on layering interaction with F1.1**: Organize by business domain at the top level. Within each domain directory, enforce the layering from F1.1 (e.g., user/controller/, user/service/, user/repository/). Do NOT create top-level controllers/, services/, repositories/ directories that span all domains.
35
-
36
- ---
37
-
38
- ## F2. API Design
39
-
40
- ### F2.1 REST Contract
41
-
42
- - **Rule**: URLs use plural nouns (`/users`, `/orders`), never verbs (forbid `/getUser`, `/createOrder`).
43
- - **Rule**: HTTP method semantics must be correct:
44
- - `GET` — query, must not modify data
45
- - `POST` — create
46
- - `PUT` — full update
47
- - `PATCH` — partial update
48
- - `DELETE` — remove
49
- - **Rule**: Standard pagination params: `page` (1-based), `pageSize` (default 20, max 100).
50
- - **Rule**: Standard sorting params: `sortBy=field&sortOrder=asc|desc`.
51
- - **RATIONALE**: The API is a contract between frontend and backend. Inconsistent naming and parameter formats cause bugs in consumers.
52
-
53
- ### F2.2 Status Codes
54
-
55
- - **Rule**: Use HTTP status codes strictly by semantics:
56
- - `200` — query success
57
- - `201` — create success
58
- - `204` — delete success (no body)
59
- - `400` — validation failure
60
- - `401` — not authenticated
61
- - `403` — forbidden
62
- - `404` — resource not found
63
- - `409` — resource conflict
64
- - `422` — valid request format but business logic rejection
65
- - `500` — unknown server error
66
- - **Forbidden**: Returning `200` for all errors with an error code in the body.
67
- - **RATIONALE**: HTTP status codes are standard signals for infrastructure (load balancers, monitoring, gateways). Bypassing them makes all observability useless.
68
-
69
- ### F2.3 Error Response Format
70
-
71
- - **Rule**: All errors return a unified structure:
72
- ```json
73
- {
74
- "error": {
75
- "code": "USER_NOT_FOUND",
76
- "message": "User not found",
77
- "details": [],
78
- "traceId": "abc-123"
79
- }
80
- }
81
- ```
82
- - **Rule**: `code` uses UPPER_SNAKE_CASE with business semantics (`USER_NOT_FOUND`, not `ERR_001`).
83
- - **Rule**: `traceId` is generated at request entry and propagated through the entire call chain.
84
- - **RATIONALE**: A unified error format lets frontends and gateways write one error handler instead of per-endpoint if/else chains.
1
+ # Backend Invariant Rules
85
2
 
86
- ### F2.4 API Versioning
3
+ POLICY_CLASS: invariant
87
4
 
88
- - **Rule**: APIs must indicate version in URL or Header (`/api/v1/users` or `Accept: application/vnd.api.v1+json`).
89
- - **Rule**: Breaking changes require a new version. Old versions must be maintained for at least one release cycle.
90
- - **RATIONALE**: Unversioned APIs cause widespread mobile/third-party client crashes on release.
5
+ These blocks apply to every backend option exposed by Rules Configuration.
91
6
 
92
- ---
7
+ **Selected-decision boundary:** language, runtime, framework, architecture, API style, API documentation, data technology, authentication scheme, cache, queue, deployment, testing depth, observability stack, dependency permission, caller analysis, and config permission belong to confirmed decisions and derivation rules. Do not encode one option here as universal behavior.
93
8
 
94
- ## F3. Error Handling
9
+ ## I1. Structure and Ownership
95
10
 
96
- - **Rule**: All exceptions must be caught by a global exception filter and return a unified error response.
97
- - **Rule**: Business exceptions vs. system exceptions are separated business exceptions return 4xx, system exceptions return 500.
98
- - **Forbidden**: Empty `catch(e) {}` blocks. If ignoring is truly necessary, comment why.
99
- - **Forbidden**: `catch(e) { throw new Error('something went wrong') }` that swallows the original stack trace.
100
- - **Rule**: Error logs must include traceId, user identifier, request method, and path.
101
- - **RATIONALE**: The biggest backend failure isn't "an error occurred" — it's "an error occurred and nobody knows".
11
+ - Every module has an explicit owner and public boundary; internal implementation is not imported as an accidental API.
12
+ - Dependency direction follows the selected architecture and remains free of unplanned cycles.
13
+ - Business behavior has one authoritative implementation rather than duplicated branches across transports or entrypoints.
14
+ - Rationale: ownership and acyclic dependencies are invariant; layer names are not.
102
15
 
103
- ---
16
+ Inject into `{{ FIXED_RULES_STRUCTURE }}`.
104
17
 
105
- ## F4. Security
18
+ ## I2. API Contract Integrity
106
19
 
107
- ### F4.1 Input Validation (Mandatory)
20
+ - Follow the selected API style consistently and document externally consumed requests, responses, errors, and compatibility expectations.
21
+ - Validate untrusted inputs at the boundary before invoking business behavior.
22
+ - Contract changes identify affected consumers and use the selected compatibility or versioning policy.
23
+ - Do not apply HTTP-specific rules to non-HTTP transports unless an adapter explicitly owns that mapping.
108
24
 
109
- - **Rule**: All external inputs must be validated (body, query params, path params, headers, cookies).
110
- - **Rule**: Use a validation framework (Joi/Zod/Pydantic/validator), not hand-written if/else.
111
- - **Rule**: Validation failures return 400 with field-level error details.
112
- - **Forbidden**: Trusting data from the frontend to be directly stored or executed.
113
- - **RATIONALE**: Input validation is the first line of defense and the root cause mitigation for multiple OWASP Top 10 attacks.
114
-
115
- ### F4.2 Authentication & Authorization
116
-
117
- - **Rule**: AuthN and AuthZ must be separated — middleware handles authentication, business logic handles authorization.
118
- - **Rule**: JWT tokens must have expiration (access token ≤ 15min, refresh token ≤ 7d).
119
- - **Rule**: Sensitive operations (delete, transfer, permission changes) require secondary confirmation.
120
- - **Forbidden**: Hardcoding tokens/secrets in source code.
121
- - **RATIONALE**: Separating AuthN and AuthZ allows independent security audits at each layer.
122
-
123
- ### F4.3 General Protections
124
-
125
- - **Rule**: All external links/callback URLs must be validated against a whitelist to prevent Open Redirect.
126
- - **Rule**: File uploads must validate type (whitelist), size, and content magic bytes.
127
- - **Rule**: Passwords must use bcrypt/argon2 hashing. Forbid plaintext, MD5, or SHA1.
128
- - **Forbidden**: Exposing secrets, tokens, or passwords in error messages or logs.
129
- - **Forbidden**: Returning internal implementation details in responses (stack traces, SQL statements, framework versions).
130
- - **RATIONALE**: These are the most common security vulnerabilities. Not a question of "should we" — it's "you will be breached if you don't."
25
+ Inject into `{{ FIXED_RULES_API }}`.
131
26
 
132
- ### F4.4 Rate Limiting
27
+ ## I3. Error Integrity
133
28
 
134
- - **Rule**: All public API endpoints must have rate limiting. Forbid unlimited request rates.
135
- - **Rule**: Rate limit tiers: authentication endpoints (5 req/min), general API (100 req/min per user/IP), internal/admin endpoints (higher limits).
136
- - **Rule**: Rate limit headers: include X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset in responses.
137
- - **Rule**: Rate limit exceeded returns 429 Too Many Requests with Retry-After header.
138
- - **RATIONALE**: Without rate limiting, a single misbehaving client or a simple script-kiddie attack can take down your entire API.
29
+ - Preserve original diagnostic context when translating an internal failure to a public error.
30
+ - Separate expected domain failures from unexpected system failures.
31
+ - Public errors expose no secrets, stack traces, query text, or private implementation details.
32
+ - Never swallow a failure without an explicit, documented recovery path.
139
33
 
140
- ---
141
-
142
- ## F5. Database
143
-
144
- **Note**: These rules assume a relational database (PostgreSQL/MySQL). If the project uses MongoDB (selected in Q8), some rules (migration files, SELECT syntax) do not apply. Document-specific rules are in the derived rules section.
145
-
146
- - **Rule**: Connection pool must be reasonably sized (default ≤ CPU cores × 2). Connections must have timeouts.
147
- - **Rule**: All migration files must be versioned, reversible, and committed to the repository.
148
- - **Rule**: Queries must use parameterized queries or ORM-provided safe methods. Forbid string-concatenated SQL.
149
- - **Rule**: Bulk operations (>1000 rows) must be batched.
150
- - **Forbidden**: Executing single-row SQL inside loops (use batch insert/update instead).
151
- - **Forbidden**: SELECT without LIMIT.
152
- - **Forbidden**: `SELECT *` (specify columns explicitly).
153
- - **RATIONALE**: The database is the component where a single failure has the largest blast radius in a backend system. One bad query can bring down the entire service.
34
+ Inject into `{{ FIXED_RULES_ERROR }}`.
154
35
 
155
- ---
36
+ ## I4. Security Baseline
156
37
 
157
- ## F6. Observability
38
+ - Authenticate and authorize at explicit trust boundaries; do not trust caller-supplied identity or role data.
39
+ - Keep credentials and secrets outside source control and redact sensitive values from logs and errors.
40
+ - Validate callback, redirect, upload, and deserialization boundaries against an allowlisted contract.
41
+ - Store passwords only with a current password-hashing construction.
42
+ - Scheme-specific token, session, OAuth, and API-key rules come from `{{ auth_rules }}`.
158
43
 
159
- - **Rule**: Logs must be structured (JSON format), containing: `timestamp`, `level`, `message`, `traceId`, `userId`, `path`, `method`.
160
- - **Rule**: Expose at least two endpoints: `GET /health` (liveness) and `GET /health/ready` (readiness).
161
- - **Rule**: Key business operations must be instrumented (registration, login, payment, order creation, etc.).
162
- - **Forbidden**: Using `console.log` as a substitute for structured logging.
163
- - **RATIONALE**: A microservice without structured logging is a black box. Troubleshooting goes from minutes to hours.
44
+ Inject into `{{ FIXED_RULES_SECURITY }}`.
164
45
 
165
- ### F6.2 Distributed Tracing
46
+ ## I5. Abuse Protection
166
47
 
167
- - **Rule**: Every incoming request must generate or propagate a traceId. traceId is passed in X-Trace-Id header.
168
- - **Rule**: All downstream calls (database, cache, message queue, external APIs) must carry the traceId.
169
- - **Rule**: Use W3C Trace Context standard (traceparent header) for cross-service propagation.
170
- - **Forbidden**: Generating a new traceId mid-request chain (breaks distributed traces).
171
- - **RATIONALE**: traceId is the thread that ties together every log line and span for a single request across microservices. Without it, troubleshooting distributed systems is guesswork.
48
+ - Identify public or expensive operations that require quotas, backpressure, idempotency, or rate protection.
49
+ - Derive concrete limits from product risk and deployment capacity instead of imposing one universal number.
50
+ - Rejection behavior is observable and does not disclose sensitive internals.
172
51
 
173
- ### F6.3 Health Check Endpoints
52
+ Inject into `{{ FIXED_RULES_RATE_LIMITING }}`.
174
53
 
175
- - **Rule**: GET /health (liveness) — returns 200 if the process is alive. No dependency checks.
176
- - **Rule**: GET /health/ready (readiness) — returns 200 if all critical dependencies are available (database, cache, message queue). Returns 503 if any critical dependency is unreachable.
177
- - **Rule**: Health checks must be lightweight (< 50ms). Forbid running expensive queries or external API calls.
178
- - **RATIONALE**: Kubernetes and load balancers use these endpoints to decide whether to route traffic or restart the pod. A slow /health creates cascading failures.
54
+ ## I6. Data Access Safety
179
55
 
180
- ---
56
+ - Use the selected data technology's safe parameter binding or query construction mechanism.
57
+ - Bound potentially unbounded reads and writes or document the controlled batch/stream contract.
58
+ - Keep transactions or equivalent atomic units short and free of unrelated external waits.
59
+ - Relational and document-specific modeling rules belong to the selected data derivation blocks.
181
60
 
182
- ## F7. Configuration Management
61
+ Inject into `{{ FIXED_RULES_DATABASE }}`.
183
62
 
184
- - **Rule**: Configuration has three tiers — code defaults < environment variables < config files (by priority).
185
- - **Forbidden**: Committing any secrets, tokens, or passwords to Git.
186
- - **Rule**: All environment-specific config (database connections, Redis addresses, third-party API keys) injected via environment variables.
187
- - **Rule**: Must have a `.env.example` file listing all required environment variables with descriptions (use placeholders for values).
188
- - **RATIONALE**: Separating config from code is a 12-Factor App principle and a security baseline.
63
+ ## I7. Observability Integrity
189
64
 
190
- ---
65
+ - Errors and key operations carry enough correlation context to diagnose one request, job, or message without logging secrets.
66
+ - Logging format and collection topology follow the selected observability decision.
67
+ - Health signals distinguish process liveness from dependency readiness when the deployment environment consumes both.
191
68
 
192
- ## F8. Async & Message Queues
69
+ Inject into `{{ FIXED_RULES_OBSERVABILITY }}`.
193
70
 
194
- - **Rule**: Message handlers must be idempotent — replaying the same message produces no side effects.
195
- - **Rule**: Async tasks must have timeout handling, retry strategy (exponential backoff), and dead letter queues.
196
- - **Rule**: Message bodies must contain a unique id (for deduplication) and traceId (for tracing).
197
- - **Rule**: Retry count and interval must have upper limits (e.g., max 3 retries, intervals 1s/5s/15s).
198
- - **RATIONALE**: The biggest async system problem isn't "messages got lost" — it's "messages got processed twice and double-charged the customer."
71
+ ## I8. Trace Continuity
199
72
 
200
- ### F8.4 Message Delivery Semantics
73
+ - Preserve an existing correlation or trace context across supported downstream boundaries.
74
+ - Do not silently replace caller-provided valid trace context mid-operation.
75
+ - Distributed tracing is enabled only when selected or required by the deployment; otherwise preserve local correlation identifiers.
201
76
 
202
- - **Rule**: Explicitly document the delivery guarantee for each queue/topic: at-most-once, at-least-once, or exactly-once.
203
- - **Rule**: At-least-once (default for most systems): consumers must be idempotent.
204
- - **Rule**: Dead letter queues (DLQ) must be configured. Failed messages route to DLQ after max retries.
205
- - **Rule**: DLQ messages must have a replay/inspect mechanism. Forbid silently discarding failed messages.
206
- - **RATIONALE**: The difference between at-least-once and exactly-once is the difference between "customer charged once" and "customer charged twice."
77
+ Inject into `{{ FIXED_RULES_TRACING }}`.
207
78
 
208
- ### F8.5 Graceful Shutdown
79
+ ## I9. Configuration Safety
209
80
 
210
- - **Rule**: Application must handle SIGTERM gracefully: stop accepting new requests, finish in-progress requests (with timeout), close database connections, flush logs.
211
- - **Rule**: Shutdown timeout must be configured (default 30s). Kubernetes terminationGracePeriodSeconds must exceed this.
212
- - **Rule**: In-flight async tasks must complete or be re-queued before shutdown.
213
- - **Forbidden**: Hard-exit on SIGTERM (SIGKILL should be the fallback, not the default).
214
- - **RATIONALE**: Deployments and pod restarts should not cause failed requests or lost data. Graceful shutdown is a basic operational requirement.
81
+ - Separate secrets from non-secret configuration and document required configuration without committing secret values.
82
+ - Validate required configuration before serving work.
83
+ - Config modification permission comes only from `{{ ai_config_rule }}`; this invariant does not forbid an authorized change.
215
84
 
216
- ---
85
+ Inject into `{{ FIXED_RULES_CONFIG }}`.
217
86
 
218
- ## F9. Testing
87
+ ## I10. Async Safety
219
88
 
220
- - **Rule**: Testing has three tiers unit tests (service layer), integration tests (API endpoints + database), E2E (critical business flows).
221
- - **Rule**: External dependencies (database, Redis, third-party APIs) must be mocked in unit tests.
222
- - **Rule**: Integration tests use a test database or testcontainers. Test data is cleaned before and after each run.
223
- - **Rule**: Coverage baseline: service layer ≥ 80%, controller layer ≥ 60%.
224
- - **Forbidden**: Tests sharing mutable state (global variables / shared database rows).
225
- - **RATIONALE**: Backend regression risk is far higher than frontend (one data corruption is irreversible). Tests are the only safety net.
89
+ - Every asynchronous side effect defines ownership, timeout/cancellation behavior, and duplicate-delivery handling where applicable.
90
+ - Do not claim queue semantics when no queue was selected.
91
+ - Queue-specific retry, ordering, and dead-letter rules come from `{{ mq_rules }}`.
226
92
 
227
- ---
93
+ Inject into `{{ FIXED_RULES_ASYNC }}`.
228
94
 
229
- ## F10. AI Vibecoding Baseline Constraints (project-agnostic, always active)
95
+ ## I11. Message Delivery Integrity
230
96
 
231
- ### F10.1 Search First
232
- - **Rule**: Before generating a new module, AI must search existing code to check for similar functionality.
233
- - **Rule**: Before writing SQL/migrations, AI must read existing migration files and schema.
97
+ - When messaging is selected, document delivery semantics and make consumers safe for the selected duplicate/retry model.
98
+ - Failed messages remain observable and recoverable according to the selected queue capability.
99
+ - Render an explicit not-applicable statement when messaging is not selected.
234
100
 
235
- ### F10.2 Dependency Control
236
- - **Rule**: AI must not modify `package.json` / `requirements.txt` / `go.mod` / `Cargo.toml` on its own.
237
- - **Rule**: If a new dependency is truly needed, AI must list: package name, version, reason, alternative comparison.
101
+ Inject into `{{ FIXED_RULES_MESSAGE_DELIVERY }}`.
238
102
 
239
- ### F10.3 Breaking Changes
240
- - **Rule**: Before modifying a shared module/utility/API contract, AI must list all callers.
241
- - **Rule**: Changing API response field names or types requires assessing frontend impact first.
103
+ ## I12. Shutdown Integrity
242
104
 
243
- ### F10.4 Config Immutability
244
- - **Rule**: AI must not modify environment variables, database connection config, docker-compose, or CI/CD configuration on its own.
245
- - **Rule**: Adding a new environment variable in code must be accompanied by an update to `.env.example`.
246
-
247
- ### F10.5 SQL Safety
248
- - **Rule**: All AI-written SQL must be parameterized queries.
249
- - **Forbidden**: AI generating string-concatenated SQL code.
105
+ - Stop accepting new work before releasing resources.
106
+ - Bound shutdown and preserve or requeue owned in-flight work where the runtime supports it.
107
+ - Apply platform-specific signal and probe details through deployment derivation rules.
250
108
 
251
- ### F10.6 Migration Files
252
- - **Rule**: AI generating a new migration must also produce the corresponding rollback migration.
253
- - **Forbidden**: Dropping columns or changing types in migrations (add-only, unless a rollback plan exists).
109
+ Inject into `{{ FIXED_RULES_GRACEFUL_SHUTDOWN }}`.
254
110
 
255
- ### F10.7 Context Honesty
256
- - **Rule**: When uncertain, AI must explicitly say "I'm not sure." Forbid inventing API paths, library versions, or database field names.
257
- - **Rule**: AI must read the latest file contents before modifying. Forbid generating diffs based on guesswork.
111
+ ## I13. Verification Integrity
258
112
 
259
- ---
113
+ - Follow the selected testing depth; do not invent unapproved coverage thresholds or mandatory tiers.
114
+ - Enabled tests are deterministic, isolated from production data, and assert behavior rather than implementation accidents.
115
+ - A `not required yet` choice is recorded explicitly with its accepted risk rather than contradicted by unconditional test requirements.
260
116
 
261
- ## Injection Instructions (for the AI executing this skill)
117
+ Inject into `{{ FIXED_RULES_TEST }}`.
262
118
 
263
- Each chapter in this file corresponds to a `{{ FIXED_RULES_* }}` placeholder in the template:
119
+ ## I14. AI Change Safety
264
120
 
265
- | Chapter | Inject Into Placeholder | Template Section |
266
- |---------|------------------------|-------------------|
267
- | F1 Project Structure | `{{ FIXED_RULES_STRUCTURE }}` | §1 Project Structure |
268
- | F2 API Design | `{{ FIXED_RULES_API }}` | §2 API Design |
269
- | F3 Error Handling | `{{ FIXED_RULES_ERROR }}` | §3 Error Handling |
270
- | F4 Security | `{{ FIXED_RULES_SECURITY }}` | §4 Security (F4.1-F4.3 only; stop before F4.4) |
271
- | F4.4 Rate Limiting | `{{ FIXED_RULES_RATE_LIMITING }}` | §4 Security (F4.4 only, injected separately) |
272
- | F5 Database | `{{ FIXED_RULES_DATABASE }}` | §5 Database |
273
- | F6 Observability | `{{ FIXED_RULES_OBSERVABILITY }}` | §6 Observability (F6 + F6.3 only; stop before F6.2) |
274
- | F6.2 Distributed Tracing | `{{ FIXED_RULES_TRACING }}` | §6 Observability (F6.2 only, injected separately) |
275
- | F7 Configuration | `{{ FIXED_RULES_CONFIG }}` | §7 Configuration |
276
- | F8 Async & Queues | `{{ FIXED_RULES_ASYNC }}` | §8 Async & Queues |
277
- | F8.4 Message Delivery | `{{ FIXED_RULES_MESSAGE_DELIVERY }}` | §8 Async & Queues |
278
- | F8.5 Graceful Shutdown | `{{ FIXED_RULES_GRACEFUL_SHUTDOWN }}` | §8 Async & Queues |
279
- | F9 Testing | `{{ FIXED_RULES_TEST }}` | §9 Testing |
280
- | F10 AI Constraints | `{{ FIXED_RULES_AI_BASE }}` | §10 AI Behavior Constraints |
121
+ - Read current code and search for existing ownership before creating duplicate modules or contracts.
122
+ - Keep changes inside the requested scope and report uncertainty rather than inventing endpoints, fields, versions, or infrastructure.
123
+ - Never expose secrets, weaken authorization, or bypass data safety merely to make a check pass.
124
+ - Dependency, caller-analysis, and config permissions come only from their selected rule blocks.
281
125
 
282
- **Rendering rules**:
283
- 1. Copy each chapter's full body (including RATIONALE) directly into the corresponding placeholder.
284
- 2. RATIONALE must be preserved — it lets AI understand intent rather than follow mechanically.
285
- 3. Keep the original markdown list structure. Do not rewrite as prose paragraphs.
126
+ Inject into `{{ FIXED_RULES_AI_BASE }}`.
127
+
128
+ ## Injection Contract
129
+
130
+ Copy each invariant block only into its named placeholder. If any invariant conflicts with a selected decision, fail generation and move the policy to a derivation block; never render both.
@@ -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 },