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 skills add ncaq/konoka --skill treefmtgit clone --depth 1 https://github.com/ncaq/konokaWrote 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/ncaq/konoka/treefmt)<a href="https://agentmods.dev/skills/ncaq/konoka/treefmt"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/treefmt/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.
<a href="https://agentmods.dev/skills/ncaq/konoka/treefmt"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/treefmt.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00045 | $0.01583 |
| Opus 5.5 | $0.00018 | $0.00633 |
| Sonnet 5.5 | $0.00009 | $0.00317 |
| Haiku 4.5 | $0.00005 | $0.00158 |
Grade A, and why
treefmt 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 yesterday.
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 — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
treefmt-nix
treefmtは、
プロジェクト内の複数の言語のファイルを、1つのコマンドで並列にフォーマットするツールです。
treefmt-nixは、
treefmtをNixのモジュールシステムで設定するラッパーです。
flakeに組み込むとformatter出力がtreefmtになり、
nix fmtで、設定した全てのプログラムが実行されます。
未追跡のファイルを先に登録する
flakeはGitが追跡しているファイルだけを対象にします。
未追跡の新しいファイルがある場合は、nix fmtの前に以下を実行してください。
未追跡のファイルが無くて入力が空でも、エラーにはなりません。
git ls-files --others --exclude-standard -z | git add --intent-to-add --pathspec-from-file=- --pathspec-file-nul
フォーマッタだけでなくリンターも実行する
nix fmtやtreefmtという名前から、フォーマッタしか実行しないと誤解しやすいですが、
treefmt-nixのprogramsにはリンターやチェッカーも多く含まれています。
treefmtがプログラムに求める仕様は、
<command> [options] [...<files>]の形でファイルのパスの一覧を受け取り、
変更があればファイルに書き戻し、エラーのときは非ゼロで終了することです。
リンターはファイルを変更しませんが、
エラーのときに非ゼロで終了するので、treefmtがエラーとして検出します。
設定の例
flake-partsを使う場合の例です。
flake-parts.lib.mkFlakeに渡すモジュールのうち、treefmtに関わる部分だけを示します。
{
imports = [ treefmt-nix.flakeModule ];
perSystem =
{ pkgs, ... }:
{
treefmt.config = {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
prettier.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
};
settings.formatter.editorconfig-checker = {
command = pkgs.editorconfig-checker;
includes = [ "*" ];
};
};
};
}
ツールの設定は、そのツールの設定ファイルに書く
treefmtの設定モジュールでツールに引数を渡すこともできますが、
ツールの設定はなるべくflake.nixではなく、そのツールが標準で読む設定ファイルに書いてください。
nix fmtを経由せずにそのツールを使うときにも、同じ設定が適用されるためです。
引数でしか設定できないツールの場合は、flake.nixに書いて構いません。
よく使われるプログラム
| 対象 | フォーマッタ | リンター、チェッカー |
|---|---|---|
| Nix | nixfmt |
deadnix, statix(自動修正もします) |
| シェルスクリプト | shfmt |
shellcheck |
| JS/TS/CSS/HTML/JSON/Markdown/YAMLなど | prettier |
|
| Haskell | fourmolu, cabal-gild(Cabalファイル) |
hlint |
| C/C++ | clang-format |
|
| Go | gofmt |
|
| Python | ruff-format |
ruff-check |
| Rust | rustfmt |
|
| TOML | taplo |
|
| YAML | yamlfmt |
|
| GitHub Actions | actionlint, zizmor(セキュリティ) |
|
| ソースコード全般 | typos(スペルチェック) |
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.
- yesterday Changed · -74 lines 164be3bb1464
- 3mo ago First seen · 195 lines · 45 tokens per session scan A b903d156f807
treefmt is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed yesterday), licensed Apache-2.0. It adds 45 tokens to every session and 1,583 once invoked, about $0.0002 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-31.
treefmt compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| treefmtncaq/konoka | Skill | 3 | yesterday | Apache-2.0 | A | 45 | Claude Code |
| github-project-automationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 45 | Claude Code |
| hono-routingsecondsky/claude-skills | Skill | 257 | today | MIT | A | 41 | Claude Code |
| api-testingsecondsky/claude-skills | Skill | 257 | today | MIT | A | 39 | Claude Code |
| bun-http-serversecondsky/claude-skills | Skill | 257 | today | MIT | A | 31 | Claude Code |
| bun-jest-migrationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 25 | Claude Code |
| cloudflare-workers-migrationsecondsky/claude-skills | Skill | 257 | today | MIT | A | 49 | Claude Code |