src/bx_skills/catalog_skills/bx-enhance-code-quality/SKILL.md
Use when asked to rate, score, audit, or improve code quality of a project, when user wants a 0-10 quality assessment, or when asked what needs to change to reach perfect quality
npx skillsauth add bitranox/bx_skills bx-enhance-code-qualityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Score a project 0-10, identify issues by severity, walk the user through fixes one-by-one, track decisions in the project instructions file so declined items are never re-raised.
Project instructions file depends on your CLI tool: Claude Code →
CLAUDE.md| Codex →AGENTS.md| Kilo Code / Windsurf → equivalent config file. This skill uses "CLAUDE.md" as shorthand — substitute the correct filename for your environment.
Core principle: Respect prior decisions. Check before suggesting. Ask before changing.
1. Read CLAUDE.md / AGENTS.md → collect accepted items
2. Run project tools → collect objective data
3. Score 0-10 with rubric
4. Filter out accepted items
5. Present Issue N
├── yes → 6a. Implement fix ──┐
└── no → 6b. Save decline ──┤
▼
More issues?
├── yes → back to 5
└── no → 7. Re-score
Before any analysis, read the entire project instructions file (CLAUDE.md / AGENTS.md / equivalent).
If no project instructions file exists: Note it and proceed to Step 2 with an empty accepted-items list. After scoring, recommend creating one as a MEDIUM issue if the project would benefit from it.
Collect deliberately accepted items from all of these sources:
# Code Quality section (explicit accepted items list)Read the entire file, not just one section. Intentional decisions are often documented inline near the relevant architecture description, not only in the "Code Quality" section.
These items are OFF-LIMITS. Do not suggest changes to deliberately accepted items. If you would have flagged something but it's documented as intentional, skip it silently.
Before manual scoring, run whatever quality tooling the project already has. Check for:
Makefile targets: make test, make lint, or similarruff check, pyright, shellcheck, eslint, pytest, etc..github/workflows/) for the project's own quality gatesRecord tool output (pass/fail, coverage %, lint warnings). Use this objective data to inform Step 3 scoring.
Use this rubric to score the project. Each dimension is 0-10, final score is the weighted average.
| Dimension | Weight | What to Check | |-----------------|--------|----------------------------------------------------------| | Architecture | 20% | Layer separation, dependency direction, SOLID principles | | Type Safety | 15% | See language-specific criteria below | | Testing | 20% | Coverage %, test quality, edge cases, isolation | | Error Handling | 10% | Consistency, domain exceptions, exit codes | | Security | 15% | Input validation, secrets handling, dependency audit | | Documentation | 10% | Docstrings/comments, README, inline docs where needed | | Maintainability | 10% | DRY, naming, complexity, readability |
Type Safety by language:
| Language | 0-3 | 4-6 | 7-10 |
|------------|---------------------------------------------|--------------------------------------------|----------------------------------------------------------|
| Python | No type hints | Partial hints, no strict checking | Full hints, pyright strict, minimal type: ignore |
| Bash | No input validation, no set -euo pipefail | Some validation, inconsistent quoting | set -euo pipefail, all vars quoted, shellcheck clean |
| TypeScript | any everywhere, no strict | Partial strict, some any | Strict mode, no any, proper generics |
| JavaScript | No JSDoc, no validation | Some JSDoc or TypeScript migration started | Full JSDoc with types, or migrated to TypeScript |
Scoring anchors (all dimensions):
| Score | Meaning | |-------|----------------------------------------------------------| | 0-2 | Absent or fundamentally broken | | 3-4 | Present but inconsistent, significant gaps | | 5-6 | Adequate, follows conventions most of the time | | 7-8 | Good, minor gaps only | | 9-10 | Excellent, best practices throughout, no meaningful gaps |
Present the scorecard as a table with per-dimension scores and the weighted total.
Cross-reference your findings against all deliberately accepted items collected in Step 1 (from the "Code Quality" section AND from inline "by design" documentation throughout the project instructions file). Remove any issue that matches.
If unsure whether something is deliberately accepted: include it but note "This may be intentional per the project instructions — please confirm."
Every finding MUST use this exact format:
## Issue N: [Short Title]
**Severity**: SEVERE | MEDIUM | MINOR
**Affected files**: [list of files]
**Description**: [what's wrong]
**Suggested fix**: [specific actionable fix instructions]
Severity guidelines:
Every issue MUST have a specific, actionable suggested fix. Not "improve this" — actual instructions.
Number issues sequentially. Present in severity order: SEVERE first, then MEDIUM, then MINOR.
Do NOT dump all issues at once. Present ONE issue at a time. After presenting, ask:
"Do you want to implement this fix? Or skip it? If skipping, what's the reason?"
Wait for the user's response before presenting the next issue.
Implement the change, verify it works (run relevant tests/lints), show the user what changed, move to next issue.
Mandatory for every decline. Append to # Code Quality section in CLAUDE.md / AGENTS.md:
Deliberately accepted items — do not flag in future reviews:
- **[Short Title]**: [User's reason]. [Brief description so future reviewers understand.]
If the section exists, append. Do not duplicate entries. If the section does not exist, create it at the end of the project instructions file. If no project instructions file exists, create one (CLAUDE.md / AGENTS.md) with the # Code Quality section.
After all issues processed, re-run the rubric. Present before/after scorecard.
| Mistake | Fix | |----------------------------------------------------|--------------------------------------------------| | Dump all issues at once | Present ONE at a time, wait for response | | Suggest changes to documented-as-intentional items | Read project instructions first, filter them out | | Vague suggested fixes ("improve this") | Write specific, actionable instructions | | Skip saving declined items | ALWAYS append to project instructions file | | Subjective scoring without rubric | Use the weighted rubric table | | Flag items already in "Code Quality" section | Check the section BEFORE analysis | | Present MINOR issues before SEVERE | Sort by severity: SEVERE > MEDIUM > MINOR | | Re-raise previously declined items | Check accepted items list first |
development
Textual TUI framework documentation reference
testing
Use when creating new skills, editing existing skills, structuring SKILL.md files, writing skill frontmatter, testing skills with subagents, deploying skills, or verifying skills work before deployment
development
Use when building transparent remote procedure calls, distributed computing, or remote object proxying in Python with RPyC. Use when asked about rpyc.connect, rpyc.Service, netref proxies, async_(), BgServingThread, SSLAuthenticator, DeployedServer, or rpyc_classic.py.
tools
Use when choosing Python libraries for a task, when writing new Python code that needs dependencies, when reviewing Python imports for non-preferred libraries, or when unsure which library to use for JSON, HTTP, logging, TOML, YAML, compression, database access, testing, or CLI tools