agentleFS
ProjectWajaProjectWaja/claude-skillcraft/skills/output-guard/SKILL.md

output-guard

Skill0 starsChanged 6 months agoMITView on GitHub

Self-review gate that validates generated code for correctness, security, and style before presenting it.

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
  1. Distinctive:

    Every piece of generated code passes through a validation gate before being presented or written to disk.

    line 14
  2. Distinctive:

    Before presenting code to the user or writing it to a file, run these checks:

    line 18
  3. Distinctive:

    Types consistent: Do function signatures match their usage?

    line 24
  4. Distinctive:

    Return paths complete: Do all code paths return the expected type?

    line 26
  5. Distinctive:

    No hardcoded secrets: No API keys, passwords, tokens, or connection strings in code

    line 30
  6. Distinctive:

    No unnecessary complexity: If a simpler approach exists, flag it

    line 38
  7. Distinctive:

    Meaningful names: No single-letter variables outside of loop counters and lambdas

    line 40
  8. Distinctive:

    When a check fails, do not silently fix it.

    line 44

≈ “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

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")

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.