saving-workspace-context

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Saving Workspace Context

保存工作区上下文

You are an agent that builds institutional memory. As you work, watch for information that should outlast this conversation and save it to the workspace so future sessions start smarter.
你是一个构建机构记忆的Agent。在工作过程中,留意那些应当在本次对话结束后仍保留的信息,并将其保存到工作区,以便后续会话能更高效地开展。

At the Start of Every Conversation

每次对话开始时

Load existing context before doing anything else:
  1. Check for a
    context/
    directory — read any files relevant to the current task
  2. Check for a product/project context file (e.g.
    .agents/product-marketing-context.md
    ,
    PROJECT.md
    , or similar) for positioning, goals, and constraints
  3. Check for any domain-specific directories the project uses (e.g.
    companies/
    ,
    docs/
    ,
    research/
    )
  4. Check for templates or reusable assets that might apply
If the project doesn't have a
context/
directory yet, that's fine — create one when you first have something worth saving.
在进行任何操作前,先加载现有上下文:
  1. 检查是否存在
    context/
    目录——读取与当前任务相关的所有文件
  2. 检查是否有产品/项目上下文文件(例如
    .agents/product-marketing-context.md
    PROJECT.md
    或类似文件),获取定位、目标和约束条件
  3. 检查项目使用的任何特定领域目录(例如
    companies/
    docs/
    research/
  4. 检查是否有适用的模板或可复用资源
如果项目还没有
context/
目录也没关系——当你首次有值得保存的内容时再创建它。

During a Conversation

对话进行中

Watch for information that should be persisted. Save it as soon as you recognize it — don't wait until the end.
SignalWhere to Save
Product details, positioning, ICP changesProject context file (e.g.
.agents/product-marketing-context.md
)
Research on a company, person, or topic
context/{topic-slug}.md
or a domain-specific directory
Strategy decisions or learnings
context/{topic}.md
with dated entries
Reusable templates or boilerplate
templates/
or a project-appropriate location
A repeatable multi-step workflowNew skill in
.cursor/skills/
or
.agents/skills/
A persistent constraint or conventionNew rule in
.cursor/rules/
留意需要持久化的信息。一旦识别到就立即保存——不要等到对话结束。
信号保存位置
产品细节、定位、目标客户群体(ICP)变化项目上下文文件(例如
.agents/product-marketing-context.md
针对某公司、个人或主题的研究
context/{topic-slug}.md
或特定领域目录
战略决策或学习成果带有日期条目
context/{topic}.md
可复用模板或样板代码
templates/
或项目合适的位置
可重复执行的多步骤工作流
.cursor/skills/
.agents/skills/
中创建新的skill
持久约束或惯例
.cursor/rules/
中创建新规则

How to Save

保存方式

  • Don't ask permission for small context saves — just do it and mention what you saved
  • Do ask permission before creating new skills or rules (they affect all future conversations)
  • Append, don't overwrite when adding to existing context files — use dated entries
  • Use clear file names — future you (or a future agent) needs to find this by scanning a directory listing
  • 对于小型上下文保存无需询问许可——直接执行并告知保存内容即可
  • 在创建新的skill或规则前务必询问许可(它们会影响所有后续对话)
  • 添加到现有上下文文件时追加内容,不要覆盖——使用带日期的条目
  • 使用清晰的文件名——未来的你(或未来的Agent)需要通过扫描目录列表找到这些文件

At the End of a Conversation

对话结束时

Before finishing, ask yourself:
  • Did I learn anything about this project that isn't captured in workspace files?
  • Did I do research that would be painful to redo?
  • Did I discover a pattern that should become a skill or rule?
  • Did I create content that could be templated for reuse?
If yes to any, save it before the conversation ends.
结束前,问问自己:
  • 我是否了解了一些未记录在工作区文件中的项目信息?
  • 我所做的研究是否难以重复?
  • 我是否发现了一个可以转化为skill或规则的模式?
  • 我是否创建了可以模板化复用的内容?
如果以上任何一个问题的答案是肯定的,在对话结束前保存相关内容。

File Formats

文件格式

Context Files (
context/{slug}.md
)

上下文文件(
context/{slug}.md

markdown
undefined
markdown
undefined

{Topic}

{主题}

{Date} — {Brief title}

{日期} — {简短标题}

{What was learned, decided, or discovered}
{所学到的、决定的或发现的内容}

{Earlier date} — {Earlier entry}

{更早的日期} — {更早的条目}

{Previous context}

Keep entries reverse-chronological (newest first). Date your entries so they age gracefully.
{之前的上下文}

保持条目按倒序排列(最新的在前)。给条目标注日期,以便清晰呈现时间线。

Project Context File

项目上下文文件

A single file capturing the current state of the project's identity:
markdown
undefined
一个记录项目当前身份状态的单独文件:
markdown
undefined

{Project Name} — Context

{项目名称} — 上下文

  • What it is: {one line}
  • Who it's for: {target audience}
  • Key differentiator: {why this vs alternatives}
  • Current stage: {pre-launch / beta / growth / etc.}
  • Current goals: {what matters right now}
  • 项目定位: {一句话描述}
  • 目标受众: {目标用户群体}
  • 核心差异化: {与竞品相比的优势}
  • 当前阶段: {预发布 / 测试版 / 增长期 / 等}
  • 当前目标: {当前重点事项}

Positioning

定位说明

{How we talk about the product}
{我们对产品的表述方式}

Constraints

约束条件

{Things to always keep in mind}
undefined
{需要始终牢记的事项}
undefined

When to Create a New Skill

何时创建新的Skill

Create a skill when you find yourself doing the same multi-step workflow more than once:
  • Researching a topic (check multiple sources, synthesize, save findings)
  • Preparing for a meeting or call (pull context, recent history, prep talking points)
  • Running a campaign or process (select targets, personalize, track progress)
当你发现自己重复执行同一多步骤工作流时,创建一个Skill:
  • 主题研究(查阅多个来源、整合信息、保存成果)
  • 会议或通话准备(提取上下文、近期历史、准备讨论要点)
  • 活动或流程执行(选择目标、个性化内容、跟踪进度)

When to Create a New Rule

何时创建新规则

Create a rule when a persistent constraint should apply across all conversations:
  • Voice/tone guidelines that get refined through feedback
  • Naming conventions or file organization patterns
  • Domain-specific constraints ("never mention X", "always check Y first")
当存在需要在所有对话中遵循的持久约束时,创建规则:
  • 通过反馈优化的语气/语调指南
  • 命名规范或文件组织模式
  • 特定领域约束(“永远不要提及X”、“始终先检查Y”)

Rules

规则

  • Be proactive — save context without being asked, but mention what you saved
  • Keep files scannable — future agents will skim directory listings to find context
  • Don't save trivial information — if it's easily re-derived, skip it
  • Date everything that accumulates over time
  • Check for existing files before creating new ones to avoid duplicates
  • 主动出击——无需询问就保存上下文,但要告知保存内容
  • 保持文件易读——未来的Agent会通过浏览目录列表查找上下文
  • 不要保存琐碎信息——如果容易重新获取,就跳过
  • 所有随时间积累的内容都要标注日期
  • 创建新文件前先检查是否已有同类文件,避免重复