Agent skill

Format Style

by Pixeval in Pixeval/Pixeval

“工程代码格式化风格指引”

— description from SKILL.md by Pixeval
GPL-3.0Auto-check passedFrontend & Design

Install Format Style

skills CLI
$ npx skills add Pixeval/Pixeval --skill format-style -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Pixeval/Pixeval format-style --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Pixeval/Pixeval.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/format-style .claude/skills/format-style && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
format-style
GitHub stars
3.2k
Token cost
~1.2k tokens
SKILL.md length
331 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
GPL-3.0

At a glance

  • SKILL.md covers 基本要求, C# 偏好 and Avalonia XAML
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Format Style is a skill in Pixeval/Pixeval (3.2k stars). Its SKILL.md is about 1.2k tokens. Licence: GPL-3.0.

What it can do on your machine

Read from SKILL.md and the folder at commit 30f113f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are xml).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Format Style loads about 1.2k tokens when it runs. Until then it costs about 6 tokens; SKILL.md has 331 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~6
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Pixeval/Pixeval at commit 30f113f, republished under its GPL-3.0 licence (© Pixeval). 331 words, ~1,201 tokens.

Download SKILL.mdSave it as .claude/skills/format-style/SKILL.md (or your agent's skills folder).
name
format-style
description
工程代码格式化风格指引

Pixeval 格式化风格

若有未详尽覆盖的情况,可参考任意 src 下的代码,但不包括 src/lib 里的第三方或子模块代码。

基本要求

  • 保留现有文件头。除非所在目录本身就有同类头部,否则不要给原本没有头部的文件新增头部。
  • 视图/控件的 .axaml 和 .axaml.cs 文件要成对维护。
  • 默认按现代 C# 假设:主项目目标框架是 net10.0,启用了 nullable,LangVersion 是 latest,并且默认启用编译绑定。

C# 偏好

  • 基础代码风格遵循 .editorconfig 中的设置。
  • 使用 UTF-8、CRLF、末尾换行、4 空格缩进,不使用 tab。
  • using 指令不要用空行拆分导入组。
  • 使用 file-scoped namespace。
  • 尽量使用 var,包括内置类型和一眼可见的类型。
  • 使用 nullable,并在所有地方保证空安全,不要留下 null 警告。对于临时为 null 的瞬态,可以用 null!。
  • 优先使用模式匹配:
    • 对常量优先使用 is 模式匹配而不是 == 或 !=:count is 0、count is not 0、value is null、value is not null、value is not A and not B。
    • 用 obj is { } value 绑定非空值。
    • 使用属性/列表模式,例如 entry is { Width: > 0, Height: > 0 }。
    • 对形状不匹配的情况,用 is not { ... } 做守卫。
  • 分支语句优先级: switch 表达式 > switch 语句 > if/else if 链,尤其适合枚举、类 union 的状态、命令和类型分发。
  • 当成员能在一行内清楚表达时,优先使用表达式主体:属性、访问器、简单方法、局部函数、转换器和运算符都适用。
  • 优先使用对象/集合初始化器、集合表达式([]、[.. items])、空条件运算、??、throw 表达式、范围/索引运算符、元组命名,以及清晰时的匿名成员推断。
  • if-else 中若主体是一行以内,则可以省略大括号;若分支中有跳转语句(如return、break、continue 等)则优先写在 if 中,并且省略 else 来减少嵌套层级。
  • 强制转换后面保留一个空格:(Type) value。
  • 二元运算符两侧保持空格,换行时把运算符放在下一行开头。
  • 简单场景优先使用 using var 或 await using var,不要嵌套多层 using 块。
  • using var 或 await using var 若有初始化列表则拆开,避免初始化时发生异常导致资源未正确释放。例如:using var a = new A { X = 1 }; 应该改为 using var a = new A(); a.X = 1;。
  • 当有意忽略一个非 void 返回值时,使用弃元(_ = ...;),表达式主体的方法除外。
  • 对“理论上穷尽”的 switch,使用 ArgumentOutOfRangeException(nameof(value)) 或等价的默认分支。
  • 如果所有构造函数都调用某一个构造函数,或只有一个构造函数,优先把这个构造函数改为主构造函数。
  • 对于返回 Task 或 Task<T> 的方法,若只有返回时用到 Task,则不需要将方法声明为异步(async)方法,而是直接返回 Task,但方法名仍然需要 Async 后缀。
  • 在非 UI 层的异步方法中,最后一个参数使用 CancellationToken token = default,并在其中所有 await 的 Task 使用 ConfigureAwait(false) 避免切换线程上下文。但在 UI 代码中,不要这样做以避免死锁。
  • 对于变量名引用,使用 nameof(...) 而不是字符串字面量,包括字符串内插中。
  • 对可复用的查找/转换状态,使用 Lazy<T>、FrozenDictionary、生成正则,或者静态只读转换器实例,不要每次调用都重建数据。
  • 对 IDisposable,若需要则调用 GC.SuppressFinalize(this)。
  • 如果可以,则将字段/属性/结构体/方法/局部方法设为 static/readonly/const/getonly/initonly 等以增强约束。
  • 不要使用旧的扩展方法,而使用 C# 14 中新的 extension blocks,并将同一类型的扩展聚在一起。
  • 尽量使用 stackalloc、Span<T>、Memory<T> 等来增强性能。
  • 抛出异常时提供要意义的消息、参数名称。
  • 不论行长短,属性、方法、类型的特性(Attribute)都要单独一行;而方法参数、泛型参数的特性可以和参数在同一行。
  • 编写 XML 注释时:
    • 对于继承自接口或基类的成员,优先使用 <inheritdoc /> 来继承文档。
    • 对于调用其他方法所以文档可以直接复用的成员,优先使用 <inheritdoc cref="..." /> 来复用文档。
    • 对于引用的类型、成员,使用 <see cref="..." />,并且不要使用全限定名,而是也用 using 引入。
    • 对于成员引用或泛型参数引用,<paramref name="..." />、<typeparamref name="..." /> 来提供链接。
    • 对于其中的关键字,使用 <see langword="..." /> 来增强高亮。
  • 接口中的泛型若可以用协变/逆变,则使用。
  • 对于返回值,优先使用 IReadOnlyCollection<T> 或更严格的 IReadOnlyList<T> 而不是 IEnumerable<T>,以表达集合内元素有限。除非这些情况:
    • 迭代代价昂贵,需要使用迭代器方法(yield return)延迟加载。
    • 包装一个已有的 IEnumerable<T> 的方法。
    • 仅进行管道式处理(例如 Select、Where、OrderBy 等)并返回一个新的 IEnumerable<T>。
    • 其他使用 IEnumerable<T> 更合理的情况。
  • 优先使用 IReadOnlyList<T>或ReadOnlySpan<T> 而不是 T[] 来表示数组,以避免潜在的数组协变。
  • 若一个类内容太多,可以拆成形如 .Commands.cs 的 partial 文件。
  • 对于每个类都较长的多个类,或者关系不大的多个类(例如某个类不是只在另一个类中使用),则拆分成每个类一个文件而不是放在同一个文件里。
  • 使用 Linq 时,优先使用方法链式调用而不是查询表达式。
  • 输出大段换行文本时,不要使用连续的 AppendLine 或 WriteLine 等,而是使用生字符串(""" 三引号包裹的字符串),并且字符串开头引号之前必须换行。
  • 命名时:
    • 对非抛出式尝试使用 Try* 命名(例如 TryReset、TryDelete)。
    • 类型、属性、事件、方法、可见字段和常量使用 PascalCase。
    • 接口以 I 开头。
    • 私有实例字段使用 _camelCase;私有静态字段使用 _PascalCase;常量字段、非私有的字段使用 PascalCase。

Avalonia XAML

  • 基础代码风格遵循 Settings.XamlStyler 中的设置。

  • 尽量使用有类型信息的 XAML:

    • x:DataType="{x:Type vm:SomeViewModel}"
    • TargetType="{x:Type Button}"
    • x:Key="{x:Type controls:SomeControl}"
    • BasedOn="{StaticResource {x:Type ListBox}}"
  • 对于 XAML 内的命名空间引用,使用 xmlns:prefix="using:..." 而不是 xmlns:prefix="clr-namespace:...;assembly=..."。对于根元素类所在的命名空间,使用 local 作为命名空间 xmlns:local="using:..."。

  • 空元素使用自闭合标签。

  • 稳定的样式/模板优先用 StaticResource,和主题相关的画刷/颜色优先用 DynamicResource。

  • 优先使用编译/有类型绑定配合 x:DataType。

  • 对控件主题/模板,使用 ControlTheme、ControlTemplate、诸如 PART_ContentPresenter 的命名部件,以及 TemplateBinding 处理模板属性。

  • 优先使用标记扩展以减少代码行数,例如使用 {markup:SymbolIcon ...} 而不是 <fluent:SymbolIcon Symbol="..." />

  • 文本布局优先使用 TextTrimming、MaxLines、TextWrapping 和资源文本主题,而不是自己写测量逻辑。

  • 标准可绑定控件状态使用 Avalonia StyledProperty,非样式属性或用户控件中定义的需要绑定的属性使用 DirectProperty 和 SetAndRaise。

  • 绑定风格:

    • 优先使用 Avalonia 语法,如 $parent[...]、#Name等。
    • 优先使用 Avalonia 语法而不是转换器,例如 IsVisible="{Binding !!Items.Count}"、{Binding !IsFollowed}。
简单示例
xml
<ControlTheme x:Key="{x:Type controls:AvatarImage}" TargetType="{x:Type controls:AvatarImage}">
    <Setter Property="Template">
        <ControlTemplate TargetType="{x:Type controls:AvatarImage}">
            <Image Source="{TemplateBinding Source}" />
        </ControlTemplate>
    </Setter>
</ControlTheme>

© Pixeval, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/format-style of Pixeval/Pixeval.

Open the folder on GitHubat commit 30f113f

Compare with similar skills

Format Style next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Format Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Format Style this skillPixeval/Pixeval3.2k—~1.2kAutomated safety check: PassGPL-3.0
Docusaurus StylingAvaloniaUI/avalonia-docs166—~3.3kAutomated safety check: PassNone
API Link BuilderAvaloniaUI/avalonia-docs166—~3.1kAutomated safety check: PassNone
Discussion Gap FinderAvaloniaUI/avalonia-docs166—~2.2kAutomated safety check: PassNone
Oneware Stylingone-ware/OneWare147—~1.1kAutomated safety check: PassApache-2.0
Wfa Avalonia UItautcony/ChapterTool113—~1.1kAutomated safety check: PassGPL-3.0

Similar skills

  • Docusaurus Styling

    AvaloniaUI/avalonia-docs

    Style Docusaurus sites to match Avalonia Customer Portal theme using TailwindCSS, CSS variables, and component swizzling.

    166 GitHub stars~3.3k tokensUpdated today
    Frontend & DesignAuto-check passed
  • API Link Builder

    AvaloniaUI/avalonia-docs

    Scans the /docs directory for opportunities to cross-link with API reference documentation in /api, and vice versa.

    166 GitHub stars~3.1k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Discussion Gap Finder

    AvaloniaUI/avalonia-docs

    Analyzes GitHub discussion links to identify documentation gaps.

    166 GitHub stars~2.2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Oneware Styling

    one-ware/OneWare

    Styles OneWare Avalonia UI with the shared design system (tokens, classes, icons, control themes).

    147 GitHub stars~1.1k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Wfa Avalonia UI

    tautcony/ChapterTool

    Phase D of a WinForms-to-Avalonia migration: build the Avalonia UI shell with composition, MVVM state and commands, responsive XAML, accessibility, localization boundaries, and behavior-focused…

    113 GitHub stars~1.1k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Fieldworks Avalonia UI

    sillsdev/FieldWorks

    Build, review, or fix Avalonia UI code in FieldWorks: XAML, MVVM, view models, owned controls, headless tests, preview host, accessibility identity, and product-vs-preview wiring.

    110 GitHub stars~3.1k tokensUpdated today
    Frontend & DesignAuto-check passed

More from Pixeval/Pixeval

  • I18n

    Pixeval/Pixeval

    Pixeval 国际化资源维护规范,涵盖用户可见字符串、JSON/Markdown 资源、XAML/C 引用、非默认语言增删规则以及 Language.tt 生成验证。Use when adding, moving, removing, or changing localized text in Pixeval.

    3.2k GitHub stars~349 tokensUpdated yesterday
    Auto-check passed
  • Code Style

    Pixeval/Pixeval

    工程代码编写风格指引(不含简单的格式化风格)

    3.2k GitHub stars~730 tokensUpdated yesterday
    Auto-check passed
  • Pixeval MCP

    Pixeval/Pixeval

    Pixeval MCP 维护指南。仅当修订 MCP 功能相关时需要读取并遵守。

    3.2k GitHub stars~608 tokensUpdated yesterday
    Auto-check passed
  • Tools

    Pixeval/Pixeval

    代码工具选择

    3.2k GitHub stars~217 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Format Style

How do I install Format Style in Claude Code?

Run `npx skills add Pixeval/Pixeval --skill format-style -a claude-code`. Or copy the skill folder (.agents/skills/format-style in Pixeval/Pixeval) into .claude/skills/format-style in your project. Claude Code loads it when a task matches its description.

How do I install Format Style in Codex?

Run `npx skills add Pixeval/Pixeval --skill format-style -a codex`. Or copy the skill folder (.agents/skills/format-style in Pixeval/Pixeval) into .agents/skills/format-style in your project. Codex loads it when a task matches its description.

Can I use Format Style in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Pixeval/Pixeval --skill format-style -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/format-style, .gemini/skills/format-style, .github/skills/format-style and .opencode/skills/format-style in your project.

What does Format Style need to run?

SKILL.md names no scripts, command-line tools or credentials: Format Style is instructions for the agent only.

Does Format Style access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Format Style safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Format Style use?

Format Style is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Format Style use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Format Style?

Skills that share tags, products or a category with Format Style: Docusaurus Styling (AvaloniaUI/avalonia-docs, 166 stars), API Link Builder (AvaloniaUI/avalonia-docs, 166 stars), Discussion Gap Finder (AvaloniaUI/avalonia-docs, 166 stars) and Oneware Styling (one-ware/OneWare, 147 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Format Style?

Pixeval (a GitHub organization) maintains it in Pixeval/Pixeval, which has 3,163 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 6, 2026.

Source: Pixeval/Pixeval on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.