You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Update component prop handling and add TypeScript types
- Moved TypeScript types and interfaces to a dedicated file (`types/wizard.ts`) for better organization.
- Added a pre-commit hook to validate question IDs before committing.
- Enhanced the `InstructionsWizard` component to create a JSON object of questions and answers upon closing.
- Updated documentation to reflect new development workflow practices regarding TypeScript types and reusable effect logic.
- Added a new script (`validate-question-ids.ts`) to check for duplicate question IDs across data files.
When adding props to a component, always place the props interface at the top of the component file, above the component definition.
3
+
4
+
Development Workflow:
5
+
- Always move TypeScript types and interfaces to a dedicated file (e.g., `types/wizard.ts`) instead of declaring them inside components.
6
+
- When you identify reusable effect logic, wrap it in a custom hook under `hooks/` (e.g., `use-window-click-dismiss.ts`) and consume that hook rather than repeating `useEffect` blocks.
Copy file name to clipboardExpand all lines: agents.md
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,16 +35,8 @@
35
35
3. The wizard automatically consumes new questions when they follow the existing schema.
36
36
37
37
## Development Workflow
38
-
- Lint with `npm run lint` (already part of standard checks).
39
-
- When editing, maintain ASCII files, Tailwind utility classes, and ShadCN UI conventions.
40
-
- Tests are lint-only at present; consider adding React Testing Library coverage if the wizard logic expands.
41
-
42
-
## Notes for Agents
43
-
- Respect the "enabled" flag semantics: `false` means the option renders disabled with a "Soon" badge.
44
-
- When adding tooltip content, prefer concise prose and keep hover cards scannable.
45
-
- Keep documentation links trustworthy; avoid marketing splash pages when direct references exist.
46
-
- If adding new output formats, update both the data definition in `data/files.json` and any generation logic (currently beyond this repo).
47
-
- When page-level components need reusable calculations or datasets, extract those helpers into `lib/utils.ts` and import them instead of defining inline.
48
-
- For complex UI blocks reused across the wizard, lift them into dedicated components (e.g., `components/instructions-answer-card.tsx`) and consume them in the wizard instead of duplicating markup.
49
-
- Create new components under `components/MyComponentName/MyComponentName.tsx` with an accompanying `index.tsx` that default-exports the component.
38
+
39
+
-**Always move TypeScript types and interfaces to a dedicated file (e.g., `types/wizard.ts`) instead of declaring them inside components.**
40
+
41
+
50
42
- When you identify reusable effect logic, wrap it in a custom hook under `hooks/` (e.g., `use-window-click-dismiss.ts`) and consume that hook rather than repeating `useEffect` blocks.
0 commit comments