4.5 KiB
4.5 KiB
1. Tooling Guardrail
- 1.1 Настроить frontend Biome rules для enforceable subset component style: const-valued named React components, no default exports и exports после declarations тела module. Verification:
npm run lintсообщает настроенные rules и падает на representative local violations. - 1.2 Доказать новый hard guardrail одним compliant fixture или временным authored source sample и representative failing samples для запрещённой component declaration, default export и export ordering. Verification: записать exact Biome commands и observed pass/fail behavior в implementation summary перед archive.
2. Frontend Conventions
- 2.1 Обновить frontend-local conventions и описать полный React component style:
FCtyping, named props types только когда они несут real props shape, no inline props typing, props destructuring внутри component body, один нижний named export block для обычных modules и прямые re-exports для чистых barrels. Verification:frontend/docs/CONVENTIONS.mdявно разделяет Biome-enforced guardrails и mandatory review conventions. - 2.2 При необходимости обновить frontend routing guidance для AI agents, чтобы будущие frontend edits находили component style convention до implementation. Verification: affected local guidance указывает на documented convention без дублирования product architecture.
3. Source Migration
- 3.1 Мигрировать authored production React components в
frontend/srcна const-valuedFCcomponent declarations без изменения JSX, hook order, route behavior, state selection, localized text keys или API calls. Verification: TypeScript и existing frontend tests проходят после migration. - 3.2 Заменить inline props typing в authored React components на named props types, использовать
FC<PropsWithChildren>без alias для children-only components, использоватьPropsWithChildren<{ ... }>для components сchildrenи дополнительными props и не создавать empty props type для components без props. Verification: review migrated source на documented convention и запускnpm run typecheck. - 3.3 Перенести React component props destructuring из function parameters в component bodies. Verification: review migrated source на documented convention и запуск
npm run typecheck. - 3.4 Свести обычные authored module exports к одному нижнему named export block, а чистые barrels — к прямым re-exports с сохранением public APIs и import paths. Verification:
npm run lint,npm run knipиnpm run depsпроходят. - 3.5 Оставить generated OpenAPI source вне manual style migration. Verification: generated files остаются owned by existing OpenAPI workflow и не редактируются руками ради component style.
4. Verification
- 4.1 Запустить targeted frontend checks после migration. Verification:
npm run lint,npm run typecheck,npm run test:coverage,npm run knip,npm run depsиnpm run buildпроходят изfrontend. - 4.2 Запустить frontend canonical gate. Verification:
npm run verifyпроходит изfrontendпод Node 22. - 4.3 Проверить OpenSpec change структурно. Verification:
openspec validate codify-frontend-component-style --type change --strict --store wealth-ledger-specsпроходит изspecs. - 4.4 Выполнить semantic verification против Proposal, Delta Spec, Design и Tasks. Verification: implementation summary подтверждает, что user-visible behavior, routes, localization, API contract, backend behavior, generated API source ownership и product documentation не изменились вне approved scope.
- 4.5 Выполнить independent read-only review перед archive. Verification: review не содержит Critical или Important findings.
- 4.6 Запустить workspace change dispatcher после завершения affected tasks. Verification:
bash specs/scripts/verify-workspace-change.sh codify-frontend-component-styleпроходит из workspace root.