Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.
The English summary is being prepared. Showing the original description.
Use when validation needs entry, business-logic, environment, and instrumentation guards so a bad value cannot reach the failure point — turns a local bug fix into a structural one.
The English summary is being prepared. Showing the original description.
See how to installReview the instructions the agent will receive before you install.
Validate at every layer the value passes through. Fixing the bug at one layer is locally sufficient and globally fragile — the next refactor, code path, mock, or platform edge case will rediscover it. Four-layer validation makes the bug structurally impossible.
Do NOT use when:
laravel-validation.Reject obviously invalid input at the API / route / command boundary. In Laravel this is FormRequest rules; in Express a zod-validated middleware; in pure services it is the public method on the service.
public function createProject(string $name, string $workingDirectory): Project
{
if (trim($workingDirectory) === '') {
throw new InvalidArgumentException('workingDirectory cannot be empty');
}
if (! is_dir($workingDirectory)) {
throw new InvalidArgumentException("workingDirectory does not exist: {$workingDirectory}");
}
if (! is_writable($workingDirectory)) {
throw new InvalidArgumentException("workingDirectory is not writable: {$workingDirectory}");
}
// ... proceed
}
Verify the value still makes sense for the operation that consumes it. Different code paths can reach the same internal — re-check rather than trust the caller.
public function initializeWorkspace(string $projectDir, string $sessionId): Workspace
{
if ($projectDir === '') {
throw new RuntimeException('projectDir required for workspace initialization');
}
// ... proceed
}
Refuse dangerous operations in the wrong context — most often: running a destructive command outside a test temp dir while the test suite is active.
public function gitInit(string $directory): void
{
if (app()->environment('testing')) {
$normalized = realpath($directory) ?: $directory;
$tmp = realpath(sys_get_temp_dir());
if ($tmp === false || ! str_starts_with($normalized, $tmp)) {
throw new RuntimeException("refusing git init outside tmp during tests: {$directory}");
}
}
// ... proceed
}
Capture context for forensics so the next failure surfaces why, not just that. Log only when the call is about to hit an irreversible side effect.
public function gitInit(string $directory): void
{
Log::debug('about to git init', [
'directory' => $directory,
'cwd' => getcwd(),
'trace' => (new Exception)->getTraceAsString(),
]);
// ... proceed
}
Try to bypass Layer 1 (call the internal directly) and confirm Layer 2 catches it. Mock the production guard and confirm Layer 3 still refuses. The pattern only earns its name when each layer is independently provable.
BEFORE adding the 5th guard:
STOP — re-check the data flow.
IF the value crosses ≤ 1 module boundary:
Use a single boundary check + a value-object invariant. Two layers max.
IF every layer would re-implement the same predicate:
Hoist the predicate into a value object / type and inject. One check is enough.
Layers are for distinct concerns: input shape vs operation invariant
vs environment risk vs forensic visibility. Same concern repeated is duplication, not depth.
Log::debug.agents/settings/contexts/skills-provenance.yml (entry: defense-in-depth).non-destructive-by-default, verify-before-complete, skill-quality.No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.
The English summary is being prepared. Showing the original description.
Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.
The English summary is being prepared. Showing the original description.
Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.
The English summary is being prepared. Showing the original description.
Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.
The English summary is being prepared. Showing the original description.
Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.
The English summary is being prepared. Showing the original description.
Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.
The English summary is being prepared. Showing the original description.