Agent skill

Atomui Resource Lifecycle

by AtomUI in AtomUI/AtomUI

A skill your agent uses when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost…

LGPL-3.0Auto-check passedDevelopment

Install Atomui Resource Lifecycle

skills CLI
$ npx skills add AtomUI/AtomUI --skill atomui-resource-lifecycle -a claude-code

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

GitHub CLI
$ gh skill install AtomUI/AtomUI atomui-resource-lifecycle --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-resource-lifecycle .claude/skills/atomui-resource-lifecycle && 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-resource-lifecycle
GitHub stars
842
Token cost
~1.4k tokens
SKILL.md length
594 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
LGPL-3.0

At a glance

A skill your agent uses when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost…

  • Works in 3 steps: If the binding target implements… → Otherwise use the XAML anchor / provider… → Subscribe to the selected host's…
  • Changing AtomUI
  • SKILL.md covers Overview, DynamicResource Scoped Host Rule, Required Patterns and Forbidden Patterns, plus 3 more sections
  • Calls rg

What it does

Atomui Resource Lifecycle is an agent skill from AtomUI/AtomUI. Use when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost, owner/container attach cleanup, or investigating memory leaks and retained controls.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Performance optimization. It works with Avalonia. 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

  • Changing AtomUI
  • Avalonia resource bindings
  • DynamicResource
  • TokenResourceBinder

Example prompts

  • “/atomui-resource-lifecycle”

Workflow steps

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

  1. If the binding target implements IResourceHost, use the target.
  2. Otherwise use the XAML anchor / provider owner.
  3. Subscribe to the selected host's ResourcesChanged, and to ActualThemeVariantChanged when the host is an IThemeVariantHost.

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:

    • rg

    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

Atomui Resource Lifecycle loads about 1.4k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 594 words of instructions outside code blocks.

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

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). 594 words, ~1,394 tokens.

