agentleFS
devdotfastdevdotfast/whiteboard/.agents/skills/deslop-cache/SKILL.md

deslop-cache

Skill3.4k starsChanged 39 days agoMITView on GitHub

Clean up hand-rolled caches and request state generated by AI in packages/review/app. Use after adding or changing caching, prefetching or request code in the canvas, before review.

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    What may stay a map: Keep a Map or WeakMap only for these, and say why in one short comment:

    line 22
  2. Distinctive:

    Read the stream line's version (and links revision) before you read a board's resources again.

    line 29
  3. Distinctive:

    Keep a version in a key when other code relies on a new version reading again, such as the page bar's place.

    line 31
  4. Very specific:

    Data paths: Do not schedule data updates with requestAnimationFrame.

    line 33
  5. Distinctive:

    Tests: Test a cache through what the canvas shows.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Review every canvas file the branch changed (git diff origin/main --stat -- packages/review/app). Look for Map, WeakMap, module-level let, refs that hold fetched data, and hand-written fetch effects. Assume each one duplicates the query client, and prove otherwise before you keep it.

The cache

  • Fetched data lives in TanStack Query. The client comes from createCanvasQueryClient in src/canvas-query.tsx. Desktop's canvas shares one client across the boards it shows (SharedCanvasQueryClient).
  • Keys come from canvasQueryKeys. A key for one board's data names the board first, so boards that share the client do not share entries.
  • Shared UI state lives in the existing Zustand stores. Do not put UI state in the query cache, and do not put fetched data in Zustand. Do not add a cache library.

Checklist

  • Side tables. Replace each of these with the query client:
    • a WeakMap<QueryClient, …> or a Map that holds a value per board: queryClient.getQueryData / setQueryData under a canvasQueryKeys key
    • a map of promises that runs a read once: queryClient.fetchQuery with staleTime: Infinity for data that never changes
    • an entry marked stale and then filtered on read: queryClient.removeQueries
    • a "previous value while the next one loads" ref: placeholderData
    • a timer or flag that reads again: staleTime, invalidateQueries or refetch
  • What may stay a map. Keep a Map or WeakMap only for these, and say why in one short comment:
    • the result of a pure function of one object (a WeakMap keyed by that object)
    • something that must be cleaned up with its owner, such as object URLs revoked on unmount
    • a lookup that lives and dies inside one effect
    • server code with no React, such as a short time-limited cache in packages/review/src
  • Freshness. Data drawn from the cache must stay current, or it must be dropped:
    • A cached copy of a board that no stream follows can be stale. Remove it when the stream stops. Do not draw it.
    • Read the stream line's version (and links revision) before you read a board's resources again. Activity alone sends a board again.
    • Key a read per board when the server checks it against its board. A cache shared across boards skips that check.
    • Keep a version in a key when other code relies on a new version reading again, such as the page bar's place.
  • Focus. refetchOnWindowFocus listens only to visibilitychange. In Desktop, switching to another app leaves the window visible. A read that must follow window focus keeps its own focus listener.
  • Data paths. Do not schedule data updates with requestAnimationFrame. It pauses in hidden windows and does not run reliably under jsdom. React already batches updates from one task.
  • Tests. Test a cache through what the canvas shows. Hold every request, switch boards, and check what draws. Then remove the cache in the code and check that the test fails. Do not count calls to internal functions.

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 16 mentionsOct 2026: 18 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the devdotfast/whiteboard repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about devdotfast/whiteboard

The biggest 5 of 34 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 34

Talked about on GitHub, Bluesky and Hacker News (34 times).

On GitHub · 27

22 more on GitHub

On Bluesky · 6

1 more on Bluesky

On Hacker News · 1

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.