session-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session Commit

会话提交

Analyze the current coding session, propose improvements to
AGENTS.md
, and apply approved changes.
分析当前编码会话,提出
AGENTS.md
的优化建议并应用已获批的变更。

Available scripts

可用脚本

  • scripts/preflight.sh
    - Checks whether required instruction files exist and optionally repairs missing files.
  • scripts/preflight.sh
    - 检查所需的指令文件是否存在,可选择修复缺失的文件。

Workflow

工作流程

  1. Run preflight checks:
bash
bash scripts/preflight.sh
  1. If preflight fails and user approves repairs, run:
bash
bash scripts/preflight.sh --fix
  1. Read the current
    AGENTS.md
    and build a mental map of existing sections.
  2. Extract only durable learnings from the current session.
  3. Propose changes using the format in
    references/change-proposal-format.md
    .
  4. Wait for explicit user approval before applying any edits.
  5. Apply approved changes and merge with existing content.
  1. 执行预检检查:
bash
bash scripts/preflight.sh
  1. 如果预检失败且用户同意修复,执行:
bash
bash scripts/preflight.sh --fix
  1. 读取当前的
    AGENTS.md
    ,构建现有章节的逻辑映射。
  2. 仅提取当前会话中可长期复用的经验。
  3. 按照
    references/change-proposal-format.md
    中的格式提出变更建议。
  4. 应用任何编辑前需等待用户明确批准。
  5. 应用已获批的变更并与现有内容合并。

What to capture

需要记录的内容

  • Coding patterns and conventions established in the session
  • Architecture decisions and reasoning that should persist
  • Debugging playbooks and recurring gotchas
  • Workflow preferences that improve future sessions
  • 本次会话中确立的编码模式和规范
  • 需要留存的架构决策及背后逻辑
  • 调试手册和反复出现的问题点
  • 可提升后续会话效率的工作流偏好

Guardrails

约束规则

  • Do not capture transient implementation details that will age quickly.
  • Prefer updating existing sections before creating new headings.
  • Use concise bullet points rather than long paragraphs.
  • Keep guidance tool-agnostic unless behavior differs by tool.
  • If no meaningful learning occurred, report that and stop.
  • 不要记录很快就会过时的临时实现细节。
  • 优先更新现有章节,再考虑新增标题。
  • 使用简洁的项目符号而非长段落。
  • 除非不同工具的行为存在差异,否则指南应保持工具无关性。
  • 如果没有产生有价值的经验,直接报告该情况并终止流程。

Pointer file behavior

指针文件行为

If
CLAUDE.md
,
CODEX.md
, or
GEMINI.md
are missing or empty, create symlinks that point to
AGENTS.md
.
如果
CLAUDE.md
CODEX.md
GEMINI.md
缺失或为空,创建指向
AGENTS.md
的符号链接。

Output contract

输出约定

  • Proposal stage: output only proposed changes with explicit add/modify/remove counts.
  • Apply stage: update
    AGENTS.md
    only after explicit approval.
  • Completion stage: summarize what changed and where.
  • 提案阶段:仅输出变更提案,附带明确的新增/修改/删除计数。
  • 应用阶段:仅在获得明确批准后更新
    AGENTS.md
  • 完成阶段:总结变更内容和变更位置。