hassanzohdy/atom/collections

Claude Code and agent skill by hassanzohdy/atom

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

How to use `atomCollection` to manage array-typed atoms with built-in mutation verbs like `push`, `pop`, `remove`, `map`, and `replace`.

Install

npx vskill@latest install hassanzohdy/atom/collections

SKILL.md

Atom Collections

atomCollection<T>(options) is a thin layer over createAtom that ships array-mutation verbs as actions.

Signature

ts
atomCollection<Value>(options: CollectionOptions<Value>): Atom<Value[], AtomCollectionActions<Value>>
ts
type CollectionOptions<V> = Omit<AtomOptions<V[], AtomCollectionActions<V>>, "default"> & {
default?: V[]; // defaults to []
};

Actions

ActionDescription
push(...items)Append.
unshift(...items)Prepend.
pop() / shift()Drop last / first.
replace(index, item)Overwrite at index.
remove(indexOrPredicate)Drop one by index or (item, index, array) => boolean.
removeItem(item)Strict-equality remove of the first occurrence.
removeAll(item)Remove every occurrence of item (strict equality). Mutates and triggers update.
map(cb)In-place map: rewrites the value AND returns the new array.
forEach(cb)Read-only iteration.
index(predicate)findIndex wrapper.
get(indexOrPredicate)Single-element read.
lengthProperty getter — current size.

Example

ts
type Todo = { id: number; text: string; done: boolean };
const todos = atomCollection<Todo>({
key: "todos",
default: [],
actions: {
toggle(this: Atom<Todo[]>, id: number) {
this.update(this.value.map(t => t.id === id ? { ...t, done: !t.done } : t));
},
},
});
todos.push({ id: 1, text: "Buy bread", done: false });
todos.toggle(1);
todos.remove((t) => t.done);

Gotchas

  • map is mutating despite the name — it rewrites the value AND returns the new array. Use atom.value.map(...) if you want a pure transform.
  • The length action is exposed as a property getter, not a function. Read it as todos.length, not todos.length().

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hassanzohdy/atom/collections/badge)](https://verified-skill.com/skills/hassanzohdy/atom/collections)

Something wrong with this skill or its page? Tell us.