Agent skill

Atomui Control Optimization

by AtomUI in AtomUI/AtomUI

A skill your agent uses when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…

LGPL-3.0Auto-check passedDevelopment

Install Atomui Control Optimization

skills CLI
$ npx skills add AtomUI/AtomUI --skill atomui-control-optimization -a claude-code

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

GitHub CLI
$ gh skill install AtomUI/AtomUI atomui-control-optimization --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/AtomUI/AtomUI.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/atomui-control-optimization .claude/skills/atomui-control-optimization && 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
atomui-control-optimization
GitHub stars
842
Token cost
~3.4k tokens
SKILL.md length
1,564 words
Files
3 (incl. references)
Skills in repo
15
Repo updated
First seen
Licence
LGPL-3.0

At a glance

A skill your agent uses when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…

  • Works in 8 steps: Inspect the target control and 2-3… → For broad optimization, perform the… → Inventory the exposed contract before… → …
  • Fixing AtomUI controls
  • SKILL.md covers Overview, Required Reading, Route First and Mandatory Audit Gate, plus 8 more sections
  • Calls git

What it does

Atomui Control Optimization is an agent skill from AtomUI/AtomUI. Use when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness, performance, Gallery-visible behavior, or documentation impact.

Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/api-layout-and-splitting.md` and `references/deep-control-optimization.md`).

It sits in Development, covering API design and Refactoring. The repository describes itself as: An enhancement and extension library for Avalonia, bringing the Ant Design design language, modern controls, theming, native integrations, and cross-platform UI capabilities to… The licence is LGPL-3.0.

When your agent uses it

  • Fixing AtomUI controls
  • Including control API contracts
  • AXAML structure
  • Gallery-visible behavior

Example prompts

  • “/atomui-control-optimization”

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Inspect the target control and 2-3 comparable controls in the same package.
  2. For broad optimization, perform the mandatory audit gate before editing.
  3. Inventory the exposed contract before deciding the edit shape.
  4. Classify API risk, file split need, and optimization mode.
  5. Present findings and phases when behavior, render, architecture, or broad cleanup risks exist.
  6. Make the smallest scoped change that matches existing control style.
  7. Run targeted tests first, then broaden based on risk.
  8. Always run git diff --check before reporting completion.

What it can do on your machine

Read from SKILL.md and the folder at commit d234fe0. 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

    Shell commands in SKILL.md call:

    • git

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

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Atomui Control Optimization loads about 3.4k tokens when it runs, and up to ~9k if it reads all its reference files. Until then it costs about 67 tokens; SKILL.md has 1,564 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~67
When it runs · the whole SKILL.md, loaded when a task matches
~3.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9k

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 AtomUI/AtomUI at commit d234fe0, republished under its LGPL-3.0 licence (© AtomUI). 1,564 words, ~3,404 tokens.

Download SKILL.mdSave it as .claude/skills/atomui-control-optimization/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
atomui-control-optimization
description
Use when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness, performance, Gallery-visible behavior, or documentation impact.

AtomUI Control Optimization

Overview

This is the entry skill for AtomUI control work. Its job is to classify the change, lock down public contracts, route to narrower skills when needed, and keep control optimization from mixing unrelated API, behavior, lifecycle, performance, and layout changes.

Required Reading

Before touching control code, read:

  • docs/engineering/development/control-development-guidelines.md
  • docs/engineering/contributing/agent-guidelines.md

For API contract optimization, member layout, method reordering, or file splitting, also read:

  • references/api-layout-and-splitting.md

For messy implementation, repeated edge-case bugs, unclear state ownership, or architecture-level control redesign, also read:

  • references/deep-control-optimization.md

Route First

Classify the request before editing.

For broad optimization requests, routing is a blocking gate. Requests phrased as "重新优化", "整体优化", "代码比较乱", "按照控件优化 skill 优化", "评估整体正确性", or similar must not go directly to code edits. First perform an optimization audit and report findings, phase plan, contract impact, and residual risks. Only skip the audit when the user names one narrow bug or one narrow mechanical edit.

If the work involvesRequired handling
API contracts, member order, method layout, partial splitRead references/api-layout-and-splitting.md
Messy implementation, boundary-condition bugs, tangled state, architecture root optimizationRead references/deep-control-optimization.md
DynamicResource, token resource binding, subscriptions, owner/container lifecycleAlso use atomui-resource-lifecycle
Performance claims, lazy visuals, binding cost, template optimizationAlso use atomui-control-performance
BindUtils.RelayBind, C#-created bindings, or template-owned binding relationshipsProve AXAML cannot express the binding before keeping C# binding; define disposal owner
Bug fix or behavior changeReproduce/trace root cause and add or update regression tests
Gallery-visible examples or docsCheck Gallery/docs impact and update only when required
AOT-sensitive binding, reflection, dynamic registrationCheck docs/engineering/development/aot-programming-guidelines.md

Mandatory Audit Gate

Before editing a control for broad optimization, write a short audit in the working notes or user-facing plan. The audit must answer:

text
Optimization request type: broad / narrow
Control:
Primary responsibilities:
State owners:
Lifecycle acquire/release pairs:
Data/selection/key flows:
Template parts and generated containers:
Existing tests / missing regression:
Dead or duplicate implementation scan:
Potential API/behavior/render changes:
Recommended phases:
What will not be changed in this pass:

If the audit finds no issues beyond member order, say that explicitly. If it finds behavior risks, do not hide them behind "cleanup"; classify them as edge-case correctness or architecture root fix and add tests before changing behavior.

Hard Boundaries

  • Without explicit user approval, do not change control API, behavior, or rendered result. This is a blocking constraint, not a preference.
  • Control API includes public/protected members, Avalonia properties/events, template parts, token names, resource keys, pseudo-classes, and documented or Gallery-exposed usage.
  • Behavior includes default values, binding priority, event timing, state transitions, focus/keyboard/pointer interaction, popup lifecycle, validation, async/data loading, and observable side effects.
  • Rendered result includes visual tree semantics, layout size, spacing, alignment, colors, typography, animations, theme response, pseudo-class visuals, and template selector behavior.
  • Control optimization must not introduce logic bugs, performance regressions, or resource leaks. If a proposed optimization cannot preserve correctness, performance, and lifecycle safety, stop and redesign before editing.
  • Fix root causes instead of patching trigger points. Do not use flag variables, delayed refreshes, forced sync, or suppression paths to hide broken state flow; patch-style fixes make controls harder to maintain and are a blocker unless explicitly justified as a deterministic state machine.
  • Do not introduce unnecessary classes, helpers, abstractions, boolean-switch parameters, marker fields, or local marker variables while fixing a control. Every new artifact must have durable ownership and a reason beyond making the current patch convenient.
  • If investigation or review finds an unnecessary class, duplicate helper, speculative abstraction, patch flag, or stale artifact introduced by the current change, remove it before reporting completion. Do not leave it as harmless cleanup for later.
  • Prefer existing shared primitives and comparable-control implementations over one-off private classes. A private class is allowed only when no existing primitive expresses the behavior correctly and the class removes real duplication or clarifies a stable responsibility.
  • Do not mix pure member reordering with behavior fixes. If a bug is found during reordering, split it into a behavior fix with tests.
  • Member layout cleanup must preserve the control contract as the first reading path. Do not place internal collaboration members, internal const, internal static helpers, private helpers, runtime fields, or patch artifacts before the public contract region inside a control class.
  • Do not split files just because a file looks long. Under about 2000 lines, prefer method order, regions, and private helper extraction.
  • Do not treat the 2000 line threshold as an automatic split rule. Even after the threshold is crossed, split only when the control has real, stable responsibility boundaries.
  • Do not scatter a control into many small partial files. Public API contracts must remain in the main control file.
  • Do not move lifecycle entry points out of the main control file unless the control is already deliberately partial and the entry remains easy to find.
  • Do not introduce performance-oriented dynamic C# visual creation unless atomui-control-performance allows it.
  • AXAML-first binding is a hard boundary. For template-owned visual state, template part state, style state, and fixed control-to-template relationships, use AXAML binding, TemplateBinding, style selectors, or existing theme/resource mechanisms before considering C# binding.
  • BindUtils.RelayBind is the last binding creation mechanism, not the default convenience API. Before adding or keeping it, prove why the same relationship cannot be expressed in AXAML without changing API, behavior, rendered result, binding mode, binding priority, or template contract.
  • Allowed BindUtils.RelayBind cases are limited to relationships AXAML cannot naturally express, such as dynamically created runtime targets, sibling/template-part coordination that cannot be represented by TemplateBinding or selectors, runtime-selected source objects, or bindings whose lifecycle is owned by a non-template runtime object.
  • Every accepted BindUtils.RelayBind must have an explicit release path matching its acquisition path, such as re-template cleanup, detach, owner disposal, popup/content clear, or container recycle. Do not create relay bindings without a matching dispose owner.
  • Do not use BindUtils.RelayBind to work around inconvenient AXAML. If the binding source and target are both stable parts of the control template, move the relationship into AXAML unless doing so would require an approved contract or behavior change.
  • Do not report broad control optimization as complete after only member reordering. If deeper risks are found but not fixed in the current pass, report them as residual risks or propose a phased follow-up.
Show full SKILL.md (594 more words)Show less

Intake Checklist

Before implementation, write down the current scope:

text
Control:
Task category: API / layout / split / correctness / lifecycle / AXAML / performance / Gallery / docs
Optimization mode: cleanup / edge-case correctness / architecture root fix
Current LOC:
Comparable controls inspected:
Contract change needed: No / L1 / L2 / L3
File split decision: No / Yes, reason:
Other required skills:
Behavior changes mixed into layout-only work: No
C# relay binding inventory: None / Reviewed, exceptions documented
New artifact audit: None / necessary classes/helpers/fields/flags listed with reason
Members before public contract region: None / exceptions documented
Verification commands:

Escalation Signals

Seeing any of these in a control during broad optimization forces a deep-control audit before editing:

  • _ignoreXxx, _suppressXxx, backup fields, delayed refreshes, or forced sync paths around state changes
  • more than one owner for the same state, such as SelectedItems, SelectedKeys, checked nodes, current item, filter text, popup state, or validation state
  • two-way sync between styled properties, template parts, collection views, and domain objects
  • public interfaces with no-op/default implementations that hide capability differences
  • runtime-created controls, popups, flyouts, dynamic menu items, or C# bindings
  • newly introduced private classes, helpers, boolean parameters, marker fields, or local marker variables that duplicate existing primitives or only serve the current patch shape
  • generated/recycled containers carrying domain state, especially tree/list nodes, selection, masked/disabled state, or checked state
  • custom pagination, collection view movement, filtering, source replacement, or key translation
  • repeated algorithms across base/subclass implementations
  • unreferenced files/classes, unused helpers, or copied selection models
  • missing tests for property changes before template apply, after template reapply, after detach, collection reset, and nested/tree data

When an escalation signal appears, list it in the audit even if the current pass will only fix a subset.

Execution Flow

  1. Inspect the target control and 2-3 comparable controls in the same package.
  2. For broad optimization, perform the mandatory audit gate before editing.
  3. Inventory the exposed contract before deciding the edit shape.
  4. Classify API risk, file split need, and optimization mode.
  5. Present findings and phases when behavior, render, architecture, or broad cleanup risks exist.
  6. Make the smallest scoped change that matches existing control style.
  7. Run targeted tests first, then broaden based on risk.
  8. Always run git diff --check before reporting completion.

Contract Inventory

For any non-trivial control optimization, check:

  • public/protected members and constructors
  • StyledProperty, DirectProperty, RoutedEvent, commands, .NET events
  • implemented public interfaces
  • template parts, pseudo-classes, theme selectors, token/resource keys
  • Gallery examples and docs that expose usage
  • C# relay bindings: for each BindUtils.RelayBind, record source, target, why AXAML cannot express it, binding mode/priority, and disposal owner
  • bindings, subscriptions, timers, popup hosts, cached views, lazy-created objects

Required Scans

For broad optimization, run focused searches before deciding the implementation shape:

  • state suppression: _ignore, _suppress, _isUpdating, Backup, Reset, Refresh, Dispatcher
  • dynamic lifecycle: +=, -=, IDisposable, CompositeDisposable, RelayBind, DynamicResource
  • data flow: ItemsSource, Selected, Checked, Current, TargetKeys, SelectedKeys, Filter, Page
  • dead/duplicate code: class references, copied methods, override methods matching the base implementation, new helpers/classes that duplicate existing primitives
  • patch artifacts: new boolean-switch parameters, marker fields, local marker variables, stale fallback branches, and cleanup-only helper classes
  • member prelude: anything inside the control class before #region 公共属性定义, especially internal const, internal static, internal collaboration APIs, private helpers, runtime fields, and temporary state

Do not treat these scans as proof by themselves. Use them to identify ownership and edge-case paths that must be reviewed.

New Artifact Review

Before reporting any control fix complete, inspect what the change added:

  • New class / helper: prove it represents a stable responsibility or remove it.
  • New field / local marker variable: prove it is the single owner of a real state machine or remove it.
  • New boolean parameter: split into clearly named methods unless the boolean is part of an existing public contract.
  • New fallback branch: prove the fallback is reachable and part of the control contract or remove it.
  • Existing primitive with equivalent behavior: use the primitive instead of keeping one-off code.

This review applies even when tests pass. Passing tests do not justify unused abstractions, duplicated motion classes, stale flags, or patch-shaped control flow.

Completion Report

Report the result in terms of contract safety and verification:

text
API/theme contract changed: No / Yes
Behavior changed: No / Yes
Files split: No / Yes
Audit performed: No / Yes
Residual risks:
New artifacts introduced and why:
Tests:
Diff hygiene:
Commit created: No unless explicitly requested

© AtomUI, LGPL-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

SKILL.md and 2 other files (references) in .agents/skills/atomui-control-optimization of AtomUI/AtomUI.

  • SKILL.md
  • references/api-layout-and-splitting.md
  • references/deep-control-optimization.md

Open the folder on GitHubat commit d234fe0

Compare with similar skills

Atomui Control Optimization 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.

Atomui Control Optimization compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Atomui Control Optimization this skillAtomUI/AtomUI842—~3.4kAutomated safety check: PassLGPL-3.0
Go Standardsasymmetric-research/solana-exporter133—~1.6kAutomated safety check: PassApache-2.0
Rust SkillsJMBeresford/retrom2.1k1 repos~9.5kAutomated safety check: PassMIT
Rust Skillsnoh-rs/nohrs156—~5.3kAutomated safety check: PassMIT
Typescript Advanced Patternspproenca/dot-skills214—~2.4kAutomated safety check: PassMIT
Software Design Philosophyluoling8192/software-design-philosophy-skill344—~3.4kAutomated safety check: PassMIT

Similar skills

  • Go Standards

    asymmetric-research/solana-exporter

    Idiomatic Go conventions — naming, error handling, concurrency, interfaces, testing, and API design.

    133 GitHub stars~1.6k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Rust Skills

    JMBeresford/retrom

    Comprehensive Rust coding guidelines with 265 rules across 26 categories.

    2.1k GitHub starsUsed in 1 repo~9.5k tokens
    DevelopmentAuto-check passed
  • Rust Skills

    noh-rs/nohrs

    Comprehensive Rust coding guidelines with 179 rules across 14 categories.

    156 GitHub stars~5.3k tokensUpdated 5 days ago
    DevelopmentAuto-check passed
  • Typescript Advanced Patterns

    pproenca/dot-skills

    Advanced TypeScript — type-level programming, library/DSL APIs, declaration merging, modern language features at depth (decorators, using, const T, NoInfer, variance), and feature implementation…

    214 GitHub stars~2.4k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Software Design Philosophy

    luoling8192/software-design-philosophy-skill

    Software design philosophy guide based on John Ousterhout's "A Philosophy of Software Design." Use this skill during: code reviews, architecture discussions, API design, module decomposition…

    344 GitHub stars~3.4k tokensUpdated 2 mo ago
    DevelopmentAuto-check passed
  • Go

    inference-gateway/inference-gateway

    Idiomatic Go - package and interface design, error wrapping, table-driven tests, generics, the modern standard library (slices/maps/cmp/errors.Join), current syntax, and logging discipline.

    214 GitHub stars~2.4k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from AtomUI/AtomUI

All 15 skills in this repo
  • A skill your agent uses when building, launching, debugging, or visually inspecting AtomUIGallery.Desktop from an AtomUI checkout where installed or mounted Gallery apps may share its name or bundle…

    842 GitHub stars~983 tokensUpdated today
    Auto-check passed
  • Atomui Commit Msg

    AtomUI/AtomUI

    Generate a single-line commit message for AtomUI by reading the project's git staged area and recent commit style.

    842 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when creating, completing, splitting, reviewing, or synchronizing AtomUI control documentation under docs/controls, including overview.md, implementation.md, token.md…

    842 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost…

    842 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when upgrading AtomUI NuGet dependencies, source dependency projects, ReactiveUI, Avalonia, Splat, or any third-party version where compatibility must be evaluated before…

    842 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Version Release

    AtomUI/AtomUI

    A skill your agent uses when preparing or validating an AtomUI release, including version-scope confirmation, AtomUIVersion consistency, README version sync, CHANGELOG and Chinese release sections…

    842 GitHub stars~2.7k tokensUpdated today
    Auto-check passed

Questions about Atomui Control Optimization

What does Atomui Control Optimization do?

A skill your agent uses when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…. Atomui Control Optimization is an agent skill from AtomUI/AtomUI. Use when optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness, performance, Gallery-visible behavior, or documentation impact.

When should I use Atomui Control Optimization?

Atomui Control Optimization fits situations like: fixing AtomUI controls; including control API contracts; AXAML structure; gallery-visible behavior.

How do I install Atomui Control Optimization in Claude Code?

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

How do I install Atomui Control Optimization in Codex?

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

Can I use Atomui Control Optimization 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 AtomUI/AtomUI --skill atomui-control-optimization -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/atomui-control-optimization, .gemini/skills/atomui-control-optimization, .github/skills/atomui-control-optimization and .opencode/skills/atomui-control-optimization in your project.

What does Atomui Control Optimization need to run?

Going by SKILL.md and its folder, Atomui Control Optimization needs the command-line tools its instructions call (git).

Does Atomui Control Optimization access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Atomui Control Optimization 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 Atomui Control Optimization use?

Atomui Control Optimization is published under the LGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Atomui Control Optimization use?

About 3.4k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.6k tokens, read only when the agent opens those files.

What are the alternatives to Atomui Control Optimization?

Skills that share tags, products or a category with Atomui Control Optimization: Go Standards (asymmetric-research/solana-exporter, 133 stars), Rust Skills (JMBeresford/retrom, 2.1k stars), Rust Skills (noh-rs/nohrs, 156 stars) and Typescript Advanced Patterns (pproenca/dot-skills, 214 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Atomui Control Optimization?

AtomUI (a GitHub organization) maintains it in AtomUI/AtomUI, which has 842 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 7, 2026.

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