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 commands/acaprino/daodan/clean-codegit clone --depth 1 https://github.com/acaprino/daodanWhat 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.00080 | $0.01488 |
| Opus 5 | $0.00040 | $0.00744 |
| Sonnet 5 | $0.00016 | $0.00298 |
| Haiku 4.5 | $0.00008 | $0.00149 |
Grade A, and why
clean-code 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 2d 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 — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Clean Code
Use the clean-code-agent to rewrite source code for readability without changing behavior.
Rules
- Validate before and after. Establish a baseline with type checker + tests + linter, then verify no regressions.
- If
--dry-run, preview only. Show proposed changes without modifying files. - Revert on failure. If any validation fails after a change, revert with
git restore <file>immediately. - Ask for confirmation at Steps 2 and 3, unless
--yesflag is provided. - Block without validation tools. If no tests AND no type checker exist, require
--forceto proceed.
Step 1: Identify Target
From $ARGUMENTS, determine files to clean:
- If a file path: clean that file
- If a directory: clean all source files in it
- Filter out test files (unless they reference renamed symbols)
List the files to be cleaned and their language.
Step 2: Establish Validation Baseline
Detect available validation tools by inspecting project files:
| Tool | How to detect | Command |
|---|---|---|
| Type checker | tsconfig.json |
tsc --noEmit |
mypy.ini, pyrightconfig.json, or mypy/pyright in pyproject.toml |
mypy . or pyright |
|
Cargo.toml |
cargo check |
|
go.mod |
go vet ./... |
|
| Test runner | package.json |
npm test |
pyproject.toml or setup.py |
pytest |
|
Cargo.toml |
cargo test |
|
go.mod |
go test ./... |
|
Makefile with test target |
make test |
|
| Linter | ruff.toml or ruff config in pyproject.toml |
ruff check |
.eslintrc* or eslint.config.* |
eslint |
|
Cargo.toml |
cargo clippy |
Run all detected tools and capture both stdout and stderr. Record the baseline.
Hard gate: if NO tests AND NO type checker are found, stop and tell the user:
No tests or type checker found. Cannot validate that changes are safe.
1. Cancel -- set up tests or type checking first (recommended)
2. Proceed with --force -- I'll be careful but regressions may go undetected
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.
- 2d ago First seen · 159 lines · 80 tokens per session scan A 07ab7b124763
clean-code is a command published in the GitHub repository acaprino/daodan (8 stars, last pushed 6d ago), licensed MIT. It adds 80 tokens to every session and 1,488 once invoked, about $0.0004 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-31.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.