agentleFS
OlliTapioOlliTapio/claude_skills/skills/quality-gates/SKILL.md

quality-gates

Skill0 starsChanged 18 days agoMITView on GitHub

Set up a project with automated code-smell and quality gates — git pre-commit (fast) and pre-push (slow) hooks that run format, lint, complexity, duplication, dead-code, type, and test checks. Language-agnostic; detects the stack and wires the idiomatic tools. Use when asked to add quality gates, code-smell detection, linting/complexity checks, or git hooks to a repo.

26 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

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Ensure every language has a tool for each capability.

    line 16
  2. Distinctive:

    Run the pre-commit and pre-push scripts once manually.

    line 51

“Common” is measured: kept by at least 6 in 10 of the 24 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

Quality gates

Deterministic linters catch measurable smells (complexity, duplication, dead code) every commit; LLM review handles semantic ones. Set up the linter tiers below.

1. Detect the stack

Inspect the repo root: package.json → TS/JS, pyproject.toml/setup.cfg → Python, go.mod → Go, Cargo.toml → Rust, etc. A repo may have several. For each, find existing scripts/config before adding anything — reuse them.

2. Fill the capability matrix per language

Ensure every language has a tool for each capability. Enable complexity, duplication, and dead-code explicitly — usually off by default.

CapabilityTS/JSPythonAny language
formatprettierruff formatthe idiomatic formatter
lintoxlintruff (E,F,B,SIM,PL)the idiomatic linter
complexityoxlint complexity ruleruff C901 + PLlinter's cyclomatic/cognitive rule, threshold ~10
duplicationjscpdjscpdjscpd (language-agnostic)
dead codeknipruff F401/vultureunused-export/dead-code tool
typestscmypy/pyright (if used)the type checker
testsvitest/bunpytestthe test runner

For unknown languages, use the community-standard tool rather than inventing config.

3. Split fast vs slow

  • pre-commit (fast, staged files only): format check, lint, complexity, duplication.
  • pre-push (slow, whole repo): type check, tests, dead-code scan.

4. Install versioned git hooks

Copy templates/git-hooks/ (at ../../templates/ from this skill's base directory) into the repo's .githooks/, then point git at it:

mkdir -p .githooks && cp <skill-dir>/../../templates/git-hooks/pre-commit <skill-dir>/../../templates/git-hooks/pre-push .githooks/
chmod +x .githooks/*
git config core.hooksPath .githooks

Edit the two scripts so their command blocks match the tools from step 2. The templates auto-detect TS/Python; add a block per additional language.

5. Add unified scripts and baseline

Wire a check (all tiers) and check:fix entry point in the project's task runner so hooks and humans share one command. Set a baseline (jscpd --threshold, linter --max-warnings) or fix-then-enforce so no gate always fails.

6. Verify

Run the pre-commit and pre-push scripts once manually; confirm they pass on a clean tree and fail on an injected smell.

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.