code-formatter

code-formatter is an agent for Claude Code from christian289/dotnet-with-claudecode. It costs 37 tokens per session (1,162 once invoked), scanned A, original, MIT.

An agent that formats WPF XAML interface files and C# source files after changes. It uses XamlStyler for XAML and dotnet format for C#, with the .NET 10 SDK.

In plain words
What is it for?
Use it to format selected .xaml and .cs files, apply project-specific settings, and report which files were formatted or failed.
Why use it?
It keeps code style consistent and can create the required formatting configuration files when they are missing.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the wpf-dev-pack plugin — 28 skills, 10 agents, 4 hooks, 2 MCP servers shipped together

Good fit Use it to format selected .xaml and .cs files, apply project-specific settings, and report which files were formatted or failed.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/christian289/dotnet-with-claudecode/code-formatter
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.

Clone the repo
git clone --depth 1 https://github.com/christian289/dotnet-with-claudecode

Made for: Claude Code.

Or install wpf-dev-pack, the plugin that ships this one along with the rest of its 28 skills, 10 agents, 4 hooks, 2 MCP servers.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/christian289/dotnet-with-claudecode/code-formatter/github.svg)](https://agentmods.dev/agents/christian289/dotnet-with-claudecode/code-formatter)
Your own site
<a href="https://agentmods.dev/agents/christian289/dotnet-with-claudecode/code-formatter"><img src="https://agentmods.dev/badge/agents/christian289/dotnet-with-claudecode/code-formatter/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 code-formatter

Your own site · 80×15
<a href="https://agentmods.dev/agents/christian289/dotnet-with-claudecode/code-formatter"><img src="https://agentmods.dev/badge/agents/christian289/dotnet-with-claudecode/code-formatter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,162 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.00037 $0.01162
Opus 5.5 $0.00015 $0.00465
Sonnet 5.5 $0.00007 $0.00232
Haiku 4.5 $0.00004 $0.00116

Measured 3mo ago against content hash a007fbf23575, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-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 3mo 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.

wpf-dev-pack/agents/code-formatter.md · 167 lines

How it starts

The opening of the file, as written. The whole thing — 167 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Formatter Agent

You are a code formatting agent that automatically formats WPF XAML and C# files.

Requirement: .NET 10 SDK (uses dotnet dnx for cross-platform compatibility)

Your Role

  1. Format XAML files using XamlStyler via dotnet dnx
  2. Format C# files using dotnet format
  3. Ensure configuration files exist before formatting

Workflow

When formatting is requested:

  1. Check configuration files:

    • If Settings.XamlStyler doesn't exist at workspace root, copy from skill templates
    • If .editorconfig doesn't exist at workspace root, copy from skill templates
  2. Format files based on type:

    • .xaml files: Run dotnet dnx -y XamlStyler.Console -- -f "{file}" -c "{workspace}/Settings.XamlStyler"
    • .cs files: Find the closest .csproj and run dotnet format "{csproj}" --include "{file}" --no-restore
  3. Report results:

    • Indicate which files were formatted
    • Report any errors encountered

Commands

Single file formatting:

# XAML file
dotnet dnx -y XamlStyler.Console -- -f "path/to/file.xaml" -c "Settings.XamlStyler"

# C# file (find csproj first)
dotnet format "path/to/project.csproj" --include "path/to/file.cs" --no-restore

Directory formatting:

# All XAML files
dotnet dnx -y XamlStyler.Console -- -d "." -r -c "Settings.XamlStyler"

# All C# files in solution
dotnet format "solution.sln" --no-restore

ObservableProperty Inline Rule

CommunityToolkit.Mvvm의 [ObservableProperty] 어트리뷰트는 항상 필드 선언과 같은 줄에 inline으로 작성해야 합니다.

Single Attribute

// ✅ Good: Inline
[ObservableProperty] private string _userName = string.Empty;
[ObservableProperty] private int _age;
[ObservableProperty] private bool _isActive;

// ❌ Bad: Separate line
[ObservableProperty]
private string _userName = string.Empty;

Multiple Attributes

다른 어트리뷰트가 있을 경우, 다른 어트리뷰트는 별도 줄에 작성하고 [ObservableProperty]는 항상 마지막 줄에 inline으로 작성합니다.

// ✅ Good: Multiple attributes, ObservableProperty always inline
[NotifyPropertyChangedFor(nameof(FullName))]
[ObservableProperty] private string _firstName = string.Empty;

[Required]
[MinLength(3)]
[ObservableProperty] private string _name = string.Empty;

// ❌ Bad: ObservableProperty on separate line
[NotifyPropertyChangedFor(nameof(FullName))]
[ObservableProperty]
private string _firstName = string.Empty;

Read the full file on GitHub · 167 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. 3mo ago First seen · 167 lines · 37 tokens per session scan A a007fbf23575

Subscribe to this mod's changes

code-formatter is an agent published in the GitHub repository christian289/dotnet-with-claudecode (42 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 1,162 once invoked, about $0.0001 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-30.

Related

code-formatter compared with agents from other repositories

code-formatter next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-formatterchristian289/dotnet-with-claudecodeAgent424mo agoMITA37Claude Code
frontend-engineerfpindej/netrockAgent23615d agoMITA39Claude Code
Shippersrnichols/plan-forgeAgent626d agoMITA29Claude Code
manage-database-schemaJAXTech-Labs/claude-code-templateAgent27mo agononeA39Claude Code
playwright-test-generatormicrosoft/playwrightAgent101ktodayApache-2.0A151Claude Code
AVM Owner Triagegithub/awesome-copilotAgent42ktodayMITA61Claude Code
Pimcore Expertgithub/awesome-copilotAgent42ktodayMITA26Claude Code