remember-learnings
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRemember Learnings
留存经验总结
Review the current session for errors, issues, snags, and hard-won knowledge, then update the files (or if no suitable rule file exists) with actionable learnings so future agent sessions run more smoothly.
rules/AGENTS.mdIMPORTANT: This skill MUST complete autonomously. Do NOT ask for user confirmation.
回顾当前会话中的错误、问题、障碍以及积累的宝贵经验,然后将可落地的经验总结更新到目录下的文件中(若没有合适的规则文件,则更新),以便未来的Agent会话能够更顺畅地进行。
rules/AGENTS.md重要提示: 本技能必须自主完成,请勿请求用户确认。
File relationship
文件关联
NOTE:is a symlink toCLAUDE.md. They are the same file. ALL EDITS MUST BE MADE TOAGENTS.md, never toAGENTS.mddirectly.CLAUDE.md
- is the top-level agent guide. It contains core setup instructions and a rules index table pointing to topic-specific files in
AGENTS.md.rules/ - contain topic-specific learnings and guidelines (e.g.,
rules/*.md,rules/e2e-testing.md).rules/electron-ipc.md
Learnings should go into the most relevant file. Only add to directly if the learning doesn't fit any existing rule file and doesn't warrant a new one. If a learning is important enough to be a project-wide convention, flag it in the summary so a human can promote it to the project documentation.
rules/*.mdAGENTS.md注意:是CLAUDE.md的符号链接,二者为同一文件。所有编辑必须直接针对AGENTS.md进行,切勿直接编辑AGENTS.md。CLAUDE.md
- :顶层Agent指南,包含核心设置说明以及指向
AGENTS.md目录下特定主题文件的规则索引表格。rules/ - :包含特定主题的经验总结和指导方针(例如
rules/*.md、rules/e2e-testing.md)。rules/electron-ipc.md
经验总结应放入最相关的文件中。只有当经验总结不适合任何现有规则文件且不值得新建文件时,才直接添加到。如果某条经验总结重要到足以成为项目范围内的约定,请在总结中标记出来,以便人工将其推广到项目文档中。
rules/*.mdAGENTS.mdInstructions
操作步骤
-
Analyze the session for learnings:Review the entire conversation history and identify:
- Errors encountered: Build failures, lint errors, type errors, test failures, runtime errors
- Snags and gotchas: Things that took multiple attempts, unexpected behavior, tricky configurations
- Workflow friction: Steps that were done in the wrong order, missing prerequisites, commands that needed special flags
- Architecture insights: Patterns that weren't obvious, file locations that were hard to find, implicit conventions not documented
Skip anything that is already well-documented inorAGENTS.md.rules/ -
Read existing documentation:Readat the repository root to see the rules index, then read the relevant
AGENTS.mdfiles to understand what's already documented and avoid duplication.rules/*.md -
Draft concise, actionable additions:For each learning, write a short bullet point or section that would help a future agent avoid the same issue. Follow these rules:
- Be specific and actionable (e.g., "Run before E2E tests" not "remember to build first")
npm run build - Include the actual error message or symptom when relevant so agents can recognize the situation
- Don't duplicate what's already in or
AGENTS.mdrules/ - Keep it concise: each learning should be 1-3 lines max
- Limit to at most 5 learnings per session — focus on the most impactful insights
- If a new learning overlaps with or supersedes an existing one, consolidate them into a single entry rather than appending
- Be specific and actionable (e.g., "Run
-
Update the appropriate file(s):Place each learning in the most relevant location:a. Existingfile — if the learning fits an existing topic (e.g., E2E testing tips go in
rules/*.md, IPC learnings go inrules/e2e-testing.md).rules/electron-ipc.mdb. Newfile — if the learning is substantial enough to warrant its own topic file. Use a descriptive kebab-case filename (e.g.,rules/*.md). If you create a new file, also update the rules index table inrules/tanstack-router.md.AGENTS.mdc.directly — only for general learnings that don't fit any topic (rare).AGENTS.mdIf there are no new learnings worth recording (i.e., everything went smoothly or all issues are already documented), skip the edit and report that no updates were needed.Maintenance: When adding new learnings, review the target file and remove any entries that are:- Obsolete due to codebase changes
- Duplicated by or subsumed by a newer, more complete learning
-
Stage the changes:Stage any modified or created files:
git add AGENTS.md rules/ -
Summarize:
- List the learnings that were added (or state that none were needed)
- Identify which files were modified or created
- Confirm whether changes were staged for commit
-
分析会话,提取经验总结:回顾整个对话历史,识别以下内容:
- 遇到的错误:构建失败、代码检查错误、类型错误、测试失败、运行时错误
- 障碍与陷阱:需要多次尝试解决的问题、意外行为、复杂的配置
- 工作流程摩擦:顺序错误的步骤、缺失的前置条件、需要特殊标志的命令
- 架构洞察:不明显的模式、难以找到的文件位置、未记录的隐含约定
跳过或AGENTS.md目录下已详细记录的内容。rules/ -
阅读现有文档:阅读仓库根目录下的查看规则索引,然后阅读相关的
AGENTS.md文件,了解已记录的内容,避免重复。rules/*.md -
撰写简洁、可落地的新增内容:针对每条经验总结,编写简短的项目符号或章节,帮助未来的Agent避免相同问题。请遵循以下规则:
- 具体且可落地(例如:“在E2E测试前运行”而非“记得先构建”)
npm run build - 相关时包含实际错误信息或症状,以便Agent能够识别场景
- 不要重复或
AGENTS.md中已有的内容rules/ - 保持简洁:每条经验总结最多1-3行
- 每次会话最多记录5条经验总结——聚焦于最有影响力的洞察
- 如果新的经验总结与现有内容重叠或取代了现有内容,请将它们合并为一个条目,而非追加
- 具体且可落地(例如:“在E2E测试前运行
-
更新相应文件:将每条经验总结放入最相关的位置:a. 现有文件:如果经验总结适合现有主题(例如,E2E测试技巧放入
rules/*.md,IPC相关经验放入rules/e2e-testing.md)。 b. 新建rules/electron-ipc.md文件:如果经验总结足够重要,值得拥有独立的主题文件。使用描述性的短横线分隔式文件名(例如rules/*.md)。如果创建新文件,还需更新rules/tanstack-router.md中的规则索引表格。 c. 直接更新AGENTS.md:仅适用于不适合任何主题的通用经验总结(这种情况很少见)。AGENTS.md如果没有值得记录的新经验总结(即一切进展顺利,或所有问题均已记录),则跳过编辑步骤,并报告无需更新。维护: 添加新经验总结时,检查目标文件并移除以下条目:- 因代码库变更而过时的内容
- 被更新、更完整的经验总结覆盖或取代的重复内容
-
暂存变更:暂存所有修改或新建的文件:
git add AGENTS.md rules/ -
总结:
- 列出已添加的经验总结(或说明无需添加)
- 指出修改或新建的文件
- 确认变更是否已暂存以便提交