Skip to content

Instantly share code, notes, and snippets.

@debugtheworldbot
debugtheworldbot / AGENTS.md
Created February 14, 2026 14:03
Agent rules for codex

Global Agent Rules

  • Delete unused or obsolete files when your changes make them irrelevant (refactors, feature removals, etc.), and revert files only when the change is yours or explicitly requested. If a git operation leaves you unsure about other agents' in-flight work, stop and coordinate instead of deleting.
  • Before attempting to delete a file to resolve a local type/lint failure, stop and ask the user. Other agents are often editing adjacent files; deleting their work to silence an error is never acceptable without explicit approval.
  • NEVER edit .env or any environment variable files—only the user may change them.
  • Coordinate with other agents before removing their in-progress edits—don't revert or delete work you didn't author unless everyone agrees.
  • Moving/renaming and restoring files is allowed.
  • ABSOLUTELY NEVER run destructive git operations (e.g., git reset --hard, rm, git checkout/git restore to an older commit) unless the user gives an explicit, written instruction in this
@debugtheworldbot
debugtheworldbot / jotai.tsx
Last active September 15, 2023 06:10
minimal jotai implementation
import { useSyncExternalStore } from 'react'
type CB<T> = (v: T) => void
export type Atom<V> = {
get: () => V
set: (v: V | ((oldV: V) => V)) => V
subscribe: (cb: CB<V>) => () => void
}
export function atom<AtomValue>(value: AtomValue): Atom<AtomValue> {
const subscribers = new Set<(value: AtomValue) => void>()
JavaScript 1 hr 16 mins ████████████████████▍ 97.3%
TypeScript 2 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.6%
JSON 0 secs ░░░░░░░░░░░░░░░░░░░░░ 0.0%