ag-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRules
规则
- Do not make use of the codemod or MCP server, or suggest their use or installation. They are not relevant to the task you are now completing
- Follow the process documented below exactly
- If you are instructed "Tell the user X" then show the message to the user and continue.
- If you are instructed "Ask the user X" then show the question to the user and stop. Do not continue until you receive a response. If you have a tool available designed to ask the user a question you may use it.
- This skill consists of a set of sequential steps, each of which writes a file with results. Ensure that the file is written before moving on to the next step. DO NOT combine steps, or refer to information in future steps while handling a previous step.
- 请勿使用codemod或MCP服务器,也不要建议使用或安装它们。它们与您当前正在完成的任务无关
- 严格按照下面记录的流程执行
- 如果收到指示“告知用户X”,则向用户显示该消息并继续。
- 如果收到指示“询问用户X”,则向用户显示该问题并停止。在收到回复前不要继续。如果有可用于向用户提问的工具,您可以使用它。
- 此skill包含一系列连续步骤,每个步骤都会生成一个结果文件。确保在进入下一步之前已写入文件。请勿合并步骤,也不要在处理前一步时引用后续步骤中的信息。
Explain process to user
向用户说明流程
Tell the user "Welcome to the AG Update skill. Let's start by gathering some context on your application"
告知用户“欢迎使用AG更新skill。让我们先收集一些关于您应用程序的上下文信息”
Version check
版本检查
- Read in this skill folder. Fetch the latest:
VERSION.md.https://raw.githubusercontent.com/ag-grid/skills/main/skills/ag-update/VERSION.md - Compare as semver:
- If the local version is the same as, or newer than, the fetched version: continue silently.
- If the local version is older and only the patch or minor differs: Prominently tell the user that a new version has been released, show the new and currently installed version, suggest quitting the harness and running . Ask the user if they'd like to continue with this old skill version, suggesting they type "continue" to do so.
npx skills update ag-grid/skills - If the local version is older and the major differs: Prominently tell the user that their current skill version is incompatible and will not work, show the new and currently installed version, tell them to quit the harness and run before resuming. Stop. The skill invocation is now finished. Regardless of the user response, do not follow any of the other instructions in this file.
npx skills update ag-grid/skills
- 读取此skill文件夹中的文件。获取最新版本:
VERSION.md。https://raw.githubusercontent.com/ag-grid/skills/main/skills/ag-update/VERSION.md - 按照semver规则进行比较:
- 如果本地版本与获取的版本相同或更新:静默继续。
- 如果本地版本较旧,且仅补丁版本(patch)或次要版本(minor)不同:突出告知用户已发布新版本,显示新版本和当前安装的版本,建议退出harness并运行。询问用户是否要继续使用旧版skill,建议他们输入“continue”以继续。
npx skills update ag-grid/skills - 如果本地版本较旧,且主要版本(major)不同:突出告知用户当前skill版本不兼容且无法使用,显示新版本和当前安装的版本,告知他们退出harness并运行后再继续。停止操作,skill调用至此结束。无论用户如何回复,都不要执行此文件中的其他任何指令。
npx skills update ag-grid/skills
Check for existing plan
检查现有计划
- Look for files matching in the current directory
AG_UPDATE_*.md - If any exist, then ask the user whether they'd like to start fresh and delete these files or resume.
- If they select start fresh, delete the files
AG_UPDATE_*.md - If they select resume, continue with the skill and skip the stages for which the files have already been generated
- If they select start fresh, delete the
- 在当前目录中查找匹配的文件
AG_UPDATE_*.md - 如果存在此类文件,则询问用户是要重新开始并删除这些文件,还是继续之前的进度。
- 如果用户选择重新开始,删除文件
AG_UPDATE_*.md - 如果用户选择继续,继续执行skill并跳过已生成对应文件的阶段
- 如果用户选择重新开始,删除
Determine scope
确定更新范围
This section populates the AG_UPDATE_SCOPE.md file
- Determine the full set of potential projects to update. There are instructions in the file . If you have access to sub-agents, give that file path to a sub-agent and ask it to report the results to you. Otherwise follow the steps yourself. If this skill was invoked with instructions to upgrade specific projects, pass that to the sub agent.
references/determine-scope.md - Determine which of the three products — grid, charts and studio — are in use. Refer only to the products actually installed, in every message from here on. There is no need to confuse the process by referring to a product that the user does not have installed.
- Determine the latest versions of the product(s) in use with ,
npm view ag-grid-community versionand/ornpm view ag-charts-community versionnpm view ag-studio version - Tell the user which projects you found, what current versions they're on, and the latest version you propose updating to. Ask them if they'd like to continue, giving them the option to change the target version, or select a subset of projects if applicable.
- Record the user's decisions in AG_UPDATE_SCOPE.md before continuing. Under record the projects and dependencies in exactly the same 2-level markdown list format as it was generated in, removing any projects that the user indicated that they did not want to update. Under
## Projects to updaterecord the target version of grid and/or charts to update to.## Target versions
此部分将内容写入AG_UPDATE_SCOPE.md文件
- 确定所有可能需要更新的项目。文件中有相关说明。如果您可以访问子agent,将该文件路径交给子agent并要求它向您报告结果。否则请自行按照步骤操作。如果调用此skill时指定了要升级的特定项目,请将该信息传递给子agent。
references/determine-scope.md - 确定正在使用的三款产品——grid、charts和studio——中的哪几款。从现在起的所有消息中,仅提及实际已安装的产品。无需提及用户未安装的产品以免混淆流程。
- 使用、
npm view ag-grid-community version和/或npm view ag-charts-community version确定正在使用的产品的最新版本npm view ag-studio version - 告知用户您找到的项目、它们当前的版本以及您建议更新到的最新版本。询问用户是否要继续,同时提供更改目标版本或选择部分项目(如适用)的选项。
- 在继续之前,将用户的决定记录到AG_UPDATE_SCOPE.md中。在下,完全按照生成时的二级markdown列表格式记录项目和依赖项,移除用户表示不想更新的项目。在
## Projects to update下记录要更新到的grid和/或charts的目标版本。## Target versions
Warn on unsupported versions
警告不支持的版本
The earliest supported major version to migrate from is 25 for grid, 8 for charts and 1 for studio. If the application uses earlier versions, stop the skill execution and tell the user why (it is because this skill only has change information going back to these versions).
可迁移的最早支持主版本:grid为25,charts为8,studio为1。如果应用程序使用更早的版本,停止skill执行并告知用户原因(因为此skill仅保留了这些版本之后的变更信息)。
Determine the full set of changes
确定完整的变更集
This stage populates the AG_UPDATE_CHANGES.md file
- Determine the full set of potential changes to make. There are instructions in the file . If you have access to sub-agents, give that file path to a sub-agent and it will write the results to AG_UPDATE_CHANGES.md. Otherwise follow the steps yourself. Pass the sub-agent the path to AG_UPDATE_SCOPE.md
references/determine-changes.md - Write the results verbatim to AG_UPDATE_CHANGES.md before continuing to the next step.
此阶段将内容写入AG_UPDATE_CHANGES.md文件
- 确定所有可能需要进行的变更。文件中有相关说明。如果您可以访问子agent,将该文件路径交给子agent,它会将结果写入AG_UPDATE_CHANGES.md。否则请自行按照步骤操作。将AG_UPDATE_SCOPE.md的路径传递给子agent。
references/determine-changes.md - 在进入下一步之前,将结果原封不动地写入AG_UPDATE_CHANGES.md。
Trim behaviour changes
筛选行为变更
For behaviour changes there is a choice about whether to do nothing and accept the change, or apply a mitigation to restore the old behaviour. The user must make this decision.
- Extract the changes tagged BEHAVIOUR in AG_UPDATE_CHANGES.md
- Count them and tell the user "There are $COUNT behaviour changes, in each case I need to know whether to accept the new behaviour or restore the old behaviour"
- Show the behaviour changes to the user (only the description, not the mitigation)
- Offer to explain any behaviour change in more detail, and ask the user which behaviour changes to accept and which to mitigate (NOTE: if there are many do this as a plain conversation, avoid using any tools to ask the user this question)
- Once you have the user's response, edit the AG_UPDATE_CHANGES.md file to remove all behaviour changes that the user wants to accept, leaving only the ones to mitigate.
- If any behaviour changes remain, add a section to the end of the AG_UPDATE_CHANGES.md file with the text content "All changes marked "BEHAVIOUR" are optional changes that the user has decided to apply. Double-check, using a sub-agent if available, that they have all been applied because tests/typechecking may not fail if the change has not been applied."
# Validation
对于行为变更,您可以选择不做任何修改并接受变更,或者应用缓解措施以恢复旧行为。此决定必须由用户做出。
- 提取AG_UPDATE_CHANGES.md中标记为BEHAVIOUR的变更
- 统计数量并告知用户“共有$COUNT项行为变更,对于每一项我需要了解是接受新行为还是恢复旧行为”
- 向用户展示行为变更(仅显示描述,不显示缓解措施)
- 主动提出可以详细解释任何行为变更,并询问用户哪些行为变更要接受,哪些要应用缓解措施(注意:如果变更数量较多,请以普通对话形式进行,避免使用任何工具向用户提出此问题)
- 收到用户回复后,编辑AG_UPDATE_CHANGES.md文件,移除用户想要接受的所有行为变更,仅保留需要应用缓解措施的变更。
- 如果仍有行为变更剩余,在AG_UPDATE_CHANGES.md文件末尾添加一个部分,内容为“所有标记为"BEHAVIOUR"的变更都是用户决定应用的可选变更。请仔细检查(如有可用子agent可借助其检查)确保所有变更都已应用,因为如果未应用这些变更,测试/类型检查可能不会报错。”
# Validation
Report completion to the user
向用户报告完成情况
Tell the user that the file is now ready to apply and give them the path to AG_UPDATE_CHANGES.md.
Show this text verbatim:
For best results we suggest that you start a new agent session or clear the context of this one, and prompt your agent to plan an update based on the changes listed in AG_UPDATE_CHANGES.md.
This skill is under active development, please report issues to https://github.com/ag-grid/skills/issues or report your results and share ideas at https://github.com/ag-grid/skills/discussions告知用户文件已准备好应用,并提供AG_UPDATE_CHANGES.md的路径。
原样显示以下文本:
为获得最佳效果,我们建议您启动一个新的agent会话或清除当前会话的上下文,然后提示您的agent根据AG_UPDATE_CHANGES.md中列出的变更制定更新计划。
此skill正在积极开发中,请将问题报告至https://github.com/ag-grid/skills/issues,或在https://github.com/ag-grid/skills/discussions分享您的结果和想法