Skills Agentes

Testing

Framework de validación de skills más inteligencia diaria de salud y regresiones de la suite de tests: valida conformidad y clasifica fallos por tandas.

Solicitasearchlist_pages
Estrellas
28.9k

en todo el repo

Actividad
56

0–100, la ruta de este skill

Actualizado
el mes pasado

último commit aquí

Commits
1

últimos 90 días

Contexto
2k tok

79 tok en reposo

Paquete
1 archivo

8 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add garrytan/gbrain --skill testing --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Valida que cada skill tenga SKILL.md con frontmatter válido, secciones requeridas y cobertura en manifest.json y RESOLVER.md
  • Ejecuta la suite de tests del proyecto en niveles (unit, evals, integration, system health)
  • Clasifica cada fallo como REGRESSION, STALE, FLAKE, NEW o INFRA usando git log y análisis de diffs
  • Genera un reporte con formato fijo y decide qué fallos puede auto-arreglar y cuáles debe escalar
  • Guarda historial de resultados en ~/.gbrain/test-state.json para seguimiento de tendencias y detección de flakes

Úsalo cuando

  • Se dispara el cron diario de tests
  • El usuario pregunta 'run the tests', 'how are the tests' o 'what's broken'
  • Después de cambios de código significativos o de un reinicio de contenedor
  • Se quiere validar que todos los skills cumplen el estándar de conformidad de gbrain

