treefmt

treefmt is a skill for Claude Code from ncaq/konoka. It costs 45 tokens per session (1,583 once invoked), scanned A, original, Apache-2.0.

A Nix configuration guide for treefmt, a tool that runs formatters, linters, and other checks across multiple programming languages.

In plain words
What is it for?
Use it to configure formatters such as nixfmt, prettier, rustfmt, and shfmt, alongside checks such as shellcheck, deadnix, spelling checks, and GitHub Actions checks.
Why use it?
It clarifies what `nix fmt` runs and how to avoid missing new or untracked files in a project.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the nix-tasuke plugin — 6 skills, 1 MCP server shipped together

Good fit Use it to configure formatters such as nixfmt, prettier, rustfmt, and shfmt, alongside checks such as shellcheck, deadnix, spelling checks, and GitHub Actions checks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/treefmt
View source ↗ ncaq/konoka
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.

Any agent
npx skills add ncaq/konoka --skill treefmt
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install nix-tasuke, the plugin that ships this one along with the rest of its 6 skills, 1 MCP server.

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 treefmt

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/treefmt/github.svg)](https://agentmods.dev/skills/ncaq/konoka/treefmt)
Your own site
<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.

agentmods 80×15 button for treefmt

Your own site · 80×15
<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>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,583 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured yesterday against content hash 164be3bb1464, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

plugins/nix-tasuke/skills/treefmt/SKILL.md · 121 lines

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(スペルチェック)

Read the full file on GitHub · 121 lines

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. yesterday Changed · -74 lines 164be3bb1464
  2. 3mo ago First seen · 195 lines · 45 tokens per session scan A b903d156f807

Subscribe to this mod's changes

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.

Related

treefmt compared with skills from other repositories

treefmt next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
treefmtncaq/konokaSkill3yesterdayApache-2.0A45Claude Code
github-project-automationsecondsky/claude-skillsSkill257todayMITA45Claude Code
hono-routingsecondsky/claude-skillsSkill257todayMITA41Claude Code
api-testingsecondsky/claude-skillsSkill257todayMITA39Claude Code
bun-http-serversecondsky/claude-skillsSkill257todayMITA31Claude Code
bun-jest-migrationsecondsky/claude-skillsSkill257todayMITA25Claude Code
cloudflare-workers-migrationsecondsky/claude-skillsSkill257todayMITA49Claude Code