project-memory: Embedding Project Context into the Repository with `.memory/`

前言

When you start a new conversation in Cursor, the Agent often can’t see the architectural trade-offs and open questions discussed in the previous round. As conversations get longer, the window fills up with history, which costs extra tokens and makes it easy to mix old conclusions with the current task. Some people paste key points into a README or scratch notes, but there isn’t a consistent process for “how to resume and how to wrap up” each conversation.

Below is project-memory on SkillHub (coordinate @user_69484e35/memoryrz2r, version 1.0.0, community-sourced, category ai-agent). It maintains structured Markdown under .memory/ in the project root, and chains “read memory, compress into a summary, write back to files” into a repeatable workflow via three slash commands. The page indicates Cursor support, and requires_api_key=false.

这是什么

project-memory is an Agent Skill based on the common SKILL.md format, published by SkillHub user user_69484e35. It addresses: how to keep the project’s current state, decisions, and open questions in fixed paths inside the repository, and how to read and write those files using the same structure at the start or end of a new conversation.

The memory directory is conventionally placed under .memory/ at the project root. Core files include project.md, context.md, and decisions.md (the Skill will also initialize the full directory structure when needed).

核心功能

The capabilities below come from the official SkillHub description and page notes, and can be understood via three commands.

/memory.bootstrap

At the start of a new conversation, read project.md, context.md, and decisions.md, and output a project current-state summary to quickly restore context. The Skill triggers according to its rules when the user says /memory.bootstrap, or mentions “memory” or “restore context,” etc.

/memory.summarize

Compress the current conversation into a structured summary with fixed fields:

  • Goal
  • Decisions
  • Context
  • Open Questions
  • Next Actions

Use this when “context is getting too long,” or when you need to wrap up and organize before starting the next round. Triggers include /memory.summarize or natural-language mentions of compression/summarization intent (consistent with the keywords listed by the official page).

/memory.update

Write the summary from the previous step (or an equivalent one) back into the corresponding memory files. In decisions.md, decision entries will be appended with precise dates to avoid overwriting the historical decision chain. Triggers include /memory.update or phrases like “update memory.”

目录初始化与时间信息

Beyond the three steps above, the Skill also supports:

  1. Initialize the .memory/ directory structure (used when the memory layout hasn’t been set up in the project yet).
  2. Extract conversation start and end times from the filesystem timestamps of .jsonl files in Cursor’s agent-transcripts directory, with minute precision; it can be used together with user mentions of “conversation time.”

安装与启用

The installation method provided on the SkillHub page is: ask the current AI to follow the official installation documentation, and install the coordinate @user_69484e35/memoryrz2r. The documentation URL is skillhub.cn/install/skillhub.md.

If the skillhub CLI is already installed locally, you can follow SkillHub’s general instructions to install the skill into the current Agent’s skills directory (you must use --dir; otherwise the default ./skills/ may not be recognized). A common Cursor path is ~/.cursor/skills/. Example:

command -v skillhub && skillhub --version

If the CLI is not installed, the official docs provide a one-click install script (full installation or CLI only); see the curl commands in the same installation document.

After installation, use this Skill in the root directory of a specific project repository: the Agent will read and write .memory/ under that root. The page does not separately list differences for Codex CLI or Claude Code; if you use another client, you should map it to that client’s skills directory yourself (the installation doc lists common paths such as Claude Code and Codex).

Example prompt to send to the Agent (consistent with the SkillHub page):

请根据 https://skillhub.cn/install/skillhub.md,安装 `@user_69484e35/memoryrz2r`。

典型用法

You can follow the order: “restore first, then compress, finally write it back to memory files.” Each step corresponds to one slash command or an equivalent natural-language instruction.

1. Restore context at the start of a new session

In a project where .memory/ already exists and the three core files have content, enter:

/memory.bootstrap

The Agent should read the three files and output a current-state summary so you can continue editing code or discussing plans.

2. Generate a structured summary after a long conversation

When the current task has reached a milestone and the window has become long, enter:

/memory.summarize

You should get a summary containing Goal, Decisions, Context, Open Questions, and Next Actions, so it can be reviewed by a human before being written into the repository.

3. Write the summary back to memory files

After confirming the summary is correct:

/memory.update

When decision-related content goes into decisions.md, it should be appended with a date; other fields are written to the files corresponding to the Skill’s definition.

4. First-time use in this repository

If there is no .memory/ under the project root yet, you can use the Skill’s initialization capability to create the directory structure, then maintain content using the three steps above. If you need to verify the start/end times of a Cursor conversation, you can mention “conversation time,” and the Skill will handle it based on the timestamps of .jsonl files under agent-transcripts.

适用场景与注意

适合谁

  • Developers who use Cursor Agent long-term in a single repository and want context that can be version-controlled and reused across conversations.
  • Teams that want decisions to have a decisions.md timeline instead of being scattered across chat logs.

限制与注意

  • Memory quality depends on the accuracy of summarization and updates; memory.update modifies repository files, so it’s recommended to run a diff before committing.
  • Conversation time comes from the filesystem timestamps of .jsonl files; whether it matches the business time inside the messages needs to be judged by yourself.
  • SkillHub stats (based on the retrieved snapshot): rating 100000, downloads 738; tags indicate no API key required. Official API page: https://api.skillhub.cn/user_69484e35/memoryrz2r, display page: https://www.skillhub.cn/skills/user_69484e35/memoryrz2r.

结尾

With the steps above, project-memory consolidates “what to read when starting a conversation and what to leave when ending it” into the project root .memory/ and three commands, reducing the cost of repeatedly explaining project background. If you already use Cursor and want memory to live with the repository, you can install @user_69484e35/memoryrz2r via the SkillHub page and start by trying /memory.bootstrap.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye