一键导入
repo-gitlink
Use when team needs to extract or sync git remote URLs from .claude/repo subdirectories for collaboration tracking
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when team needs to extract or sync git remote URLs from .claude/repo subdirectories for collaboration tracking
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
当用户希望整理需求、明确目的、描述问题,或要求"生成文档"、"整理意图"、"明确现象"时触发。用于通过多轮对话收集和整理需求,不执行任何代码修改。
当用户说 "boot work-flow"、"初始化 work-flow"、"为这个仓库创建 work-flow skill"、"创建 <仓库名>-work-flow" 时触发。这是一个元skill:自动检测 git 仓库名 → 在项目本地创建 <repo>-work-flow skill → 仅写入项目启动方法和启动信息作为最小骨架 → 标注后续通过 /key_board_3 添加 references 增强。
清理git嵌套仓库,保持仓库隔离性,让 git add . 干净无污染。 适用于 .claude/repo/ 或其他包含克隆仓库的目录。 当用户提到"清理git"、"处理嵌套仓库"、"git隔离"、"保持干净"、 "部分跟踪"、"白名单子目录"、"忽略但保留子目录"、"gitignore 否定规则"、 "忽略 .tool/"、"工具目录不入库"时触发。
当用户要求"总结成skill"、"保存对话为skill"、"提取提示词"、"做成技能"时触发。这是元技能模板,用于指导创建其他技能,而非被创建的技能本身。
当用户要求"拆分到references"、"给skill加ref引导"、"把xx沉淀为reference"、"优化skill结构"、"重构skill"、"skill膨胀了"、"合并skill"、或要求"探索/扫描现有skill看哪些可合并"时触发。本 skill 专用于按主题把已有 skill 组织成渐进式指导文档——主 SKILL.md 承担主干主题、references/ 承担特化专项的特化指导,整个 skill 包高内聚、单文档承担一个主题;长度只是边缘参考。不创建新 skill、不改变前置 skill (key_board / key_board_2) 的职责。探索模式详见 [[场景E-合并审计]]。
阅读任意代码库目录(不限语言/框架),分析模块与代码结构,生成防腐蚀规范 SKILL.md、更新已有 skill 使其与代码库一致、或在使用 skill 后反思同步项目经验。覆盖"创建"、"同步"、"反思"三个场景。不生成孤儿文档。
| name | repo-gitlink |
| description | Use when team needs to extract or sync git remote URLs from .claude/repo subdirectories for collaboration tracking |
Extract git remote URLs from all repositories under .claude/repo and append to .claude/www/git.remote. One line per remote URL. Append-mode by design — preserves historical entries across runs. Use -f/-Force flag to start fresh. Supports both PowerShell (Windows) and Bash (Linux/Mac).
| Platform | Command | Mode |
|---|---|---|
| Windows | powershell -ExecutionPolicy Bypass -File .claude/skills/repo-gitlink/get-git-remotes.ps1 | append |
| Windows (reset) | powershell -ExecutionPolicy Bypass -File .claude/skills/repo-gitlink/get-git-remotes.ps1 -Force | overwrite |
| Linux/Mac | bash .claude/skills/repo-gitlink/get-git-remotes.sh | append |
| Linux/Mac (reset) | bash .claude/skills/repo-gitlink/get-git-remotes.sh -f | overwrite |
Input: .claude/repo/<repo-name>/.git (one level deep only)
Output: .claude/www/git.remote (append by default)
Format: One URL per line, no extra whitespace
Mode: append unless -f/-Force passed
# get-git-remotes.ps1
param([switch]$Force)
$repoDir = Join-Path $PSScriptRoot "..\..\repo"
$outputFile = Join-Path $PSScriptRoot "..\..\www\git.remote"
$wwwDir = Join-Path $PSScriptRoot "..\..\www"
if (-not (Test-Path $wwwDir)) {
New-Item -ItemType Directory -Path $wwwDir -Force | Out-Null
}
# Append by default; only reset when -Force passed
if ($Force -and (Test-Path $outputFile)) {
Remove-Item -Path $outputFile -Force
}
if (-not (Test-Path $outputFile)) {
New-Item -ItemType File -Path $outputFile -Force | Out-Null
}
foreach ($repo in Get-ChildItem -Path $repoDir -Directory) {
$gitDir = Join-Path $repo.FullName ".git"
if (Test-Path $gitDir) {
Set-Location $repo.FullName
$remoteUrl = git remote get-url origin 2>$null
if ($remoteUrl) {
Add-Content -Path $outputFile -Value $remoteUrl
}
}
}
#!/bin/bash
# get-git-remotes.sh
FORCE=false
[ "$1" = "-f" ] || [ "$1" = "--force" ] && FORCE=true
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../repo"
OUTPUT_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../www/git.remote"
mkdir -p "$(dirname "$OUTPUT_FILE")"
# Append by default; only reset when -f/--force passed
if [ "$FORCE" = true ] && [ -f "$OUTPUT_FILE" ]; then
rm -f "$OUTPUT_FILE"
fi
touch "$OUTPUT_FILE"
for repo in "$REPO_DIR"/*/; do
if [ -d "$repo/.git" ]; then
cd "$repo"
git remote get-url origin 2>/dev/null >> "$OUTPUT_FILE"
fi
done
| # | Criterion | Test Method |
|---|---|---|
| 1 | Output file created at .claude/www/git.remote | Test-Path .claude/www/git.remote |
| 2 | One URL per line, no empty lines between | Get-Content / cat |
| 3 | Only valid git URLs (ssh or https) | Regex:^git@|^https:// |
| 4 | All repos with .git folder appended on each run | Count repos vs new lines added |
| 5 | Append-mode preserves history (duplicates expected across runs) | Compare line count before/after; should grow |
| 6 | -f/-Force flag resets file to fresh state | Run with flag, line count == repo count |
| 7 | Works on fresh clone (no prior www dir) | Delete www, run script, verify |
| 8 | Non-git directories silently skipped | repos without .git not in output |
| Mistake | Prevention |
|---|---|
| Hardcoded paths | Use $PSScriptRoot / dirname "${BASH_SOURCE[0]}" relative to script |
| Overwriting historical entries | Default is append (Add-Content / >>); use -Force/-f only when intentional reset is needed |
| Including non-git dirs | Explicitly check for .git folder |
| Empty output on failure | Verify $remoteUrl is not null/empty |
Unbounded growth of git.remote | Periodically reset with -Force/-f, or post-process with sort -u if dedup is needed downstream |