akunzai/agent-skills / skills/agents-memory
agents-memory
VerifiedRecord, recall, or forget notes in the agent's global or project memory, deciding scope (global vs. project) and tier (short-term candidate vs. long-term durable) when recording. Use on `/agents-memory`, `$agents-memory`, "remember this", "what did I note about X", "recall", or "forget X". Autonomous knowledge capture after solving a problem is agents-md's Prevent Recurrence, not this skill.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.8 KB |
| references/cross-agent-locations.md | markdown | 1.7 KB |
| references/project-memory-migration.md | markdown | 5.1 KB |
| references/security.md | markdown | 1.0 KB |
| scripts/proj-memory-path.shexecutable | script | 2.9 KB |
| skill.oms.sig | other | 12.7 KB |
scripts/proj-memory-path.sh
View on GitHub#!/usr/bin/env bash
set -euo pipefail
# proj-memory-path.sh
# Resolves global project short-term memory path
# (~/.agents/memories/projects/<project-name>/).
#
# Usage: proj-memory-path.sh [--ensure] [DIR]
# Default: pure path resolution (no side effects).
# --ensure: create the directory if missing, then print the path.
ENSURE=0
TARGET_DIR="$PWD"
while [[ $# -gt 0 ]]; do
case "$1" in
--ensure)
ENSURE=1
shift
;;
-h|--help)
cat <<'EOF'
Usage: proj-memory-path.sh [--ensure] [DIR]
Resolve the global project short-term memory directory for DIR
(default: current working directory).
--ensure Create the directory if it does not exist
-h, --help Show this help
EOF
exit 0
;;
-*)
echo "Error: unknown option: $1" >&2
echo "Usage: proj-memory-path.sh [--ensure] [DIR]" >&2
exit 1
;;
*)
TARGET_DIR="$1"
shift
;;
esac
done
if [ ! -d "$TARGET_DIR" ]; then
echo "Error: Directory '$TARGET_DIR' does not exist." >&2
exit 1
fi
# Resolve canonical absolute path of target dir
CANONICAL_TARGET="$(cd "$TARGET_DIR" && pwd -P)"
# Wraps `git -C "$CANONICAL_TARGET"` as a function rather than an unquoted
# string: a string command word-splits a space in CANONICAL_TARGET, sending
# git a truncated -C path plus stray positional args, which makes it fail
# silently (2>/dev/null || true below) and lets MAIN_REPO_ROOT wrongly fall
# back to the target dir itself. bash 3.2 compatible (macOS /bin/bash): no
# arrays-of-arrays, no mapfile.
git_cmd() {
env -u GIT_DIR -u GIT_WORK_TREE -u GIT_PREFIX git -C "$CANONICAL_TARGET" "$@"
}
# Resolve Git Main Repo Root (supports Git worktrees)
MAIN_REPO_ROOT=""
if git_cmd rev-parse --is-inside-work-tree >/dev/null 2>&1; then
COMMON_DIR="$(git_cmd rev-parse --git-common-dir 2>/dev/null || true)"
if [ -n "$COMMON_DIR" ]; then
# Make COMMON_DIR absolute if relative. Besides a leading `/`, also
# accept a drive-letter prefix (`C:/...` or `C:\...`): Git for Windows
# (Git Bash) can return one from --git-common-dir in linked worktrees.
if [[ "$COMMON_DIR" != /* && ! "$COMMON_DIR" =~ ^[A-Za-z]:[/\\] ]]; then
COMMON_DIR="$CANONICAL_TARGET/$COMMON_DIR"
fi
ABS_COMMON_DIR="$(cd "$COMMON_DIR" 2>/dev/null && pwd -P || true)"
if [ -n "$ABS_COMMON_DIR" ] && [ "$(basename "$ABS_COMMON_DIR")" = ".git" ]; then
MAIN_REPO_ROOT="$(dirname "$ABS_COMMON_DIR")"
fi
fi
if [ -z "$MAIN_REPO_ROOT" ]; then
MAIN_REPO_ROOT="$(git_cmd rev-parse --show-toplevel 2>/dev/null || true)"
fi
fi
if [ -z "$MAIN_REPO_ROOT" ]; then
MAIN_REPO_ROOT="$CANONICAL_TARGET"
fi
# Same-name projects intentionally share memory across local checkout paths.
PROJ_NAME="$(basename "$MAIN_REPO_ROOT")"
GLOBAL_MEM_DIR="${HOME}/.agents/memories/projects/${PROJ_NAME}"
if [[ "$ENSURE" -eq 1 ]]; then
mkdir -p "$GLOBAL_MEM_DIR"
fi
echo "$GLOBAL_MEM_DIR"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |