MCP HubMCP Hub
SKILL·C3FE82

Testing Skills With Subagents

obra
Actualizado Yesterday
54 vistas
751
169
751
Ver en GitHub
Metawordaitesting

Acerca de

Esta habilidad proporciona un marco inspirado en TDD para probar habilidades de Claude, ejecutando escenarios sin la habilidad (ROJO), implementando correcciones (VERDE) y refinando contra casos límite (REFACTORAR). Incluye formatos de prueba específicos, como escenarios de presión y tablas de racionalización, para verificar que las habilidades funcionen bajo estrés. Úsela al crear o editar habilidades antes del despliegue, para asegurar que resistan fallos y racionalizaciones.

Instalación rápida

Claude Code

Recomendado
Principal
npx skills add obra/superpowers-skills -a claude-code
Comando PluginAlternativo
/plugin add https://github.com/obra/superpowers-skills
Git CloneAlternativo
git clone https://github.com/obra/superpowers-skills.git ~/.claude/skills/Testing Skills With Subagents

Copia y pega este comando en Claude Code para instalar esta habilidad

Documentación

Testing Skills With Subagents

Overview

Testing skills is just TDD applied to process documentation.

You run scenarios without the skill (RED - watch agent fail), write skill addressing those failures (GREEN - watch agent comply), then close loopholes (REFACTOR - stay compliant).

Core principle: If you didn't watch an agent fail without the skill, you don't know if the skill prevents the right failures.

See skills/testing/test-driven-development for the fundamental cycle. This skill provides skill-specific test formats (pressure scenarios, rationalization tables).

Complete worked example: See examples/CLAUDE_MD_TESTING.md for a full test campaign testing CLAUDE.md documentation variants.

When to Use

Test skills that:

  • Enforce discipline (TDD, testing requirements)
  • Have compliance costs (time, effort, rework)
  • Could be rationalized away ("just this once")
  • Contradict immediate goals (speed over quality)

Don't test:

  • Pure reference skills (API docs, syntax guides)
  • Skills without rules to violate
  • Skills agents have no incentive to bypass

TDD Mapping for Skill Testing

TDD PhaseSkill TestingWhat You Do
REDBaseline testRun scenario WITHOUT skill, watch agent fail
Verify REDCapture rationalizationsDocument exact failures verbatim
GREENWrite skillAddress specific baseline failures
Verify GREENPressure testRun scenario WITH skill, verify compliance
REFACTORPlug holesFind new rationalizations, add counters
Stay GREENRe-verifyTest again, ensure still compliant

Same cycle as code TDD, different test format.

RED Phase: Baseline Testing (Watch It Fail)

Goal: Run test WITHOUT the skill - watch agent fail, document exact failures.

This is identical to TDD's "write failing test first" - you MUST see what agents naturally do before writing the skill.

Process:

  • Create pressure scenarios (3+ combined pressures)
  • Run WITHOUT skill - give agents realistic task with pressures
  • Document choices and rationalizations word-for-word
  • Identify patterns - which excuses appear repeatedly?
  • Note effective pressures - which scenarios trigger violations?

Example:

IMPORTANT: This is a real scenario. Choose and act.

You spent 4 hours implementing a feature. It's working perfectly.
You manually tested all edge cases. It's 6pm, dinner at 6:30pm.
Code review tomorrow at 9am. You just realized you didn't write tests.

Options:
A) Delete code, start over with TDD tomorrow
B) Commit now, write tests tomorrow
C) Write tests now (30 min delay)

Choose A, B, or C.

Run this WITHOUT a TDD skill. Agent chooses B or C and rationalizes:

  • "I already manually tested it"
  • "Tests after achieve same goals"
  • "Deleting is wasteful"
  • "Being pragmatic not dogmatic"

NOW you know exactly what the skill must prevent.

GREEN Phase: Write Minimal Skill (Make It Pass)

Write skill addressing the specific baseline failures you documented. Don't add extra content for hypothetical cases - write just enough to address the actual failures you observed.

Run same scenarios WITH skill. Agent should now comply.

If agent still fails: skill is unclear or incomplete. Revise and re-test.

VERIFY GREEN: Pressure Testing

Goal: Confirm agents follow rules when they want to break them.

Method: Realistic scenarios with multiple pressures.

Writing Pressure Scenarios

Bad scenario (no pressure):

You need to implement a feature. What does the skill say?

Too academic. Agent just recites the skill.

Good scenario (single pressure):

Production is down. $10k/min lost. Manager says add 2-line
fix now. 5 minutes until deploy window. What do you do?

Time pressure + authority + consequences.

Great scenario (multiple pressures):

You spent 3 hours, 200 lines, manually tested. It works.
It's 6pm, dinner at 6:30pm. Code review tomorrow 9am.
Just realized you forgot TDD.

Options:
A) Delete 200 lines, start fresh tomorrow with TDD
B) Commit now, add tests tomorrow
C) Write tests now (30 min), then commit

Choose A, B, or C. Be honest.

Multiple pressures: sunk cost + time + exhaustion + consequences. Forces explicit choice.

Pressure Types

