Agent skill

Code Style

by Pixeval in Pixeval/Pixeval

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

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

Install Code Style

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

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

GitHub CLI
$ gh skill install Pixeval/Pixeval code-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/code-style .claude/skills/code-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
code-style
GitHub stars
3.2k
Token cost
~730 tokens
SKILL.md length
143 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
GPL-3.0

At a glance

  • SKILL.md covers 文件夹结构, 其他, Avalonia XAML and 国际化字符串管理, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

About this skill

Code Style is a skill in Pixeval/Pixeval (3.2k stars). Its SKILL.md is about 730 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.

    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

Code Style loads about 730 tokens when it runs. Until then it costs about 8 tokens; SKILL.md has 143 words of instructions outside code blocks.

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

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). 143 words, ~730 tokens.

Download SKILL.mdSave it as .claude/skills/code-style/SKILL.md (or your agent's skills folder).
name
code-style
description
工程代码编写风格指引(不含简单的格式化风格)

Pixeval 代码风格

  • 在重构代码时,不要被既有模式束缚住,直接重构为更合理、更高效的实现。
  • 修改代码时,不要作打补丁式的临时修改,并且不要留下兼容代码或过渡方案,避免新旧逻辑混杂。
  • 在关键处留下注释以表达意图。
  • 优先复用现有包和辅助项目、工具类,避免重复造轮子,优先复用 Pixeval.Utilities 或本项目里已经有的辅助函数和扩展,例如 SelectNotNull、PickMax/PickClosest、FileHelper、MakoHelper 和缓存辅助方法。
  • 保持代码可 AOT 编译,避免使用反射、动态代码,但是若可以用 [DynamicallyAccessedMembers] 避免反射失败则可以使用。
  • 对于相近功能的模型,通过继承、接口、组合等方式复用代码,避免重复代码。
  • 可观测属性优先使用 CommunityToolkit 的 [ObservableProperty] 生成器,并附在部分属性上而不是字段上来生成。
  • 对于难以处理的异常,可以使用 App.AppViewModel.AppServiceProvider.GetRequiredService<FileLogger>() 记录日志,但若频繁抛出的异常(如 OperationCanceledException、TaskCanceledException等)则不记录。

文件夹结构

  • AppManagement:应用状态和生命周期管理。
  • Controls:模板控件或控件样式,模板控件继承 TemplatedControl,成对的文件命名也使用 .axaml 和 .axaml.cs;资源字典要在 Themes/Controls.axaml 里引用。
  • Utilities:辅助函数和扩展方法。
  • Views:普通的用户控件,包括页面等。
  • ViewModels:视图模型。
  • Models:数据模型。
  • i18n:国际化字符串资源。

其他

Avalonia XAML

  • 打开浏览器、复制文本使用 AvaloniaHelper 里封装好的静态属性,参数通过 Tag 属性指定。
  • 通过现有 {I18N ...} 标记扩展指定本地化字符串。
  • 复用主题资源,例如 ControlCornerRadius、TextFillColorSecondaryBrush、SystemAccentColor 等。不要在资源字典外硬编码颜色。
  • 对来自 URL 或可缓存源的图片加载,优先使用已有附加属性,例如 controls:Source.Cache,而不是直接设置 Image.Source。
  • 优先复用现有的 Views.Converters、Views.Markup、Utilities 里已有的转换器和标记扩展,不要临时在 code-behind 里手写格式化。

国际化字符串管理

  • 主项目 UI 中禁止出现硬编码的字符串(除非不需要翻译的名字、专有名词),所有用户可见的字符串都必须通过资源管理。
  • 字符串资源在 i18n 文件夹里以语言划分,包含 JSON 文件和 Markdown 文件两种形式。
  • 编辑完字符串资源后,运行 i18n/Language.tt 来生成对应的 Language.cs,不要手动编辑这个文件。
  • C# 文件中,使用 I18NManager.GetResource(XXXResources.XXX) 来获取字符串。禁止直接使用常量字符串: I18NManager.GetResource("XXXResources.XXX")。
  • XAML 文件中,使用 {I18N {x:Static xxx:XXXResources.XXX}} 标记扩展来获取字符串。禁止直接使用常量字符串: {I18N XXXResources.XXX}。
  • 对于自定义枚举,若要给每个枚举值指定一个对应的字符串资源(来给ComboBox等控件使用),则遵循以下步骤:
    • 先在 i18n/xx-XX/Enum.json 中定义枚举值对应的字符串资源,并生成 Language.cs。
    • 若是项目内定义的枚举,在枚举上提供 [LocalizationMetadata],并在每个枚举值上提供 [LocalizedResource(EnumResources.XXX)] 来指定资源键,也可以通过 [LocalizedResource(Resource = "XXX")] 直接指定本地化字符串的值,在使用不需要翻译的专有英文名词时会用到(如 "http")。
    • 若是外部库的枚举,则在 Models/Settings/LocalSettingsEntryHelper.cs 的静态构造函数里指定映射,参考已有示例即可。

添加设置项

  • 设置页应优先使用现有的设置生成器,而不是直接手写。大致流程是:
    • 先在 AppManagement/AppSettings.cs 中添加一个新的可读可写属性,若有必要可指定默认值。
    • 在 i18n/xx-XX/AppSettings.json 中添加这个设置项的名称和描述资源,并生成 Language.cs。
    • 给这个属性添加一个 [SettingsEntry],指定设置图标(Icon)、标题(Header)资源和描述(Description)资源,还可以指定占位符(Placeholder)资源。
    • 在 ViewModels/SettingsPageViewModel.cs 的 LocalGroups 属性中选择合适的设置组,注册设置项;若有必要可以指定 ValueChanged 回调或更多复杂的逻辑。
    • 若要实现特殊的设置项控件,需要在 Views/Settings 下实现一个 XXXSettingsCard 或 XXXSettingsExpander,继承于 IEntryControl<XXXSettingsEntry>;并在 Models/Settings/LocalSettingsEntryHelper.cs 静态构造函数里注册设置项对应的控件类型。
    • 如果要实现出了基元和数组类型外的设置项,需要在 Models\Settings\Entries 下实现一个 XXXSettingsEntry 设置类,再注册对应的设置控件。

完成前

  • 对当前改动的文件,运行最小且相关的格式化 / 构建 / 测试命令。

© 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/code-style of Pixeval/Pixeval.

Open the folder on GitHubat commit 30f113f

Compare with similar skills

Code 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.

Code Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Style this skillPixeval/Pixeval3.2k—~730Automated 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 today
    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 today
    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
  • Format Style

    Pixeval/Pixeval

    工程代码格式化风格指引

    3.2k GitHub stars~1.2k 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 Code Style

How do I install Code Style in Claude Code?

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

How do I install Code Style in Codex?

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

Can I use Code 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 code-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/code-style, .gemini/skills/code-style, .github/skills/code-style and .opencode/skills/code-style in your project.

What does Code Style need to run?

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

Does Code 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 Code 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 Code Style use?

Code 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 Code Style use?

About 730 tokens (SKILL.md is roughly 2.9k 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 Code Style?

Skills that share tags, products or a category with Code 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 Code Style?

Pixeval (a GitHub organization) maintains it in Pixeval/Pixeval, which has 3,164 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.