yy-refresh
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseyy-refresh
yy-refresh
描述
Description
帮助 AI 重新理解最新改动的代码,确保上下文与最新状态同步。
Help the AI re-understand the latest modified code to ensure the context is synchronized with the latest state.
使用场景
Usage Scenarios
当用户提到以下内容时,使用此 skill:
- 刷新代码理解
- 重新理解改动
- 刷新缓存
- 重新加载代码
- 对比文件变化
- 同步最新代码
不应触发:
- 用户只是询问代码内容(非刷新意图)
- 用户提到的是浏览器缓存刷新、页面刷新等非代码场景
- 用户要求查看 git 日志或差异(应直接使用 git 命令)
Use this skill when the user mentions the following:
- Refresh code understanding
- Re-understand changes
- Refresh cache
- Reload code
- Compare file changes
- Sync latest code
Do NOT trigger when:
- The user is only asking about code content (no refresh intent)
- The user mentions browser cache refresh, page refresh, or other non-code scenarios
- The user requests to view git logs or differences (use git commands directly)
指令
Instructions
步骤 1. 获取改动文件列表
Step 1. Get the list of modified files
-
获取所有改动的文件(包括已暂存和未暂存):bash
git diff --name-only HEAD git diff --cached --name-only git status --short -
合并所有改动文件,去除重复
-
Get all modified files (including staged and unstaged):bash
git diff --name-only HEAD git diff --cached --name-only git status --short -
Merge all modified files and remove duplicates
步骤 2. 对比文件变化
Step 2. Compare file changes
对于每个改动的文件,读取并对比:
- 已暂存的文件 → 对比
git diff --cached [file] - 未暂存的文件 → 对比
git diff [file] - 新文件 → 读取完整内容
For each modified file, read and compare:
- Staged files → Compare with
git diff --cached [file] - Unstaged files → Compare with
git diff [file] - New files → Read the full content
步骤 3. 重新理解代码
Step 3. Re-understand the code
对于改动较大的关键文件,重新分析:
- 读取文件的完整内容(对于小文件)或关键部分(对于大文件)
- 识别改动涉及的:
- 函数/方法变化
- 接口/类型变化
- 逻辑变化
- 依赖变化
- 总结改动要点
For key files with significant changes, re-analyze:
- Read the full content (for small files) or key sections (for large files)
- Identify changes related to:
- Function/method changes
- Interface/type changes
- Logic changes
- Dependency changes
- Summarize key points of the changes
步骤 4. 输出刷新结果
Step 4. Output refresh results
输出格式:
markdown
undefinedOutput format:
markdown
undefined刷新结果
Refresh Results
统计信息
Statistics
- 改动文件总数:N 个
- 已暂存文件:M 个
- 未暂存文件:K 个
- Total modified files: N
- Staged files: M
- Unstaged files: K
文件详情
File Details
src/auth/login.ts
src/auth/login.ts
- 改动类型: 修改
- 改动内容: 新增 getToken 方法、修改 validateUser 函数签名
- 关键变化:
- : 新增方法,生成 JWT Token
getToken() - : 新增 passwordHash 参数
validateUser()
- Change type: Modified
- Change content: Added getToken method, modified validateUser function signature
- Key changes:
- : New method to generate JWT Token
getToken() - : Added passwordHash parameter
validateUser()
src/utils/helper.ts
src/utils/helper.ts
- 改动类型: 新增
- 改动内容: 新增文件
- 关键变化:
- 整个文件为新增,包含 3 个工具函数
- Change type: Added
- Change content: New file
- Key changes:
- Entire file is newly added, containing 3 utility functions
src/components/Button.vue
src/components/Button.vue
- 改动类型: 删除
- 改动内容: 删除废弃组件
- 关键变化:
- 整个组件被移除
- Change type: Deleted
- Change content: Removed deprecated component
- Key changes:
- The entire component has been removed
总结
Summary
共刷新了 3 个文件的理解,当前 AI 上下文已与最新代码状态同步。
undefinedSuccessfully refreshed understanding of 3 files. The current AI context is now synchronized with the latest code state.
undefined