apply_cognitive_bias
Apply cognitive biases like Fitts' Law, grouping, or serial-position effect to React components to improve user experience through proven psychological principles.
Instructions
Aplica viés cognitivo específico para melhor UX
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bias | Yes | Viés cognitivo a aplicar | |
| component | Yes | Código do componente ou nome do arquivo |
Implementation Reference
- index.js:571-597 (handler)Handler implementation for the 'apply_cognitive_bias' tool. Maps the specified cognitive bias to a UX guideline key, retrieves the guideline from UX_GUIDELINES, and returns formatted instructions for the given component. Handles unknown biases with an error response.case 'apply_cognitive_bias': const biasMap = { fitts: 'fittssLaw', grouping: 'groupingEffect', }; const biasKey = biasMap[args.bias]; const bias = UX_GUIDELINES[biasKey]; if (!bias) { return { content: [ { type: 'text', text: `Viés ${args.bias} não encontrado.`, }, ], isError: true, }; } return { content: [ { type: 'text', text: `**${bias.description}**\n\n${bias.instructions}\n\n**Componente:** ${args.component}`, }, ], };
- index.js:464-482 (registration)Tool registration in the ListToolsRequestSchema handler, defining the tool name, description, and input schema for 'apply_cognitive_bias'.{ name: 'apply_cognitive_bias', description: 'Aplica viés cognitivo específico para melhor UX', inputSchema: { type: 'object', properties: { component: { type: 'string', description: 'Código do componente ou nome do arquivo', }, bias: { type: 'string', enum: ['fitts', 'grouping', 'proximity', 'zeigarnik', 'serial-position', 'hicks'], description: 'Viés cognitivo a aplicar', }, }, required: ['component', 'bias'], }, },
- index.js:467-481 (schema)Input schema definition for the 'apply_cognitive_bias' tool, specifying required parameters 'component' and 'bias' with enum values.inputSchema: { type: 'object', properties: { component: { type: 'string', description: 'Código do componente ou nome do arquivo', }, bias: { type: 'string', enum: ['fitts', 'grouping', 'proximity', 'zeigarnik', 'serial-position', 'hicks'], description: 'Viés cognitivo a aplicar', }, }, required: ['component', 'bias'], },
- index.js:572-575 (helper)Bias mapping helper used in the handler to map input bias names to UX_GUIDELINES keys.const biasMap = { fitts: 'fittssLaw', grouping: 'groupingEffect', };