moon: Skill for Claude Code

.agents/skills/improve-code-quality/SKILL.md

improve-code-quality is a skill for Claude Code, Codex from moonrepo/moon. It costs 116 tokens per session (1,748 once invoked), scanned A, original, MIT.

A structured code-quality audit for any path in a monorepo, which is a repository containing multiple related projects or packages. It uses automated checks and manual review, then reports findings before applying approved fixes.

In plain words
What is it for?
Use it to audit or improve a directory, file, or package, including refactoring, linting, security checks, dependency audits, and performance reviews.
Why use it?
It gathers security, performance, robustness, readability, and maintenance issues in one review instead of relying only on a linter.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is moonrepo/moon's own configuration. It tells Claude Code and Codex how to work on moon itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything moon configures →

About the project

moon is a Rust-based build system and repository management tool for web projects, including monorepos, where multiple related packages live in one repository. It coordinates projects and tasks, standardizes language and package-manager versions, and reduces duplicated scripts. The catalogue skills and instructions support working with moon-managed repositories.

moonrepo/moon · 4,171 stars · on GitHub · moonrepo.dev

Reuse

Borrowing it

Nothing to install: this file belongs to moonrepo/moon. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/moonrepo/moon/master/.agents/skills/improve-code-quality/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/moonrepo/moon

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for improve-code-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/moonrepo/moon/improve-code-quality/github.svg)](https://agentmods.dev/skills/moonrepo/moon/improve-code-quality)
Your own site
<a href="https://agentmods.dev/skills/moonrepo/moon/improve-code-quality"><img src="https://agentmods.dev/badge/skills/moonrepo/moon/improve-code-quality/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for improve-code-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/moonrepo/moon/improve-code-quality"><img src="https://agentmods.dev/badge/skills/moonrepo/moon/improve-code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 116 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,748 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 92
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00116 $0.01748
Opus 5.5 $0.00046 $0.00699
Sonnet 5.5 $0.00023 $0.00350
Haiku 4.5 $0.00012 $0.00175

Measured 2mo ago against content hash e546e3232b1d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

improve-code-quality scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/improve-code-quality/SKILL.md · 235 lines

How it starts

The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Improve Code Quality

Perform a structured code quality audit on a target path in the monorepo. The workflow is: run automated tools, do deeper manual analysis, present a report, then apply fixes only after the user approves.

Usage

/improve-code-quality <path>

The path can be a directory (e.g., crates/task-runner), a single file (e.g., crates/task-runner/src/lib.rs), or the name of a package (e.g., moon_task_runner).

Step 1: Validate and detect language

First, verify the target path exists. If it doesn't, tell the user and stop.

Then detect what languages are present:

  • Rust: path is under crates/, wasm/, or legacy/, or contains .rs files or a Cargo.toml

Tell the user what you detected before continuing.

If the target is a single file, skip the automated tool phase and go straight to manual analysis.

Step 2: Manual analysis

Read the source files in the target path and look for issues that automated tools miss. Organize findings by category:

Security

  • unsafe blocks without justification comments
  • .unwrap() on user-facing code paths (not tests — unwrap is fine in tests)
  • Path traversal or injection risks
  • Hardcoded secrets or credentials
  • Use of std::collections::HashMap or std::collections::HashSet (refer to conventions below)

Performance

  • Unnecessary .clone() where borrowing would work
  • Unnecessary .collect() in iterator chains
  • O(n^2) or worse algorithms with better alternatives
  • Blocking calls inside async functions
  • Large types on the stack that should be Boxed
  • Avoid cloning in loops; use .iter() instead of .into_iter() for Copy types
  • Prefer iterators over manual loops (when applicable); avoid intermediate .collect() calls
  • Detect memory leaks or dangling pointers

Readability & structure

  • Functions longer than ~80 lines that should be split
  • Deeply nested or complex match/if-else chains
  • Dead code or unused imports
  • Inconsistent naming
  • Magic numbers that should be named constants

Read the full file on GitHub · 235 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 235 lines · 116 tokens per session scan A e546e3232b1d

Subscribe to this mod's changes

improve-code-quality is a skill published in the GitHub repository moonrepo/moon (4,171 stars, last pushed today), licensed MIT. It adds 116 tokens to every session and 1,748 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

turborepo

Configure and troubleshoot Turborepo repositories. Use when working with turbo.json, task pipelines, caching, Remote Cache, the turbo CLI, filtering, environment variables, package boundaries, monorepo structure, or CI workflows.

vercel/turborepo · 50 tokens

triage-contributor-pr

Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

review-triage-phase

Produces canonical review actions from fetched review state and renders action markdown. Use when the user wants only triage/action-planning for the review-framework workflow.

prisma/orm · 36 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

product-direction

Judges feature requests, feature pull requests and your own proposals against a repository's written product direction, gives a cited verdict, and records each new no. Use when triaging, labelling or replying to a feature request or a feature pull request, including as an autonomous triage agent; when asked whether a…

prisma/orm · 145 tokens