No lo uses cuando

    Qué lo activa

    Di cualquiera de estas frases y el agente debería cargar este skill.

    • Corre los tests del proyecto
    • ¿Cómo están los tests hoy?
    • Valida que todos los skills tengan su SKILL.md correcto
    • ¿Qué está roto en la suite de tests?

    SKILL.md

    En inglés

    Testing Skill — Validation + Daily Health & Regression Intelligence

    Convention: see conventions/quality.md for the test-before-bulk pattern; this skill enforces it across the project's own test suite.

    Two modes

    This skill has two related but distinct modes:

    1. Skill conformance validation — gbrain's own conformance bar (the original 1.0 scope). Validates every skill has SKILL.md with frontmatter, every reference exists, manifest + resolver coverage round-trips.

    2. Project test-suite health (v0.25.1 extension) — runs the project's tiered test suite and produces a regression-classified report. Used by daily cron, container-restart bootstrap, and "how are the tests" prompts.

    Pick the mode by trigger.

    Mode 1: Skill conformance validation

    Contract

    This mode guarantees:

    • Every skill directory has a SKILL.md file
    • Every SKILL.md has valid YAML frontmatter (name, description)
    • Every SKILL.md has required sections per test/skills-conformance.test.ts
    • skills/manifest.json lists every skill directory
    • skills/RESOLVER.md references every skill in the manifest
    • openclaw.plugin.json skills[] round-trips with both
    • openclaw.plugin.json keeps OpenClaw install-required native plugin fields (id, object configSchema, and contracts.contextEngines when applicable)
    • No MECE violations (duplicate triggers across skills)

    Phases

    1. Walk skills directory. List all subdirs containing SKILL.md.
    2. Validate frontmatter. Parse YAML, check required fields.
    3. Validate sections. Check for the required headings.
    4. Check manifest. Every skill dir must be in manifest.json.
    5. Check resolver. Every manifest skill must have a RESOLVER row.
    6. Check round-trip. RESOLVER trigger ↔ frontmatter triggers.
    7. Report results.

    Automation

    bun test test/skills-conformance.test.ts test/resolver.test.ts test/openclaw-plugin-manifest.test.ts
    

    The CI-gated check is the package.json test script.

    Output format

    Skill Validation Report
    ========================
    Skills found:        N
    Conformance:         N/N pass
    Manifest coverage:   N/N
    Resolver coverage:   N/N
    Round-trip:          N/N
    MECE violations:     N
    
    Issues:
    - <skill>: <issue>
    

    Mode 2: Project test-suite health (v0.25.1)

    When to use

    • Daily test cron fires
    • User asks "run the tests" / "how are the tests" / "what's broken"
    • After significant code changes (often via cross-modal-review)
    • After container restart (bootstrap)
    • When something seems off and you want to verify system health

    Test tiers

    Tier What it runs Wall time Gates
    Unit bun test (deterministic, zero external calls) <2s Every commit
    Evals LLM-judge or quality evals ~60s Daily
    Integration E2E tests against real Postgres ~5m Pre-ship + nightly
    System health Disk / memory / CPU / service liveness <10s Daily

    Daily run protocol

    When the cron fires (or the user asks), do ALL of this:

    1. Run unit tests

    bun test 2>&1
    

    Parse: total passed, total failed, total skipped, file-level results.

    2. Run evals (if the project has an evals config)

    # Adapt to the project's eval config
    bun test --filter eval 2>&1
    

    Parse: same format. Note any flakes (tests that fail due to API timeouts, not code bugs).

    3. Run system health checks

    • Disk / memory / CPU
    • gbrain: gbrain doctor --fast --json
    • Database connection (if applicable)
    • Critical files exist (CLAUDE.md, AGENTS.md, etc.)

    4. Git diff analysis (CRITICAL — regression intelligence)

    # What changed since last test run?
    git log --oneline --since="24 hours ago"
    

    For each failing test:

    1. Check if the test itself was modified recently (test change, not regression).
    2. Check if the code it tests was modified recently (possible regression).
    3. Check if it's a known flake (API timeout, service down).
    4. Check if a dependency was updated (gbrain, bun, etc.).

    5. Classify each failure

    Classification Marker Action
    REGRESSION — code changed, test broke 🔴 Flag with the commit that broke it
    STALE — test expects old behavior; code is correct 🟡 Fix the test, not the code
    FLAKE — API timeout, service down, LLM variance ⚠️ Note, don't alarm; retry once
    NEW — test was just added and isn't passing yet 🟢 Check if intentional
    INFRA — container restart wiped state 🛠 Run bootstrap, retest

    6. Report format

    🧪 Daily Tests — YYYY-MM-DD
    
    Unit:   X/Y passed (Z skipped)
    Evals:  X/Y passed
    System: [health summary]
    
    REGRESSIONS:
      🔴 <test-name>: broke by commit <sha> "<commit message>"
    
    STALE TESTS:
      🟡 <test-name>: expects X but code now does Y (commit <sha>)
    
    FLAKES:
      ⚠️ <test-name>: timeout (retry passed)
    
    ✅ ALL CLEAR  (when applicable)
    

    7. Auto-fix protocol

    DO auto-fix:

    • Test expects an old file path after a rename → update the test
    • Test expects an old version string → update
    • Test expects a file that was intentionally deleted → remove the test
    • Import path broke because file moved → fix the import

    DO NOT auto-fix:

    • Test expects behavior A but code now does B → ASK first. Maybe the test is right and the code has a bug.
    • Security test failing → ALWAYS escalate, never auto-fix.
    • Test was skipped with a TODO → don't un-skip without understanding why.

    When uncertain: check the commit message that changed the code, check if there's a related PR or conversation, ask the user if still unclear.

    State (regression history)

    Track results in ~/.gbrain/test-state.json for trend tracking:

    {
      "lastRun": "2026-04-16T13:37:00Z",
      "unit": { "passed": 1262, "failed": 31, "skipped": 8 },
      "evals": { "passed": 17, "failed": 0 },
      "system": { "doctor": "ok", "gbrain": "0.25.1" },
      "failureHistory": [
        { "test": "<name>", "since": "2026-04-14", "classification": "stale" }
      ]
    }
    

    This enables:

    • Trend tracking (are we getting better or worse?)
    • Flake detection (same test fails intermittently)
    • Regression velocity (how fast do we break things after changes?)

    Anti-Patterns

    • ❌ Skipping conformance validation after adding a new skill
    • ❌ Adding skills to manifest.json without adding to RESOLVER.md
    • ❌ Treating every red test as a regression. Classify first; many are stale or flaky.
    • ❌ Auto-un-skipping a test without understanding why it was skipped
    • ❌ Auto-"fixing" a security test failure
    • ❌ Reporting "all clear" without actually running system health checks

    Contract

    This skill guarantees:

    • Routing matches the canonical triggers in the frontmatter.
    • Output written under the directories listed in writes_to: (when applicable).
    • Conventions referenced (quality.md, brain-first.md, _brain-filing-rules.md) are followed.
    • Privacy contract preserved: no real names, no fork-specific filesystem path literals, no upstream-fork references.

    The full behavior contract is documented in the body sections above; this section exists for the conformance test.

    Output Format

    The skill's output shape is documented inline in the body sections above (see "Output", "Brain page format", or equivalent). The literal section header here exists for the conformance test (test/skills-conformance.test.ts).

    Reproducido de garrytan/gbrain bajo licencia MIT. Leer esta página en markdown.

    Archivos

    1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

    Antes de instalar

    Requiere bun test configurado, y opcionalmente gbrain doctor y una base de datos Postgres para tests de integración.

    Necesita en el PATH:bungit

    Detalles

    Creador
    garrytan
    Categoría
    Testing y QA
    Licencia
    MIT
    Recursos incluidos
    Solo SKILL.md
    Repositorio
    garrytan/gbrain
    Código fuente
    Ver SKILL.md

    Etiquetas

    Más de garrytan/gbrain

    Este repo incluye 75 skills. Si instalas uno, normalmente ya tienes los demás.

    Setup

    28.9k

    Configura GBrain con auto-aprovisionamiento de Supabase o PGLite, inyección en AGENTS.md y primera importación.

    Costo de contexto al activarse
    7.4k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 4 días
    bases de datos

    Chequeos de salud del brain: aplicación de back-links, auditoría de citas, validación de filing, detección de info obsoleta, páginas huérfanas y benchmarks.

    Costo de contexto al activarse
    5k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 4 días
    productividad

    Migra un brain de gbrain-base a la taxonomía de 14 tipos canónicos de gbrain-base-v2 usando gbrain onboard --check y el handler Minion unify-types.

    Costo de contexto al activarse
    3.2k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 5 días
    bases de datos

    Cuándo y qué recuperar: abre la página del brain de una entidad relevante antes de responder desde memoria.

    Costo de contexto al activarse
    740 tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 1 hora
    productividad

    Operaciones del brain: búsqueda primero, ciclo leer-enriquecer-escribir, atribución de fuentes, enriquecimiento ambiental y back-linking. Leer antes de cualquier interacción con el brain.

    Costo de contexto al activarse
    2.6k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 días
    productividad

    Importa exports de ChatGPT, Claude y Perplexity y transcripciones de sesiones como páginas fechadas en conversations/, valida y extrae hechos, y mantiene el archivo sin huecos con detección y backfill.

    Costo de contexto al activarse
    5k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 4 días
    productividad

    Skills relacionados

    Control de calidad mediante un segundo modelo: hace que otro modelo revise el trabajo antes de darlo por bueno, con enrutamiento de negativas y opción de derivar a Codex para revisión de diffs.

    Costo de contexto al activarse
    1.7k tok
    Tamaño del paquete
    1 archivo
    Última actualización
    hace 3 meses
    testing qa

    Verificación sistemática, afirmación por afirmación, de cualquier contenido antes de publicarlo, basada en estándares de fact-checking profesional (The New Yorker, ProPublica, IFCN).

    Costo de contexto al activarse
    5.1k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 9 días
    testing qa

    Redacta un eval para una skill existente a partir de su historial real de uso (no de su spec), etiqueta casos como SPEC-DERIVED o HISTORY-IMPLIED y lo deja pendiente de aprobación humana.

    Costo de contexto al activarse
    3.1k tok
    Tamaño del paquete
    2 archivos
    Última actualización
    hace 9 días
    testing qa