agentleFS
tanbopptanbopp/ai-development-framework/.agents/skills/code-quality-gate/SKILL.md

code-quality-gate

Skill1 starsChanged 18 days agoMITView on GitHub

Pre-commit and pre-delivery gate that scans newly generated or modified code for AI failure modes including stubbed functions, silent error handling, unvalidated inputs, and hardcoded secrets. Use before final delivery or git commit.

  • Reads credentials

3 other projects use 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. 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 4

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before final delivery (Phase 7/8) or before running git commit.

    line 11
  2. Very specific:

    Look for throw new Error('Not implemented'), throw new NotImplementedError, TODO / FIXME / XXX placeholders standing in for real behavior, …

    line 17
  3. Very specific:

    Look for empty catch blocks (catch (e) {}, except: pass, ignored returned errors) or catch handlers that swallow failures without logging, …

    line 19
  4. Distinctive:

    Check all trust boundaries (HTTP/API handlers, form submissions, CLI arguments, file path operations, dynamic queries) to verify …

    line 21
  5. Very specific:

    If the AI writes more than 800 lines of code in a single task or PR, it MUST STOP, split the code into smaller logical chunks, or ask the …

    line 26
  6. Distinctive:

    If any item above is found (or the 800 LOC limit is exceeded):

    line 28
  7. Distinctive:

    Do NOT proceed to delivery or git commit.

    line 29

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Code Quality Gate

Trigger

Before final delivery (Phase 7/8) or before running git commit.

Process

Scan every newly generated or modified source file in scope for the following AI failure modes:

  1. Stubbed or unimplemented logic:
    • Look for throw new Error('Not implemented'), throw new NotImplementedError, TODO / FIXME / XXX placeholders standing in for real behavior, empty function bodies, or hardcoded mock return data left in production paths.
  2. Silent error handling:
    • Look for empty catch blocks (catch (e) {}, except: pass, ignored returned errors) or catch handlers that swallow failures without logging, user-facing error states, recovery, or rethrowing.
  3. Unvalidated user inputs:
    • Check all trust boundaries (HTTP/API handlers, form submissions, CLI arguments, file path operations, dynamic queries) to verify schema/type validation, bounds checking, and safe parameterization.
  4. Hardcoded secrets or credentials:
    • Scan for API keys, tokens, passwords, private keys, or connection strings with embedded credentials. All secrets must come from environment variables or a secret manager and never be committed.
  5. The 800 LOC Limit (Strict Rule):
    • Measure total lines of code written or modified in the current task or PR.
    • If the AI writes more than 800 lines of code in a single task or PR, it MUST STOP, split the code into smaller logical chunks, or ask the user to break the task down in docs/tasks/TASKS.md. Never submit massive, unreviewable PRs.

If any item above is found (or the 800 LOC limit is exceeded):

  • Do NOT proceed to delivery or git commit.
  • Fix every finding (or split oversized changes into smaller reviewable tasks/chunks), re-scan, and verify all tests pass before continuing.

Output Contract

A pass/fail scan report listing checked categories, verified diff size (<= 800 LOC per task/PR), file:line findings (if any), and confirmation that all findings were resolved before commit or delivery.

Checklist

  • Zero stubbed or Not implemented production functions
  • Zero silent/empty catch or swallowed error paths
  • All trust-boundary inputs validated
  • Zero hardcoded secrets, tokens, or API keys
  • Single task or PR size stays within The 800 LOC Limit (or is split with user confirmation)
  • Existing unit and E2E tests pass after fixes

Prohibitions

  • Allowing stubbed handlers or empty catch blocks to ship as "temporary".
  • Skipping trust-boundary validation for brevity.
  • Committing .env values or inline credentials.
  • Writing > 800 lines of code in one unsplit task or PR.

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.