brain-ingest-gate
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
Skill validation framework PLUS daily test-suite health and regression intelligence. Validates skill conformance (frontmatter, manifest coverage, resolver coverage). Runs the project test suite in tiered phases (unit / evals / integration / system health), classifies failures,
$ npx -y skills add garrytan/gbrain --skill testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Skill validation framework PLUS daily test-suite health and regression intelligence. Validates skill conformance (frontmatter, manifest coverage, resolver coverage). Runs the project test suite in tiered phases (unit / evals / integration / system health), classifies failures,
name: testing version: 1.1.0 description: | Skill validation framework PLUS daily test-suite health and regression intelligence. Validates skill conformance (frontmatter, manifest coverage, resolver coverage). Runs the project test suite in tiered phases (unit / evals / integration / system health), classifies failures, and produces a regression-aware report. triggers: - "validate skills" - "test skills" - "skill health check" - "run conformance tests" - "run the tests" - "how are the tests" - "what's broken" - "daily test run" tools: - search - list_pages mutating: false
> **Convention:** see [conventions/quality.md](../conventions/quality.md) for > the test-before-bulk pattern; this skill enforces it across the project's > own test suite.
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.
This mode guarantees:
`test/skills-conformance.test.ts`
(`id`, object `configSchema`, and `contracts.contextEngines` when applicable)
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.**
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.
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>
| 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 |
When the cron fires (or the user asks), do ALL of this:
bun test 2>&1
Parse: total passed, total failed, total skipped, file-level results.
# 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).
# 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.).
| 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 |
🧪 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)
**DO auto-fix:**
**DO NOT auto-fix:**
Give the agent you already use a memory you control. GBrain stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across your agents.
Repo: garrytan/gbrain
Pre-write quality gate for content entering the brain. No raw copies: a bare cp/mv into the brain repo is a bug. Before any new page lands, resolve named…
When you report a brain page to the user — created, edited, committed, or relayed from a subagent — a working link is part of the deliverable, in the SAME…
Brain knowledge base operations. The core read/write cycle: brain-first lookup, read-enrich-write loop, source attribution, ambient enrichment, back-linking.…
Deduplicate and synthesize raw concept stubs into a tiered intellectual map (T1 Canon to T4 Riff), tracing idea evolution across sources over time. Transforms…
Token-hygiene audit of the always-loaded context stack — CLAUDE.md, AGENTS.md, auto-memory MEMORY.md, and the bootstrap-rendered identity files (SOUL.md,…
When the user corrects a factual error, root-cause it immediately. Don't just note the correction — trace the error to its source, fix the source, and prevent…