Cross-tool project memory and agent handoff for OpenCode, Gemini CLI, Claude Code, Codex, and any agent that can read Markdown files.
Published repository target: https://github.com/txzh007/universal-memory-skill
This skill supports two modes:
No Node.js required. Just copy the templates and fill them in.
-
Copy these files from
templates/to your project root:# From your project root (NOT this repo) cp path/to/universal-memory-skill/templates/AGENTS.template.md ./AGENTS.md cp path/to/universal-memory-skill/templates/current-work.template.md .agent-context/current-work.md cp path/to/universal-memory-skill/templates/next-steps.template.md .agent-context/next-steps.md cp path/to/universal-memory-skill/templates/handoff-message.template.md .agent-context/handoff-message.md -
Create tool-specific memory files:
cp AGENTS.md agent.md cp AGENTS.md GEMINI.md cp AGENTS.md CLAUDE.md
-
Before handing off, update
.agent-context/current-work.mdand.agent-context/next-steps.md. -
The next agent reads:
AGENTS.md.agent-context/current-work.md.agent-context/next-steps.md
Requires Node.js 14+. Provides automatic file detection and structured handoff.
# From your project root (NOT this repo)
node path/to/universal-memory-skill/init-universal-memory.js
node path/to/universal-memory-skill/capture-state.js --task "Implementing feature X" --next-steps "Step 1, Step 2"
node path/to/universal-memory-skill/handoff.js --to gemini --task "Feature X" --next-steps "Step 1, Step 2"
node path/to/universal-memory-skill/restore-state.jsTip: Add the skill directory to your PATH or create a wrapper script to avoid typing the full path every time.
This skill creates a simple, portable memory model for AI-assisted development:
AGENTS.mdas the universal project-memory source.agent-context/current-work.mdfor current session state.agent-context/next-steps.mdfor actionable handoff items.agent-context/handoff-message.mdfor tool-to-tool transfer
It is intentionally file-based so it works even when tools do not share session state.
templates/AGENTS.template.md- Project memory templatetemplates/current-work.template.md- Current work state templatetemplates/next-steps.template.md- Next steps templatetemplates/handoff-message.template.md- Handoff message template
init-universal-memory.js- Bootstrap the memory filescapture-state.js- Capture current work statehandoff.js- Generate a portable handoff packagerestore-state.js- Restore and summarize saved state
# In YOUR PROJECT ROOT (not this repo)
cd /path/to/your-project
# Copy AGENTS.md template
cp /path/to/universal-memory-skill/templates/AGENTS.template.md ./AGENTS.md
# Create .agent-context directory
mkdir .agent-context
# Copy state templates
cp /path/to/universal-memory-skill/templates/current-work.template.md .agent-context/current-work.md
cp /path/to/universal-memory-skill/templates/next-steps.template.md .agent-context/next-steps.md
cp /path/to/universal-memory-skill/templates/handoff-message.template.md .agent-context/handoff-message.md
# Create tool-specific memory files
cp AGENTS.md agent.md
cp AGENTS.md GEMINI.md
cp AGENTS.md CLAUDE.mdEdit AGENTS.md with your project's identity, conventions, and status.
Update .agent-context/current-work.md and .agent-context/next-steps.md with:
- What you're working on
- What files you changed
- What the next agent should do
# In YOUR PROJECT ROOT (not this repo)
cd /path/to/your-project
# Initialize universal memory
node /path/to/universal-memory-skill/init-universal-memory.jsnode capture-state.js \
--task "Implement auth middleware" \
--next-steps "Handle expired token, add integration test" \
--files "src/auth/middleware.ts, tests/auth.test.ts" \
--verification "Manual smoke test passed"node handoff.js \
--to gemini \
--task "Implement auth middleware" \
--next-steps "Handle expired token, add integration test" \
--message "Continue from captured state"node restore-state.jsClone the repo and run the scripts directly:
git clone https://github.com/txzh007/universal-memory-skill.git
cd universal-memory-skillThen choose your mode:
- Mode 1: Copy templates manually
- Mode 2: Run
node init-universal-memory.js
If your skills workflow supports GitHub-backed skills, publish this repository first and then point your skill manager at the repo.
Recommended repository contents:
SKILL.mdREADME.mdpackage.jsontemplates/- Node scripts
LICENSE
Recommended repository description:
Cross-tool project memory and agent handoff for OpenCode, Gemini CLI, Claude Code, and Codex.
Recommended topics:
ai-agentsdeveloper-toolsopencodeclaude-codegemini-clicodexproject-memoryhandoffmarkdown
This skill creates a simple, portable memory model for AI-assisted development:
AGENTS.mdas the universal project-memory source.agent-context/current-work.mdfor current session state.agent-context/next-steps.mdfor actionable handoff items.agent-context/handoff-message.mdfor tool-to-tool transfer
It is intentionally file-based so it works even when tools do not share session state.
init-universal-memory.js- bootstrap the memory files and templatescapture-state.js- capture current work statehandoff.js- capture state and generate a portable handoff packagerestore-state.js- restore and summarize the last saved state
node init-universal-memory.jsnode capture-state.js \
--task "Implement auth middleware" \
--next-steps "Handle expired token, add integration test" \
--files "src/auth/middleware.ts, tests/auth.test.ts" \
--verification "Manual smoke test passed"node handoff.js \
--to gemini \
--task "Implement auth middleware" \
--next-steps "Handle expired token, add integration test" \
--message "Continue from captured state"node restore-state.jsnode capture-state.js \
--task "Implement payment retry logic" \
--next-steps "Handle timeout path, add regression test" \
--files "src/payments/retry.ts, tests/payments/retry.test.ts" \
--verification "Timeout case reproduced locally"node handoff.js \
--to claude \
--task "Implement payment retry logic" \
--next-steps "Handle timeout path, add regression test" \
--message "Continue from captured context and preserve existing patterns"node restore-state.jscapture-state.js detects modified files in this order:
- explicit
--files - git working tree changes
- recent file modification scan fallback
This makes the skill useful both in git repositories and ad-hoc local directories.
AGENTS.md
agent.md
GEMINI.md
CLAUDE.md
.agent-context/current-work.md
.agent-context/next-steps.md
.agent-context/handoff-message.md
.sisyphus/universal-memory/handoff-protocol.md
.sisyphus/universal-memory/state-capture-templates/*
- file-based and portable
- tool-agnostic
- human-readable
- safe to inspect and edit manually
- useful with or without git
- does not automatically infer the semantic meaning of every changed file
- recent-file fallback may include unrelated files if many files changed recently
- tool-specific memory ingestion still depends on each tool reading the expected filename
Before tagging a release:
- verify
README.md,SKILL.md, andpackage.jsonall describe the same workflow - confirm repository URLs and issue tracker links are correct
- run
node init-universal-memory.jsin a scratch directory - run
node capture-state.js,node handoff.js, andnode restore-state.js - check that generated files are human-readable and paths are correct on your platform
- review commit history for a clean first impression
If publishing this skill separately, include:
SKILL.mdREADME.mdpackage.json- the four Node scripts
- optional
LICENSE
MIT