output-guard
Skill0 starsChanged 6 months agoMITView on GitHub
Self-review gate that validates generated code for correctness, security, and style before presenting it.
In this repository13 other files it gives its agents.
- clean-commitSkill
- context-budgetSkill
- craft-principlesSkill
- debug-circuitSkill
- meeting-driverSkill
- memory-curatorSkill
- plan-firstSkill
- pm-docsSkill
- ship-cycleSkill
- simplify-codeSkill
- sprint-flowSkill
- task-resumeSkill
- verify-buildSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Every piece of generated code passes through a validation gate before being presented or written to disk.
- Distinctive: line 18
Before presenting code to the user or writing it to a file, run these checks:
- Distinctive: line 24
Types consistent: Do function signatures match their usage?
- Distinctive: line 26
Return paths complete: Do all code paths return the expected type?
- Distinctive: line 30
No hardcoded secrets: No API keys, passwords, tokens, or connection strings in code
- Distinctive: line 38
No unnecessary complexity: If a simpler approach exists, flag it
- Distinctive: line 40
Meaningful names: No single-letter variables outside of loop counters and lambdas
- Distinctive: line 44
When a check fails, do not silently fix it.
≈ “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
Output Guard
Every piece of generated code passes through a validation gate before being presented or written to disk.
Validation Checks
Before presenting code to the user or writing it to a file, run these checks:
Correctness
- Syntax valid: Would this code parse without errors?
- Imports present: Are all referenced modules imported?
- Types consistent: Do function signatures match their usage?
- No undefined references: Are all variables and functions defined before use?
- Return paths complete: Do all code paths return the expected type?
Security
- No hardcoded secrets: No API keys, passwords, tokens, or connection strings in code
- Input validation: User input is sanitized before use in queries, commands, or HTML
- No dangerous functions: Flag use of
eval(),exec(),dangerouslySetInnerHTML, raw SQL string concatenation - Dependency trust: New dependencies should be well-maintained and from known publishers
Style
- Consistent with project: Match existing indentation, naming conventions, and file structure
- No unnecessary complexity: If a simpler approach exists, flag it
- Reasonable function length: Functions over 50 lines get flagged for splitting
- Meaningful names: No single-letter variables outside of loop counters and lambdas
How to Report
When a check fails, do not silently fix it. Report it:
Output Guard:
[WARN] Function `processOrder` is 73 lines — consider splitting
[FAIL] Hardcoded database URL on line 12 — move to environment variable
[PASS] All imports present
[PASS] No security issues detected
Fixing FAIL items before writing...Fix FAIL items automatically. WARN items are reported to the user for their judgment.
When to Skip
- Pseudocode or explanatory snippets (not meant to run)
- Single-line examples in conversation
- Code the user explicitly asked not to validate ("just give me the raw output")
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.

