quality-gates — Claude Code rule: what it checks before a commit
quality-gates — a Claude rule that makes the agent lint and typecheck before a commit, then sweep the staged diff for debug lines and hardcoded keys.
MIT ★ 2,966 updated 2026-09-29
.cursor/rules/quality-gates.mdcWhat quality-gates does
The rule lays out a pre-commit routine for the agent: run the linter and the type checker, and run tests for the paths you touched. Debug output such as console.log, debugger or a stray print has no place in code headed for production. Secrets and API keys belong in environment variables rather than in source files.
It also lists what to inspect in the staged diff: debug statements, TODO and FIXME notes with no ticket number, hardcoded strings like api_key = "...", and test-only code left behind. Read it as a checklist for the diff. The agent runs the tools.
Because the front matter carries alwaysApply: true, the rule loads in every session, not just at commit time, so expect reminders about leftover debug lines during ordinary refactoring too. The file sits at .claude/rules/quality-gates.md.
What it helps with
- run lint and typecheck before committing
- catch leftover
console.loganddebuggerlines in the staged diff - move a hardcoded API key into an environment variable
- link every
TODOto a ticket instead of leaving it bare - strip test-only stubs that slipped into the commit
Example prompts for the agent
- Run the linter and the type checker on the touched files before you commit.
- Check the staged diff for
console.logand forTODOnotes with no ticket. - Find hardcoded keys in the source and move them into environment variables.
How to install quality-gates
Manually: put the files in place
.cursor/rules/quality-gates.mdcFrontmatter: description, globs, alwaysApply
1Plugin marketplace
/plugin marketplace add rohitg00/pro-workflow/plugin install pro-workflow@pro-workflow2Manually: put the files in place
.claude/rules/quality-gates.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/quality-gates.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/quality-gates.mdManually: put the files in place
.clinerules/quality-gates.mdStep by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules
Questions about quality-gates
How to install quality-gates in Claude Code?
Add the marketplace first with /plugin marketplace add rohitg00/pro-workflow, then install the plugin with /plugin install pro-workflow@pro-workflow. The rule lands at .claude/rules/quality-gates.md.
What does quality-gates do?
It asks the agent to lint and typecheck before a commit and to test the code paths it changed. It also screens the staged diff for debug statements, ticketless TODO notes and hardcoded keys.
When does this rule apply?
The front matter sets alwaysApply: true, so it is active in every session rather than only at commit time. Reminders about debug lines will show up during ordinary edits as well.
Source text
quality-gates.mdc · MIT
--- description: Enforce quality checks before commits - lint, typecheck, and test affected code alwaysApply: true --- Run lint and typecheck before every commit. Test affected code paths. No `console.log` or `debugger` statements in production code. No hardcoded secrets, API keys, or credentials in source files. Use environment variables. Before committing, scan staged changes for: - Debug statements (console.log, print, debugger) - TODO/FIXME without ticket references - Hardcoded secrets matching patterns like `api_key = "..."` - Leftover test-only code
© Rohit Ghumare · MIT · rohitg00/pro-workflow