quality-gates
Skill1 starsChanged 24 days agoMITView on GitHub
Set up or audit pre-commit hooks and CI quality gates for a TypeScript or Python repo. Covers format, lint and import order (Biome / Ruff), strict type checking (tsc / mypy), tests with coverage floors (Vitest / pytest-cov), per-function complexity (Biome and cccc / Ruff and complexipy), file maintainability (FTA), duplication (jscpd), dead code and unused dependencies (knip / vulture and deptry), git hooks (husky + lint-staged / pre-commit) and a GitHub Actions verify workflow. Use when asked to add linting, formatting, type checking, tests, coverage, static checks, quality gates, pre-commit hooks or CI to a TS/JS or Python project, to bring a repo up to the same standard as another, or when one of these gates fails and needs fixing.
26 other projects use a version of this.
Adopted by
Most recently taken up by
- cormacc/dotagentstheir own version, first seen Nov 8, 2026
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- mxrsv/agents-skillstheir own version, first seen Nov 1, 2026
- NoobyGains/godmodetheir own version, first seen Nov 1, 2026
- rubenmarcus/agent-skillstheir own version, first seen Nov 1, 2026
- OpenxIntelligence/Coding-Agent-Skillstheir own version, first seen Nov 1, 2026
Used with
Projects with it also use plan.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
BlockSkillplan
Draft a TDD, PRD, or lightweight plan in the conversation without committing it.
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- andymai/gridfinity-layout-tool★ 525same name
- typv/nest-turbo-starter★ 224same name
- andymai/brepjs★ 140same name
- NoobyGains/godmode★ 118same name
- cubetribe/ClaudeCode_GodMode-On★ 53same name
- Kanevry/session-orchestrator★ 53same name
- microsoft/github-copilot-modernization★ 48same name
- NikiforovAll/lazyclaude★ 41same name
- sampleXbro/agentsmesh★ 27same name
- mxrsv/agents-skills★ 11same name
16 more not listed
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.
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Read the reference for each language the repo uses before you change anything:
- Distinctive: line 53
If a different tool already covers a gate (ESLint/Prettier, Jest, Black/flake8, pyright, Poetry), ask whether to migrate or keep it.
- Distinctive: line 60
Follow the reference for the language: it lists the install command with pinned versions, every template with its destination and what to …
- Distinctive: line 68
Run the one command for the language.
- Distinctive: line 76
All must be shown, not assumed:
- Distinctive: line 95
Every threshold that differs from the defaults above, its measured value and its target.
- Distinctive: line 96
Every suppression added and why.
- Distinctive: line 100
Commit in reviewable steps when asked to commit: tooling and configs.
- Very specific: line 108
Keep one .jscpd.json at the root with both formats ("format": ["typescript", "tsx", "javascript", "jsx", "python"]), run it from pnpm …
- Distinctive: line 112
Keep the jscpd new-clones step in one job only.
“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.
Files
Quality gates
One recipe per language: the same gates run on each commit (git hooks) and in CI, so a change that breaks formatting, types, tests, complexity, duplication or dead-code rules never lands.
| Gate | TypeScript | Python | Default |
| Format, lint, import order | Biome | Ruff | errors fail |
| Cognitive complexity per function | Biome noExcessiveCognitiveComplexity | complexipy | 15 |
| Cyclomatic complexity and size per function | cccc (40 / 40), Biome function length (120 lines) | Ruff C901 (15), PLR0911–PLR0915 | as listed |
| Types | tsc --noEmit, strict flags | mypy strict = true | 0 errors |
| Tests and coverage | Vitest + @vitest/coverage-v8 | pytest + pytest-cov | 85% in logic layers |
| File maintainability | FTA (fta-cli) | (covered per function) | score 60 |
| Duplication | jscpd | jscpd | 5%, plus new clones on PRs (warning) |
| Dead code | knip (files, exports) | vulture (60% confidence) | 0 findings |
| Dependencies | knip | deptry | 0 findings |
| Git hooks | husky + lint-staged | pre-commit | every commit |
| CI | .github/workflows/verify.yml | .github/workflows/verify.yml | every PR and push to main |
| Everything, one command | pnpm verify | uv run pre-commit run --all-files | must exit 0 |
Everything to copy is in templates/typescript/ and templates/python/ next to this file.
Read the reference for each language the repo uses before you change anything:
references/typescript.md: install, templates, tsconfig flags, and variants (npm/yarn/bun, Next.js, Vite, monorepos, existing ESLint/Prettier or Jest, slow hooks, other CI).references/python.md: install, templates, framework notes, and variants (no uv, pyright, prek, a Python project in a subdirectory, slow hooks).references/calibration.md: adopting the gates on a codebase that does not meet them yet.
Workflow
1. Survey the repo (read only)
Find out, before changing anything:
- Which languages:
package.json/tsconfig.jsonmean TypeScript;pyproject.toml,setup.pyorrequirements*.txtmean Python. Both means both recipes (see below). - TypeScript: package manager (lockfile), Node version, monorepo or not, framework, Tailwind.
- Python: uv or not (
uv.lock), src layout or flat, the import package name, Python version, framework (FastAPI, Django, Flask) and how it finds handlers. - What already exists: ESLint, Prettier, Biome, Jest, Vitest, husky, lefthook, lint-staged;
Black, isort, flake8, pylint, mypy, pyright, pre-commit;
.github/workflows/*; tsconfig strictness. - Generated or vendored folders every tool must skip (
_generated,generated,dist,.next,migrations,public/vendor). - Whether the repo has agent instructions (
AGENTS.md,CLAUDE.md).
If a different tool already covers a gate (ESLint/Prettier, Jest, Black/flake8, pyright, Poetry), ask whether to migrate or keep it; the variants in each reference cover both. Do not remove a tool the user did not agree to remove. Everything else has a default here; do not ask about it.
2. Install and 3. Copy the templates
Follow the reference for the language: it lists the install command with pinned versions, every
template with its destination and what to adapt, and the one-time hook installation. Merge into
existing files (package.json, pyproject.toml, .gitignore, vitest.config.ts) rather than
overwriting them. Append the language's quality-gates.md to AGENTS.md or CLAUDE.md
(create AGENTS.md if neither exists).
4. Calibrate
Run the one command for the language. On a new or small repo it should pass after the
formatter's fix pass. On an existing codebase, follow references/calibration.md: fix what is
cheap, suppress single offenders in place with a reason, and where violations are broad set the
threshold to the measured worst value with the target recorded. Never lower a gate below what
the code already achieves.
5. Verify end to end
All must be shown, not assumed:
- The one command exits 0 (
pnpm verify,uv run pre-commit run --all-files). TypeScript:pnpm buildexits 0 too. - The hooks are installed:
git config core.hooksPathprints.husky/_(husky), or.git/hooks/pre-commitexists and mentions pre-commit. - A gate bites: add an unused import and a
console.log/print()to a source file, stage it, try to commit, confirm the commit is refused, then revert the file. If the commit lands, the hook is not installed:git reset HEAD~1, revert the file, and fix the hook first. - The installed skill is not scanned as project code: when it lives in the repo
(
.agents/,.claude/,skills-lock.json), every tool's ignore list covers it (the templates already do). verify.ymlis valid YAML and names the repo's default branch.
6. Report
Tell the user, in short:
- What was added and which existing tools were kept, migrated or removed.
- Every threshold that differs from the defaults above, its measured value and its target.
- Every suppression added and why.
- That
verifymust be made a required status check on the default branch by a repo admin (GitHub → Settings → Rules), which the workflow cannot do itself.
Commit in reviewable steps when asked to commit: tooling and configs; the one-off formatting pass; then calibration fixes.
Both languages in one repo
- Git runs one pre-commit hook, so one manager owns it. With a
package.jsonat the root, husky does: appenduv run --project <python dir> pre-commit runto.husky/pre-commitand do not runpre-commit install(it refuses whilecore.hooksPathis set). - Keep one
.jscpd.jsonat the root with both formats ("format": ["typescript", "tsx", "javascript", "jsx", "python"]), run it frompnpm metrics:jscpd, and drop thejscpdhook from.pre-commit-config.yaml. - One
verify.ymlwith two jobs,typescriptandpython, each taken from its template. Keep the jscpd new-clones step in one job only. - A Python project in a subdirectory needs the hook entries adjusted: see
references/python.md.
When a gate fails later
Fix the code, not the gate. The rules are in the language's quality-gates.md (which step 3
copies into the repo's agent instructions): split complex functions and files, extract
duplicated logic, delete dead code, and add tests for changed logic. Raise a threshold only when
the user asks, in its own commit, with the reason.
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.

