CtrlK
BlogDocsLog inGet started
Tessl Logo

using-kea-disposables

Use when adding timers (`setInterval`, `setTimeout`), event listeners (`window.addEventListener`, `document.addEventListener`, `MediaQueryList.addEventListener`), or any other resource that needs cleanup inside a kea logic. Every logic has `cache.disposables.add(setup, key?, options?)` and `cache.disposables.dispose(key)` available via the globally registered `disposablesPlugin` (`frontend/src/kea-disposables.ts`). Replaces the bare `cache.foo = setInterval(...)` + `beforeUnmount: clearInterval(cache.foo)` pattern and auto-pauses background work when the tab is hidden.

74

Quality

91%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

82%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A high-quality, actionable reference: executable examples anchored to real codebase paths, a clear before/after conversion workflow, and good section navigation. The only slack is mild example redundancy and the absence of validation checkpoints (unneeded for this non-destructive pattern).

Suggestions

Consolidate the repeated popstate/hidden-tab guidance (lines 60 and 138-140) into one place to remove duplication.

Consider moving the multi-example 'Examples in the codebase' section into a references/ file, keeping only the canonical example inline in SKILL.md to tighten the overview.

Add a one-line explicit 'verify the resource is gone after dispose' note for the keyed-dispose flow so the early-teardown path has a clear checkpoint.

DimensionReasoningScore

Conciseness

Lean and assumes Claude's competence — no explaining what kea or setInterval is — but the ~215-line body carries six full code examples and repeats the popstate/hidden-tab note (lines 60 and 138-140), so a few tokens could be trimmed.

4 / 5

Actionability

Fully executable, copy-paste-ready TypeScript with the exact `add(setup, key?, options?)` signature and six real codebase examples (file paths + line ranges) covering pollers, keyed intervals, spam-replacement timeouts, multi-listener mounts, and visibility opt-outs.

5 / 5

Workflow Clarity

The 'Anti-patterns to convert' section gives a clear Before→After rewrite flow and 'Use this skill when' enumerates triggers, but there are no explicit validation checkpoints — acceptable here since registering a disposable is non-destructive, so no feedback-loop cap applies.

4 / 5

Progressive Disclosure

Well-organized into clear one-level sections (The pattern, Choosing a key, pauseOnPageHidden, dispose, Examples, Anti-patterns) with easy navigation and no nested references; the long inline Examples section could arguably split into a reference file, but no bundle files exist and the single-file structure is appropriate.

4 / 5

Total

17

/

20

Passed

Description

100%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

An excellent description: concrete, trigger-rich, and explicitly scoped to the kea disposables niche with a clear 'Use when' clause. It tells Claude both what the skill does and exactly when to reach for it.

DimensionReasoningScore

Specificity

Lists multiple concrete actions — adding timers, event listeners, `cache.disposables.add`/`dispose`, replacing the bare `cache.foo` + `beforeUnmount` pattern, and auto-pausing on tab hide — covering the skill's capabilities comprehensively.

5 / 5

Completeness

Explicitly answers both: 'what' (every logic has `cache.disposables.add/dispose` via the disposablesPlugin, replaces the bare pattern, auto-pauses) and 'when' (opens with 'Use when adding timers, event listeners, or any resource needing cleanup').

5 / 5

Trigger Term Quality

Includes natural trigger terms a developer would say — 'timers', 'setInterval', 'setTimeout', 'event listeners', and three `addEventListener` variants — plus the explicit 'Use when adding...' phrasing.

5 / 5

Distinctiveness Conflict Risk

Tightly scoped to kea logics via `cache.disposables`, `disposablesPlugin`, and `frontend/src/kea-disposables.ts` — a clear niche with distinct triggers and minimal overlap risk.

5 / 5

Total

20

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository
PostHog/posthog
Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.