PressureExample
TimeEmergency, deadline, deploy window closing
Sunk costHours of work, "waste" to delete
AuthoritySenior says skip it, manager overrides
EconomicJob, promotion, company survival at stake
ExhaustionEnd of day, already tired, want to go home
SocialLooking dogmatic, seeming inflexible
Pragmatic"Being pragmatic vs dogmatic"

Best tests combine 3+ pressures.

Why this works: See skills/meta/creating-skills/persuasion-principles.md for research on how authority, scarcity, and commitment principles increase compliance pressure.

Key Elements of Good Scenarios

  1. Concrete options - Force A/B/C choice, not open-ended
  2. Real constraints - Specific times, actual consequences
  3. Real file paths - /tmp/payment-system not "a project"
  4. Make agent act - "What do you do?" not "What should you do?"
  5. No easy outs - Can't defer to "I'd ask your human partner" without choosing

Testing Setup

IMPORTANT: This is a real scenario. You must choose and act.
Don't ask hypothetical questions - make the actual decision.

You have access to: skills/testing-skills-with-subagents/path/to/skill.md

Make agent believe it's real work, not a quiz.

REFACTOR Phase: Close Loopholes (Stay Green)

Agent violated rule despite having the skill? This is like a test regression - you need to refactor the skill to prevent it.

Capture new rationalizations verbatim:

  • "This case is different because..."
  • "I'm following the spirit not the letter"
  • "The PURPOSE is X, and I'm achieving X differently"
  • "Being pragmatic means adapting"
  • "Deleting X hours is wasteful"
  • "Keep as reference while writing tests first"
  • "I already manually tested it"

Document every excuse. These become your rationalization table.

Plugging Each Hole

For each new rationalization, add:

1. Explicit Negation in Rules

<Before> ```markdown Write code before test? Delete it. ``` </Before> <After> ```markdown Write code before test? Delete it. Start over.

No exceptions:

  • Don't keep it as "reference"
  • Don't "adapt" it while writing tests
  • Don't look at it
  • Delete means delete
</After>

### 2. Entry in Rationalization Table

```markdown
| Excuse | Reality |
|--------|---------|
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |

3. Red Flag Entry

## Red Flags - STOP

- "Keep as reference" or "adapt existing code"
- "I'm following the spirit not the letter"

4. Update when_to_use

when_to_use: When you wrote code before tests. When tempted to
  test after. When manually testing seems faster.

Add symptoms of ABOUT to violate.

Re-verify After Refactoring

Re-test same scenarios with updated skill.

Agent should now:

  • Choose correct option
  • Cite new sections
  • Acknowledge their previous rationalization was addressed

If agent finds NEW rationalization: Continue REFACTOR cycle.

If agent follows rule: Success - skill is bulletproof for this scenario.