Download SKILL.mdSave it as .claude/skills/atomui-resource-lifecycle/SKILL.md (or your agent's skills folder).
name
atomui-resource-lifecycle
description
Use when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost, owner/container attach cleanup, or investigating memory leaks and retained controls.

AtomUI Resource Lifecycle

Overview

Resource lifecycle correctness is a hard boundary, not a performance optimization. Any object that subscribes, binds, attaches, caches, or enters an owner/container lifecycle must define the release event before the acquire call is accepted.

The Gallery rule is strict: after navigation settles, old ShowCases must not remain alive unless a feature explicitly owns a cache and documents its eviction policy.

DynamicResource Scoped Host Rule

A non-Visual AvaloniaObject must not carry DynamicResource or token-resource bindings unless it owns or is attached to a scoped IResourceHost with a verified release path.

Violations block merge because they can root an entire Gallery ShowCase through Application.ResourcesChanged.

Why This Leaks

DynamicResourceExpression chooses its resource host in this order:

  1. If the binding target implements IResourceHost, use the target.
  2. Otherwise use the XAML anchor / provider owner.
  3. Subscribe to the selected host's ResourcesChanged, and to ActualThemeVariantChanged when the host is an IThemeVariantHost.

This behavior has been verified against the currently resolved framework dependency and AtomUI leak regressions. Revalidate it after dependency upgrades; do not copy an external version, local source path, or line number into AtomUI's long-term lifecycle contract.

If the target is a non-Visual AvaloniaObject and does not implement IResourceHost, the host can fall back to Application. The leak chain then becomes:

text
Application.ResourcesChanged
  DynamicResourceExpression
    ValueStore
      non-Visual AvaloniaObject
        owner/header/container
          Gallery ShowCase visual tree

This exact pattern leaked DataGridColumn, DataGridColumnGroupItem, and NavMenuNode. Full case study: docs/engineering/case-studies/avalonia-dynamic-resource-memory-leak-case-study.md.

Required Patterns

Owner-based objects, such as DataGridColumn:

  • Implement IResourceHost and IThemeVariantHost on the non-Visual object.
  • TryGetResource(...) queries the scoped owner first, then falls back to Application.Current.
  • Owner changes unsubscribe the old owner before assigning/subscribing the new owner.
  • Owner ResourcesChanged and ActualThemeVariantChanged are forwarded through the object.
  • Owner attach/detach raises ResourcesChanged so dynamic resources republish.

Container-driven data nodes, such as NavMenuNode:

  • Do not store a permanent last-container reference.
  • Attach through an API that returns IDisposable.
  • Store the disposable in the same owner/container CompositeDisposable as the node bindings.
  • Release through ClearContainerForItemOverride, detach, re-template, unregister, or owner disposal.
  • If multiple temporary attachments are possible, use attachment counting or an equivalent scoped token.

Global token bindings:

  • Do not create TokenResourceBinder.CreateGlobalTokenBinding(...) in constructors by default.
  • Create global bindings on first real use, such as first open/show.
  • Dispose the returned binding on close, unregister, detach, owner disposal, or the matching clear path.
Show full SKILL.md (224 more words)Show less

Forbidden Patterns

  • target[!SomeProperty] = new DynamicResource... on a non-Visual AvaloniaObject that is not a scoped IResourceHost.
  • Constructor-time TokenResourceBinder.CreateGlobalTokenBinding(...) with no explicit release path.
  • Relying on Gallery route reset, DataContext clearing, or visual cleanup to break a global resource subscription.
  • Replacing dynamic resources with static values only to avoid a leak. That breaks theme/token behavior instead of fixing lifecycle.
  • Permanent owner/container references used only to keep resource lookup working.

Required Tests

Every fix or new non-Visual dynamic-resource target needs lifecycle and resource behavior coverage:

  • WeakReference test: dynamic resource does not root an otherwise unreferenced target after GC.
  • Owner resource test: target uses scoped owner resources before falling back to Application.
  • Resource update test: owner/application resource updates still republish values.
  • Gallery object-count test when applicable: after random navigation, only the current ShowCase remains alive.

The WeakReference test must simulate the XAML DynamicResourceExtension anchor shape. Hand-setting a property or using only static values does not reproduce the Application-root leak.

Review Trigger

Before approving changes in this area, scan for:

bash
rg "DynamicResource|CreateGlobalTokenBinding|IResourceHost|IThemeVariantHost" --type cs src/ controlgallery/
rg "class .*: AvaloniaObject" --type cs src/
rg "ResourcesChanged \\+|ActualThemeVariantChanged \\+|CreateGlobalTokenBinding" --type cs src/ controlgallery/

Any non-Visual AvaloniaObject with dynamic resource/token binding and no scoped host lifecycle is a blocker.

Memory Validation

Use object counts, not RSS alone:

  • Current ShowCase count should settle to 1 after navigation.
  • Old ShowCaseItem, DataGridColumn, NavMenuNode, and DynamicResourceExpression counts must not grow monotonically across random navigation.
  • RSS can have load peaks; persistent old object graphs are the leak signal.

© 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

Just SKILL.md in .agents/skills/atomui-resource-lifecycle of AtomUI/AtomUI.

Open the folder on GitHubat commit d234fe0

Compare with similar skills

Atomui Resource Lifecycle 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 Resource Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Atomui Resource Lifecycle this skillAtomUI/AtomUI842—~1.4kAutomated safety check: PassLGPL-3.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
LLM Torch Profiler Analysissgl-project/sglang37k2 repos~6.4kAutomated safety check: PassApache-2.0
Pycrazyguitar/pysheeet8.2k—~886Automated safety check: PassMIT
Cmux Debugging Guidemanaflow-ai/cmux28k1 repos~1.1kAutomated safety check: PassCustom licence
Electron Heap Snapshot Analysiskeybase/client9.3k—~875Automated safety check: PassBSD-3-Clause

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • LLM Torch Profiler Analysis

    sgl-project/sglang

    Unified LLM torch-profiler triage skill for sglang, vllm, TensorRT-LLM, and TokenSpeed.

    37k GitHub starsUsed in 2 repos~6.4k tokens
    DevelopmentAuto-check passed
  • Py

    crazyguitar/pysheeet

    Comprehensive Python programming reference covering syntax, concurrency, networking, databases, ML/LLM development, and HPC.

    8.2k GitHub stars~886 tokensUpdated today
    DevelopmentAuto-check passed
  • Cmux Debugging Guide

    manaflow-ai/cmux

    Covers debug logging, the Debug menu, profiling rules and runtime pitfalls for working on the cmux macOS terminal app.

    28k GitHub starsUsed in 1 repo~1.1k tokens
    DevelopmentAuto-check passed
  • Analyzes V8, Chrome and Electron .heapsnapshot files with Node scripts to find memory leaks, detached DOM nodes and the retainer paths that keep objects alive.

    9.3k GitHub stars~875 tokensUpdated today
    DevelopmentAuto-check passed
  • Runs controlled JMH experiments on the Caffeine cache to find shared contention and hot-path waste, then reviews correctness and returns a reviewable patch.

    18k GitHub stars~2.6k tokensUpdated yesterday
    DevelopmentAuto-check: notes

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 optimizing, refactoring, reviewing, or fixing AtomUI controls, including control API contracts, member layout, file splitting, lifecycle, AXAML structure, correctness…

    842 GitHub stars~3.4k 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 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

Works with

Categories

Questions about Atomui Resource Lifecycle

What does Atomui Resource Lifecycle do?

A skill your agent uses when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost…. Atomui Resource Lifecycle is an agent skill from AtomUI/AtomUI. Use when changing AtomUI or Avalonia resource bindings, DynamicResource, TokenResourceBinder, non-Visual AvaloniaObject lifecycle, IResourceHost/IThemeVariantHost, owner/container attach cleanup, or investigating memory leaks and retained controls.

When should I use Atomui Resource Lifecycle?

Atomui Resource Lifecycle fits situations like: changing AtomUI; avalonia resource bindings; dynamicResource; tokenResourceBinder.

How do I install Atomui Resource Lifecycle in Claude Code?

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

How do I install Atomui Resource Lifecycle in Codex?

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

Can I use Atomui Resource Lifecycle 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-resource-lifecycle -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-resource-lifecycle, .gemini/skills/atomui-resource-lifecycle, .github/skills/atomui-resource-lifecycle and .opencode/skills/atomui-resource-lifecycle in your project.

What does Atomui Resource Lifecycle need to run?

Going by SKILL.md and its folder, Atomui Resource Lifecycle needs the command-line tools its instructions call (rg).

Does Atomui Resource Lifecycle 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 Atomui Resource Lifecycle 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 Resource Lifecycle use?

Atomui Resource Lifecycle 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 Resource Lifecycle use?

About 1.4k tokens (SKILL.md is roughly 5.6k 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 Atomui Resource Lifecycle?

Skills that share tags, products or a category with Atomui Resource Lifecycle: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), LLM Torch Profiler Analysis (sgl-project/sglang, 37k stars), Py (crazyguitar/pysheeet, 8.2k stars) and Cmux Debugging Guide (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Atomui Resource Lifecycle?

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.