Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/moonrepo/moon/improve-code-qualitynpx skills add moonrepo/moon --skill improve-code-qualitygit clone --depth 1 https://github.com/moonrepo/moonWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00116 | $0.01748 |
| Opus 5 | $0.00058 | $0.00874 |
| Sonnet 5 | $0.00023 | $0.00350 |
| Haiku 4.5 | $0.00012 | $0.00175 |
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 3d 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.
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/, orlegacy/, or contains.rsfiles or aCargo.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
unsafeblocks 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::HashMaporstd::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()forCopytypes - 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
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.
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.
- 3d ago First seen · 235 lines · 116 tokens per session scan A e546e3232b1d
improve-code-quality is a skill published in the GitHub repository moonrepo/moon (4,084 stars, last pushed 4d ago), licensed MIT. It adds 116 tokens to every session and 1,748 once invoked, about $0.0006 per session on Opus 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.
Other skills, from other repositories
turborepo
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines…
migrate-internal-package
Move a package from another TryGhost repository into Ghost as an internal-only workspace package while preserving its Git history. Use for package migrations from repositories such as TryGhost/SDK or TryGhost/framework, including the history import PR, exceptional merge-commit handoff, source-repository removal PR…
Shade tokens, not hex
Use Shade semantic tokens (bg-background, text-foreground, border-border-default, bg-surface-elevated) — never hex, hsl(), or bg-gray-200-style raw palette utilities for UI chrome. Trigger when editing TSX/CSS in Shade-consuming apps.
Shade dropdown surface contract
DropdownMenu, Select, and Popover share one visual recipe (bg-surface-elevated-2 + border-border/60 dark:border-border/30 + shadow-md). Change them together. Trigger when editing any of those three Shade files.
Shade inputSurface recipe
Use the inputSurface() recipe for form-control chrome (border, background, radius, focus ring, invalid state) — don't roll your own. Trigger when editing form-control-shaped files in Shade.
Shade new component
Acceptance checklist for adding or editing a Shade component or pattern file — naming, sibling story, className forwarding, cva variants, required states, recipe usage. Trigger when editing files in apps/shade/src/components.