context

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

context

项目上下文维护

Maintain
tasks/context.md
as a living, durable "what matters" record for the project. Write it for someone taking over the project (or a future session resuming later). Explain where things are, what was decided, and what to watch before proceeding. Treat this as shared behaviour embedded in other skills, not a mandatory standalone step in normal workflows. When invoked inline (from another skill), apply this workflow as part of that skill's execution. When invoked directly, use for explicit backfill/repair/cleanup requests.

tasks/context.md
维护为项目的动态、持久化“关键信息”记录文档。 撰写目标为接手项目的人员(或后续恢复工作的自己)。 需说明当前进展、已做出的决策,以及后续推进前需要注意的事项。 将此流程视为嵌入其他技能的共享行为,而非常规工作流中强制要求的独立步骤。 当从其他技能中嵌入调用时,将此工作流作为该技能执行的一部分。 当直接调用时,用于处理明确的补全/修复/清理请求。

Guardrails

约束规则

  • Do not store secrets (API keys, tokens, credentials).
  • Keep entries short and durable; avoid duplicating long PRDs or code.
  • Update
    tasks/context.md
    in place; do not rewrite the whole file.
  • Write in plain language so a junior dev (or another AI) can take over without extra context.
  • Prefer inline updates during active skills (
    prd
    ,
    design
    ,
    implement
    ,
    review
    ,
    commit
    ).
  • Update when worthwhile information emerges.
  • Links are optional and high-signal only; see Links Format below.
  • When asking users for decisions/clarifications, provide numbered short-reply options (e.g.
    1
    ,
    2
    ,
    3
    ).
  • 禁止存储敏感信息(API密钥、令牌、凭证等)。
  • 条目应简洁且具备持久性;避免重复冗长的PRD或代码内容。
  • 直接在
    tasks/context.md
    中更新内容;请勿重写整个文件。
  • 使用平实语言撰写,确保初级开发人员(或其他AI)无需额外上下文即可接手工作。
  • 优先在活跃技能执行过程中嵌入更新(如
    prd
    design
    implement
    review
    commit
    )。
  • 当出现有价值的信息时进行更新。
  • 链接为可选内容,仅添加高价值的链接;格式参考下文的「链接格式」。
  • 当需要用户做出决策或澄清时,提供带编号的简短回复选项(例如
    1
    2
    3
    )。

What goes where

内容分工

  • PRD files (
    tasks/f-##-*.md
    ) = what we intend to do (the spec + progress checklist for one feature)
  • tasks/context.md
    = project definition, durable decisions, milestones, gotchas, and "where we are now"

  • PRD文件(
    tasks/f-##-*.md
    )= 我们计划要做的事情(单个功能的规格说明+进度检查清单)
  • tasks/context.md
    = 项目定义、持久化决策、里程碑、注意事项,以及“当前进展状态”

What to Record

记录内容

  • Project gist (what it is, who it's for, success measures) →
    ## Project
  • Current state (what's done, what's next, what's blocked) →
    ## Current state
  • Key decisions and durable design decisions (what we chose + why + tradeoffs) →
    ## Key decisions
  • Completed work (feature IDs and notable outcomes) →
    ## Completed
  • Notes/gotchas (constraints, pitfalls, conventions, sharp edges) →
    ## Notes / gotchas
  • Optional context links (canonical docs, API specs, repos) →
    ## Links (optional)
Avoid:
  • raw meeting transcripts
  • verbose day-by-day logs
  • duplicate content that already lives in PRDs or code

  • 项目概要(项目定位、目标用户、成功衡量标准)→
    ## Project
  • 当前状态(已完成工作、下一步计划、阻塞事项)→
    ## Current state
  • 关键决策与持久化设计决策(选择方案+原因+权衡取舍)→
    ## Key decisions
  • 已完成工作(功能ID及重要成果)→
    ## Completed
  • 注意事项(约束条件、潜在陷阱、约定规则、风险点)→
    ## Notes / gotchas
  • 可选上下文链接(标准文档、API规格、代码仓库)→
    ## Links (optional)
避免记录:
  • 原始会议记录
  • 冗长的每日日志
  • 已存在于PRD或代码中的重复内容

Links Format

链接格式

  • Only add
    ## Links (optional)
    when links materially improve handoff context.
  • Format:
    [Label](path-or-url) — why this helps future context
  • Prefer durable references (design docs, API specs, runbooks, repos); avoid ephemeral links (temp chats, preview URLs).
  • De-duplicate by updating existing entries instead of adding near-identical links.

  • 仅当链接能切实提升上下文交接效率时,才添加
    ## Links (optional)
    章节。
  • 格式:
    [标签](路径或URL) — 该链接对未来上下文维护的帮助
  • 优先使用持久化参考链接(如设计文档、API规格、运行手册、代码仓库);避免使用临时链接(如临时聊天记录、预览URL)。
  • 通过更新现有条目来避免重复,而非添加几乎相同的链接。

Workflow

工作流程

  1. Ensure
    tasks/
    exists; create
    tasks/context.md
    if missing.
    • Use
      references/context-template.md
      as the default file template when creating it.
  2. Add short entries (1–3 lines) in the most relevant section.
  3. Prepend new entries at the top of each section (newest-first order).
  4. Prefer referencing stable feature IDs (
    f-##
    ) and avoid file paths (paths can change after archiving/compaction).
  5. If a link materially improves context, add or update entries in
    ## Links (optional)
    using the links format.
  6. If it's unclear what to record, ask one clarifying question with numbered short-reply options (e.g.
    1
    ,
    2
    ,
    3
    ).

  1. 确保
    tasks/
    目录存在;若
    tasks/context.md
    不存在则创建该文件。
    • 创建时默认使用
      references/context-template.md
      作为模板。
  2. 在最相关的章节中添加简短条目(1-3行)。
  3. 将新条目添加到对应章节的顶部(按最新优先排序)。
  4. 优先引用稳定的功能ID(
    f-##
    ),避免使用文件路径(归档/压缩后路径可能发生变化)。
  5. 若链接能切实提升上下文价值,按照上述链接格式在
    ## Links (optional)
    中添加或更新条目。
  6. 若不确定需要记录什么,提出一个带编号简短回复选项的澄清问题(例如
    1
    2
    3
    )。

References

参考资料

  • references/context-template.md
    : default structure for creating
    tasks/context.md
    .

  • references/context-template.md
    :创建
    tasks/context.md
    的默认结构模板。

Output

输出结果

  • Create or update
    tasks/context.md
    .
  • Inline (from another skill): reply with a short summary of what was added/updated. Let the calling skill's output format take precedence.
  • Standalone (direct invocation): reply with the file path, summary, and a status block:
    • Files changed: list of created/updated files
    • Key decisions: any assumptions or choices made (if any)
    • Next step: recommended next skill or action
  • 创建或更新
    tasks/context.md
  • 嵌入调用(来自其他技能):回复添加/更新内容的简短摘要,遵循调用技能的输出格式优先级。
  • 直接调用:回复文件路径、摘要及状态块:
    • 已修改文件:创建/更新的文件列表
    • 关键决策:做出的任何假设或选择(如有)
    • 下一步建议:推荐的后续技能或操作