reference-module
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReference Module
参考模块
Use when the user asks to inspect, compare, or research another Git repository.
当用户要求检查、比较或研究其他Git仓库时使用。
Workflow
工作流程
-
Get the repo URL, plus any requested branch, tag, commit, or alias.
-
Resolve storage from the active: find the nearest parent named
SKILL.md; its parent isskills. If unavailable, ask for a storage path.<scope-root> -
Store references in, where
<scope-root>/reference-modules/<name>is the alias,<name>when the URL has an owner or group, or the repo basename when it does not. Strip trailing<owner>/<repo-name>..git -
If the target exists, ask unless the user already chose:
- use as-is: do not fetch or check out; report current ref/SHA
- update: fetch, then check out the requested ref or remote
HEAD - copy: clone into a separate directory; ask for a name unless alias was provided Never modify an unsafe or wrong-repo target without asking.
-
If the target is missing, clone it. Use remoteunless a ref was requested.
HEAD -
Fetch only for update/copy:bash
git -C <reference-path> fetch --all --tags --prune -
After clone/update/copy, check out the requested ref or remote, preferably detached. If the user chose use as-is, leave it untouched.
HEAD -
Treat contents as read-only. Do not create submodules, symlinks, or pointer files unless explicitly asked.
-
Report path, source URL, action taken, checked-out ref, and commit SHA.
-
获取仓库URL,以及任何请求的分支、标签、提交记录或别名。
-
从活跃的中解析存储路径:找到最近的名为
SKILL.md的父目录;其父目录为skills。如果无法获取,询问存储路径。<scope-root> -
将参考内容存储在,其中
<scope-root>/reference-modules/<name>为别名;当URL包含所有者或组时为<name>;若没有则为仓库基名。去除末尾的<owner>/<repo-name>。.git -
如果目标已存在,除非用户已做出选择,否则询问:
- 直接使用:不进行拉取或检出;报告当前引用/SHA
- 更新:拉取,然后检出请求的引用或远程
HEAD - 复制:克隆到单独目录;除非已提供别名,否则询问名称 未经询问,绝不要修改不安全或错误的仓库目标。
-
如果目标不存在,克隆它。除非请求了特定引用,否则使用远程。
HEAD -
仅在更新/复制时执行拉取:bash
git -C <reference-path> fetch --all --tags --prune -
克隆/更新/复制完成后,检出请求的引用或远程,优选分离头指针模式。如果用户选择直接使用,则保持原样。
HEAD -
将内容视为只读。除非明确要求,否则不要创建子模块、符号链接或指针文件。
-
报告路径、源URL、执行的操作、检出的引用以及提交SHA。