.claude/skills/context-optimized-dev/SKILL.md
Context-Optimized Development — Skill
npx skillsauth add gonzalezpazmonica/pm-workspace context-optimized-devInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guía operativa para producir código de alta calidad con ~40% de context window libre.
Context window (200K tokens)
├── Auto-loaded (rules, CLAUDE.md): ~120K (60%) — NO controlable
├── Conversación acumulada: variable
└── Espacio libre para trabajo: ~80K (40%) — ESTE es tu presupuesto
Regla de oro: Si tu próxima acción va a consumir >15K tokens → delégala a un subagent.
| Elemento | Tokens típicos | Cuándo incluir | |----------|---------------|----------------| | Spec-slice excerpt | 1.5-2K | SIEMPRE — es la fuente de verdad | | Ficheros target (actuales) | 1-8K por fichero | SIEMPRE — el agente necesita el código actual | | Test expectations | 0.5-1K | Si hay tests que deben pasar | | Convención de arquitectura | 0.5-1K | 1 párrafo, no toda la regla | | Ejemplo similar del proyecto | 1-3K | Si existe un patrón a seguir |
Subagent: {lang}-developer
Input:
1. [Spec slice]: {contenido del slice-{n}.md}
2. [Ficheros actuales]: {solo los listados en el slice}
3. [Tests esperados]: {qué assertions deben pasar}
4. [Convención]: {1 párrafo de arquitectura aplicable}
Output esperado:
- Ficheros modificados/creados (código completo)
- Notas de implementación (decisiones tomadas, trade-offs)
- Ficheros de test si aplica
Cargar: spec-slice + interface del servicio + DTO + test template
NO cargar: repositorio (el handler no lo toca directamente)
Tokens estimados: 2K + 2K + 1K + 1K = 6K
Cargar: spec-slice + entidad domain + interface repo + EF DbContext (solo el DbSet)
NO cargar: controllers, otros repos, migrations
Tokens estimados: 2K + 2K + 1K + 1K = 6K
Cargar: spec-slice + código a testear + test fixture base (si existe)
NO cargar: implementaciones de dependencias (usar mocks)
Tokens estimados: 2K + 4K + 1K = 7K
Cargar: spec-slice + entidad + configuraciones existentes similares
NO cargar: todo el DbContext, otros entities
Tokens estimados: 2K + 2K + 2K = 6K
Cargar: spec-slice + componente padre + design system tokens + API contract
NO cargar: otros componentes, store completo, router
Tokens estimados: 2K + 3K + 1K + 1K = 7K
| Tipo | Factor (tokens/línea) | Ejemplo 100 líneas | |------|----------------------|-------------------| | C# / Java | 1.4 | ~140 tokens | | TypeScript / JavaScript | 1.2 | ~120 tokens | | Python | 1.1 | ~110 tokens | | Go / Rust | 1.3 | ~130 tokens | | YAML / JSON config | 0.8 | ~80 tokens | | Markdown (spec) | 1.0 | ~100 tokens |
| Fase | Budget | Uso típico | |------|--------|------------| | Context Prime | 15K | Spec (2K) + Source (8K) + Tests (3K) + Arch (2K) | | Implement | 12K subagent | Prompt (3K) + Files (6K) + Output (3K) | | Validate | 8K × 2 subagents | Test run (4K) + Coherence check (4K) | | Review | 12K subagent | Full diff (6K) + Review output (6K) |
| # | Anti-patrón | Síntoma | Solución |
|---|------------|---------|----------|
| 1 | Cargar proyecto entero | @src/ en prompt (50-200K tokens) | Usar /spec-slice para ficheros exactos |
| 2 | Múltiples slices sin compact | Contexto >60K, respuestas degradadas | /compact obligatorio entre slices |
| 3 | Recursión de agentes sin reducción | Agente invoca otro con todo su contexto | Mínimo necesario por tarea |
| 4 | Pasar spec completo al agente | 5K tokens cuando solo necesita 2K del slice | Solo slice-{n}.md |
| 5 | No persistir estado | Progreso perdido tras /compact | state.json después de cada fase |
| Métrica | Objetivo | Cómo medir |
|---------|----------|------------|
| Tokens por slice | <15K main + 12K subagent | Monitorizar en /dev-session status |
| Rework rate | <15% | Slices que requieren >1 intento en Fase 4 |
| Coherence score | ≥95% | Output de coherence-validator |
| Context exhaustion | 0 incidents | Sesiones que agotan contexto |
dev-session-protocol.md — Protocolo de 5 fasescontext-health.md — Reglas de salud de contextoagent-context-budget.md — Budgets por categoría de agentespec-driven-development/SKILL.md — Flujo SDD completotesting
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
tools
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
tools
Sistema proactivo de bienestar individual
development
Search the web to resolve context gaps — documentation, versions, CVEs, best practices. Auto-starts SearxNG Docker if available, falls back to WebSearch.