mcpField
Y
yy-refresh

yy-refresh

github.com/bulls-cowsAgent workflows346 installsUpdated 2w ago
Repository

About yy-refresh

yy-refresh is a skill for coding agents that re-examines changed files and updates their understanding of the code. It uses Git diffs and file contents to summarize changes, while excluding unrelated refresh requests.

Key features

  1. 01Collect staged and unstaged changes
  2. 02Compare diffs or read new files
  3. 03Analyze function, interface, logic, and dependency changes
  4. 04Report change counts and refresh results

Use cases

  1. 01Sync an agent’s context after code edits
  2. 02Refresh understanding of staged and unstaged code
  3. 03Inspect new files and analyze their role

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bulls-cows/skills --skill yy-refresh

After installing, type/yy-refreshin Claude Code to confirm it loaded.

Details

From the project README

yy-refresh

描述

帮助 AI 重新理解最新改动的代码,确保上下文与最新状态同步。

使用场景

当用户提到以下内容时,使用此 skill:

  • 刷新代码理解
  • 重新理解改动
  • 刷新缓存
  • 重新加载代码
  • 对比文件变化
  • 同步最新代码

不应触发:

  • 用户只是询问代码内容(非刷新意图)
  • 用户提到的是浏览器缓存刷新、页面刷新等非代码场景
  • 用户要求查看 git 日志或差异(应直接使用 git 命令)

指令

步骤 1. 获取改动文件列表
  1. 获取所有改动的文件(包括已暂存和未暂存):

    git diff --name-only HEAD
    git diff --cached --name-only
    git status --short
    
  2. 合并所有改动文件,去除重复

步骤 2. 对比文件变化

对于每个改动的文件,读取并对比:

  1. 已暂存的文件 → 对比 git diff --cached [file]
  2. 未暂存的文件 → 对比 git diff [file]
  3. 新文件 → 读取完整内容
步骤 3. 重新理解代码

对于改动较大的关键文件,重新分析:

  1. 读取文件的完整内容(对于小文件)或关键部分(对于大文件)
  2. 识别改动涉及的:
    • 函数/方法变化
    • 接口/类型变化
    • 逻辑变化
    • 依赖变化
  3. 总结改动要点
步骤 4. 输出刷新结果

输出格式:

## 刷新结果

### 统计信息

- 改动文件总数:N 个
- 已暂存文件:M 个
- 未暂存文件:K 个

### 文件详情

#### src/auth/login.ts

- 改动类型: 修改
- 改动内容: 新增 getToken 方法、修改 validateUser 函数签名
- 关键变化:
  - `getToken()`: 新增方法,生成 JWT Token
  - `validateUser()`: 新增 passwordHash 参数

#### src/utils/helper.ts

- 改动类型: 新增
- 改动内容: 新增文件
- 关键变化:
  - 整个文件为新增,包含 3 个工具函数

#### src/components/Button.vue

- 改动类型: 删除
- 改动内容: 删除废弃组件
- 关键变化:
  - 整个组件被移除

## 总结

共刷新了 3 个文件的理解,当前 AI 上下文已与最新代码状态同步。

Comments

Markdown supported