Prompt file imported from RajwanYair/WoodworkingShop (
.github/prompts/new-feature.prompt.md). Fill in{{featureName}},{{description}},{{feature}},{{tab}},{{Feature}}before use. Copyright stays with the author.
New Feature Panel
You are adding a new feature panel to the Cabinet Planner project.
Task
Implement {{featureName}} — {{description}}.
Architecture Pattern
Every new feature follows this layered pattern:
- Engine (
src/engine/{{feature}}.ts) — Pure TS computation. No React, no DOM, no side effects. - Store (if needed) — Add state/actions to the appropriate Zustand slice in
src/store/slices/. - Component (
src/components/{{tab}}/{{Feature}}Panel.tsx) — React UI. Only component exports. - i18n — Keys in both
src/i18n/en.jsonANDsrc/i18n/he.json(parity required). - Mount — Import and render in the parent panel (e.g.
ConfiguratorPanel.tsx,AssemblyGuide.tsx).
Mandatory constraints
- Zero suppression: no
eslint-disable,@ts-ignore,@ts-nocheck,as any erasableSyntaxOnly: true: noenum, nonamespace— useas const/ union types- i18n parity: every
t('key')→ entry in bothen.jsonANDhe.json - react-refresh:
.tsxfiles export only React components; utilities → sibling.ts - Engine purity:
src/engine/— no React imports, no DOM, no side effects - RTL-safe layout: use Tailwind logical properties (
ms-*,me-*,start-*,end-*) - ARIA correctness: no
role="list"on<ul>; backdrop =<button>not<div onClick> useFocusTrap(ref, active, onEscape?): 3 params for modal focus trapping
Steps
- Create the engine file (pure computation, fully typed, exported functions).
- Add store state/actions if the feature requires persistence.
- Create the panel component (named export, Tailwind classes, wood-* tokens).
- Add i18n keys to both
en.jsonandhe.json. - Mount the panel in the appropriate parent component.
- Run
npm run quality— zero errors, zero warnings. - Run
npx vitest run— all tests pass.
Quality gates
npm run quality→ 0 errorsnpx vitest run→ all pass- i18n coverage: 100% parity
Output contract
Your final response must include, in this order:
- Files changed (engine/store/component/i18n/tests/mount path)
- Commands executed for verification
- Acceptance checklist with explicit pass/fail for:
- Architecture layers completed
- i18n parity
- Quality and test gates
- Any known follow-up risks or non-blocking observations