prizmkit 1.1.154 → 1.1.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +75 -11
- package/bundled/skills/prizmkit-prizm-docs/assets/prizm-docs-format.md +191 -56
- package/bundled/skills/prizmkit-prizm-docs/references/op-init.md +18 -18
- package/bundled/skills/prizmkit-prizm-docs/references/op-rebuild.md +14 -8
- package/bundled/skills/prizmkit-prizm-docs/references/op-status.md +12 -5
- package/bundled/skills/prizmkit-prizm-docs/references/op-update.md +23 -12
- package/bundled/skills/prizmkit-prizm-docs/references/op-validate.md +13 -9
- package/bundled/skills/prizmkit-retrospective/SKILL.md +94 -97
- package/bundled/skills/prizmkit-retrospective/references/knowledge-injection-steps.md +79 -37
- package/bundled/skills/prizmkit-retrospective/references/retrospective-result-schema.json +138 -0
- package/bundled/skills/prizmkit-retrospective/references/structural-sync-steps.md +111 -54
- 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/bundled/templates/hooks/validate-prizm-docs.py +124 -12
- 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,339 +1,161 @@
|
|
|
1
1
|
# Frontend Rules — {{ project_name }}
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Generated by app-planner Rules Configuration
|
|
4
4
|
> Scope: {{ project_scope }}
|
|
5
5
|
> Design basis: {{ design_source }}
|
|
6
|
-
> Audience:
|
|
7
|
-
>
|
|
8
|
-
> **Usage**:
|
|
9
|
-
> 1. All AI coding assistants must read this file before generating or modifying any frontend code
|
|
10
|
-
> 2. This document takes precedence over "general best practices" in AI training data
|
|
11
|
-
> 3. Code conflicting with this document must not be committed
|
|
12
|
-
> 4. Modifying this document requires team review
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## Table of Contents
|
|
17
|
-
|
|
18
|
-
- [0. TL;DR — Key Decisions at a Glance](#0-tldr--key-decisions-at-a-glance)
|
|
19
|
-
- [1. Design System](#1-design-system)
|
|
20
|
-
- [2. Engineering Architecture](#2-engineering-architecture)
|
|
21
|
-
- [3. Code Quality (Non-Negotiable)](#3-code-quality-non-negotiable)
|
|
22
|
-
- [4. State & Data](#4-state--data)
|
|
23
|
-
- [5. User Experience](#5-user-experience)
|
|
24
|
-
- [6. Testing & Quality Assurance](#6-testing--quality-assurance)
|
|
25
|
-
- [7. AI Vibecoding Behavior Constraints](#7-ai-vibecoding-behavior-constraints)
|
|
26
|
-
- [8. Collaboration Process](#8-collaboration-process)
|
|
27
|
-
- [9. Security Baseline](#9-security-baseline)
|
|
28
|
-
- [Appendix A: Deny List (Quick Reference)](#appendix-a-deny-list-quick-reference)
|
|
29
|
-
- [Appendix B: Recommended Libraries & Tools](#appendix-b-recommended-libraries--tools)
|
|
30
|
-
- [Appendix C: References](#appendix-c-references)
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
## 0. TL;DR — Key Decisions at a Glance
|
|
36
|
-
|
|
37
|
-
| Dimension | Decision |
|
|
38
|
-
|-----------|----------|
|
|
39
|
-
| Framework | {{ framework }} |
|
|
40
|
-
| Meta-Framework | {{ meta_framework }} |
|
|
41
|
-
| Package Manager | {{ package_manager }} |
|
|
42
|
-
| Styling Solution | {{ style_solution }} |
|
|
43
|
-
| Font Strategy | {{ font_strategy }} |
|
|
44
|
-
| Global State | {{ state_lib }} |
|
|
45
|
-
| Server State | {{ server_state_lib }} |
|
|
46
|
-
| API Type Source | {{ api_type_source }} |
|
|
47
|
-
| Design Token Layers | {{ token_layering }} |
|
|
48
|
-
| Dark Mode | {{ dark_mode }} |
|
|
49
|
-
| Responsive Strategy | {{ responsive_strategy }} |
|
|
50
|
-
| Breakpoints | {{ breakpoint_scheme }} |
|
|
51
|
-
| Internationalization | {{ i18n }} |
|
|
52
|
-
| Accessibility Target | {{ a11y_level }} |
|
|
53
|
-
| Test Coverage | {{ test_coverage }} |
|
|
54
|
-
| Unit Test Framework | {{ unit_test_framework }} |
|
|
55
|
-
| E2E Framework | {{ e2e_framework }} |
|
|
56
|
-
| AI Single File Limit | {{ ai_max_lines }} lines |
|
|
57
|
-
| First Screen LCP Target | {{ lcp_target }} |
|
|
58
|
-
| Single Chunk Limit | {{ bundle_size }} |
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## 1. Design System
|
|
63
|
-
|
|
64
|
-
### 1.1 Design Token Layers
|
|
65
|
-
|
|
66
|
-
{{ token_layering_rules }}
|
|
67
|
-
|
|
68
|
-
### 1.2 Naming Conventions
|
|
6
|
+
> Audience: project contributors and AI coding assistants working in the declared scope
|
|
69
7
|
|
|
70
|
-
|
|
71
|
-
- Spacing: `space.{step}` (e.g., `space.4` = 16px)
|
|
72
|
-
- Font sizes: `font.size.{role}` (e.g., `font.size.body`)
|
|
73
|
-
- Border radius: `radius.{step}` (e.g., `radius.md`)
|
|
74
|
-
- Shadows: `shadow.{level}` (e.g., `shadow.elevated`)
|
|
8
|
+
This document is generated from confirmed decisions. A recommendation is non-binding unless it appears in the decision ledger or an active rule block.
|
|
75
9
|
|
|
76
|
-
|
|
10
|
+
## 1. Decision Ledger
|
|
77
11
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
{{
|
|
12
|
+
| Domain | Selected Decision |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Framework | {{ framework }} |
|
|
15
|
+
| Meta-framework | {{ meta_framework }} |
|
|
16
|
+
| Package manager | {{ package_manager }} |
|
|
17
|
+
| Styling | {{ style_solution }} |
|
|
18
|
+
| Font strategy | {{ font_strategy }} |
|
|
19
|
+
| Global state | {{ state_lib }} |
|
|
20
|
+
| Server state | {{ server_state_lib }} |
|
|
21
|
+
| API type source | {{ api_type_source }} |
|
|
22
|
+
| Token layering | {{ token_layering }} |
|
|
23
|
+
| Dark mode | {{ dark_mode }} |
|
|
24
|
+
| Responsive strategy | {{ responsive_strategy }} |
|
|
25
|
+
| Breakpoints | {{ breakpoint_scheme }} |
|
|
26
|
+
| Localization | {{ i18n }} |
|
|
27
|
+
| Accessibility | {{ a11y_level }} |
|
|
28
|
+
| Test depth | {{ test_coverage }} |
|
|
29
|
+
| Unit test framework | {{ unit_test_framework }} |
|
|
30
|
+
| E2E framework | {{ e2e_framework }} |
|
|
31
|
+
| File-size guidance | {{ ai_max_lines }} |
|
|
32
|
+
| LCP target | {{ lcp_target }} |
|
|
33
|
+
| Bundle target | {{ bundle_size }} |
|
|
87
34
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## 2. Engineering Architecture
|
|
91
|
-
|
|
92
|
-
### 2.1 Directory Structure (Mandatory)
|
|
93
|
-
|
|
94
|
-
```
|
|
95
|
-
src/
|
|
96
|
-
├── app/ # Routes/page entry points
|
|
97
|
-
├── components/ # Shared components (must export to components/index.ts)
|
|
98
|
-
│ └── index.ts # Component index (AI must read this before deciding to create a new component)
|
|
99
|
-
├── features/ # Business modules (organized by domain)
|
|
100
|
-
│ └── <domain>/
|
|
101
|
-
│ ├── api/
|
|
102
|
-
│ ├── components/
|
|
103
|
-
│ ├── hooks/
|
|
104
|
-
│ └── index.ts
|
|
105
|
-
├── hooks/ # Shared hooks
|
|
106
|
-
├── lib/ # Third-party wrappers, utilities
|
|
107
|
-
├── stores/ # Global state
|
|
108
|
-
├── styles/ # Global styles + tokens
|
|
109
|
-
├── types/ # Global types
|
|
110
|
-
└── utils/ # Pure function utilities
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### Component Contract
|
|
35
|
+
If a decision is deferred or not applicable, its cell and section state that explicitly.
|
|
114
36
|
|
|
115
|
-
|
|
37
|
+
## 2. Stack and Architecture
|
|
116
38
|
|
|
117
|
-
### 2.
|
|
39
|
+
### 2.1 Selected stack
|
|
118
40
|
|
|
119
41
|
{{ tech_stack_rules }}
|
|
120
42
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
### 2.3 Styling Solution Specific Rules
|
|
124
|
-
|
|
125
|
-
{{ style_specific_rules }}
|
|
126
|
-
|
|
127
|
-
### 2.4 Routing Conventions
|
|
128
|
-
|
|
129
|
-
> Routing rules come from the official conventions of `{{ meta_framework }}`, already incorporated in §2.2 Tech Stack Lock-in.
|
|
130
|
-
> Additional project rules: Route file naming follows meta-framework default conventions. Forbid custom route matchers unless there is an explicit architectural decision.
|
|
43
|
+
### 2.2 Component contract
|
|
131
44
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
## 3. Code Quality (Non-Negotiable)
|
|
45
|
+
{{ FIXED_RULES_COMPONENT_CONTRACT }}
|
|
135
46
|
|
|
136
|
-
### 3
|
|
47
|
+
### 2.3 Type and naming integrity
|
|
137
48
|
|
|
138
49
|
{{ FIXED_RULES_TYPESCRIPT }}
|
|
139
50
|
|
|
140
|
-
### 3.2 Naming Conventions
|
|
141
|
-
|
|
142
51
|
{{ FIXED_RULES_NAMING }}
|
|
143
52
|
|
|
144
|
-
###
|
|
145
|
-
|
|
146
|
-
- Single file ≤ {{ ai_max_lines }} lines (including blank lines and comments)
|
|
147
|
-
- Single function ≤ 50 lines
|
|
148
|
-
- Single component props ≤ 8 (beyond this, consider splitting or using object aggregation)
|
|
149
|
-
- Nesting depth ≤ 4 levels
|
|
53
|
+
### 2.4 Styling
|
|
150
54
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- Config files must be committed to the repository
|
|
154
|
-
- Pre-commit hooks enforce lint and format
|
|
155
|
-
- Forbid file-level `eslint-disable`. Exceptions require documented reasons and review
|
|
55
|
+
{{ FIXED_RULES_DENY_LIST }}
|
|
156
56
|
|
|
157
|
-
|
|
57
|
+
{{ style_specific_rules }}
|
|
158
58
|
|
|
159
|
-
|
|
59
|
+
### 2.5 Design tokens and themes
|
|
160
60
|
|
|
161
|
-
|
|
61
|
+
{{ token_layering_rules }}
|
|
162
62
|
|
|
163
|
-
{{
|
|
63
|
+
{{ dark_mode_rules }}
|
|
164
64
|
|
|
165
|
-
###
|
|
65
|
+
### 2.6 Responsive behavior
|
|
166
66
|
|
|
167
|
-
{{
|
|
67
|
+
{{ breakpoint_rules }}
|
|
168
68
|
|
|
169
|
-
|
|
69
|
+
## 3. State, Data, and Forms
|
|
170
70
|
|
|
171
|
-
|
|
172
|
-
- Forbid hand-writing types related to backend contracts (unless API type source is "hand-written .d.ts")
|
|
173
|
-
- All request functions must return fully-typed Promises. Forbid `Promise<any>`
|
|
71
|
+
### 3.1 Global state
|
|
174
72
|
|
|
175
|
-
|
|
73
|
+
{{ state_rules }}
|
|
176
74
|
|
|
177
|
-
|
|
178
|
-
- Client-side + server-side validation dual protection. Forbid relying solely on client-side validation
|
|
179
|
-
- Error messages must be displayed inline near the corresponding field and support keyboard focus
|
|
180
|
-
- Submit buttons must have a loading state to prevent duplicate submissions
|
|
75
|
+
### 3.2 Server state and API contracts
|
|
181
76
|
|
|
182
|
-
|
|
77
|
+
{{ server_state_rules }}
|
|
183
78
|
|
|
184
|
-
|
|
79
|
+
- Selected API type source: {{ api_type_source }}
|
|
80
|
+
- Preserve the selected type-source boundary; generated, shared, and hand-written sources must not be mixed without an explicit migration.
|
|
185
81
|
|
|
186
|
-
###
|
|
82
|
+
### 3.3 Forms
|
|
187
83
|
|
|
188
|
-
|
|
84
|
+
- Use the project's selected form pattern when one exists; the global-state choice does not automatically become the form library.
|
|
85
|
+
- Validate on both the usability boundary and the authoritative server boundary where applicable.
|
|
86
|
+
- Prevent duplicate non-idempotent submissions and keep field errors accessible.
|
|
189
87
|
|
|
190
|
-
|
|
191
|
-
- **error**: error message + retry button. Forbid just `console.error`.
|
|
192
|
-
- **empty**: empty state illustration + guided action.
|
|
193
|
-
- **success**: normal rendering.
|
|
88
|
+
## 4. User Experience and Safety
|
|
194
89
|
|
|
195
|
-
###
|
|
90
|
+
### 4.1 Error and async-state handling
|
|
196
91
|
|
|
197
92
|
{{ FIXED_RULES_ERROR_HANDLING }}
|
|
198
93
|
|
|
199
|
-
###
|
|
94
|
+
### 4.2 Accessibility
|
|
200
95
|
|
|
201
96
|
{{ FIXED_RULES_A11Y }}
|
|
202
97
|
|
|
203
98
|
{{ a11y_extra_rules }}
|
|
204
99
|
|
|
205
|
-
###
|
|
100
|
+
### 4.3 Localization
|
|
206
101
|
|
|
207
102
|
{{ FIXED_RULES_I18N_BASELINE }}
|
|
208
103
|
|
|
209
104
|
{{ i18n_rules }}
|
|
210
105
|
|
|
211
|
-
###
|
|
106
|
+
### 4.4 Performance
|
|
212
107
|
|
|
213
108
|
{{ FIXED_RULES_PERFORMANCE }}
|
|
214
109
|
|
|
215
110
|
{{ performance_rules }}
|
|
216
111
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
- All animations must be ≤ 300ms (page transitions excepted)
|
|
220
|
-
- Must respect `prefers-reduced-motion`
|
|
221
|
-
- Forbid using animation properties that block the main thread (like `top` / `left` — use `transform` instead)
|
|
222
|
-
|
|
223
|
-
---
|
|
224
|
-
|
|
225
|
-
## 6. Testing & Quality Assurance
|
|
226
|
-
|
|
227
|
-
### 6.1 Testing Strategy
|
|
112
|
+
## 5. Testing
|
|
228
113
|
|
|
229
114
|
{{ test_rules }}
|
|
230
115
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
- Shared components: ≥ 80%
|
|
234
|
-
- Business modules: ≥ 60%
|
|
235
|
-
- Critical flows (login, payment, checkout, etc.): E2E coverage mandatory
|
|
116
|
+
Only thresholds and test tiers stated by the selected testing decision are mandatory. Deferred testing is recorded as accepted risk rather than replaced by hidden defaults.
|
|
236
117
|
|
|
237
|
-
|
|
118
|
+
## 6. AI Change Permissions
|
|
238
119
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
### 7.1 Baseline Constraints (project-agnostic, always active)
|
|
120
|
+
### 6.1 Invariant change safety
|
|
242
121
|
|
|
243
122
|
{{ FIXED_RULES_AI_BASE }}
|
|
244
123
|
|
|
245
|
-
###
|
|
246
|
-
|
|
247
|
-
AI must complete the following in order before generating or modifying any frontend code:
|
|
248
|
-
|
|
249
|
-
1. Read this file (`frontend-rules.md`)
|
|
250
|
-
2. Read `src/components/index.ts` to confirm whether a reusable component already exists
|
|
251
|
-
3. Read the target module's `README.md` or `index.ts` (if present)
|
|
252
|
-
4. If modifying a shared component, search all callers and list the impact
|
|
124
|
+
### 6.2 Selected permissions
|
|
253
125
|
|
|
254
|
-
|
|
126
|
+
- Dependency changes: {{ ai_dependency_rule }}
|
|
127
|
+
- Shared component impact analysis: {{ ai_breaking_change_rule }}
|
|
128
|
+
- Configuration changes: {{ ai_config_rule }}
|
|
129
|
+
- Component index synchronization: {{ ai_index_rule }}
|
|
130
|
+
- File-size guidance: {{ ai_max_lines }}
|
|
255
131
|
|
|
256
|
-
|
|
257
|
-
- **Adding dependencies**: {{ ai_dependency_rule }}
|
|
258
|
-
- **Modifying shared components**: {{ ai_breaking_change_rule }}
|
|
259
|
-
- **New component registration trifecta**: ① Register in `components/index.ts` ② Add example in preview page ③ Export props types
|
|
260
|
-
- **Config file modification**: {{ ai_config_rule }}
|
|
261
|
-
- **New component index sync**: {{ ai_index_rule }}
|
|
132
|
+
Selected permissions own these domains. No fixed or appendix rule may silently narrow or broaden them.
|
|
262
133
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
- ❌ Self-initiated `npm install` to introduce new dependencies
|
|
266
|
-
- ❌ Modifying `package.json`, `tsconfig.json`, `vite.config.*`, `next.config.*`, ESLint/Prettier config (unless explicitly requested by user)
|
|
267
|
-
- ❌ Deleting or renaming exported APIs (unless explicitly requested by user with caller impact assessed)
|
|
268
|
-
- ❌ Skipping type definitions (writing `any` / `as any` / `// @ts-ignore`)
|
|
269
|
-
- ❌ Introducing hardcoded colors/font sizes/spacing that bypass design tokens
|
|
270
|
-
- ❌ "Incidental changes" spanning more than 5 files in a single commit
|
|
271
|
-
- ❌ Creating a new component without reading `components/index.ts` first
|
|
272
|
-
|
|
273
|
-
### 7.5 Output Format Convention
|
|
274
|
-
|
|
275
|
-
After completing code generation, AI must output:
|
|
276
|
-
|
|
277
|
-
1. **Change list**: files added / modified / deleted
|
|
278
|
-
2. **Impact**: modified exported APIs and their callers
|
|
279
|
-
3. **Not done**: items mentioned in the user's original request but not addressed this time
|
|
280
|
-
4. **Next steps**: up to 3 suggestions
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 8. Collaboration Process
|
|
285
|
-
|
|
286
|
-
### 8.1 Branching & Commits
|
|
134
|
+
## 7. Collaboration
|
|
287
135
|
|
|
288
136
|
{{ FIXED_RULES_GIT }}
|
|
289
137
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
PR submitter must self-check the following:
|
|
138
|
+
Review against the selected decisions, affected public contracts, applicable states, accessibility, security, and the selected testing evidence. Do not enforce a technology or process that the decision ledger did not select.
|
|
293
139
|
|
|
294
|
-
|
|
295
|
-
- [ ] Reuses existing components from `components/index.ts`
|
|
296
|
-
- [ ] Has loading / error / empty states
|
|
297
|
-
- [ ] Has accessibility handling (label, aria, keyboard)
|
|
298
|
-
- [ ] Has i18n (no hardcoded user-visible text)
|
|
299
|
-
- [ ] Has unit tests (shared components) / E2E (critical flows)
|
|
300
|
-
- [ ] Single file ≤ {{ ai_max_lines }} lines
|
|
301
|
-
- [ ] New dependencies added? If so, has it been submitted for review?
|
|
302
|
-
- [ ] Shared components modified? If so, has the impact been listed?
|
|
303
|
-
|
|
304
|
-
### 8.3 Best Practices for AI Collaboration
|
|
305
|
-
|
|
306
|
-
- Task granularity: let AI do one thing at a time. Avoid "while you're at it, also add xxx"
|
|
307
|
-
- Verification granularity: run locally once after every AI output before merging
|
|
308
|
-
- Dispute handling: when AI output conflicts with this spec, **this spec takes precedence**
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
## 9. Security Baseline
|
|
140
|
+
## 8. Security
|
|
313
141
|
|
|
314
142
|
{{ FIXED_RULES_SECURITY }}
|
|
315
143
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
## Appendix A: Deny List (Quick Reference)
|
|
319
|
-
|
|
320
|
-
> This appendix is auto-generated by AI in Phase 4 by extracting key forbidden entries from §1.5 (Style Deny List), §3 (Code Quality), §7.4 (AI Forbidden Behaviors), and §9 (Security Baseline) to provide a one-glance review.
|
|
144
|
+
## Appendix A: Active Deny List
|
|
321
145
|
|
|
322
146
|
{{ deny_list_summary }}
|
|
323
147
|
|
|
324
|
-
|
|
148
|
+
The deny list is derived only from active invariant and selected rule blocks; it must not include rejected or not-applicable options.
|
|
325
149
|
|
|
326
|
-
|
|
150
|
+
## Appendix B: Compatible Recommendations
|
|
327
151
|
|
|
328
152
|
{{ recommended_libs }}
|
|
329
153
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
- This document was generated by the `frontend-rules` skill
|
|
333
|
-
- To modify this document, invoke the `frontend-rules` skill and choose "Incremental update" mode
|
|
334
|
-
- Original rule library: `.claude/skills/frontend-rules/references/`
|
|
154
|
+
Recommendations must be compatible with the selected stack and dependency-permission rule. They are not authorization to modify dependencies.
|
|
335
155
|
|
|
336
|
-
|
|
156
|
+
## Source Contract
|
|
337
157
|
|
|
338
|
-
|
|
339
|
-
|
|
158
|
+
- Owner: app-planner Rules Configuration
|
|
159
|
+
- Resource family: `references/rules/frontend/`
|
|
160
|
+
- Regenerate after changing a selected decision or source contract; do not patch contradictory generated sections independently.
|
|
161
|
+
- Generation metadata value: {{ generated_at }}
|