Codescene code health
Skill lucasheriques/codescene-skill/skills/codescene-code-health
Use when setting up or reviewing code quality with CodeScene Code Health MCP tools: initializing/onboarding a repository, configuring CodeScene MCP for Codex, Claude Code, or Cursor, before committing or pushing changes, running CodeScene, code-health, file score, file review, pre-commit safeguard, branch/change-set analysis, or applying a ratcheted quality policy to touched code without broad unrelated refactors.From its SKILL.md
npx -y skills add lucasheriques/codescene-skill --skill codescene-code-healthAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its file declares
Copied from the file, not written here
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.2 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it
CodeScene Code Health
Overview
Use CodeScene as a focused code-health signal for the code already in scope. Prefer local MCP tools and repository checks over generic advice, and treat CodeScene as a ratchet: new code should be healthy, healthy touched files should not regress, and unhealthy touched files should improve or be called out explicitly.
Initial Check
- Confirm you are in a git repository before doing branch or change-set analysis.
- Inspect the user's request,
git status, and the touched files before selecting a CodeScene tool. - Check whether CodeScene MCP tools are available in the session. If they are missing, do not invent scores or reviews; use
references/mcp-setup.mdto help the user configure the server. - Preserve unrelated user work. Do not stage, revert, or refactor unrelated files to chase a score.
- If the user asks you to set up MCP, use
scripts/install-mcp.mjsas the opt-in helper. It can configure Codex, Claude Code, and Cursor. Do not store tokens in agent config unless the user explicitly asks for that.
Init / Onboarding
Treat requests like "init CodeScene", "$codescene init", "set up CodeScene for this repo", or "onboard this project" as an onboarding flow.
- Read
references/mcp-setup.md. - Decide scope from the user's wording: use project scope for "this repo/project"; use user scope for "all projects" or "this machine".
- Verify
CS_ACCESS_TOKENis available. If it is missing, point the user to CodeScene MCP access and stop before claiming tools are ready. - Configure MCP with
scripts/install-mcp.mjs --scope project --applyorscripts/install-mcp.mjs --scope user --applywhen setup is requested. - Restart or reconnect the agent session if newly configured MCP tools are not visible yet.
- Run the smallest first CodeScene check that fits the repo state:
pre_commit_code_health_safeguardfor local changes,analyze_change_setfor a branch, orcode_health_scorefor a named file. - Report the configured agents, files written, first check result, and any files the user should commit.
Tool Selection
- Use
pre_commit_code_health_safeguardbefore commit, handoff, or push when the current modified/staged files are the unit of review. - Use
analyze_change_setfor a branch-level review against a base ref such asorigin/main. - Use
code_health_scorefor a quick numeric score on one or more specific files. - Use
code_health_reviewfor detailed findings on a specific file when deciding what to improve. - Use
explain_code_healthorexplain_code_health_productivityonly when the user asks what the metric means or why it matters.
Workflow
- Read the relevant diff and nearby code first. CodeScene output is more useful after you know the intent of the change.
- Run the smallest CodeScene tool that answers the question.
- Interpret findings through the ratchet policy in
references/ratchet-policy.md. - Fix high-confidence issues that are within the requested scope and covered by the same validation path.
- Avoid broad rewrites, style churn, or unrelated "score polishing" unless the user explicitly asks for a refactor.
- Rerun the relevant CodeScene tool after meaningful changes.
- Run the repository's focused tests or checks for the touched behavior; CodeScene does not replace tests.
Interpreting Results
- Treat blocker-level CodeScene findings as review findings: fix them or explain why the current task cannot safely include the fix.
- For new files, aim for excellent structure immediately; avoid landing new low-health code.
- For healthy touched files, avoid regressions even if the code still passes tests.
- For low-health legacy files, improve the touched area when practical. If the score stays flat, document the exception instead of silently normalizing it.
- For critical surfaces such as auth, payments, subscriptions, access control, jobs, notifications, and production-runtime glue, use stricter judgment than for low-risk content code.
Reporting
When reporting back, include:
- The CodeScene tool used and the scope reviewed.
- The main findings or a clear "no CodeScene issues found" statement.
- What was changed, if anything.
- The verification commands or checks that passed.
- Any residual risk or explicit ratchet exception.
References
- Read
references/mcp-setup.mdwhen CodeScene MCP is missing or the user asks how to configure Codex, Claude Code, or Cursor. - Read
references/ratchet-policy.mdbefore defining thresholds, exceptions, or repository quality gates. - Read
references/nagringa-case-study.mdwhen adapting this workflow to another repository or explaining why the skill is shaped this way. - Run
scripts/install-mcp.mjs --helpwhen the user wants this skill to help configure the CodeScene MCP server.
What ships with it: 5 files
15.4 KB alongside SKILL.md, 1 of them executable
agents/
- openai.yaml186 B
references/
- mcp-setup.md3.2 KB
- nagringa-case-study.md2.4 KB
- ratchet-policy.md1.9 KB
scripts/
- install-mcp.mjsruns7.7 KB