mirror of
https://github.com/davila7/claude-code-templates.git
synced 2026-09-19 01:30:23 +08:00
41cbbea00c
- Split components.json: índice sin content (1.9 MB / 249 KB br vs 15.6 MB / 4.15 MB br).
Generador produce component-content/{type}/{slug}.json por componente y auto-copia
a dashboard/public/. Página de detalle carga contenido on-demand via fetchComponentContent().
- Restaurar cabeceras de caché y seguridad perdidas en la migración Vercel→Cloudflare:
_headers con Cache-Control max-age=86400 para JSONs, immutable para _astro/*,
y HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy en todas las rutas.
- Eliminar dashboard/vercel.json (config muerta desde migración a Cloudflare Pages).
- Diferir hidratación: ClerkIsland y AuthButton client:load → client:idle;
SaveToCollectionButton → client:visible.
- Eliminar gpt-tokenizer del bundle del navegador: reemplazado por estimación chars/4.
- Actualizar .claude/rules/dashboard.md para reflejar hosting en Cloudflare Pages.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 line
2.3 KiB
JSON
1 line
2.3 KiB
JSON
{"content": "---\nallowed-tools: Read, Write, Edit, Bash\nargument-hint: [target-file] | [test-type] | --unit | --integration | --e2e | --component\ndescription: Write comprehensive unit and integration tests with proper mocking and coverage\n---\n\n# Write Tests\n\nWrite comprehensive unit and integration tests with framework-specific best practices: **$ARGUMENTS**\n\n## Current Testing Context\n\n- Test framework: !`find . -name \"jest.config.*\" -o -name \"*.test.*\" | head -1 && echo \"Jest/Vitest detected\" || echo \"Detect framework\"`\n- Target file: Analysis of $ARGUMENTS for test requirements and complexity\n- Project patterns: !`find . -name \"*.test.*\" -o -name \"*.spec.*\" | head -3` existing test patterns\n- Coverage setup: !`grep -l \"coverage\" package.json jest.config.* 2>/dev/null | head -1 || echo \"Setup needed\"`\n\n## Task\n\nExecute comprehensive test writing with framework-specific optimizations and best practices:\n\n**Test Focus**: Use $ARGUMENTS to specify target file, unit tests, integration tests, e2e tests, or component tests\n\n**Test Writing Framework**:\n\n1. **Code Analysis** - Analyze target code structure, identify testable functions, assess dependency complexity, evaluate edge cases\n2. **Test Strategy Design** - Plan test organization, design test hierarchies, identify mock requirements, optimize test isolation\n3. **Framework Integration** - Setup framework-specific patterns, configure test utilities, implement proper assertions, optimize test performance\n4. **Mock Implementation** - Design dependency mocks, implement test doubles, create factory functions, setup async handling\n5. **Test Case Generation** - Write unit tests, integration tests, edge cases, error scenarios, performance tests, snapshot tests\n6. **Quality Assurance** - Ensure test maintainability, optimize execution speed, validate coverage, implement proper cleanup\n\n**Advanced Features**: Property-based testing, contract testing, visual regression testing, accessibility testing, performance benchmarking.\n\n**Framework Support**: Jest/Vitest, React Testing Library, Vue Test Utils, Angular TestBed, Cypress, Playwright integration.\n\n**Output**: Comprehensive test suite with unit tests, integration tests, proper mocking, test utilities, and coverage optimization.\n"} |