add-atom
Add a new Jotai atom to the state system with type definitions, registry, and Store API access
Best use case
add-atom is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Add a new Jotai atom to the state system with type definitions, registry, and Store API access
Teams using add-atom should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/add-atom/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How add-atom Compares
| Feature / Agent | add-atom | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Add a new Jotai atom to the state system with type definitions, registry, and Store API access
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Add Atom Skill
## Usage
```
/add-atom <atomName>
```
---
## Step 1: Ask Questions
### 1. Atom Purpose
```
What state does this atom hold?
Brief description:
```
### 2. Data Source
```
Where does the data come from?
A) Game WebSocket - Captured from server messages
B) User input - Settings, preferences
C) Derived - Computed from other atoms
D) Internal - Module/feature internal state
```
### 3. Update Frequency
```
How often does this atom update?
A) Rarely - User actions only
B) Occasionally - Every few seconds
C) Frequently - Multiple times per second
→ If C: Consider adding a Signature function
```
### 4. Public API
```
Should this atom be exposed in window.Gemini?
A) Yes - Part of public API
B) No - Internal only
```
---
## Step 2: Define Types
### In `src/atoms/types.ts`
```typescript
// 1. Add to AtomKey union
export type AtomKey =
| "existingAtom"
| "<atomName>" // Add this
// ...
// 2. Define the state type
export interface <AtomName>State {
// Define fields
}
// 3. Add to AtomTypeMap
export interface AtomTypeMap {
existingAtom: ExistingState;
<atomName>: <AtomName>State; // Add this
// ...
}
```
---
## Step 3: Declare Atom
### In `src/atoms/atoms.ts`
```typescript
import { atom } from 'jotai';
import type { <AtomName>State } from './types';
export const <atomName>Atom = atom<<AtomName>State | null>(null);
```
---
## Step 4: Register in Lookup
### In `src/atoms/lookup.ts`
```typescript
import { <atomName>Atom } from './atoms';
export const atomRegistry = {
// ... existing
<atomName>: <atomName>Atom,
} as const;
```
---
## Step 5: Export (if public)
### In `src/atoms/index.ts`
```typescript
export { <atomName>Atom } from './atoms';
export type { <AtomName>State } from './types';
```
---
## Step 6: Optional - Signature (for frequent updates)
### In `src/atoms/signature.ts`
```typescript
import type { <AtomName>State } from './types';
/**
* Returns a stable hash for change detection
* Only reacts to meaningful changes, not every tick
*/
export function get<AtomName>Signature(state: <AtomName>State | null): string {
if (!state) return 'null';
// Hash only fields that matter
return `${state.id}-${state.version}`;
}
```
---
## Step 7: Optional - View (for UI consumption)
### In `src/atoms/view.ts`
```typescript
import type { <AtomName>State } from './types';
export interface <AtomName>View {
// UI-friendly format
items: string[];
total: number;
}
export function get<AtomName>View(state: <AtomName>State | null): <AtomName>View {
if (!state) return { items: [], total: 0 };
return {
items: state.items.map(item => item.name),
total: state.items.length,
};
}
```
---
## Step 8: Validate
### Registration
- [ ] Key added to `AtomKey` type in `types.ts`
- [ ] State type added to `AtomTypeMap` in `types.ts`
- [ ] Atom declared in `atoms.ts` with `atom<T | null>(null)`
- [ ] Atom registered in `lookup.ts`
- [ ] Exported from `index.ts` (if public)
### Store API
- [ ] `Store.select('<atomName>')` works
- [ ] `Store.set('<atomName>', value)` works
- [ ] `Store.subscribe('<atomName>', callback)` works
### Optional
- [ ] Signature added (if frequent updates)
- [ ] View added (if UI needs transformed data)
---
## Store API Usage
```typescript
// Read
const value = await Store.select('<atomName>');
// Write
await Store.set('<atomName>', newValue);
// Subscribe
const unsub = await Store.subscribe('<atomName>', (value) => {
console.log('Changed:', value);
});
// Cleanup
unsub();
```
---
## References
- Rules: `.claude/rules/state/atoms.md`
- Existing atoms: `src/atoms/`
- Store implementation: `src/atoms/store.ts`Related Skills
astro
This skill provides essential Astro framework patterns, focusing on server-side rendering (SSR), static site generation (SSG), middleware, and TypeScript best practices. It helps AI agents implement secure authentication, manage API routes, and debug rendering behaviors within Astro projects.
modal-deployment
Run Python code in the cloud with serverless containers, GPUs, and autoscaling using Modal. This skill enables agents to generate code for deploying ML models, running batch jobs, serving APIs, and scaling compute-intensive workloads.
thor-skills
An entry point and router for AI agents to manage various THOR-related cybersecurity tasks, including running scans, analyzing logs, troubleshooting, and maintenance.
ux
This AI agent skill provides comprehensive guidance for creating professional and insightful User Experience (UX) designs, covering user research, information architecture, interaction design, visual guidance, and usability evaluation. It aims to produce actionable, user-centered solutions that avoid generic AI aesthetics.
chrome-debug
This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.
tech-blog
Generates comprehensive technical blog posts, offering detailed explanations of system internals, architecture, and implementation, either through source code analysis or document-driven research.
grail-miner
This skill assists in setting up, managing, and optimizing Grail miners on Bittensor Subnet 81, handling tasks like environment configuration, R2 storage, model checkpoint management, and performance tuning.
vly-money
Generate crypto payment links for supported tokens and networks, manage access to X402 payment-protected content, and provide direct access to the vly.money wallet interface.
lets-go-rss
A lightweight, full-platform RSS subscription manager that aggregates content from YouTube, Vimeo, Behance, Twitter/X, and Chinese platforms like Bilibili, Weibo, and Douyin, featuring deduplication and AI smart classification.
whisper-transcribe
Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.
ontopo
An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.
advanced-skill-creator
Meta-skill that generates domain-specific skills using advanced reasoning techniques. PROACTIVELY activate for: (1) Create/build/make skills, (2) Generate expert panels for any domain, (3) Design evaluation frameworks, (4) Create research workflows, (5) Structure complex multi-step processes, (6) Instantiate templates with parameters. Triggers: "create a skill for", "build evaluation for", "design workflow for", "generate expert panel for", "how should I approach [complex task]", "create skill", "new skill for", "skill template", "generate skill"