AI Skill Report Card

Generated Skill

B-70·May 6, 2026·Source: Web
TypeScript
export const updateEntityController = async ( id: Entity.Entity['id'], params: Entity.UpdateEntityParams, ): Promise<AxiosResponse<Entity.Entity, any>> => { const url = `/api/entity/${id}/`; const instance = genRequestInstance(); try { const response = await instance.patch(url, params); return response; } catch (error) { console.error('Erro na requisição:', error); return Promise.reject(error); } };
Recommendation
Consider adding more specific examples
  1. Analyze requirements - Identify entity name, parameters, and URL structure
  2. Generate function name - Use pattern: update{EntityName}Controller
  3. Define parameters - ID (required), additional params (optional), body params (required)
  4. Build URL - Follow pattern: /api/{module}/{entity}/{id}/ or with extra params
  5. Add JSDoc - Document all parameters, returns, and throws
  6. Implement function - Use genRequestInstance, patch method, error handling

Progress:

  • Identify entity and module
  • Determine URL parameters
  • Check typings availability
  • Generate controller function
  • Add proper JSDoc
Recommendation
Include edge cases

Example 1 - Entity with version parameter: Input: Entity "adicional-noturno" with version parameter Output:

TypeScript
/** * Updates an adicional noturno record * @param versao - Version ID for the planning * @param id - Adicional noturno ID to update * @param params - Update parameters for adicional noturno * @returns Promise with the updated adicional noturno data * @throws Error if request fails or authentication issues */ export const updateAdicionalNoturnoController = async ( versao: Planejamento.Versao.Versao['id'], id: Pessoal.Premissas.AdicionalNoturno.AdicionalNoturno['id'], params: Pessoal.Premissas.AdicionalNoturno.UpdateAdicionalNoturnoParams, ): Promise< AxiosResponse<Pessoal.Premissas.AdicionalNoturno.AdicionalNoturno, any> > => { const url = `/api/pessoal/versao/${versao}/adicional-noturno/${id}/`; const instance = genRequestInstance(); try { const response = await instance.patch(url, params); return response; } catch (error) { console.error('Erro na requisição:', error); return Promise.reject(error); } };

Example 2 - Simple entity without additional parameters: Input: Entity "area" without additional parameters Output:

TypeScript
/** * Updates an area record * @param id - Area ID to update * @param params - Update parameters for area * @returns Promise with the updated area data * @throws Error if request fails or authentication issues */ export const updateAreaController = async ( id: Planejamento.Cadastro.Area.Area['id'], params: Planejamento.Cadastro.Area.UpdateAreaParams, ): Promise<AxiosResponse<Planejamento.Cadastro.Area.Area, any>> => { const url = `/api/planejamento/area/${id}/`; const instance = genRequestInstance(); try { const response = await instance.patch(url, params); return response; } catch (error) { console.error('Erro na requisição:', error); return Promise.reject(error); } };
  • Function naming: Use camelCase with "update" prefix and "Controller" suffix
  • URL structure: Always end with trailing slash /
  • Parameter order: Extra params first, then entity ID, then body params
  • Error handling: Use try-catch but let axios interceptor handle auth errors
  • Typing: Use namespace-qualified types for entity references
  • JSDoc: Include @param for all parameters, @returns, and @throws
  • Missing trailing slash in URL - Always include / at the end
  • Wrong parameter order - ID should be last path parameter, body params last overall
  • Inconsistent naming - Don't mix snake_case with camelCase in function names
  • Missing imports - Ensure genRequestInstance and AxiosResponse are imported
  • Hardcoded types - Always check if typings exist in typings.d.ts first
0
Grade B-AI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
11/15
Workflow
11/15
Examples
15/20
Completeness
15/20
Format
11/15
Conciseness
11/15