skill-test-architect
Skill4 starsChanged 7 months agoMITView on GitHub
Design adversarial test suites for Guards that prove both positive enforcement and bypass resistance.
In this repository16 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skill-ai-dspy-validatorSkill
- Bootstrap AgentSkill
- CreatorSkill
- Deep ResearchSkill
- skill-devops-github-actionsSkill
- skill-guard-governanceSkill
- skill-impact-predictorSkill
- skill-review-codeSkill
- Self ReflectionSkill
- skill-surgical-refactorerSkill
- skill-threat-modeling-expertSkill
- [Skill Name]Skill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 31
Real files over mocks: Use os.tmpdir() + real file writes.
- Distinctive: line 34
Config coverage: Test non-default config values (custom regex, custom min length, etc.).
- Very specific: line 35
Empty stagedFiles: Always test stagedFiles: [] → guard must return passed: true with zero findings.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SKILL: skill-test-architect
Identity
Role: The Adversarial Test Architect
Philosophy: A test that only proves success is half a test. The other half proves the guard cannot be tricked.
Mission
Produce a test suite for a DiD Guard that:
- Proves the guard BLOCKS what it claims to block
- Proves the guard does NOT block what it should pass (false positive prevention)
- Proves the guard survives adversarial bypass attempts
- Uses real filesystem fixtures, not mocked
fscalls
Hard Gates
- Real files over mocks: Use
os.tmpdir()+ real file writes. Mockingfshides byte-level edge cases (BOM, encoding, line endings). - Fixtures before assertions:
edge_cases.mdmust be populated before the test file is written. - Adversarial cases are mandatory: At minimum 1 bypass attempt per guard.
- Config coverage: Test non-default config values (custom regex, custom min length, etc.).
- Empty stagedFiles: Always test
stagedFiles: []→ guard must returnpassed: truewith zero findings.
Workflow
Step 1: Read the fixtures
Load tests/fixtures/<guard-name>/edge_cases.md — this is the source of truth.
Step 2: Structure the test file
// tests/<guard-name>.test.js
import { describe, it, beforeEach, afterEach } from "node:test";
import assert from "node:assert/strict";
import os from "node:os";
import fs from "node:fs";
import path from "node:path";
// Pattern: write temp file → run guard → assert findingsStep 3: Test categories (in order)
1. Happy path — clean files → guard passes, zero findings
2. BLOCK cases — hollow/invalid files → guard emits BLOCK finding
3. WARN cases — borderline files → guard emits WARN, does not BLOCK
4. Bypass attempts — adversarial inputs designed to evade the guard
5. Config overrides — non-default config changes behavior correctly
6. Edge: empty — stagedFiles=[] → passes with zero findings
7. Edge: missing — staged file doesn't exist on disk → guard skips gracefullyStep 4: Assertion pattern for findings
const blockFindings = result.findings.filter(f => f.severity === "block");
assert.equal(blockFindings.length, 1, "Expected exactly one BLOCK finding");
assert.ok(result.findings[0].fix, "BLOCK finding must include a fix message");
assert.ok(result.findings[0].message.includes("hollow"), "Message must name the violation");Step 5: DSPy fallback tests (if guard has useDspy)
// Simulate DSPy down: useDspy=true but no server → should still enforce Tier 0
// See: tests/hollow-artifact-dspy-fallback.test.js as referenceOutput Contract
| File | Required content |
tests/<guard-name>.test.js | All 7 categories above |
tests/fixtures/<guard-name>/edge_cases.md | Annotated with expected outcomes |
| Coverage contribution | New guard tests must not drop coverage below the current gate |
Anti-Patterns
- Mocking
fs.existsSync— Hides path-resolution bugs. Use real tempdir files. - Only testing BLOCK — A guard with 100% BLOCK-case coverage and 0% pass-case coverage will produce false positives in production.
- Hardcoded absolute paths — Test fixtures must use
path.join(tmpDir, 'file.md'), never hardcoded paths. - One assertion per test — Prefer grouped assertions that validate the full finding shape (guardId, severity, message, fix).
- Ignoring
durationMs— Not a hard assertion, but log it. Performance regressions are real.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

