src/core.ts: all logic — paths, truncation, scratchpad, context builder, qmd integration, standalone tool functions (memoryWrite,memoryRead,scratchpadAction,memorySearch)src/cli.ts: CLI entry point — subcommands (context/write/read/scratchpad/search/init/status), compiles todist/agent-memorybinaryskills/claude-code/SKILL.md: Claude Code skill fileskills/codex/SKILL.md: Codex skill fileskills/cursor/SKILL.md: Cursor skill fileskills/agent/SKILL.md: Agent (Cursor CLI) skill filetest/unit.test.ts,test/cli.test.ts: unit tests (bun:test)README.md: user-facing install/usage docs
Runtime data lives outside the repo under the memory directory:
- Default:
~/.agent-memory/(configurable viaAGENT_MEMORY_DIR)
Files: MEMORY.md, SCRATCHPAD.md, daily/YYYY-MM-DD.md
- Track all work sessions by writing a short entry to the daily log using
agent-memory write --target daily. - Summaries should include what changed, files touched, and any notable decisions.
- Use the scratchpad tool for follow-ups or TODOs discovered during work.
bun run build:cli: compile CLI binary todist/agent-memorynpm run build:lib: emitdist/library build viatscnpm run build: typecheck withtsc(--noEmit)npm run lint: lint with Biomebun test test/unit.test.tsornpm run test:unit: run unit tests (no LLM/qmd needed)bun test test/cli.test.tsornpm run test:cli: run CLI unit testsbash scripts/install-skills.shornpm run install-skills: install SKILL.md files for Claude Code and Codex- Optional (for
memory_search, requires Bun):command -v qmd >/dev/null 2>&1 || bun install -g https://github.com/tobi/qmd - Optional search setup:
agent-memory init(auto-creates qmd collection); runqmd embedonce for semantic/deep search
src/core.tshas zero external dependencies: onlynode:fs,node:path,node:child_process.- Match existing formatting: tabs for indentation, semicolons, and double quotes.
- Naming:
camelCasefor functions,PascalCasefor types,SCREAMING_SNAKE_CASEfor constants; tool names remainsnake_case(e.g.memory_write).
- Tests touch memory directories; ensure backups/restores remain intact and new tests don't leak user data.
- Unit tests use temp directories via
_setBaseDir()— no real memory files. - Prefer behavior-focused assertions (file contents, cross-session recall). Keep timeouts generous for model latency.
Before every git add, commit, and push, you must run and verify all pass:
bun test test/unit.test.ts— unit testsbun test test/cli.test.ts— CLI testsbun run lint— Biome linting and formattingbun run build— TypeScript type-checking
Do not commit or push if any of the above fail. Fix issues first.
- Maintain
CHANGELOG.mdat the project root. - For every version bump, add an entry documenting Added, Changed, Fixed, and Removed sections as applicable.
- Review local + committed git changes (
git log,git diff) to draft accurate changelog entries.
- Use Conventional Commits (
feat:,fix:,docs:,chore:) and keep messages imperative. - PRs: include a short summary, exact test command(s) run, and call out any changes to on-disk memory formats or
qmdbehavior.
AGENT_MEMORY_DIRcontrols the memory directory (default:~/.agent-memory).AGENT_MEMORY_QMD_UPDATEcontrols qmd updates after writes (background,manual,off).PI_MEMORY_QMD_UPDATEis a legacy fallback.- Never commit real memory files or secrets.
A skill is a set of local instructions to follow that is stored in a SKILL.md file. Below is the list of skills that can be used. Each entry includes a name, description, and file path so you can open the source for full instructions when using a specific skill.
- agent-memory: Persistent memory across coding sessions — long-term facts, daily logs, topic notes, scratchpad checklist, and semantic search. (file: /Users/jay/.agents/skills/agent-memory/SKILL.md)
- agent-memory: Persistent memory across coding sessions — long-term facts, daily logs, topic notes, scratchpad checklist, and semantic search. (file: /Users/jay/.codex/skills/agent-memory/SKILL.md)
- algorithmic-art: Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations. (file: /Users/jay/.codex/skills/algorithmic-art/SKILL.md)
- find-skills: Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill. (file: /Users/jay/.agents/skills/find-skills/SKILL.md)
- polymarket-weather: Polymarket Weather Probabilities (KSEA/KLAX/KSFO) to predict weather (file: /Users/jay/.codex/skills/polymarket/SKILL.md)
- vercel-composition-patterns: React composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes. (file: /Users/jay/.agents/skills/vercel-composition-patterns/SKILL.md)
- vercel-react-best-practices: React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements. (file: /Users/jay/.agents/skills/vercel-react-best-practices/SKILL.md)
- vercel-react-best-practices: React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements. (file: /Users/jay/.codex/skills/vercel-react-best-practices/SKILL.md)
- vercel-react-native-skills: React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs. (file: /Users/jay/.agents/skills/vercel-react-native-skills/SKILL.md)
- web-design-guidelines: Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices". (file: /Users/jay/.agents/skills/web-design-guidelines/SKILL.md)
- web-design-guidelines: Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices". (file: /Users/jay/.codex/skills/web-design-guidelines/SKILL.md)
- skill-creator: Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Codex's capabilities with specialized knowledge, workflows, or tool integrations. (file: /Users/jay/.codex/skills/.system/skill-creator/SKILL.md)
- skill-installer: Install Codex skills into $CODEX_HOME/skills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos). (file: /Users/jay/.codex/skills/.system/skill-installer/SKILL.md)
- Discovery: The list above is the skills available in this session (name + description + file path). Skill bodies live on disk at the listed paths.
- Trigger rules: If the user names a skill (with
$SkillNameor plain text) OR the task clearly matches a skill's description shown above, you must use that skill for that turn. Multiple mentions mean use them all. Do not carry skills across turns unless re-mentioned. - Missing/blocked: If a named skill isn't in the list or the path can't be read, say so briefly and continue with the best fallback.
- How to use a skill (progressive disclosure):
- After deciding to use a skill, open its
SKILL.md. Read only enough to follow the workflow. - When
SKILL.mdreferences relative paths (e.g.,scripts/foo.py), resolve them relative to the skill directory listed above first, and only consider other paths if needed. - If
SKILL.mdpoints to extra folders such asreferences/, load only the specific files needed for the request; don't bulk-load everything. - If
scripts/exist, prefer running or patching them instead of retyping large code blocks. - If
assets/or templates exist, reuse them instead of recreating from scratch. - Coordination and sequencing:
- If multiple skills apply, choose the minimal set that covers the request and state the order you'll use them.
- Announce which skill(s) you're using and why (one short line). If you skip an obvious skill, say why.
- Context hygiene:
- Keep context small: summarize long sections instead of pasting them; only load extra files when needed.
- Avoid deep reference-chasing: prefer opening only files directly linked from
SKILL.mdunless you're blocked. - When variants exist (frameworks, providers, domains), pick only the relevant reference file(s) and note that choice.
- Safety and fallback: If a skill can't be applied cleanly (missing files, unclear instructions), state the issue, pick the next-best approach, and continue.