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/malakhov-dmitrii/forge/code-hygienenpx skills add malakhov-dmitrii/forge --skill code-hygienegit clone --depth 1 https://github.com/malakhov-dmitrii/forgeWrote 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.
[](https://agentmods.dev/skills/malakhov-dmitrii/forge/code-hygiene)<a href="https://agentmods.dev/skills/malakhov-dmitrii/forge/code-hygiene"><img src="https://agentmods.dev/badge/skills/malakhov-dmitrii/forge/code-hygiene.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00034 | $0.02347 |
| Opus 5 | $0.00017 | $0.01174 |
| Sonnet 5 | $0.00007 | $0.00469 |
| Haiku 4.5 | $0.00003 | $0.00235 |
Grade A, and why
code-hygiene 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 4d 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 — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Hygiene — Scan, Report, Integrate
Persistent codebase health analysis. Runs static tools, interprets output, stores structured findings, suggests forge tasks for cleanup.
When to Use
- After shipping a feature (catch accumulated tech debt)
- Periodic hygiene (every 1-2 sprints)
- Before major refactoring (map current state first)
- Onboarding to unfamiliar codebase (architecture overview)
- User says "code hygiene", "tech debt", "почисти код", "найди мертвый код", "проверь тесты"
Pipeline: SCAN → REPORT → INTEGRATE → SAVE
Phase 1: SCAN
1a. Project Detection
package.json→ TypeScript/JavaScript (primary, full tool support)pyproject.toml/setup.py→ Python (semgrep + scc only)go.mod→ Go (semgrep + scc only)Cargo.toml→ Rust (semgrep + scc only)- Report honestly: "Full analysis available for TS/JS. Limited to semgrep+scc for [language]."
1b. Tool Detection
Check availability, report what's missing:
Global: which tsc semgrep scc jq
Local: grep devDependencies package.json for knip, jscpd, dependency-cruiser, stryker
Missing: suggest `npm i -D knip jscpd dependency-cruiser` for full coverage
1c. Tool Execution
Run available tools. ALL output goes to files first — NEVER read raw output into context.
3-step pattern for every tool:
- Redirect:
<cmd> > .omc/hygiene/raw-<name>.json 2>&1 - Summarize:
jq '<path>[:50]' raw-<name>.json > <name>.json- If jq unavailable:
Read raw-<name>.jsonwithlimit: 200 - tsc is plain text:
head -100 raw-types.txt > types.txt
- If jq unavailable:
- Read: Read
<name>.json— NEVER readraw-*files into context
Tools (run in parallel via background Bash):
| Tool | Command | Output file | Summary jq path |
|---|---|---|---|
| tsc | tsc --noEmit 2>&1 > raw-types.txt |
types.txt | head -100 (plain text) |
| scc | scc --by-file --format json src/ > raw-complexity.json |
complexity.json | sort_by(.Complexity) | reverse | .[:50] |
| semgrep | semgrep scan --config auto --json . > raw-security.json |
security.json | .results[:50] |
| knip | npx knip --reporter json > raw-dead-code.json |
dead-code.json | .files[:50] + .exports[:50] (if in devDeps) |
| jscpd | npx jscpd src/ --reporters json -o /tmp/jscpd > raw-duplicates.json |
duplicates.json | .duplicates[:50] (if installed) |
| dep-cruiser | npx dependency-cruiser src --include-only "^src" --output-type json > raw-dependencies.json |
dependencies.json | .summary.violations[:50] (if installed) |
| stryker | npx stryker run --reporters json > raw-mutations.json |
mutations.json | .files | to_entries[:20] (only with --deep) |
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.
- 4d ago First seen · 189 lines · 34 tokens per session scan A cad70535bb48
code-hygiene is a skill published in the GitHub repository malakhov-dmitrii/forge (25 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 2,347 once invoked, about $0.0002 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
new-skill
Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…
brooks-sweep
Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…
brooks-test
Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…
procoder
Work like a senior developer in a repository governed by procoder: run the commit gate before calling anything done, format and lint through the binary, and drive the spec, plan, todo, backlog, and sprint chain in .procoder/. Use this skill when the repository contains a .procoder/ directory or an AGENTS.md naming…
status
Where is the work right now. Regenerates the projections and the kanban board from the journal and answers with the progress line, the agents still running, the open gates and the resume steps. Read-only. Use for /tyran:status or when asked what is going on.
deslop
The optimization pass, defined - delete before you add, one smell class per pass, behaviour pinned by a test that ran BEFORE the edit. Lints a SKILL.md and prose by the same instinct. Use for the per-story optimization pass or when code has grown noisy without growing capable.