Skip to content

Commit 6b74c45

Browse files
committed
Fix #6: Strengthen icon import completeness - per-file verification and counting heuristic
1 parent 7b91f34 commit 6b74c45

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

‎app/lib/agent/prompts.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,9 @@ Before reporting task completion, verify:
326326
- [ ] Every utility function used is explicitly imported (e.g., \`cn\` from \`@/lib/utils\`, \`clsx\` from \`clsx\`)
327327
- [ ] No undefined references — every function/component used is imported or defined in the file
328328
- [ ] All companion/peer dependencies listed in package.json (e.g., zustand+immer, react-hook-form+zod)
329-
- [ ] LUCIDE ICONS: Every \`<IconName />\` in JSX has a matching \`import { IconName } from 'lucide-react'\` — scan ALL files for icon usage
329+
- [ ] LUCIDE ICONS: Every \`<IconName />\` in JSX has a matching \`import { IconName } from 'lucide-react'\` — scan ALL files for icon usage. COUNT: for each file, count icon usages in JSX vs. icon names in the import statement. If counts differ, you missed one.
330330
- [ ] NO UI COMPONENTS FROM LUCIDE: Tooltip, Dialog, Sheet, Popover, Select, Accordion, etc. are imported from \`@/components/ui/\` — NEVER from \`lucide-react\`
331+
- [ ] FINAL ICON AUDIT: Re-read EVERY file that imports from 'lucide-react' and verify EVERY PascalCase JSX element used as \`<Name />\` or \`<Name \` has a corresponding import. Pay special attention to icons used inside .map() callbacks, conditional renders, and nested components.
331332
- [ ] Shell commands use SEPARATE devonz_run_command calls — NEVER chain with &&
332333
Completeness (CRITICAL):
333334
- [ ] No hardcoded mock data arrays — real state management with CRUD operations used

‎app/lib/common/prompts/new-prompt.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ export const getFineTunedPrompt = (
418418
Command, DropdownMenu, AlertDialog, ContextMenu, HoverCard, Menubar,
419419
NavigationMenu, RadioGroup, ScrollArea, Collapsible, Resizable
420420
If a name could be either an icon or a UI component, import it from '@/components/ui/' — NOT from 'lucide-react'
421+
- PER-FILE ICON VERIFICATION (MANDATORY — do this BEFORE closing each file):
422+
1. Scan ALL JSX in the file for PascalCase components that look like icons (e.g., <Search />, <Users />, <Mail />)
423+
2. Cross-reference each one against the file's import statements
424+
3. If ANY icon is used in JSX but NOT imported, ADD it to the lucide-react import IMMEDIATELY
425+
4. Common missed icons: Users, CloudSun, Package, Loader2, ChevronDown, ChevronRight, X, Check, Star, Heart, Eye, EyeOff, Copy, ExternalLink, Info, AlertCircle, AlertTriangle
421426
422427
CRITICAL RULES - MANDATORY:
423428
@@ -854,8 +859,9 @@ The todo app is running with local storage persistence.</assistant_response>
854859
[ ] Every utility function used in a file is explicitly imported (e.g., \`cn\` from \`@/lib/utils\`, \`clsx\` from \`clsx\`)
855860
[ ] No undefined references — if a function/component is used, it MUST be imported or defined in that file
856861
[ ] All companion/peer dependencies listed in package.json (e.g., zustand+immer, react-hook-form+zod)
857-
[ ] LUCIDE ICONS: Every \`<IconName />\` in JSX has a matching \`import { IconName } from 'lucide-react'\` — scan ALL files for icon usage
862+
[ ] LUCIDE ICONS: Every \`<IconName />\` in JSX has a matching \`import { IconName } from 'lucide-react'\` — scan ALL files for icon usage. COUNT: for each file, count icon usages in JSX vs. icon names in the import statement. If counts differ, you missed one.
858863
[ ] NO UI COMPONENTS FROM LUCIDE: Tooltip, Dialog, Sheet, Popover, Select, Accordion, etc. are imported from \`@/components/ui/\` — NEVER from \`lucide-react\`
864+
[ ] FINAL ICON AUDIT: Re-read EVERY file that imports from 'lucide-react' and verify EVERY PascalCase JSX element used as \`<Name />\` or \`<Name \` has a corresponding import. Pay special attention to icons used inside .map() callbacks, conditional renders, and nested components.
859865
860866
Artifact Completeness:
861867
[ ] All referenced files are included in the artifact

0 commit comments

Comments
 (0)