Agent skill

Agentic UI Widget Lifecycle

by carlos-algms in carlos-algms/agentic.nvim

Rules for ChatWidget window lifecycle. An agent skill from carlos-algms/agentic.nvim.

MITAuto-check passed

Install Agentic UI Widget Lifecycle

skills CLI
$ npx skills add carlos-algms/agentic.nvim --skill agentic-ui-widget-lifecycle -a claude-code

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

GitHub CLI
$ gh skill install carlos-algms/agentic.nvim agentic-ui-widget-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/carlos-algms/agentic.nvim.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/agentic-ui-widget-lifecycle .claude/skills/agentic-ui-widget-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
agentic-ui-widget-lifecycle
GitHub stars
642
Token cost
~2.1k tokens
SKILL.md length
996 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Rules for ChatWidget window lifecycle. An agent skill from carlos-algms/agentic.nvim.

  • SKILL.md covers State machine, Rules, Widget buffers and windows and Background sessions, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Agentic UI Widget Lifecycle is an agent skill from carlos-algms/agentic.nvim. Rules for ChatWidget window lifecycle. Use before editing ChatWidget show/hide/destroy, WidgetLayout, WidgetRegistry, WindowDecoration, BufferGuard, SessionRegistry.showsession, the hidden chat float, fallback windows, or any programmatic window close.

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

It works with Lua. The repository describes itself as: Agentic Chat Interface directly in Neovim with ACP providers from Claude-Code, Gemini, Codex, OpenCode, and Cursor-agent. The licence is MIT.

Example prompts

  • “Use the agentic-ui-widget-lifecycle skill to rule for ChatWidget window lifecycle. An agent skill from carlos-algms/agentic.nvim”
  • “/agentic-ui-widget-lifecycle”

What it can do on your machine

Read from SKILL.md and the folder at commit 5ee5110. 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 mermaid).

    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

Agentic UI Widget Lifecycle loads about 2.1k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 996 words of instructions outside code blocks.

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

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 carlos-algms/agentic.nvim at commit 5ee5110, republished under its MIT licence (© carlos-algms). 996 words, ~2,058 tokens.

