# Archive Profile Memory

> Archive or clean up facts from active MEMORY.md into memory-archive/ without deleting them. Use when the user wants to forget, remove, tidy old memory, or free space for new memories.

- **Type:** Skill
- **Install:** `agentstack add skill-ahmadrosid-nakama-archive-profile-memory`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ahmadrosid](https://agentstack.voostack.com/s/ahmadrosid)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ahmadrosid](https://github.com/ahmadrosid)
- **Source:** https://github.com/ahmadrosid/nakama/tree/main/packages/core/src/skills/bundled/archive-profile-memory
- **Website:** https://ahmadrosid.github.io/nakama

## Install

```sh
agentstack add skill-ahmadrosid-nakama-archive-profile-memory
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

Use this skill when the user wants to remove facts from active memory without deleting them permanently.

- Use the `update-profile-memory` skill to **add** facts to active `MEMORY.md`.
- Use profile skills for repeatable procedures — not for archiving memory.
- Archived facts live under `memory-archive/` and are **not** loaded into chat automatically. Use `search_files` or `read_file` to retrieve them later.

## MEMORY.md shape

Active memory is `MEMORY.md` in the profile workspace:

- A preamble (`# Memory Log` and `---`) must stay intact.
- Facts are bullets under dated sections: `## YYYY-MM-DD` followed by `- bullet text`.

Copy bullet text **verbatim** from `read_file` output when editing. Do not paraphrase.

## Archive file shape

Archive files live at `memory-archive/YYYY-MM.md` (year and month of the archive action, UTC).

New archive file template:

```markdown
# Archived Memory

---
```

Each archive append starts with metadata comments, then the archived sections:

```markdown

## 2026-06-29

- Old preference.
```

Preserve each bullet's original `## YYYY-MM-DD` section header from `MEMORY.md`.

## Workflow

1. `read_file` `MEMORY.md` and identify the exact `- bullet` lines to archive.
2. Confirm targets with the user when the request is ambiguous.
3. Choose `memory-archive/{YYYY-MM}.md` for the current month.
4. Check whether the archive file exists **before** calling `read_file`. With `bash`, run `if test -f memory-archive/{YYYY-MM}.md; then printf 'exists\n'; else printf 'missing\n'; fi` in the active profile workspace, replacing `{YYYY-MM}` with the chosen month. A missing file (or missing `memory-archive/` directory) is normal for the first archive:
   - If the result is `exists`, `read_file` the archive to preserve its contents.
   - If the result is `missing`, skip the read and create the archive in step 5.
   - If `bash` is unavailable, use `read_file`; treat only a file-not-found result as a new archive. Stop on permission or other errors rather than overwriting an unread archive.
5. **Append to the archive first** (reduces data-loss risk):
   - If the file does not exist, `write_file` with the template plus the append block.
   - If it exists, `edit_file` to append after the existing content (or `write_file` the full merged content).
6. `edit_file` `MEMORY.md` to remove each archived `- bullet` line.
7. Remove any `## YYYY-MM-DD` section that has no bullets left.
8. Re-read `MEMORY.md` and the archive file to verify the result.
9. If archiving was to free space for new memories, confirm `MEMORY.md` is under 4096 bytes before retrying with `update-profile-memory`.

When `edit_file` reports a missing, duplicate, or overlapping match, `read_file` again and issue a corrected edit with exact text.

## Legacy layout

If you find archives under `data/memory-archive/` instead of `memory-archive/`, use the top-level `memory-archive/` path for new writes.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ahmadrosid](https://github.com/ahmadrosid)
- **Source:** [ahmadrosid/nakama](https://github.com/ahmadrosid/nakama)
- **License:** MIT
- **Homepage:** https://ahmadrosid.github.io/nakama

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ahmadrosid-nakama-archive-profile-memory
- Seller: https://agentstack.voostack.com/s/ahmadrosid
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