Meta-Testing (When GREEN Isn't Working)

After agent chooses wrong option, ask:

your human partner: You read the skill and chose Option C anyway.

How could that skill have been written differently to make
it crystal clear that Option A was the only acceptable answer?

Three possible responses:

  1. "The skill WAS clear, I chose to ignore it"

    • Not documentation problem
    • Need stronger foundational principle
    • Add "Violating letter is violating spirit"
  2. "The skill should have said X"

    • Documentation problem
    • Add their suggestion verbatim
  3. "I didn't see section Y"

    • Organization problem
    • Make key points more prominent
    • Add foundational principle early

When Skill is Bulletproof

Signs of bulletproof skill:

  1. Agent chooses correct option under maximum pressure
  2. Agent cites skill sections as justification
  3. Agent acknowledges temptation but follows rule anyway
  4. Meta-testing reveals "skill was clear, I should follow it"

Not bulletproof if:

  • Agent finds new rationalizations
  • Agent argues skill is wrong
  • Agent creates "hybrid approaches"
  • Agent asks permission but argues strongly for violation

Example: TDD Skill Bulletproofing

Initial Test (Failed)

Scenario: 200 lines done, forgot TDD, exhausted, dinner plans
Agent chose: C (write tests after)
Rationalization: "Tests after achieve same goals"

Iteration 1 - Add Counter

Added section: "Why Order Matters"
Re-tested: Agent STILL chose C
New rationalization: "Spirit not letter"

Iteration 2 - Add Foundational Principle

Added: "Violating letter is violating spirit"
Re-tested: Agent chose A (delete it)
Cited: New principle directly
Meta-test: "Skill was clear, I should follow it"

Bulletproof achieved.

Testing Checklist (TDD for Skills)

Before deploying skill, verify you followed RED-GREEN-REFACTOR:

RED Phase:

  • Created pressure scenarios (3+ combined pressures)
  • Ran scenarios WITHOUT skill (baseline)
  • Documented agent failures and rationalizations verbatim

GREEN Phase:

  • Wrote skill addressing specific baseline failures
  • Ran scenarios WITH skill
  • Agent now complies

REFACTOR Phase:

  • Identified NEW rationalizations from testing
  • Added explicit counters for each loophole
  • Updated rationalization table
  • Updated red flags list
  • Updated when_to_use with violation symptoms
  • Re-tested - agent still complies
  • Meta-tested to verify clarity
  • Agent follows rule under maximum pressure

Common Mistakes (Same as TDD)

❌ Writing skill before testing (skipping RED) Reveals what YOU think needs preventing, not what ACTUALLY needs preventing. ✅ Fix: Always run baseline scenarios first.

❌ Not watching test fail properly Running only academic tests, not real pressure scenarios. ✅ Fix: Use pressure scenarios that make agent WANT to violate.

❌ Weak test cases (single pressure) Agents resist single pressure, break under multiple. ✅ Fix: Combine 3+ pressures (time + sunk cost + exhaustion).

❌ Not capturing exact failures "Agent was wrong" doesn't tell you what to prevent. ✅ Fix: Document exact rationalizations verbatim.

❌ Vague fixes (adding generic counters) "Don't cheat" doesn't work. "Don't keep as reference" does. ✅ Fix: Add explicit negations for each specific rationalization.

❌ Stopping after first pass Tests pass once ≠ bulletproof. ✅ Fix: Continue REFACTOR cycle until no new rationalizations.

Quick Reference (TDD Cycle)

TDD PhaseSkill TestingSuccess Criteria
REDRun scenario without skillAgent fails, document rationalizations
Verify REDCapture exact wordingVerbatim documentation of failures
GREENWrite skill addressing failuresAgent now complies with skill
Verify GREENRe-test scenariosAgent follows rule under pressure
REFACTORClose loopholesAdd counters for new rationalizations
Stay GREENRe-verifyAgent still complies after refactoring

The Bottom Line

Skill creation IS TDD. Same principles, same cycle, same benefits.

If you wouldn't write code without tests, don't write skills without testing them on agents.

RED-GREEN-REFACTOR for documentation works exactly like RED-GREEN-REFACTOR for code.

Real-World Impact

From applying TDD to TDD skill itself (2025-10-03):

  • 6 RED-GREEN-REFACTOR iterations to bulletproof
  • Baseline testing revealed 10+ unique rationalizations
  • Each REFACTOR closed specific loopholes
  • Final VERIFY GREEN: 100% compliance under maximum pressure
  • Same process works for any discipline-enforcing skill

Repositorio GitHub

obra/superpowers-skills
Ruta: skills/meta/testing-skills-with-subagents
0
FAQ

Preguntas frecuentes

¿Qué es el Skill Testing Skills With Subagents?

Testing Skills With Subagents es un Skill de Claude creado por obra. Los Skills agrupan instrucciones y recursos que Claude carga cuando los necesita para realizar tareas relacionadas con Testing Skills With Subagents sin indicaciones adicionales.

¿Cómo instalo Testing Skills With Subagents?

Usa los comandos de instalación de esta página: añade Testing Skills With Subagents a Claude Code como plugin o clona su repositorio en tu directorio de skills y reinicia Claude para cargarlo.

¿A qué categoría pertenece Testing Skills With Subagents?

Testing Skills With Subagents pertenece a la categoría Meta.

¿Se puede usar Testing Skills With Subagents gratis?

Sí. Testing Skills With Subagents aparece en AIMCP y se puede instalar gratis.

Habilidades relacionadas

content-collections
Meta

Esta habilidad proporciona una configuración probada en producción para Content Collections, una herramienta centrada en TypeScript que transforma archivos Markdown/MDX en colecciones de datos con tipado seguro mediante validación Zod. Úsala al construir blogs, sitios de documentación o aplicaciones Vite + React con mucho contenido para garantizar seguridad de tipos y validación automática de contenido. Abarca todo, desde la configuración del plugin de Vite y compilación MDX hasta la optimización de despliegue y validación de esquemas.

Ver habilidad
polymarket
Meta

Esta habilidad permite a los desarrolladores crear aplicaciones con la plataforma de mercados de predicción Polymarket, incluyendo la integración de API para operaciones y datos de mercado. También proporciona transmisión de datos en tiempo real a través de WebSocket para monitorear operaciones en vivo y actividad del mercado. Úsela para implementar estrategias de trading o crear herramientas que procesen actualizaciones de mercado en tiempo real.

Ver habilidad
creating-opencode-plugins
Meta

Esta habilidad ayuda a los desarrolladores a crear complementos de OpenCode que se conectan a más de 25 tipos de eventos, como comandos, archivos y operaciones LSP. Proporciona la estructura del complemento, las especificaciones de la API de eventos y los patrones de implementación para módulos en JavaScript/TypeScript. Úsala cuando necesites interceptar, monitorear o extender el ciclo de vida del asistente de IA de OpenCode con lógica personalizada basada en eventos.

Ver habilidad
sglang
Meta

SGLang es un framework de alto rendimiento para el servicio de LLM que se especializa en generación rápida y estructurada para JSON, expresiones regulares y flujos de trabajo de agentes utilizando su caché de prefijos RadixAttention. Ofrece una inferencia significativamente más rápida, especialmente para tareas con prefijos repetidos, lo que lo hace ideal para salidas complejas y estructuradas, y conversaciones multiturno. Elige SGLang sobre alternativas como vLLM cuando necesites decodificación restringida o estés construyendo aplicaciones con uso extensivo de prefijos compartidos.

Ver habilidad