prizmkit 1.1.154 → 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.
- package/bundled/VERSION.json +3 -3
- package/bundled/adapters/codex/skill-adapter.js +1 -1
- package/bundled/adapters/pi/skill-adapter.js +2 -1
- package/bundled/dev-pipeline/.env.example +2 -6
- package/bundled/dev-pipeline/README.md +21 -27
- package/bundled/dev-pipeline/prizmkit_runtime/checkpoint_state.py +341 -15
- package/bundled/dev-pipeline/prizmkit_runtime/cli.py +0 -3
- package/bundled/dev-pipeline/prizmkit_runtime/daemon.py +1 -15
- package/bundled/dev-pipeline/prizmkit_runtime/gitops.py +48 -14
- package/bundled/dev-pipeline/prizmkit_runtime/runner_classification.py +50 -2
- package/bundled/dev-pipeline/prizmkit_runtime/runner_models.py +0 -9
- package/bundled/dev-pipeline/prizmkit_runtime/runner_prompts.py +3 -3
- package/bundled/dev-pipeline/prizmkit_runtime/runners.py +120 -22
- package/bundled/dev-pipeline/prizmkit_runtime/runtime_commit.py +482 -0
- package/bundled/dev-pipeline/prizmkit_runtime/test_result.py +64 -11
- package/bundled/dev-pipeline/scripts/generate-bootstrap-prompt.py +145 -367
- package/bundled/dev-pipeline/scripts/generate-bugfix-prompt.py +91 -62
- package/bundled/dev-pipeline/scripts/generate-refactor-prompt.py +105 -69
- package/bundled/dev-pipeline/scripts/prompt_framework.py +36 -41
- package/bundled/dev-pipeline/scripts/update-bug-status.py +1 -4
- package/bundled/dev-pipeline/scripts/update-checkpoint.py +61 -13
- package/bundled/dev-pipeline/scripts/update-feature-status.py +1 -4
- package/bundled/dev-pipeline/scripts/update-refactor-status.py +1 -4
- package/bundled/dev-pipeline/templates/bootstrap-prompt.md +22 -27
- package/bundled/dev-pipeline/templates/bootstrap-tier3.md +71 -104
- package/bundled/dev-pipeline/templates/bugfix-bootstrap-prompt.md +59 -111
- package/bundled/dev-pipeline/templates/refactor-bootstrap-prompt.md +37 -72
- package/bundled/dev-pipeline/templates/sections/artifact-manifest.md +39 -0
- package/bundled/dev-pipeline/templates/sections/bugfix-critical-paths.md +3 -1
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-commit-report.md +8 -25
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-diagnose-plan.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-implement.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-review.md +3 -3
- package/bundled/dev-pipeline/templates/sections/bugfix-phase-test.md +2 -2
- package/bundled/dev-pipeline/templates/sections/bugfix-reminders.md +4 -4
- package/bundled/dev-pipeline/templates/sections/bugfix-session-context.md +0 -1
- package/bundled/dev-pipeline/templates/sections/checkpoint-system.md +7 -4
- package/bundled/dev-pipeline/templates/sections/context-budget-rules.md +14 -27
- package/bundled/dev-pipeline/templates/sections/feature-completion-summary.md +20 -0
- package/bundled/dev-pipeline/templates/sections/phase-commit-full.md +8 -71
- package/bundled/dev-pipeline/templates/sections/phase-implement-full.md +7 -7
- package/bundled/dev-pipeline/templates/sections/phase-prizmkit-test.md +3 -3
- package/bundled/dev-pipeline/templates/sections/phase-review-full.md +4 -4
- package/bundled/dev-pipeline/templates/sections/phase-specify-plan-full.md +5 -17
- package/bundled/dev-pipeline/templates/sections/refactor-critical-paths.md +3 -1
- package/bundled/dev-pipeline/templates/sections/refactor-phase-commit-report.md +10 -23
- package/bundled/dev-pipeline/templates/sections/refactor-phase-implement.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-phase-plan.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-phase-review.md +3 -3
- package/bundled/dev-pipeline/templates/sections/refactor-phase-test.md +2 -2
- package/bundled/dev-pipeline/templates/sections/refactor-reminders.md +7 -7
- package/bundled/dev-pipeline/templates/sections/refactor-session-context.md +0 -1
- package/bundled/dev-pipeline/templates/sections/retrospective.md +12 -0
- package/bundled/dev-pipeline/templates/sections/runtime-commit-handoff.md +35 -0
- package/bundled/dev-pipeline/templates/session-status-schema.json +45 -62
- package/bundled/dev-pipeline/tests/test_checkpoint_state.py +469 -18
- package/bundled/dev-pipeline/tests/test_generate_bootstrap_prompt.py +262 -175
- package/bundled/dev-pipeline/tests/test_generate_bugfix_prompt.py +62 -23
- package/bundled/dev-pipeline/tests/test_generate_refactor_prompt.py +76 -28
- package/bundled/dev-pipeline/tests/test_python_runner_parity.py +168 -18
- package/bundled/dev-pipeline/tests/test_recovery_workflow.py +111 -0
- package/bundled/dev-pipeline/tests/test_reset_preserve.py +0 -2
- package/bundled/dev-pipeline/tests/test_runtime_commit.py +608 -0
- package/bundled/dev-pipeline/tests/test_unified_cli.py +167 -25
- package/bundled/skills/_metadata.json +9 -9
- package/bundled/skills/app-planner/SKILL.md +3 -3
- package/bundled/skills/app-planner/references/generated-plan-review.md +2 -1
- package/bundled/skills/app-planner/references/rules/backend/derivation-rules.md +56 -64
- package/bundled/skills/app-planner/references/rules/backend/fixed-rules.md +85 -240
- package/bundled/skills/app-planner/references/rules/backend/question-bank.md +25 -25
- package/bundled/skills/app-planner/references/rules/backend/question-manifest.json +16 -7
- package/bundled/skills/app-planner/references/rules/backend/template.md +74 -92
- package/bundled/skills/app-planner/references/rules/database/derivation-rules.md +93 -93
- package/bundled/skills/app-planner/references/rules/database/fixed-rules.md +66 -173
- package/bundled/skills/app-planner/references/rules/database/question-bank.md +31 -26
- package/bundled/skills/app-planner/references/rules/database/question-manifest.json +13 -4
- package/bundled/skills/app-planner/references/rules/database/template.md +76 -98
- package/bundled/skills/app-planner/references/rules/frontend/derivation-rules.md +68 -95
- package/bundled/skills/app-planner/references/rules/frontend/fixed-rules.md +93 -166
- package/bundled/skills/app-planner/references/rules/frontend/question-bank.md +46 -36
- package/bundled/skills/app-planner/references/rules/frontend/question-manifest.json +11 -2
- package/bundled/skills/app-planner/references/rules/frontend/template.md +79 -257
- package/bundled/skills/app-planner/references/rules/mobile/derivation-rules.md +91 -99
- package/bundled/skills/app-planner/references/rules/mobile/fixed-rules.md +73 -246
- package/bundled/skills/app-planner/references/rules/mobile/question-bank.md +17 -17
- package/bundled/skills/app-planner/references/rules/mobile/question-manifest.json +17 -2
- package/bundled/skills/app-planner/references/rules/mobile/template.md +73 -85
- package/bundled/skills/app-planner/references/rules-configuration.md +133 -65
- package/bundled/skills/app-planner/scripts/validate-rules-configuration.py +291 -0
- package/bundled/skills/prizmkit/SKILL.md +17 -18
- package/bundled/skills/prizmkit/references/workflow-state-protocol.md +22 -18
- package/bundled/skills/prizmkit-code-review/SKILL.md +22 -58
- package/bundled/skills/prizmkit-code-review/references/independent-code-review.md +6 -6
- package/bundled/skills/prizmkit-code-review/references/review-report-template.md +2 -2
- package/bundled/skills/prizmkit-committer/SKILL.md +82 -132
- package/bundled/skills/prizmkit-deploy/SKILL.md +27 -11
- package/bundled/skills/prizmkit-deploy/assets/deploy-document-template.md +89 -0
- package/bundled/skills/prizmkit-deploy/references/ci-cd-workflows.md +44 -14
- package/bundled/skills/prizmkit-deploy/references/cloud-platform-deploy.md +19 -3
- package/bundled/skills/prizmkit-deploy/references/database-setup.md +22 -12
- package/bundled/skills/prizmkit-deploy/references/deploy-config-schema.md +3 -1
- package/bundled/skills/prizmkit-deploy/references/deploy-history-schema.md +22 -6
- package/bundled/skills/prizmkit-deploy/references/deploy-metadata-schema.json +49 -0
- package/bundled/skills/prizmkit-deploy/references/live-validation-notes.md +1 -1
- package/bundled/skills/prizmkit-deploy/references/pending-input-schema.json +164 -0
- package/bundled/skills/prizmkit-deploy/references/ssh-adapter-flow.md +9 -8
- package/bundled/skills/prizmkit-deploy/references/ssh-execution-flow.md +6 -6
- package/bundled/skills/prizmkit-implement/SKILL.md +30 -66
- package/bundled/skills/prizmkit-implement/references/implementation-subagent-procedure.md +4 -4
- package/bundled/skills/prizmkit-init/SKILL.md +4 -0
- package/bundled/skills/prizmkit-plan/SKILL.md +21 -64
- package/bundled/skills/prizmkit-plan/references/artifact-identity.md +38 -0
- package/bundled/skills/prizmkit-plan/references/independent-plan-review.md +4 -4
- package/bundled/skills/prizmkit-plan/references/review-plan-spec-loop.md +5 -5
- package/bundled/skills/prizmkit-prizm-docs/SKILL.md +11 -1
- package/bundled/skills/prizmkit-retrospective/SKILL.md +63 -77
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +3 -3
- package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +17 -23
- package/bundled/skills/prizmkit-test/SKILL.md +64 -51
- package/bundled/skills/prizmkit-test/references/boundary-contract-and-test-double-guidance.md +206 -0
- package/bundled/skills/prizmkit-test/references/independent-test-review.md +17 -9
- package/bundled/skills/prizmkit-test/references/test-coverage-model.md +45 -21
- package/bundled/skills/prizmkit-test/references/test-report-template.md +20 -13
- package/bundled/skills/prizmkit-workflow/SKILL.md +35 -37
- package/bundled/skills/prizmkit-workflow/references/artifact-identity.md +34 -0
- package/bundled/skills/prizmkit-workflow/references/workflow-state-protocol.md +22 -18
- package/bundled/skills/recovery-workflow/SKILL.md +2 -1
- package/bundled/skills/recovery-workflow/references/detection.md +4 -3
- package/bundled/skills/recovery-workflow/scripts/detect-recovery-state.py +15 -5
- package/package.json +1 -1
- package/src/scaffold.js +33 -22
- package/bundled/dev-pipeline/templates/sections/bugfix-artifacts.md +0 -16
- package/bundled/dev-pipeline/templates/sections/bugfix-session-status.md +0 -31
- package/bundled/dev-pipeline/templates/sections/critical-paths-agent.md +0 -7
- package/bundled/dev-pipeline/templates/sections/critical-paths-lite.md +0 -7
- package/bundled/dev-pipeline/templates/sections/directory-convention-agent.md +0 -9
- package/bundled/dev-pipeline/templates/sections/directory-convention-lite.md +0 -6
- package/bundled/dev-pipeline/templates/sections/headless-commit-authorization.md +0 -15
- package/bundled/dev-pipeline/templates/sections/phase-commit.md +0 -61
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-agent-suffix.md +0 -24
- package/bundled/dev-pipeline/templates/sections/phase-context-snapshot-lite-suffix.md +0 -12
- package/bundled/dev-pipeline/templates/sections/phase-implement-agent.md +0 -44
- package/bundled/dev-pipeline/templates/sections/phase-implement-lite.md +0 -25
- package/bundled/dev-pipeline/templates/sections/phase-plan-agent.md +0 -20
- package/bundled/dev-pipeline/templates/sections/phase-plan-lite.md +0 -20
- package/bundled/dev-pipeline/templates/sections/phase-review-agent.md +0 -20
- package/bundled/dev-pipeline/templates/sections/refactor-artifacts.md +0 -17
- package/bundled/dev-pipeline/templates/sections/refactor-session-status.md +0 -28
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-agent.md +0 -52
- package/bundled/dev-pipeline/templates/sections/test-failure-recovery-lite.md +0 -52
- package/bundled/skills/prizmkit-code-review/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-committer/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-implement/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-plan/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-retrospective/references/workflow-state-protocol.md +0 -174
- package/bundled/skills/prizmkit-test/references/external-contract-mock-guidance.md +0 -119
|
@@ -1,188 +1,115 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Frontend Invariant Rules
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
3
|
+
POLICY_CLASS: invariant
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
These blocks contain only safety and correctness requirements that remain valid across every frontend option exposed by Rules Configuration.
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
**Selected-decision boundary:** framework, meta-framework, package manager, styling, fonts, state libraries, API type source, token layering, dark mode, responsive strategy, localization, test depth, dependency permission, caller analysis, config permission, file-size target, and performance targets belong to confirmed decisions and derivation rules. Do not add those policies here.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
- **Rule**: `tsconfig.json` must enable `"strict": true`.
|
|
13
|
-
- **Forbidden**: Using `any`. Use `unknown` and apply type guards before use.
|
|
14
|
-
- **Forbidden**: `@ts-ignore`. If ignoring is necessary, use `@ts-expect-error` with a reason comment.
|
|
15
|
-
- **RATIONALE**: Types are the safety net for large projects. AI understands context more accurately in strict mode.
|
|
16
|
-
|
|
17
|
-
### F1.2 Lint & Formatting
|
|
18
|
-
- **Rule**: ESLint + Prettier config must be committed to the repository root.
|
|
19
|
-
- **Rule**: Git pre-commit hooks (husky + lint-staged) enforce lint and format.
|
|
20
|
-
- **Forbidden**: Committing `console.log`, `debugger`, unattributed `TODO` (must include issue number or owner).
|
|
21
|
-
- **RATIONALE**: Automated guardrails are always more reliable than manual review.
|
|
9
|
+
## I1. Type and Contract Safety
|
|
22
10
|
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
- **Types/Interfaces**: PascalCase. Avoid `I` prefix (`User`, not `IUser`).
|
|
29
|
-
- **Forbidden**: Pinyin names, meaningless abbreviations (`a`/`b`/`tmp`), numeric suffixes (`button2`/`utils3`).
|
|
30
|
-
- **RATIONALE**: Consistent naming significantly improves AI search/completion hit rates.
|
|
11
|
+
- Preserve declared public component, hook, route, event, and data contracts unless the task explicitly includes a migration.
|
|
12
|
+
- In typed code, keep public inputs and outputs typed and justify any suppression or unsafe cast at the narrowest boundary.
|
|
13
|
+
- Validate untrusted runtime data before treating it as a trusted application type.
|
|
14
|
+
- Do not invent API fields, routes, component props, or library capabilities.
|
|
15
|
+
- Rationale: contract safety applies regardless of framework or type system.
|
|
31
16
|
|
|
32
|
-
|
|
17
|
+
Inject into `{{ FIXED_RULES_TYPESCRIPT }}`.
|
|
33
18
|
|
|
34
|
-
##
|
|
19
|
+
## I2. Naming Integrity
|
|
35
20
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- **Forbid** inline `style` attributes (unless for dynamically computed positions/sizes, with a comment).
|
|
41
|
-
- **Forbid** raw `z-index` numbers (must use a z-index layer constant).
|
|
42
|
-
- **RATIONALE**: Hardcoded values make the design system meaningless. Once AI learns to hardcode, it spreads everywhere.
|
|
21
|
+
- Follow the naming convention already selected or consistently detected for the project.
|
|
22
|
+
- Use descriptive domain names; avoid ambiguous temporary names in durable interfaces.
|
|
23
|
+
- Renames of exported identifiers include an explicit consumer migration or compatibility plan.
|
|
24
|
+
- Rationale: consistency is invariant; a specific casing convention is not.
|
|
43
25
|
|
|
44
|
-
|
|
26
|
+
Inject into `{{ FIXED_RULES_NAMING }}`.
|
|
45
27
|
|
|
46
|
-
##
|
|
28
|
+
## I3. Design-System Integrity
|
|
47
29
|
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
- **Rule**: Exposed `ref` must use `forwardRef` with typing.
|
|
53
|
-
- **RATIONALE**: Unclear component contracts are the main reason AI breaks three things when changing one.
|
|
30
|
+
- When a design system or token strategy is selected, component code must use its public tokens and extension points rather than bypassing them with unexplained one-off values.
|
|
31
|
+
- Third-party overrides and computed values are allowed only at a documented boundary.
|
|
32
|
+
- Do not combine incompatible styling systems unless the selected migration plan explicitly defines the boundary.
|
|
33
|
+
- Rationale: the invariant is honoring the selected system, not forcing one styling technology.
|
|
54
34
|
|
|
55
|
-
|
|
56
|
-
- **Rule**: Single component file ≤ 300 lines (including comments).
|
|
57
|
-
- **Rule**: Beyond this, split by logic/view/types into the same directory.
|
|
58
|
-
- **RATIONALE**: Beyond 300 lines, the risk of AI losing context during modification spikes sharply.
|
|
35
|
+
Inject into `{{ FIXED_RULES_DENY_LIST }}`.
|
|
59
36
|
|
|
60
|
-
|
|
61
|
-
- **Rule**: All data-driven views must explicitly handle `loading` / `error` / `empty` / `success` states.
|
|
62
|
-
- **Forbid**: Using `data && <UI/>` to gloss over the empty state.
|
|
63
|
-
- **RATIONALE**: Missing states are the largest source of hidden UX bugs.
|
|
37
|
+
## I4. Component Contract
|
|
64
38
|
|
|
65
|
-
|
|
39
|
+
- Components expose explicit inputs, outputs, states, and ownership boundaries.
|
|
40
|
+
- Data-driven UI handles the applicable loading, error, empty, and success states or documents why a state cannot occur.
|
|
41
|
+
- Shared components preserve accessibility semantics and consumer compatibility.
|
|
42
|
+
- Rationale: clear component contracts are framework-independent.
|
|
66
43
|
|
|
67
|
-
|
|
44
|
+
Inject into `{{ FIXED_RULES_COMPONENT_CONTRACT }}`.
|
|
68
45
|
|
|
69
|
-
|
|
70
|
-
- **Rule**: All user-visible text must use i18n keys.
|
|
71
|
-
- **Rule**: i18n key naming follows `page.section.element` three-segment format (e.g., `login.form.submitBtn`).
|
|
72
|
-
- **Exception**: Pure brand names, trademarks, fixed acronyms (like `API`, `URL`) may be hardcoded.
|
|
73
|
-
- **RATIONALE**: Even for single-language projects, reserving the i18n channel costs almost nothing. Retrofitting it later costs an enormous amount.
|
|
46
|
+
## I5. Localization Decision Integrity
|
|
74
47
|
|
|
75
|
-
|
|
48
|
+
- Follow the selected localization strategy consistently across a feature.
|
|
49
|
+
- Do not mix centralized keys and ad-hoc literals in a way that makes one user flow partially localized.
|
|
50
|
+
- Preserve locale-sensitive formatting for dates, numbers, plurals, and currency when localization is enabled.
|
|
51
|
+
- Rationale: localization depth is user-owned; consistency with that decision is invariant.
|
|
76
52
|
|
|
77
|
-
|
|
53
|
+
Inject into `{{ FIXED_RULES_I18N_BASELINE }}`.
|
|
78
54
|
|
|
79
|
-
|
|
80
|
-
- **Rule**: Async operations must have loading + error UI. "Silent failure" is not allowed.
|
|
81
|
-
- **Rule**: API failures must have user notification (toast/inline) + retry entry.
|
|
82
|
-
- **Rule**: Caught errors must be reported to monitoring (Sentry / custom).
|
|
83
|
-
- **Forbid**: `catch(e) {}` empty catch blocks.
|
|
84
|
-
- **RATIONALE**: The worst frontend experience isn't a bug — it's "nothing happened."
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## F6. Accessibility (a11y Baseline)
|
|
89
|
-
|
|
90
|
-
- **Rule**: All interactive elements must be keyboard-operable (Tab/Enter/Space/Esc).
|
|
91
|
-
- **Rule**: Images must have `alt`. Decorative images use `alt=""`.
|
|
92
|
-
- **Rule**: Icon buttons must have `aria-label`.
|
|
93
|
-
- **Rule**: Form controls must be associated with `<label>` (`htmlFor` or wrapping).
|
|
94
|
-
- **Rule**: Modal open must move focus into the modal. Modal close must return focus to the trigger element.
|
|
95
|
-
- **Forbid**: `<div onClick>` as a substitute for `<button>`.
|
|
96
|
-
- **Forbid**: Conveying information through color alone (must pair with icon/text).
|
|
97
|
-
- **RATIONALE**: a11y is not a moral requirement — it's a legal requirement (GDPR/ADA), and SEO shares the same foundation.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## F7. Git Collaboration
|
|
102
|
-
|
|
103
|
-
### F7.1 Branching & Commits
|
|
104
|
-
- **Branch naming**: `feat/xxx`, `fix/xxx`, `refactor/xxx`, `chore/xxx`, `docs/xxx`.
|
|
105
|
-
- **Commit messages**: Follow Conventional Commits (`type(scope): subject`).
|
|
106
|
-
- **Rule**: Main branch protection. PR + Code Review required to merge.
|
|
107
|
-
- **Rule**: Single PR changes ≤ 500 lines (generated code excluded). Beyond this, must split.
|
|
108
|
-
|
|
109
|
-
### F7.2 PR Self-Check Checklist (must review each item)
|
|
110
|
-
- [ ] Local `lint` / `typecheck` / `test` all green
|
|
111
|
-
- [ ] New components registered in component index
|
|
112
|
-
- [ ] New user-visible text has i18n keys
|
|
113
|
-
- [ ] Four states (loading/error/empty/success) covered
|
|
114
|
-
- [ ] No hardcoded colors/font sizes/spacing
|
|
115
|
-
- [ ] No `console.log` / `debugger` / `any`
|
|
116
|
-
- [ ] Key changes have supporting description (screenshots / recordings / design links)
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## F8. Security Baseline
|
|
121
|
-
|
|
122
|
-
- **Forbid**: Writing API keys, tokens, or secrets into frontend code.
|
|
123
|
-
- **Forbid**: Using `dangerouslySetInnerHTML` / `v-html` to render user input (must sanitize).
|
|
124
|
-
- **Rule**: All external links with `target="_blank"` must include `rel="noopener noreferrer"`.
|
|
125
|
-
- **Rule**: Form submission requires client-side validation, but **forbid** relying solely on client-side validation.
|
|
126
|
-
- **Rule**: Sensitive operations (delete, payment) require secondary confirmation.
|
|
127
|
-
- **RATIONALE**: The frontend is an attack surface, not a security boundary.
|
|
128
|
-
|
|
129
|
-
---
|
|
55
|
+
## I6. Error and Async-State Safety
|
|
130
56
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
- **Rule**: Before generating a utility function, AI must search `src/utils/` / `src/hooks/`. Forbid reinventing the wheel.
|
|
136
|
-
|
|
137
|
-
### F9.2 Dependency Control
|
|
138
|
-
- **Rule**: AI must not introduce new npm dependencies on its own.
|
|
139
|
-
- **Rule**: If a new dependency is truly needed, AI must **explicitly list** in its response: package name, version, reason, alternative comparison. Human reviews the `package.json` change.
|
|
140
|
-
|
|
141
|
-
### F9.3 Breaking Changes
|
|
142
|
-
- **Rule**: Before modifying a shared component / common hook / common type, AI must first list **all callers**.
|
|
143
|
-
- **Rule**: If the change would break callers, AI must provide a migration plan or refuse the change.
|
|
144
|
-
|
|
145
|
-
### F9.4 Context Honesty
|
|
146
|
-
- **Rule**: When uncertain, AI must explicitly say "I'm not sure." Forbid inventing API paths, file paths, or field names.
|
|
147
|
-
- **Rule**: AI must read the latest file contents before modifying. Forbid generating diffs based on guesswork.
|
|
148
|
-
|
|
149
|
-
### F9.5 Comment Obligation
|
|
150
|
-
- **Rule**: Non-obvious AI-generated code must include a "why" comment (not "what").
|
|
151
|
-
- **Forbid**: AI deleting existing comments (unless the corresponding code is also deleted).
|
|
152
|
-
|
|
153
|
-
---
|
|
57
|
+
- Do not swallow errors silently.
|
|
58
|
+
- Async user actions expose a deterministic pending and failure outcome and prevent unintended duplicate submission where side effects are not idempotent.
|
|
59
|
+
- User-facing errors avoid secrets and internal implementation details while logs preserve actionable diagnostic context.
|
|
60
|
+
- Rationale: failures must remain observable under every framework choice.
|
|
154
61
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
- **Rule**: List rendering must have `key`, and `key` must not use index (unless the list is purely static).
|
|
158
|
-
- **Rule**: Long lists (>100 items) must use virtual scrolling.
|
|
159
|
-
- **Rule**: Routes must be code-split (dynamic import).
|
|
160
|
-
- **Rule**: Images must be lazy-loaded (`loading="lazy"`) + modern formats (webp/avif) + explicit width/height (prevents CLS).
|
|
161
|
-
- **Rule**: Avoid creating new objects/functions in render (unless wrapped with memo).
|
|
162
|
-
- **RATIONALE**: These are zero-cost performance optimizations. There is no reason not to do them.
|
|
62
|
+
Inject into `{{ FIXED_RULES_ERROR_HANDLING }}`.
|
|
163
63
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
64
|
+
## I7. Accessibility Baseline
|
|
65
|
+
|
|
66
|
+
- Interactive controls are operable with the platform's standard keyboard or assistive input model.
|
|
67
|
+
- Controls have accessible names; form controls have associated labels; focus remains predictable across overlays and navigation.
|
|
68
|
+
- Information is not conveyed by color alone, and decorative media is excluded from the accessibility tree.
|
|
69
|
+
- Apply any stricter selected accessibility target through derivation rules.
|
|
70
|
+
- Rationale: semantic access is a baseline while the conformance target is configurable.
|
|
71
|
+
|
|
72
|
+
Inject into `{{ FIXED_RULES_A11Y }}`.
|
|
73
|
+
|
|
74
|
+
## I8. Evidence-Based Performance
|
|
75
|
+
|
|
76
|
+
- Measure before introducing a performance-specific abstraction.
|
|
77
|
+
- Avoid unbounded rendering, listeners, subscriptions, caches, and retained resources.
|
|
78
|
+
- Preserve correctness and accessibility when applying loading, memoization, virtualization, or code-splitting strategies.
|
|
79
|
+
- Apply numeric budgets only from the selected performance decisions.
|
|
80
|
+
- Rationale: resource safety is invariant; concrete budgets and techniques are contextual.
|
|
81
|
+
|
|
82
|
+
Inject into `{{ FIXED_RULES_PERFORMANCE }}`.
|
|
83
|
+
|
|
84
|
+
## I9. AI Change Safety
|
|
85
|
+
|
|
86
|
+
- Read the current target and search for existing reusable behavior before creating a duplicate.
|
|
87
|
+
- Keep changes inside the requested scope and report uncertainty rather than inventing repository facts.
|
|
88
|
+
- Never expose secrets, weaken validation, or remove a safety check merely to make a build pass.
|
|
89
|
+
- Dependency, shared-caller, config-file, and file-size permissions come only from their selected decision blocks.
|
|
90
|
+
- Rationale: evidence and scope honesty remain valid under every permission mode.
|
|
91
|
+
|
|
92
|
+
Inject into `{{ FIXED_RULES_AI_BASE }}`.
|
|
93
|
+
|
|
94
|
+
## I10. Collaboration Integrity
|
|
95
|
+
|
|
96
|
+
- Use the repository's existing branch, commit, review, and verification conventions when they exist.
|
|
97
|
+
- Report changed public contracts, relevant verification, and known follow-up work.
|
|
98
|
+
- Do not claim checks passed unless evidence exists.
|
|
99
|
+
- Rationale: the project owns its collaboration model; truthful evidence is invariant.
|
|
100
|
+
|
|
101
|
+
Inject into `{{ FIXED_RULES_GIT }}`.
|
|
102
|
+
|
|
103
|
+
## I11. Frontend Security
|
|
104
|
+
|
|
105
|
+
- Never place secrets or privileged credentials in browser-delivered code.
|
|
106
|
+
- Treat browser validation as usability and defense-in-depth, not as the server authorization boundary.
|
|
107
|
+
- Sanitize untrusted rich content and protect external navigation boundaries against opener and redirect abuse.
|
|
108
|
+
- Sensitive side effects require the authorization and confirmation behavior defined by the product contract.
|
|
109
|
+
- Rationale: the browser is attacker-controlled under every stack choice.
|
|
110
|
+
|
|
111
|
+
Inject into `{{ FIXED_RULES_SECURITY }}`.
|
|
112
|
+
|
|
113
|
+
## Injection Contract
|
|
114
|
+
|
|
115
|
+
Copy each `I*` block only into its named placeholder. Do not copy the header, policy metadata, or selected-decision boundary into generated files. If a proposed invariant conflicts with a confirmed decision, fail generation and reclassify the rule instead of emitting both.
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
1. **Group order**: G1 → G2 → G3 → G4 → G5 → G6 → G7 → G8 → G9. Do not skip.
|
|
29
29
|
2. **Shortcut commands** (respond immediately when user types these at any point):
|
|
30
30
|
- `recommended` / `default` → skip current group, adopt all recommended options
|
|
31
|
-
- `all recommended` / `one-click` →
|
|
31
|
+
- `all recommended` / `one-click` → explicit authorization to adopt each remaining applicable recommended option; ask any question whose recommendation is ambiguous for the selected stack
|
|
32
32
|
- `strict` / `strictest` → adopt the strictest option for the current group
|
|
33
33
|
- `skip` / `don't need this` → mark current group as N/A, note in output that "project does not require this yet"
|
|
34
34
|
- `custom: xxx` → record user's custom content, do not match against options
|
|
35
35
|
3. **Abbreviation recognition**: `A` / `a` / `1` all mean option A. `A,C` means multi-select (only for multi-select questions).
|
|
36
36
|
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.
|
|
37
37
|
5. **Forbidden behaviors**:
|
|
38
|
-
- Must not make choices for the user before they explicitly answer.
|
|
38
|
+
- Must not make choices for the user before they explicitly answer, except concrete defaults covered by the user's explicit Quick/all-recommended authorization.
|
|
39
39
|
- Must not fabricate user preferences to complete the answer set.
|
|
40
40
|
- Must not output more than 3 questions in a single message.
|
|
41
41
|
|
|
@@ -73,13 +73,16 @@ Total: 25 questions.
|
|
|
73
73
|
|
|
74
74
|
### Q2. Meta-Framework
|
|
75
75
|
- **Options**:
|
|
76
|
-
- A) Next.js (App Router) **【Recommended for React
|
|
77
|
-
- B) Nuxt
|
|
76
|
+
- A) Next.js (App Router) **【Recommended for React full-stack/SSR needs】**
|
|
77
|
+
- B) Nuxt **【Recommended for Vue full-stack/SSR needs】**
|
|
78
78
|
- C) Remix
|
|
79
79
|
- D) Plain SPA (Vite)
|
|
80
|
-
- E)
|
|
81
|
-
-
|
|
82
|
-
-
|
|
80
|
+
- E) SvelteKit **【Recommended for Svelte full-stack/SSR needs】**
|
|
81
|
+
- F) SolidStart **【Recommended for Solid full-stack/SSR needs】**
|
|
82
|
+
- G) Custom
|
|
83
|
+
- **Compatibility**: React → A/C/D/G; Vue → B/D/G; Svelte → D/E/G; Solid → D/F/G; Custom/Other → D/G unless the user names a compatible tool.
|
|
84
|
+
- **Note**: Affects rendering, routing, and data-fetching rules. When product requirements do not need a meta-framework, a plain SPA is a valid explicit choice.
|
|
85
|
+
- **Maps to**: `{{ meta_framework }}` (TL;DR + architecture section) + `{{ tech_stack_rules }}` (derivation injection)
|
|
83
86
|
|
|
84
87
|
### Q3. Package Manager
|
|
85
88
|
- **Options**:
|
|
@@ -121,32 +124,39 @@ Total: 25 questions.
|
|
|
121
124
|
|
|
122
125
|
### Q5. Global State Library
|
|
123
126
|
- **Options**:
|
|
124
|
-
- A) Zustand **【Recommended for React】**
|
|
125
|
-
- B) Pinia **【Recommended for Vue】**
|
|
127
|
+
- A) Zustand **【Recommended for React when global client state is needed】**
|
|
128
|
+
- B) Pinia **【Recommended for Vue when global client state is needed】**
|
|
126
129
|
- C) Redux Toolkit
|
|
127
130
|
- D) Jotai / Valtio
|
|
128
|
-
- E)
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
+
- E) Framework context/provide only
|
|
132
|
+
- F) Svelte runes/stores
|
|
133
|
+
- G) Solid signals/store
|
|
134
|
+
- H) Custom or no dedicated global-state library
|
|
135
|
+
- **Compatibility**: React → A/C/D/E/H; Vue → B/E/H; Svelte → E/F/H; Solid → E/G/H; Custom/Other → H unless the user names a compatible mechanism.
|
|
136
|
+
- **Note**: Use only for confirmed cross-page client state. Server data does not belong here, and Quick mode should select no dedicated library when no global-state need has been established.
|
|
137
|
+
- **Maps to**: `{{ state_lib }}` (TL;DR + state section) + `{{ state_rules }}` (derivation injection)
|
|
131
138
|
|
|
132
139
|
### Q6. Server State Library
|
|
133
140
|
- **Options**:
|
|
134
|
-
- A) TanStack Query **【Recommended】**
|
|
141
|
+
- A) TanStack Query **【Recommended when client-side server-state caching is required and the selected framework is supported】**
|
|
135
142
|
- B) SWR
|
|
136
143
|
- C) RTK Query
|
|
137
|
-
- D) Custom fetch
|
|
138
|
-
-
|
|
139
|
-
- **
|
|
140
|
-
- **
|
|
144
|
+
- D) Custom fetch/data boundary
|
|
145
|
+
- E) No dedicated client server-state library **【Recommended when the selected meta-framework owns data loading or no client cache is needed】**
|
|
146
|
+
- **Strict option**: A (TanStack Query + enforced query-key convention)
|
|
147
|
+
- **Note**: Choose from confirmed data-loading and caching needs. Quick mode must not add a client cache solely because a library is available.
|
|
148
|
+
- **Maps to**: `{{ server_state_lib }}` (decision ledger + state section) + `{{ server_state_rules }}` (derivation injection)
|
|
141
149
|
|
|
142
150
|
### Q7. API Type Source
|
|
143
151
|
- **Options**:
|
|
144
|
-
- A) Backend OpenAPI
|
|
145
|
-
- B) Backend Protobuf generation
|
|
146
|
-
- C) Hand-written
|
|
147
|
-
- D) Shared monorepo type package with backend
|
|
148
|
-
-
|
|
149
|
-
-
|
|
152
|
+
- A) Backend OpenAPI code generation **【Recommended for an OpenAPI-owned REST contract】**
|
|
153
|
+
- B) Backend Protobuf generation **【Recommended for a Protobuf/gRPC-owned contract】**
|
|
154
|
+
- C) Hand-written TypeScript declarations plus runtime validation
|
|
155
|
+
- D) Shared monorepo contract/type package with backend
|
|
156
|
+
- E) GraphQL schema/code generation **【Recommended for a GraphQL-owned contract】**
|
|
157
|
+
- F) Framework/server contract inference supported by the selected stack
|
|
158
|
+
- **Strict option**: Use the authoritative backend contract source when one exists; never select an incompatible generator.
|
|
159
|
+
- **Note**: There is no universal Quick default. Match the confirmed backend/API contract or ask, and keep runtime validation for untrusted data where static generation is insufficient.
|
|
150
160
|
- **Maps to**: `{{ api_type_source }}` (TL;DR + §4.3) + `{{ server_state_rules }}` (derivation injection)
|
|
151
161
|
|
|
152
162
|
---
|
|
@@ -173,10 +183,10 @@ Total: 25 questions.
|
|
|
173
183
|
|
|
174
184
|
### Q10. Dark Mode
|
|
175
185
|
- **Options**:
|
|
176
|
-
- A) Supported
|
|
177
|
-
- B) Supported
|
|
178
|
-
- C) Not supported
|
|
179
|
-
- **Note**:
|
|
186
|
+
- A) Supported via the selected token/theme mechanism **【Recommended when dark mode is a product requirement】**
|
|
187
|
+
- B) Supported via a styling-library class/variant mechanism
|
|
188
|
+
- C) Not supported **【Recommended when no dark-mode requirement exists】**
|
|
189
|
+
- **Note**: Choose from product/design evidence. A/B derive complete light/dark token behavior; C renders an explicit no-dark-mode decision.
|
|
180
190
|
- **Maps to**: `{{ dark_mode }}` (TL;DR) + `{{ dark_mode_rules }}` (derivation injection into §1.3)
|
|
181
191
|
|
|
182
192
|
---
|
|
@@ -206,10 +216,10 @@ Total: 25 questions.
|
|
|
206
216
|
|
|
207
217
|
### Q13. Internationalization (i18n)
|
|
208
218
|
- **Options**:
|
|
209
|
-
- A) Multi-language with
|
|
210
|
-
- B) Single-language
|
|
211
|
-
- C) Single-language
|
|
212
|
-
- **Note**:
|
|
219
|
+
- A) Multi-language with a selected i18n framework and explicit locale list
|
|
220
|
+
- B) Single-language with text centralized for a confirmed near-term localization path
|
|
221
|
+
- C) Single-language with no i18n infrastructure **【Recommended when localization is not planned】**
|
|
222
|
+
- **Note**: Quick mode derives this only from confirmed locale/product scope. A/B centralize user-visible text; C permits in-scope literals and must not inherit hidden i18n requirements.
|
|
213
223
|
- **Maps to**: `{{ i18n }}` (TL;DR) + `{{ i18n_rules }}` (derivation injection into §5.4)
|
|
214
224
|
|
|
215
225
|
### Q14. Accessibility Target
|
|
@@ -255,12 +265,12 @@ Total: 25 questions.
|
|
|
255
265
|
|
|
256
266
|
## G8 — AI Vibecoding Constraints
|
|
257
267
|
|
|
258
|
-
### Q18. AI Component
|
|
268
|
+
### Q18. AI Component Export Registry Sync
|
|
259
269
|
- **Options**:
|
|
260
|
-
- A) Must
|
|
261
|
-
- B)
|
|
262
|
-
- **Strict option**: A
|
|
263
|
-
- **Note**:
|
|
270
|
+
- A) Must synchronize the project's existing authoritative component/export registry **【Recommended when such a registry exists】**
|
|
271
|
+
- B) No central registry; update direct exports/consumers only **【Recommended when no registry exists】**
|
|
272
|
+
- **Strict option**: A when a stable registry path was detected or confirmed
|
|
273
|
+
- **Note**: Record the actual stable registry path when A is selected; never invent `src/components/index.ts`.
|
|
264
274
|
- **Maps to**: `{{ ai_index_rule }}` (injected into §7.3)
|
|
265
275
|
|
|
266
276
|
### Q19. AI Permission to Add Dependencies
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schema_version": "app-planner-question-manifest-
|
|
2
|
+
"schema_version": "app-planner-question-manifest-v2",
|
|
3
3
|
"layer": "frontend",
|
|
4
4
|
"total_questions": 25,
|
|
5
5
|
"_doc": "Machine-readable structure for frontend 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
6
|
"_conditions": "required_if / auto_derived_when use simple expressions over recorded answers, e.g. 'Q15 in [A, B]'. options_vary_by names a prior answer that changes the OPTION LIST/recommendation 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", "Q4b", "Q5", "Q6", "Q7", "Q8", "Q9", "Q10", "Q11", "Q12", "Q13", "Q14", "Q15", "Q16", "Q17", "Q18", "Q19", "Q20", "Q21", "Q22", "Q23", "Q24"]
|
|
15
|
+
},
|
|
7
16
|
"groups": [
|
|
8
17
|
{ "id": "G1", "topic": "Tech Stack", "quick_mode": true },
|
|
9
18
|
{ "id": "G2", "topic": "Styling", "quick_mode": true },
|
|
@@ -34,7 +43,7 @@
|
|
|
34
43
|
{ "id": "Q15", "group": "G7", "topic": "Test Coverage Requirements", "maps_to": ["test_coverage", "test_rules"], "required": true },
|
|
35
44
|
{ "id": "Q16", "group": "G7", "topic": "Unit Test Framework", "maps_to": ["unit_test_framework", "test_rules"], "required": true, "required_if": "Q15 in [A, B]" },
|
|
36
45
|
{ "id": "Q17", "group": "G7", "topic": "E2E Framework", "maps_to": ["e2e_framework", "test_rules"], "required": true, "required_if": "Q15 in [A, C]" },
|
|
37
|
-
{ "id": "Q18", "group": "G8", "topic": "AI Component
|
|
46
|
+
{ "id": "Q18", "group": "G8", "topic": "AI Component Export Registry Sync", "maps_to": ["ai_index_rule"], "required": true },
|
|
38
47
|
{ "id": "Q19", "group": "G8", "topic": "AI Permission to Add Dependencies", "maps_to": ["ai_dependency_rule"], "required": true },
|
|
39
48
|
{ "id": "Q20", "group": "G8", "topic": "AI Impact Analysis Before Modifying Shared Components", "maps_to": ["ai_breaking_change_rule"], "required": true },
|
|
40
49
|
{ "id": "Q21", "group": "G8", "topic": "AI Permission to Modify Config Files", "maps_to": ["ai_config_rule"], "required": true },
|