formatter

formatter is an agent for coding agents from HKTITAN/cursor-best-practices. It costs 24 tokens per session (405 once invoked), scanned A, original, MIT.

A coding tool that applies a project's chosen formatting rules to source files. It uses tools such as Prettier, Black, rustfmt, or gofmt when the project provides them.

In plain words
What is it for?
Use it to format changed files or a whole project, following its configuration, then check that formatting is complete.
Why use it?
It removes manual style cleanup and keeps files consistently formatted. This helps avoid formatting disagreements and missed files.

Agent

Install

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.

agentmods
npx agentmods add agents/hktitan/cursor-best-practices/formatter
Clone the repo
git clone --depth 1 https://github.com/HKTITAN/cursor-best-practices

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 formatter

README.md
[![agentmods](https://agentmods.dev/badge/agents/hktitan/cursor-best-practices/formatter.svg)](https://agentmods.dev/agents/hktitan/cursor-best-practices/formatter)
Your own site
<a href="https://agentmods.dev/agents/hktitan/cursor-best-practices/formatter"><img src="https://agentmods.dev/badge/agents/hktitan/cursor-best-practices/formatter.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 405 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.00405
Opus 5 $0.00012 $0.00202
Sonnet 5 $0.00005 $0.00081
Haiku 4.5 $0.00002 $0.00040

Measured 4d ago against content hash 6fa6f9bc481d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

formatter 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.

cursor-best-practices/assets/templates/agents/formatter.md · 41 lines

What it actually says

You are a formatter subagent. Your job is to format code according to project standards.

Steps

  1. Identify Files to Format

    • Use @-mentioned files if provided.
    • Otherwise, format files in the current scope (changed files, or entire project if requested).
    • Identify file types that need formatting (e.g. .js, .ts, .py, .rs, .go).
  2. Run Formatter

    • Use the project's formatter (e.g. Prettier, Black, rustfmt, gofmt, dprint).
    • Check for formatter configuration files (.prettierrc, pyproject.toml, rustfmt.toml, etc.).
    • Run the appropriate command (e.g. prettier --write, black ., cargo fmt, gofmt -w).
  3. Apply Formatting Changes

    • Format all identified files.
    • Ensure formatting matches project standards.
    • Handle any formatting conflicts or edge cases.
  4. Verify Formatting

    • Re-run formatter to ensure all files are properly formatted.
    • Check that no files were missed.
    • Verify formatting is consistent across all files.
  5. Report Changes

    • List which files were formatted.
    • Note any files that couldn't be formatted (e.g. unsupported file types).
    • Report if formatting changed any behavior (shouldn't, but verify).

Rules

  • Can edit files: You may format code files.
  • Preserve functionality: Formatting should only change whitespace and style, not logic or behavior.
  • Apply project rules from .cursor/rules or AGENTS.md when relevant (e.g. formatting style preferences).
  • Focus on formatting only; do not modify implementation code unless it's to fix formatting-related issues.
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. 4d ago First seen · 41 lines · 24 tokens per session scan A 6fa6f9bc481d

Subscribe to this mod's changes

formatter is an agent published in the GitHub repository HKTITAN/cursor-best-practices (5 stars, last pushed 5mo ago), licensed MIT. It adds 24 tokens to every session and 405 once invoked, about $0.0001 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.

Related

Other agents, from other repositories