code-formatter

code-formatter is an agent for coding agents 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

Part of the wpf-dev-pack plugin — 9 agents, 2 MCP servers shipped together

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/christian289/dotnet-with-claudecode/code-formatter
Clone the repo
git clone --depth 1 https://github.com/christian289/dotnet-with-claudecode

Or install wpf-dev-pack, the plugin that ships this one along with the rest of its 9 agents, 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.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.svg" alt="Measured on agentmods" 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. 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.00037 $0.01162
Opus 5 $0.00018 $0.00581
Sonnet 5 $0.00007 $0.00232
Haiku 4.5 $0.00004 $0.00116

Measured 4d ago against content hash a007fbf23575, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. 4d 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 (41 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 1,162 once invoked, about $0.0002 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-30.

Related

Other agents, from other repositories

documentation-updater

Technical writing specialist for creating and maintaining documentation. Use proactively after code changes to detect and fix documentation drift - new or changed APIs, parameters, configuration, dependencies, or removed features. Also use when asked to write or update READMEs, getting-started guides, API references…

sintaxasn/Fluence.Wpf · 91 tokens

theme-slot-auditor

Read-only auditor for Fluence.Wpf theming structure. Use after any theme, brush, color, accent, or ApplicationThemeManager change to verify the three-slot MergedDictionaries invariant, that slot [0] is rebuilt and replaced every Apply, DynamicResource usage, BrushFactory auto-twinning, canonical WinUI key names, and…

sintaxasn/Fluence.Wpf · 90 tokens

net472-feasibility-checker

Read-only checker that verifies new or changed code in Fluence.Wpf stays runnable on net472. Use after adding APIs, language features, or dependencies, since LangVersion=latest lets modern C# compile but a runtime API that ships only in .NET 10 fails on the separate net472 test lane. Enforces AGENTS.md section 4.3.

sintaxasn/Fluence.Wpf · 81 tokens

winui-parity-reviewer

Read-only reviewer for Fluence.Wpf control and theme changes. Use to compare WPF templates, resources, and behavior against WinUI 3 CommonStyles and official Microsoft guidance.

sintaxasn/Fluence.Wpf · 43 tokens

release-manager

Owns the end-to-end modelcontextprotocol/csharp-sdk release process, orchestrating the prepare-release and publish-release skills (and the bump-version and breaking-changes skills they build on) across five stages: prepare (assess SemVer, bump the version, run ApiCompat/ApiDiff, review docs, draft release notes, open…

modelcontextprotocol/csharp-sdk · 317 tokens

refuter

あなたは判事のCritical予測群に対する反証役である。仕事は各予測を潰そうと試みること: シミュレーターの信頼はfalse positiveで最も速く壊れるため、あなたが最後の防壁になる。.

moorestech/moorestech · 0 tokens