ワンクリックで
skill-guard-governance
The canonical skill for designing, implementing, testing, and registering a new Guard in defense-in-depth.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
The canonical skill for designing, implementing, testing, and registering a new Guard in defense-in-depth.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Trace import graph + test coverage of files about to be modified and produce an impact report before any code changes are made.
Evaluate the quality of a DSPy integration in DiD — endpoint correctness, graceful degradation, and WARN-NOT-BLOCK contract.
Design, implement, and debug GitHub Actions workflows for DiD's server-side enforcement layer.
Review a PR against DiD's governance contracts — Guard purity, severity correctness, test coverage, and documentation completeness.
Refactor guard code with minimum blast radius — change only what is needed, verify nothing else shifts.
Design adversarial test suites for Guards that prove both positive enforcement and bypass resistance.
| domain | governance |
| name | skill-guard-governance |
| description | The canonical skill for designing, implementing, testing, and registering a new Guard in defense-in-depth. |
| version | 1.0.0 |
| type | specialist |
| role | The Guard Architect |
Role: The Guard Architect
Philosophy: A Guard is a formalized threat model. Before writing code, write the threat.
Design and ship a new Guard that:
These constraints are non-negotiable. Violating any one = the Guard is rejected.
Pure function contract: Guards must NOT perform I/O inside .check().
All file reads, network calls, and enrichment belong in the engine's
pre-pipeline phase. Source: src/core/engine.ts enrichment pattern.
Severity contract:
BLOCK = deterministic violation. Regex match, schema fail, etc. Never probabilistic.WARN = advisory signal. DSPy score, heuristic, soft policy. Always WARN.Tier 0 by default: The core check path (no useDspy, no network) must
work without any external dependencies. Optional enhancements are Tier 1.
Test fixtures before code: The tests/fixtures/<guard-name>/edge_cases.md
file must exist and contain at least 5 adversarial cases BEFORE src/guards/*.ts
is written.
Single responsibility: One guard = one threat category. Do not bundle "hollow artifact" + "wrong ticket" into one guard. Split them.
ls src/guards/) — does one already cover this?STRATEGY.md roadmap — is this scheduled for a future version?tests/fixtures/<guard-name>/edge_cases.mdguardId (kebab-case, e.g., hollow-artifact)defense.config.yml?)ctx.stagedFiles entries trigger the guardIn tests/fixtures/<guard-name>/edge_cases.md, document:
src/guards/<guard-name>.ts
Template structure:
import type { Guard, GuardContext, GuardResult, Finding } from "../core/types.js";
import { Severity } from "../core/types.js";
export const myGuard: Guard = {
id: "my-guard",
name: "Human Readable Name",
description: "One-line: what it catches and why.",
async check(ctx: GuardContext): Promise<GuardResult> {
const start = performance.now();
const findings: Finding[] = [];
const config = ctx.config.guards.myGuard;
for (const relPath of ctx.stagedFiles) {
// Tier 0 deterministic checks here
// Tier 1 (DSPy) checks ONLY if: useDspy=true AND file passed Tier 0
}
return {
guardId: "my-guard",
passed: !findings.some(f => f.severity === Severity.BLOCK),
findings,
durationMs: performance.now() - start,
};
},
};
src/core/engine.ts guard list (follow existing pattern)src/core/types.ts (follow HollowArtifactConfig pattern)src/core/config-loader.tsFile: tests/<guard-name>.test.js
Must cover:
minContentLength etc.)stagedFiles array (no files staged → guard should pass cleanly)fix: message to every BLOCK finding (user-actionable)When this skill is complete, you must have produced:
| File | Status |
|---|---|
tests/fixtures/<guard-name>/edge_cases.md | ✅ Written FIRST |
src/guards/<guard-name>.ts | ✅ Pure, no I/O in check() |
src/core/types.ts — config type added | ✅ |
src/core/engine.ts — guard registered | ✅ |
src/core/config-loader.ts — defaults added | ✅ |
tests/<guard-name>.test.js | ✅ Adversarial coverage |
README.md — guard table updated | ✅ |
CHANGELOG.md — entry added | ✅ |
.check() is acceptable. Writing files, making network calls, or modifying state is not.ctx.*. They must never import engine.ts or call other guards.fix: field on BLOCK findings — Every BLOCK must tell the user exactly how to fix it. "Fix the file" is not a fix.docs/dev-guide/fail-fast-policy.md — Engine behavior contractsrc/core/types.ts — Guard, Finding, Severity interfacessrc/guards/hollow-artifact.ts — Reference implementationtests/hollow-artifact-adversarial.test.js — Reference test pattern