agentleFS
TalonT-OrgTalonT-Org/AutoSkillit/.claude/skills/design-guards/SKILL.md

design-guards

Skill5 starsChanged 6 months agoMITView on GitHub

Investigate a bug pattern audit report and design architectural guards (tests, contracts, structural changes) that provide immunity to each identified pattern. Use when user says "design guards", "design defenses", or wants architectural solutions for bug patterns.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After /audit-bugs produces a bug pattern report

    line 19
  2. Very specific:

    Create files outside temp/design-guards/ directory

    line 32
  3. Distinctive:

    Use subagents for parallel codebase exploration

    line 35
  4. Very specific:

    All output goes under temp/design-guards/ (create if needed)

    line 38
  5. Distinctive:

    Do not change any code

    line 41
  6. Distinctive:

    Read the input report and extract each pattern:

    line 47
  7. Very specific:

    Ensure temp/design-guards/ exists (mkdir -p).

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Design Guards Skill

Take a bug pattern audit report and design architectural guards that make each pattern structurally impossible or instantly caught. This is a multi-pattern analysis driven by a pattern report rather than a single bug investigation.

When to Use

  • After /audit-bugs produces a bug pattern report
  • User says "design guards", "design defenses", or "guard against these patterns"
  • User wants architectural immunity for a set of identified bug patterns

Arguments

Path to a bug pattern audit report (typically under temp/audit-bugs/). If not specified, use the most recent temp/audit-bugs/bug_pattern_audit_*.md.

Critical Constraints

NEVER:

  • Modify any source code files
  • Propose bandaid fixes or direct-only patches
  • Create files outside temp/design-guards/ directory

ALWAYS:

  • Use subagents for parallel codebase exploration
  • Focus on structural immunity over one-off fixes
  • Each guard must be concrete and testable
  • All output goes under temp/design-guards/ (create if needed)
  • Final report: temp/design-guards/defense_guards_{YYYY-MM-DD_HHMMSS}.md
  • Subagents must NOT create their own files - they return findings in their response text only
  • Do not change any code

Workflow

Step 1: Parse the Bug Pattern Report

Read the input report and extract each pattern:

  • Pattern name and description
  • Affected components and sessions
  • The root architectural gap identified

Step 2: Investigate Each Pattern in Parallel

For each pattern (or group of related patterns), launch subagents to explore:

Current State

  • Find all current instances of the pattern in the codebase (not just the ones that already caused bugs)
  • Map which components are vulnerable to this pattern today

Existing Guards

  • What tests, contracts, or validation already exists for this area?
  • Why did existing guards miss these bugs?

Architectural Solutions

  • How do well-designed parts of the codebase prevent similar issues?
  • What structural pattern would make this class of bug impossible?
  • What's the minimum change that provides maximum coverage?

Step 3: Design Guards for Each Pattern

For each pattern, produce:

  1. Detection scan - A concrete grep/search command or pattern that finds latent instances today
  2. Contract test - A test that fails if the pattern re-emerges (description of what it asserts, not code)
  3. Structural guard - An architectural change that makes the pattern impossible by construction (if applicable)
  4. Standard recommendation - Whether this should become an enforced standard in /audit-defense-standards

Prioritize guards by:

  • Coverage: How many bug instances would this single guard have prevented?
  • Automation: Can it be enforced in CI/pre-commit, or does it require manual audit?
  • Cost: How invasive is the change?

Step 4: Write Report

Ensure temp/design-guards/ exists (mkdir -p).

Save to: temp/design-guards/defense_guards_{YYYY-MM-DD_HHMMSS}.md

# Defense Guards: {Report Title}

**Date:** {today}
**Source Report:** {path to bug audit report}
**Patterns Addressed:** {count}

## Summary
{Which patterns get guards, expected coverage, recommended standards}

## Guard N: {Pattern Name}

**Addresses Pattern:** {name} ({X} of {Y} historical bugs)

### Current Exposure
{How many latent instances exist in the codebase today}

### Detection Scan
{Runnable grep/search commands}

### Contract Test
{What the test asserts, where it belongs}

### Structural Guard
{Architectural change that prevents by construction}

### Standard Recommendation
{YES/NO - should this become an audit-defense-standards entry?}
{If YES: one-sentence rule statement}

---

## Standards to Add
{List of guards recommended as permanent standards for audit-defense-standards, with rule statements}

Step 5: Terminal Summary

Output: guard count, coverage stats, how many standards recommended, and report location.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.