N.E.K.O is a real-time AI catgirl companion designed to live with the user, initiate interaction, share media, and perform tasks through an emotional engine. It is intended for people seeking a proactive personal digital companion. The catalogue contains skills for working with it.
Borrowing it
Nothing to install: this file belongs to Project-N-E-K-O/N.E.K.O. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Project-N-E-K-O/N.E.K.O/main/.agent/skills/vanilla-js-ui-race-conditions/SKILL.mdgit clone --depth 1 https://github.com/Project-N-E-K-O/N.E.K.OWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/vanilla-js-ui-race-conditions)<a href="https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/vanilla-js-ui-race-conditions"><img src="https://agentmods.dev/badge/skills/project-n-e-k-o/n.e.k.o/vanilla-js-ui-race-conditions/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/project-n-e-k-o/n.e.k.o/vanilla-js-ui-race-conditions"><img src="https://agentmods.dev/badge/skills/project-n-e-k-o/n.e.k.o/vanilla-js-ui-race-conditions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00037 | $0.00889 |
| Opus 5 | $0.00018 | $0.00445 |
| Sonnet 5 | $0.00007 | $0.00178 |
| Haiku 4.5 | $0.00004 | $0.00089 |
Grade A, and why
Vanilla JS UI Race Conditions (VRM vs Live2D) scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
应对原生 JS 中的 DOM 竞态与乐观更新陷阱
症状
- 界面组件(如侧边栏、HUD)在页面初次加载时由于丢失状态而不显示,但手动交互后又能弹出。
- 界面在开启和关闭之间发生闪烁,或者无法通过代码正确关闭。
- 绑定在 DOM 元素上的事件监听器未能触发。
根本原因
原因 1: 不同模型/模块的 DOM 懒加载时机不一致
- 问题: 在处理跨模型(如 Live2D 和 VRM)或模块化应用时,某些弹窗会在首次点击时才 createElement(懒加载)。
- 为什么发生: 性能优化导致 DOM 并非一上来就在 HTML 里。如果使用固定的 setTimeout(..., 100) 去抓取 DOM 绑定事件,极大概率会面临扑空(DOM 还未生成)。
- 解决方案: 使用自我终结的递归轮询替代死等。
原因 2: 乐观 UI (Optimistic UI) 与底层状态的竞态冲突
- 问题: 用户点击开关后,前端乐观地将按钮置为开启并附带动画,同时向后端发起请求。但在后端返回真实 lag 之前,如果其他组件(如轮询的 App)根据空后端或者默认的错误 DOM 被触发检查,会产生互相覆盖的 BUG。
- 为什么发生: 缺乏统一的单向数据流。
- 解决方案: 在读取源头状态时,判断 UI 是否处于 disabled(加载中)。如果是,则优先信任 gent_ui_v2 缓存的 optimistic 状态或后端缓存 machineFlags,而不是盲目相信刚建立且尚未同步的 DOM 节点。
代码解决方案
1. 应对懒加载 DOM 的绑定轮询(安全可靠)
`javascript const bindEvents = () => { // 兼容多个 ID 解析 const getEl = (ids) => { for (let id of ids) { const el = document.getElementById(id); if (el) return el; } return null; };
const targetEl = getEl(['live2d-agent-keyboard', 'vrm-agent-keyboard']);
// 如果没找到,自己建立一个 500ms 后的新宏任务来重试,然后 return 本次任务。
if (!targetEl) {
setTimeout(bindEvents, 500);
return;
}
// 找到了,顺次执行并结束,不会留下任何定时器垃圾
targetEl.addEventListener('change', myLogic);
myLogic(); // 手动触发第一次检查
};
setTimeout(bindEvents, 100); // 发动第一下 `
2. 多源状态判定降级(防止覆盖)
`javascript const checkState = () => { const isUiInteractive = domCheckbox && !domCheckbox.disabled; let isFeatureOn = false;
if (!isUiInteractive) {
// UI 在转圈加载,信任乐观状态或后端缓存
isFeatureOn = optimisticState !== undefined ? optimisticState : backendFlags;
} else {
// UI 处于可用交互态,百分百信任当前 DOM
isFeatureOn = optimisticState !== undefined ? optimisticState : domCheckbox.checked;
}
} `
关键经验
- 永远不要用硬编码的 setTimeout 时长来假定某个资源或 DOM 一定会加载完毕。
- 如果没有 React 这种 Virtual DOM 框架,手动处理跨组件通讯时要随时当心当前脚本运行时的真实 DOM 快照情况。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 73 lines · 37 tokens per session scan A 0e399710f47b
Vanilla JS UI Race Conditions (VRM vs Live2D) is a skill published in the GitHub repository Project-N-E-K-O/N.E.K.O (2,861 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 889 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
error-recovery-skill
Handle errors gracefully with retry strategies and fallback patterns.
multi-tool-orchestration-skill
Coordinate multiple tools together for complex multi-step tasks.
tikhub-skill
Scrape TikTok, Douyin, Instagram, YouTube, Twitter/X, Xiaohongshu, Bilibili, Kuaishou, Weibo, Reddit, Threads, LinkedIn and more through the TikHub pay-per-request API - discover endpoints, call them by id, parse any share URL, and check account balance.
stripe-skill
Process payments, manage customers, issue refunds, and handle subscriptions via the Stripe CLI. Pass any Stripe command (customers, charges, paymentintents, refunds, invoices, products, prices, subscriptions) and the tool runs it for you and returns parsed JSON.
whatsapp-db-skill
Query WhatsApp database for contacts, groups, channels, and chat history. Look up contact info, search groups, manage channels, retrieve messages.
agent-builder-skill
How to use the Agent Builder tool's five canvas-mutation operations to inspect and grow your own toolset / skills / teammates / workflows mid-execution.