quality-check
npx skills add https://github.com/meriley/claude-code-skills --skill quality-check
Agent 安装分布
Skill 文档
Code Quality Check Skill
â ï¸ MANDATORY SKILL – AUTO-INVOKED BY SAFE-COMMIT
Purpose
Enforce code quality standards through automated linting, formatting, and static analysis. Ensures code meets project conventions before committing.
CRITICAL: This skill is automatically invoked by safe-commit. NEVER run linters manually.
ð« COMMIT BLOCKING RULE – ZERO TOLERANCE
Commits are FORBIDDEN unless the LATEST quality check run shows ZERO issues.
This means:
- If quality check finds errors â FIX THEM
- After fixing â RERUN quality check (MANDATORY)
- If rerun finds errors â FIX AND RERUN AGAIN
- Repeat until clean pass
- Only after a clean pass may you proceed to commit
The last quality check output MUST show all checks passing. No exceptions.
CRITICAL: Full Repository Scope
All quality checks run on the ENTIRE repository:
ruff check .– ALL Python fileseslint .– ALL JS/TS filesgolangci-lint run ./...– ALL Go files
You MUST fix ALL issues found, not just those in files you modified. Whoever runs quality-check is responsible for fixing discovered issues.
ð« NEVER DO THIS
- â Running
eslintornpm run lintmanually before commit - â Running
golangci-lint runmanually before commit - â Running
flake8orblackmanually before commit - â Running linters outside of this skill during commit workflow
Let safe-commit invoke this skill automatically. Manual linting before commit is REDUNDANT and FORBIDDEN.
â ï¸ SKILL GUARD – READ BEFORE RUNNING LINTERS MANUALLY
Before using Bash tool to run linters, answer these questions:
â Are you about to run npm run lint or eslint?
â STOP. Are you doing this before commit? If YES, use safe-commit instead (it invokes this skill).
â Are you about to run golangci-lint run?
â STOP. Are you doing this before commit? If YES, use safe-commit instead (it invokes this skill).
â Are you about to run flake8, black, or mypy?
â STOP. Are you doing this before commit? If YES, use safe-commit instead (it invokes this skill).
â Are you about to run prettier --check or formatting tools?
â STOP. Are you doing this before commit? If YES, use safe-commit instead (it invokes this skill).
â Are you checking code quality before committing?
â STOP. Invoke safe-commit skill (it will invoke this skill automatically).
IF YOU RUN LINTERS MANUALLY BEFORE COMMIT, YOU ARE CREATING REDUNDANCY AND WASTING TIME.
When to run linters manually:
- â During development/refinement (not for commit)
- â When user explicitly requests quality check
When NOT to run linters manually:
- â Before commit (use safe-commit instead)
- â As part of commit workflow (use safe-commit instead)
Safe-commit invokes this skill automatically. Don’t duplicate the work.
Philosophy
CRITICAL: Treat linter issues as syntax errors, not warnings.
- All linter issues MUST be fixed before commit
- No exceptions unless explicitly approved by user
- Auto-fix when tools support it
- Manual fix when auto-fix unavailable
â ï¸ CRITICAL: Rerun Policy – ZERO TOLERANCE (All Languages)
Assuming fixes resolved all errors is FORBIDDEN.
This applies to ALL auto-fix operations in ANY language:
- ESLint –fix, Prettier –write (Node.js/TypeScript)
- gofmt -w, golangci-lint –fix (Go)
- ruff –fix, ruff format, black, isort (Python)
- cargo fmt, cargo clippy –fix (Rust)
- spotless:apply (Java)
After ANY Fix (Auto or Manual):
- MUST rerun the same check to verify fix succeeded
- MUST NOT proceed until rerun passes
- MUST NOT assume any fix caught everything
- MUST repeat fix â rerun cycle until clean
The Fix-Rerun Loop (MANDATORY)
while (quality_check_has_errors) {
fix_errors(); // Auto-fix or manual
rerun_quality_check(); // ALWAYS rerun after fixing
}
// Only exit loop when rerun shows ZERO errors
Why This Matters
- Auto-fix tools don’t catch 100% of issues
- Manual fixes can introduce new issues
- Some fixes reveal previously hidden issues
- Proceeding without verification can commit broken code
- Commits with quality issues pollute the codebase
Example (WRONG) – Applies to ALL Languages
â Found 5 linting errors
â Running auto-fix...
â "Fixed! Proceeding to commit..." â FORBIDDEN - DID NOT RERUN
Example (ALSO WRONG) – Manual Fix Without Rerun
â Found 3 type errors
â [Manually fixed the code]
â "Fixed! Proceeding to commit..." â FORBIDDEN - DID NOT RERUN
Example (CORRECT) – Full Fix-Rerun Loop
â
Found 5 linting errors
â
Running auto-fix...
â
Re-running lint check... â MANDATORY RERUN
â
Found 1 remaining error (requires manual fix)
â
[Fix manually]
â
Re-running lint check... â MANDATORY RERUN AGAIN
â
All checks pass. Safe to proceed.
Workflow (Quick Summary)
Core Steps
- Detect Languages: Check for package.json, go.mod, requirements.txt, Cargo.toml, etc.
- Run Standard Checks: Linting, formatting, type checking, static analysis (auto-fix when possible)
- Run Deep Audits: Language-specific skills (control-flow-check, type-safety-audit, n-plus-one-detection)
- Handle Results: Report pass/auto-fix/fail, provide specific error locations and fixes
- Verify Multi-Language: All languages must pass before commit
Language Support
- Node.js/TypeScript: ESLint, Prettier, tsc, npm audit
- Go: gofmt, go vet, golangci-lint, go mod tidy
- Python: ruff (lint+format), mypy | fallback: black, flake8, isort
- Rust: rustfmt, clippy
- Java: Maven/Gradle spotless, checkstyle
For detailed language-specific commands and checks:
Read `~/.claude/skills/quality-check/references/LANGUAGE-CHECKS.md`
Use when: Need specific tool commands, troubleshooting linter issues, or setting up new language
For deep audit integration (control-flow, type-safety, N+1 detection):
Read `~/.claude/skills/quality-check/references/DEEP-AUDITS.md`
Use when: Running language-specific deep audits or integrating specialized checks
For result handling and reporting patterns:
Read `~/.claude/skills/quality-check/references/RESULT-HANDLING.md`
Use when: Formatting output, handling auto-fix scenarios, or reporting manual fix requirements
Integration with Other Skills
This skill is invoked by:
safe-commit– Before committing changescreate-pr– Before creating pull requests
Best Practices
- Run in parallel – Multiple languages? Check simultaneously
- Auto-fix first – Always attempt auto-fix before asking user
- Be specific – Show exact file, line, and error
- Suggest solutions – Don’t just report errors, help fix them
- Verify fixes – Re-run checks after auto-fixing
- No skip option – Quality checks are mandatory
Tool Installation Detection
Before running tools, check if they’re available:
# Example for Node.js:
if ! command -v eslint &> /dev/null; then
echo "ESLint not found. Install with: npm install -D eslint"
exit 1
fi
If tool missing:
- Report missing tool
- Provide installation command
- Ask user to install or use project’s package.json scripts
Configuration Detection
Check for project-specific configuration:
.eslintrc.js,.eslintrc.json(ESLint).prettierrc,prettier.config.js(Prettier).golangci.yml(golangci-lint)pyproject.toml(Python tools).editorconfig(Cross-language)
Use project config when available, otherwise use sensible defaults.
Handling Make/NPM Scripts
If project has quality scripts in Makefile or package.json:
# Check for make target:
make lint
make fmt
# Check for npm script:
npm run lint
npm run format
Prefer project scripts over direct tool invocation when available.
Emergency Override
Only if user explicitly states “skip quality checks” or “I acknowledge quality issues”:
- Document the override in output
- List specific issues being ignored
- Suggest creating follow-up ticket
- Proceed with commit
This should be RARE – quality checks exist for good reason.