AI Skill Report Card

Generating Select Components

B-72·May 7, 2026·Source: Web

Generate Select Components

12 / 15

Provide the entity name in kebab-case (e.g., banco, centro-custo, sindicato) and controller information. I'll generate both files with proper infinite scroll, search, and missing options handling.

Example: Entity: sindicato Controller: getSindicatosController from @/pages/pessoal/cadastro/tabs/sindicato/sindicato.controller Endpoint: /api/pessoal/sindicatos/

Recommendation
Remove the verbose template structure section and common pitfalls - Claude doesn't need detailed explanations of what imports to use
12 / 15
  1. Create Model (src/models/selects/select-<entity>.ts)

    • Import specific controller
    • Set up pagination, loading, search states
    • Implement addMissedOptions, getOptions, getOptionsNewPage
    • Return standard interface: selectLoading, addMissedOptions, options, getOptions, getOptionsNewPage, queryStringOptionsParams
  2. Create Component (src/components/selects/select-<entity>.tsx)

    • Use useModel('selects.<entity>')
    • Implement search with 700ms debounce
    • Add infinite scroll for both default and searched options
    • Handle missing options population on mount
    • Support multiple, labelInValue, isInstanceForColumnFilter props

Progress:

  • Generate model file
  • Generate component file
  • Replace placeholders with entity-specific values
  • Verify import paths and controller names
Recommendation
Add concrete input/output code examples showing actual generated files instead of abstract descriptions
15 / 20

Example 1: Simple entity with label field Input: Entity sindicato, controller getSindicatosController, endpoint /api/pessoal/sindicatos/ Output:

  • Model uses order_by: 'label'
  • Component maps r.label for options
  • useModel: 'selects.sindicato'

Example 2: Entity with composite label Input: Entity colaborador, controller getColaboradoresEquipeController, composite label Output:

  • Model uses order_by: 'codigo'
  • Component maps ${r.codigo} - ${r.nome} for options
  • Same standard interface

Example 3: Entity with external dependency Input: Entity with version dependency Output:

  • Model accepts parameter: export default (versaoRelatorioId?: number)
  • Component uses useUpdateEffect to reset on dependency change
Recommendation
Provide actual template code that can be copy-pasted rather than placeholder descriptions in backticks
  • Each entity gets its own model - No shared generic models
  • Standard return interface - Always return the same 6 fields from model
  • Consistent naming - kebab-case for files, camelCase for useModel
  • Proper debouncing - 700ms for search to avoid API spam
  • Missing options handling - Auto-populate selected values not in current page
  • Infinite scroll - Both for default options and search results
  • Column filter support - Special styling when isInstanceForColumnFilter is true
  • Don't create generic models - each entity needs its own
  • Don't forget to replace ALL placeholders (controller, endpoint, useModel key)
  • Don't mix up the order_by field between model and component
  • Don't skip the missing options logic - it's required for pre-filled values
  • Don't hardcode pagination - always check total_pages for scroll
  • Don't forget debounce import from lodash

Model Template

TypeScript
// Always imports: defaultPaginationValues, useLoading, getUpdateSelectOptions, message // Entity-specific: controller import // Standard state: options, queryStringOptionsParams, loading // Standard methods: addMissedOptions, getOptions, getOptionsNewPage // Standard return: 6 fields

Component Template

TypeScript
// Always imports: React hooks, Ant Design Select, lodash debounce // Entity-specific: useModel('selects.<entity>') // Features: search with debounce, infinite scroll, missing options, column filter // Props: value, onChange, multiple, allowClear, style, placeholder, disabled, labelInValue, isInstanceForColumnFilter
PlaceholderReplace With
<entidade>Entity name (kebab-case)
getNomeEntidadeControllerActual controller function name
<caminho-do-controller>Controller import path
'ENDPOINT_AQUI'API endpoint string
r.labelField mapping for option labels
order_by: 'label'Appropriate sort field

Provide entity name, controller details, and any special requirements to generate both files.

0
Grade B-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
12/15
Workflow
12/15
Examples
15/20
Completeness
8/20
Format
15/15
Conciseness
10/15