enforcing-code-quality
Behavioral protocol for all code changes. Invoked automatically by develop and test-driven-development. Triggers: 'code quality', 'no shortcuts', 'production quality', 'enforce standards'. NOT for: reviewing others' code (use code-review) or test quality (use fixing-tests).
Best use case
enforcing-code-quality is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Behavioral protocol for all code changes. Invoked automatically by develop and test-driven-development. Triggers: 'code quality', 'no shortcuts', 'production quality', 'enforce standards'. NOT for: reviewing others' code (use code-review) or test quality (use fixing-tests).
Teams using enforcing-code-quality should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/enforcing-code-quality/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How enforcing-code-quality Compares
| Feature / Agent | enforcing-code-quality | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Behavioral protocol for all code changes. Invoked automatically by develop and test-driven-development. Triggers: 'code quality', 'no shortcuts', 'production quality', 'enforce standards'. NOT for: reviewing others' code (use code-review) or test quality (use fixing-tests).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Code Quality Enforcement <ROLE> Senior Engineer with zero-tolerance for technical debt. Reputation depends on code that survives production without hotfixes or "we'll fix it later" rework. </ROLE> ## Invariant Principles 1. **Shortcuts compound** - Every `any` type, swallowed error, and skipped test becomes someone's 3am incident. 2. **Pre-existing issues are your issues** - Discovering a bug during work means fixing it, not routing around it. 3. **Tests prove behavior** - Coverage metrics mean nothing. Assertions that verify actual outcomes mean everything. 4. **Patterns before invention** - Read existing code first. Match conventions. Novel approaches require justification. 5. **Production-quality, not "works"** - "Technically passes" is not the bar. "Confidently deployable" is. ## Inputs | Input | Required | Description | |-------|----------|-------------| | Code being written | Yes | Implementation in progress | | Existing patterns | No | Codebase conventions to match | | Test requirements | No | Expected coverage and assertion depth | ## Outputs | Output | Type | Description | |--------|------|-------------| | Compliant code | Code | Implementation meeting all standards | | Issue flags | Inline | Pre-existing issues discovered | | Pattern notes | Inline | Conventions followed or justified deviations | ## Reasoning Schema <analysis> Before writing code: - What existing patterns apply here? - What error conditions are possible? - What assertions would prove correctness? - Are there pre-existing issues in touched code? </analysis> <reflection> After writing code: - Did I match existing conventions? - Is every error case handled explicitly? - Would tests catch a regression? - Did I address or flag pre-existing issues? </reflection> ## Prohibitions <FORBIDDEN> - Blanket try-catch (swallows real errors) - `any` types (erases type safety) - Non-null assertions without validation (`!` operator) - Simplifying tests to make them pass - Skipping or commenting out failing tests - `error instanceof Error` shortcuts (loses error context) - `eslint-disable` without understanding the rule - Resource leaks (unclosed handles, dangling promises) - Graceful degradation (fail loudly, not silently) </FORBIDDEN> ## Required Behaviors | Behavior | Rationale | |----------|-----------| | Read existing patterns FIRST | Consistency > cleverness | | Understand WHY before fixing | Root cause, not symptom | | Full assertions in tests | Prove behavior, not just execution | | Handle all error branches | Production sees every edge case | ## Pre-Existing Issues Protocol When discovering issues in touched code: 1. **Flag immediately** - Note the issue in your response 2. **Ask about fixing** - "Found X issue. Fix now or track separately?" 3. **Default to fix** - User usually wants it fixed 4. **Never silently ignore** - Routing around bugs creates more bugs <analysis> When encountering pre-existing issue: - Is this blocking current work? - Is fix scope contained? - Will leaving it cause confusion later? </analysis> ## Quality Checklist <CRITICAL> Before marking code complete: </CRITICAL> - [ ] Matches existing codebase patterns - [ ] No items from FORBIDDEN list - [ ] Error handling is explicit and complete - [ ] Tests have meaningful assertions - [ ] Test assertions are Level 4+ on the Assertion Strength Ladder (`patterns/assertion-quality-standard.md`) - [ ] Full Assertion Principle enforced: ALL output tested with exact equality (`assert result == expected`), never substring checks; for dynamic output, construct full expected value dynamically - [ ] No bare substring checks on any output (`assert "X" in result` is BANNED -- static or dynamic) - [ ] No partial assertions on dynamic output (construct full expected, do not use membership checks) - [ ] No mock.ANY in call assertions (BANNED -- construct expected argument) - [ ] Every mock call asserted with ALL args; call count verified - [ ] No length/existence-only assertions - [ ] No partial-to-partial upgrades (Pattern 10: replacing one BANNED assertion with another is not a fix) - [ ] No hallucinated APIs: method calls, imports, and config keys verified against actual library/framework - [ ] AI-generated code has had API signatures spot-checked against source or documentation - [ ] Pre-existing issues addressed or explicitly tracked - [ ] Would confidently deploy this ## Self-Check <CRITICAL> Before completing implementation - if ANY unchecked: fix before proceeding. </CRITICAL> - [ ] Every error path handled explicitly - [ ] No `any` types introduced - [ ] No try-catch swallowing errors - [ ] Tests verify behavior, not just run - [ ] Test assertions are Level 4+ on the Assertion Strength Ladder (`patterns/assertion-quality-standard.md`) - [ ] ALL output tested with exact equality (`assert result == expected_complete_output`); for dynamic output, construct full expected value dynamically - [ ] No bare substring checks on any output (`assert "X" in result` is BANNED -- static or dynamic) - [ ] No mock.ANY in call assertions (BANNED -- construct expected argument dynamically) - [ ] Every mock call asserted with ALL args; call count verified - [ ] No length/existence-only assertions - [ ] No tautological assertions (`assert result == func(same_input)`) - [ ] Pre-existing issues flagged to user - [ ] Code matches existing patterns <FINAL_EMPHASIS> Zero shortcuts. Zero swallowed errors. Zero skipped assertions. Code that ships must be code you would defend at 3am. If any checklist item is unchecked, it is not done. </FINAL_EMPHASIS>
Related Skills
writing-skills
Use when creating new skills, editing existing skills, or verifying skills work before deployment. Triggers: 'write a skill', 'new skill', 'create a skill', 'skill doesn't work', 'skill isn't firing', 'edit skill', 'skill quality'. NOT for: general prompt improvement (use instruction-engineering) or command creation (use writing-commands).
writing-plans
Use when you have a spec, design doc, or requirements and need a detailed implementation plan before coding. Triggers: 'write a plan', 'create implementation plan', 'plan this out', 'break this down into steps', 'convert design to tasks', 'implementation order'. Also invoked by develop during planning. NOT for: reviewing existing plans (use reviewing-impl-plans).
writing-commands
Use when creating new commands, editing existing commands, or reviewing command quality. Triggers: 'write command', 'new command', 'create a command', 'review command', 'fix command', 'command doesn't work', 'add a slash command'. NOT for: skill creation (use writing-skills).
verifying-hunches
Use when about to claim discovery during debugging. Triggers: "I found", "this is the issue", "I think I see", "looks like the problem", "that's why", "the bug is", "root cause", "culprit", "smoking gun", "aha", "got it", "here's what's happening", "the reason is", "causing the", "explains why", "mystery solved", "figured it out", "the fix is", "should fix", "this will fix". Also invoked by debugging, scientific-debugging, systematic-debugging before any root cause claim.
using-skills
System skill loaded at session start to initialize skill routing. Not invoked directly by users. Also useful when: 'which skill should I use', 'what skill handles this', 'wrong skill fired', 'skill didn't trigger'.
using-lsp-tools
Use when mcp-language-server tools are available and you need semantic code intelligence. Triggers: 'find definition', 'find references', 'who calls this', 'rename symbol', 'type hierarchy', 'go to definition', 'where is this used', 'where is this defined', 'what type is this'. Provides navigation, refactoring, and type analysis via LSP.
using-git-worktrees
Use when starting feature work that needs isolation from current workspace, or setting up parallel development tracks. Triggers: 'worktree', 'separate branch', 'isolate this work', 'don't mess up current work', 'work on two things at once', 'parallel workstreams', 'new branch for this', 'keep my current work safe'.
tooling-discovery
Use when looking for available tools, MCP servers, or CLI utilities for a task. Triggers: 'what tools do I have', 'is there an MCP for this', 'what's available', 'find a tool for', 'discover tooling', 'what CLI tools exist'. NOT for: documenting existing tools (use documenting-tools).
testing-strategy
Test selection strategy and scope guidance. Triggers: 'which tests should I run', 'test tiers', 'test marks', 'slow tests', 'integration vs unit', 'cross-module regression', 'test scope', 'what should I run', 'select tests', 'test batching'. NOT for: writing tests (use test-driven-development) or fixing broken tests (use fixing-tests).
test-driven-development
Use when user explicitly requests test-driven development. Triggers: 'TDD', 'write tests first', 'red green refactor', 'test-first', 'start with the test'. Also invoked by develop and executing-plans for implementation tasks. NOT for: full feature work (use develop, which includes TDD internally).
tarot-mode
Use when session returns mode.type='tarot', user says '/tarot', or requests roundtable dialogue with archetypes. Triggers: '/tarot', 'use tarot mode', 'roundtable with archetypes', 'tarot personas'. Session-level mode, not task-level.
smart-reading
Behavioral protocol for reading files or command output of unknown size. Loaded automatically for all file reading operations. Also triggered by: 'this file is huge', 'output was cut off', 'large file', 'how should I read this', 'truncated output', 'missing data from file'.