audit-defense-standards
Skill5 starsChanged 6 months agoMITView on GitHub
Audit the codebase against defense standards derived from historical bug patterns. Standards accumulate over time as new patterns are discovered via audit-bugs and design-guards. Use when user says "audit defenses", "audit defense standards", "check defenses", or "defense audit".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Trecek/useful-claude-skillsword for word, first seen Mar 26, 2026
Other versions1 project uses a version of this.
Word for word · 1
- Trecek/useful-claude-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- audit-archSkill
- audit-bugsSkill
- audit-cohesionSkill
- audit-testsSkill
- chart-courseSkill
- check-bearingSkill
- design-guardsSkill
- elaborate-phaseSkill
- id-slopSkill
- make-arch-diagSkill
- make-reqSkill
- make-scenariosSkill
- promote-to-mainSkill
- render-recipeSkill
- review-promotionSkill
- update-architectureSkill
- update-reqsSkill
- update-specsSkill
- validate-auditSkill
- verify-diagSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 11 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
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
- Distinctive: line 23
After major refactors to verify guards still hold
- Distinctive: line 29
Update an existing report - always generate new
- Distinctive: line 32
Use subagents for parallel exploration (one per standard or group)
- Very specific: line 33
All output goes under temp/audit-defense-standards/ (create if needed)
- Very specific: line 57
Check that boundary-crossing functions use typed parameters, not Dict[str, Any] or unvalidated strings
- Very specific: line 58
Verify no mutation of caller's data (.pop() on function parameters)
- Distinctive: line 59
Look for direct external input consumption without schema validation
- Distinctive: line 67
Rule: When error/failure data passes through transformations or wrappers, the error message/context must be explicitly preserved.
- Distinctive: line 71
Verify all error factory methods preserve error messages when wrapping
- Distinctive: line 73
Check that error logs include actionable context (not just "An error occurred")
- Distinctive: line 85
Check that validation happens before business logic operates on the data
- Distinctive: line 86
Verify validation errors propagate (not swallowed or logged-only)
- Distinctive: line 87
Look for late validation (only at save/persist) that allows invalid state in memory
- Distinctive: line 100
Add the approved standards to this file following the format below
- Very specific: line 123
Ensure temp/audit-defense-standards/ exists (mkdir -p)
≈ “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.
Files
Defense Standards Audit Skill
Audit the codebase against defense standards derived from historical bug pattern analysis. Each standard represents an architectural lesson learned from real bugs - a guard that prevents an entire class of bugs, not just one instance.
Standards are added here when /design-guards recommends them and the user approves.
When to Use
- User says "audit defenses", "audit defense standards", "check defenses"
- As a periodic health check to catch regressions
- After major refactors to verify guards still hold
Critical Constraints
NEVER:
- Modify any source code files
- Update an existing report - always generate new
ALWAYS:
- Use subagents for parallel exploration (one per standard or group)
- All output goes under
temp/audit-defense-standards/(create if needed) - Final report:
temp/audit-defense-standards/defense_audit_{YYYY-MM-DD_HHMMSS}.md - Subagents must NOT create their own files - they return findings in their response text only
- Provide file paths and line numbers for violations
- Categorize by severity
Defense Standards Template
This skill requires project-specific defense standards. Define them in this section following the format below.
Example Defense Standards
The following examples show common patterns applicable to many codebases. Replace these with project-specific standards derived from your bug pattern analysis.
DS-1: Typed Boundaries Over Raw Data Access
Rule: Data crossing component boundaries must pass through typed accessors or validation. No raw dict.get() or unvalidated external input at boundary crossings.
Audit Strategy:
- Find raw dict/JSON access on data crossing component boundaries
- Check that boundary-crossing functions use typed parameters, not
Dict[str, Any]or unvalidated strings - Verify no mutation of caller's data (
.pop()on function parameters) - Look for direct external input consumption without schema validation
Severity: HIGH
DS-2: Error Context Preservation
Rule: When error/failure data passes through transformations or wrappers, the error message/context must be explicitly preserved. Broad exception handlers must not swallow programmer errors.
Audit Strategy:
- Trace error context through transformation chains
- Verify all error factory methods preserve error messages when wrapping
- Find
except Exceptionandexcept BaseExceptionhandlers; verify each is narrowed or justified - Check that error logs include actionable context (not just "An error occurred")
Severity: HIGH
DS-3: Validation at Construction Time
Rule: Domain objects must be validated at construction time, not only at persistence boundaries. Direct constructors must not bypass validators.
Audit Strategy:
- Find direct constructor calls for domain models; verify validators fire
- Check that validation happens before business logic operates on the data
- Verify validation errors propagate (not swallowed or logged-only)
- Look for late validation (only at save/persist) that allows invalid state in memory
Severity: HIGH
Adding Project-Specific Standards
Defense standards come from the /design-guards pipeline:
/audit-bugsidentifies recurring patterns/design-guardsinvestigates solutions and recommends standards- User approves which recommendations become permanent standards
- Add the approved standards to this file following the format below
Standard format:
### DS-N: {Short Name}
**Rule:** {One-sentence rule statement}
**Audit Strategy:**
{Concrete steps subagents should take to check compliance}
**Severity:** {CRITICAL / HIGH / MEDIUM / LOW}Before first use: Replace the example standards above with your project's actual defense standards, or keep them as a starting point and add project-specific ones as they're discovered.
Audit Workflow
- Launch parallel subagents - one per standard or group of related standards
- Each subagent: runs the audit strategy, reports violations with file paths and line numbers
- Consolidate findings by standard and severity
- Ensure
temp/audit-defense-standards/exists (mkdir -p) - Write report to
temp/audit-defense-standards/defense_audit_{YYYY-MM-DD_HHMMSS}.md - Output summary to terminal: violation count per standard, total by severity
Report Structure
# Defense Standards Audit
**Date:** {today}
**Standards Checked:** {count}
## Summary
| Standard | Violations | Severity |
|----------|-----------|----------|
| DS-1: Typed Boundaries | X | HIGH |
| DS-2: Error Context | X | HIGH |
| ... | ... | ... |
## DS-N: {Standard Name}
### Violations
- {file}:{line} - {description of violation}
### Compliant Patterns Found
{Brief note on good patterns found, if any}Severity Guidelines
CRITICAL: Violations that can cause silent data corruption or unrecoverable state HIGH: Violations that cause crashes, validation bypass, or error masking MEDIUM: Violations that cause incorrect behavior in edge cases LOW: Violations that affect code quality but not correctness
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.