Download SKILL.mdSave it as .claude/skills/agentic-ui-widget-lifecycle/SKILL.md (or your agent's skills folder).
name
agentic-ui-widget-lifecycle
description
Rules for ChatWidget window lifecycle. Use before editing ChatWidget show/hide/destroy, WidgetLayout, WidgetRegistry, WindowDecoration, BufferGuard, SessionRegistry.show_session, the hidden chat float, fallback windows, or any programmatic window close.

ChatWidget lifecycle

Widget windows are disposable. Buffers persist; windows do not.

State machine

Each transition cites the test that pins it. A transition without a test is a gap: add the test or delete the transition.

mermaid
stateDiagram-v2
    [*] --> hidden
    hidden --> visible: show()<br/>create fresh windows<br/>reapply window-local opts
    visible --> hidden: hide()<br/>close + destroy widget windows<br/>buffers persist

    state "destroy()" as destroy
    visible --> destroy
    hidden --> destroy

    destroy --> [*]: WidgetLayout.close(win_nrs)<br/>then buffers deleted<br/>(close skips handles whose tabpage is gone)

Pinned by, in lua/agentic/ui/chat_widget.test.lua:

  • hidden -> visible: ::"show() after hide() creates new windows", ::"show() is idempotent when called multiple times"
  • visible -> hidden: ::"hide() closes all windows and preserves buffers", ::"hide() is safe when called multiple times"
  • hidden -> destroy: ::"deletes the buffers of a hidden widget without raising"
  • visible -> destroy: ::"keeps the tabpage alive when the widget holds its only windows"
  • hidden float on destroy: ::"tears down the hidden chat window on destroy"

Rules

  • show after hide creates fresh windows and applies every window-local option. show on a visible widget reuses its live windows; it reopens nothing.
  • Before closing widget windows, hide ensures a non-widget fallback window exists in the same tabpage; if find_first_non_widget_window returns nil it calls open_editor_window. Skipping this destroys the user's tabpage: closing the last window of a non-current tabpage closes that tabpage silently, and E444 (cannot close last window) only fires when it is also the last tabpage. See ChatWidget:hide.
  • A caller that reaches hide across an async boundary MUST pass the tabpage it captured BEFORE the defer, as hide(keep_insert, tabpage). WinClosed fires on win_nrs.chat and invalidates it before the scheduled hide runs, and get_visible_tab_id reads no other handle, so the derived placement is already nil there: _ensure_fallback_window returns early and the close takes the widget-only tabpage down with it. Only the tabpage IDENTITY crosses the boundary — _ensure_fallback_window and find_first_non_widget_window still re-check nvim_tabpage_is_valid on it. Regression: chat_widget.test.lua::"keeps a widget-only tab alive when the chat window closes".
  • ChatWidget:open_editor_window anchors on the first USABLE window in win_nrs, preferring chat. The chat handle is already dead on the WinClosed path above, and returning nil there is what loses the tabpage.
  • Programmatic window closes (hide, layout rotation) MUST wrap the close call in ChatWidget:_avoid_auto_close_cmd. The wrapper sets self._closing = true so the WinClosed autocmd's auto-close-on-user-close branch skips the call. Skipping the wrapper triggers a recursive close through the autocmd. Tests: chat_widget.test.lua group "WinClosed autocmd".
  • destroy never routes through hide, but both share ChatWidget:_ensure_fallback_window. It calls that, then WidgetLayout.close on its win_nrs, then deletes the buffers. Relative to hide it skips hidden-float recreation, size capture, and stopinsert suppression — a destroyed widget is never shown again. WidgetLayout.close skips every handle whose tabpage is already gone, keeping this safe during a tabclose teardown on 0.11.x. See ChatWidget:destroy.
    • The fallback is mandatory here. SessionRegistry.show_session hides non-target widgets in the current tabpage and hides the target at its previous placement, so an outgoing session in another tabpage stays visible. Destroying it reaches WidgetLayout.close there, and without the fallback that tabpage disappears under the user. Reachable from Agentic.destroy_session and from restore's explicit Destroy current session choice. Regression: chat_widget.test.lua::"keeps the tabpage alive when the widget holds its only windows".
    • Ordering: the fallback MUST run before WidgetRegistry.unregister. find_first_non_widget_window excludes windows showing a registered widget buffer, so once unregistered the widget's own chat window looks like a valid fallback and gets handed back.
  • destroy is the one programmatic close exempt from the _avoid_auto_close_cmd rule above. It deletes the AgenticWinClosed_<chat bufnr> augroup before closing, so the only listener that ever read self._closing is gone by then; setting the flag would guard nothing. Any new close path that runs while that augroup still exists MUST wrap.

Widget buffers and windows

  • Widget buffers are buflisted = false and buftype = nofile. Each widget window records its buffer in vim.w[winid].agentic_bufnr, 1:1. Users cannot swap buffers between widget windows; BufferGuard restores them.
  • The WinClosed autocmd hides the WHOLE widget when the user closes any one widget window. The widget is one unit.
Show full SKILL.md (387 more words)Show less

Background sessions

A background session must never be surfaced by a content callback. The FileList, CodeSelection, DiagnosticsList and TodoList on_change handlers call ChatWidget:rerender, which no-ops when get_visible_tab_id() is nil. Calling show directly there put a second widget in the current tabpage — a plan update from a hidden session was enough, with no user action at all. The update survives: panel buffers are written before on_change fires, and show_layout decides each panel window from buffer emptiness at show time. Regression: tests/integration/test_multi_session.lua::"keeps a hidden session hidden when its file list changes".

  • An EMPTY panel is the same path and MUST obey the same two rules. The existing regression covers a non-empty panel only, and the empty case takes a different branch: open_or_resize_dynamic_window closes the panel window instead of opening one. That close runs asynchronously, so the cached handle can belong to a tabpage the user has since closed — stale-valid on 0.11.x, hence BufHelpers.is_win_usable, not bare validity — and closing it MUST NOT move the cursor out of the tab the user is looking at. Regression: lua/agentic/ui/widget_layout.test.lua::"clears an empty panel whose tabpage is gone".
  • A cached panel handle from ANOTHER tabpage MUST NOT be reused, and MUST be closed when the panel is reopened. Chat and input enforced this; dynamic panels did not, so a widget that moved tabpages left its panels behind and split one widget's topology across two tabs, the abandoned window untracked once win_nrs was repointed. Regression: lua/agentic/ui/widget_layout.test.lua::"creates a fresh chat window when the cached one is in another tab".

Hidden chat float

A hidden chat floating window keeps the chat buffer attached while the widget is hidden, so manual folds can be applied while closed. See ADR 0001. Tests: chat_widget.test.lua group "hidden chat window lifecycle".

  • Opened with hide = true + focusable = false + noautocmd = true. The user cannot reach it: <C-w>w/<C-w>p, :wincmd, and :buffer skip it; nvim_list_wins() returns it but interactive navigation does not visit it. Only code holding widget._hidden_chat_winid can target it (via nvim_set_current_win/nvim_win_set_buf). Treat it as an internal handle, not a window the user might be sitting in. Do NOT add keymaps, buffer-local autocmds expecting user focus, or any UX that assumes the user can act inside it.
  • Reopening the hidden chat float without closing the previous one overwrites the stored winid and leaks the prior window. Regression: chat_widget.test.lua::"does not leak a hidden float across hide() calls".

© carlos-algms, MIT. 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/agentic-ui-widget-lifecycle of carlos-algms/agentic.nvim.

Open the folder on GitHubat commit 5ee5110

Compare with similar skills

Agentic UI Widget 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.

Agentic UI Widget Lifecycle compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agentic UI Widget Lifecycle this skillcarlos-algms/agentic.nvim642—~2.1kAutomated safety check: PassMIT
Pandoc DOCX TemplateAchuan-2/pandoc_docx_template1.1k—~1kAutomated safety check: PassNone
Add Lua Binding Simplecataclysmbn/Cataclysm-BN1.3k—~846Automated safety check: PassCustom licence
Cpp Compiler FlagsSerial-Studio/Serial-Studio7.2k—~2.1kAutomated safety check: PassCustom licence
Luamakeactboy168/luamake210—~2kAutomated safety check: PassMIT
Lua Ecozhaojh329/lua-eco103—~1.7kAutomated safety check: PassMIT

Similar skills

  • Pandoc DOCX Template

    Achuan-2/pandoc_docx_template

    A skill your agent uses when converting Markdown to Word DOCX or DOCX back to Markdown with Pandoc, especially when the output should use the bundled Chinese Word reference templates, heading…

    1.1k GitHub stars~1k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Add Lua Binding Simple

    cataclysmbn/Cataclysm-BN

    Add simple Cataclysm-BN Lua bindings for stringid types, enums, and basic read-only C++ types.

    1.3k GitHub stars~846 tokensUpdated today
    Auto-check passed
  • Cpp Compiler Flags

    Serial-Studio/Serial-Studio

    C++ compiler/linker flag guidance for Serial Studio's build (GCC, Clang, AppleClang, MSVC cl.exe, clang-cl, MinGW, IntelLLVM).

    7.2k GitHub stars~2.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Luamake

    actboy168/luamake

    Luamake 构建系统指南——用于当前项目的 luamake / make.lua / Ninja 生成流程。当用户需要编写、修改、排查或理解 make.lua、目标定义、lm:conf、deps / objdeps、代码生成、Lua C 模块、Bee 运行时集成,或需要解决当前项目中由 luamake 驱动的构建问题时,使用此 skill。即使用户没有明确提到…

    210 GitHub stars~2k tokensUpdated 2 days ago
    Auto-check passed
  • Lua Eco

    zhaojh329/lua-eco

    International lua-eco public API skill for writing, reviewing, explaining, and fixing Lua 5.4 code that runs on the eco runtime.

    103 GitHub stars~1.7k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Ss Cpp Modern

    Serial-Studio/Serial-Studio

    Modern C++20 authoring guidance for Serial Studio (Qt 6.11, C++20): concepts, ranges, move/RAII, std smart pointers, constexpr, lock-free SPSC atomics.

    7.2k GitHub stars~1.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from carlos-algms/agentic.nvim

All 11 skills in this repo
  • Agentic GitHub Discussion

    carlos-algms/agentic.nvim

    Creates, lists, and manages GitHub discussions in this repo through the GraphQL API.

    642 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Agentic Learn

    carlos-algms/agentic.nvim

    Turns rule gaps into routed, verified rules and empties rules-report.md.

    642 GitHub stars~796 tokensUpdated yesterday
    Auto-check passed
  • Agentic Testing

    carlos-algms/agentic.nvim

    MANDATORY before creating, editing, or reviewing tests in agentic.nvim, and before behavior changes that require TDD.

    641 GitHub stars~828 tokensUpdated yesterday
    Auto-check passed
  • Agentic Lua Class

    carlos-algms/agentic.nvim

    Enforced Lua style: class pattern, visibility prefixes (private, protected), optional-type syntax, LuaCATS annotations.

    642 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Agentic Vimdoc

    carlos-algms/agentic.nvim

    A skill your agent uses when writing or updating agentic.nvim vimdoc (doc/agentic.txt), or after changing init.lua, configdefault.lua, theme.lua, or README install/keymaps - those edits require a…

    641 GitHub stars~298 tokensUpdated yesterday
    Auto-check passed
  • Agentic Acp Docs And Schema

    carlos-algms/agentic.nvim

    Official ACP schema, events, and rules for this plugin's provider work.

    642 GitHub stars~481 tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Agentic UI Widget Lifecycle

What does Agentic UI Widget Lifecycle do?

Rules for ChatWidget window lifecycle. An agent skill from carlos-algms/agentic.nvim. nvim. Rules for ChatWidget window lifecycle.

How do I install Agentic UI Widget Lifecycle in Claude Code?

Run `npx skills add carlos-algms/agentic.nvim --skill agentic-ui-widget-lifecycle -a claude-code`. Or copy the skill folder (.agents/skills/agentic-ui-widget-lifecycle in carlos-algms/agentic.nvim) into .claude/skills/agentic-ui-widget-lifecycle in your project. Claude Code loads it when a task matches its description.

How do I install Agentic UI Widget Lifecycle in Codex?

Run `npx skills add carlos-algms/agentic.nvim --skill agentic-ui-widget-lifecycle -a codex`. Or copy the skill folder (.agents/skills/agentic-ui-widget-lifecycle in carlos-algms/agentic.nvim) into .agents/skills/agentic-ui-widget-lifecycle in your project. Codex loads it when a task matches its description.

Can I use Agentic UI Widget 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 carlos-algms/agentic.nvim --skill agentic-ui-widget-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/agentic-ui-widget-lifecycle, .gemini/skills/agentic-ui-widget-lifecycle, .github/skills/agentic-ui-widget-lifecycle and .opencode/skills/agentic-ui-widget-lifecycle in your project.

What does Agentic UI Widget Lifecycle need to run?

SKILL.md names no scripts, command-line tools or credentials: Agentic UI Widget Lifecycle is instructions for the agent only.

Does Agentic UI Widget 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 Agentic UI Widget 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 Agentic UI Widget Lifecycle use?

Agentic UI Widget Lifecycle is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agentic UI Widget Lifecycle use?

About 2.1k tokens (SKILL.md is roughly 8.2k 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 Agentic UI Widget Lifecycle?

Skills that share tags, products or a category with Agentic UI Widget Lifecycle: Pandoc DOCX Template (Achuan-2/pandoc_docx_template, 1.1k stars), Add Lua Binding Simple (cataclysmbn/Cataclysm-BN, 1.3k stars), Cpp Compiler Flags (Serial-Studio/Serial-Studio, 7.2k stars) and Luamake (actboy168/luamake, 210 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agentic UI Widget Lifecycle?

carlos-algms (a GitHub user) maintains it in carlos-algms/agentic.nvim, which has 642 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 10, 2026.

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