npx skills add https://github.com/derogab/agent-kit --skill worktreegit rev-parse --git-common-dirgit rev-parse --git-dirgit worktree listgit rev-parse --show-toplevel解析在以下描述中缺失的文件或路径:$ARGUMENTS
$ARGUMENTS 为空,立即停止并告知用户提供错误信息或缺失的路径。不执行其他操作。Git 公共目录 和 Git 目录 解析为同一路径,这不是一个工作区。停止并告知用户缺失文件问题与工作区无关。不执行其他操作。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
从 $ARGUMENTS 中提取缺失的文件或目录路径。它可能是:
src/config/keys)Cannot find module './config/secrets.js')将每个路径相对于项目根目录进行解析。规范化它并验证绝对路径严格位于项目根目录内。如果它超出了项目根目录(例如通过 ../ 遍历),则拒绝操作并通知用户。
如果提供了多个路径,请对每个路径重复以下工作流程。
如果缺失项明显不是安装命令会生成的内容(例如凭据、API 密钥、.env 文件、配置密钥),则跳过此步骤。
否则:
package.json、requirements.txt、Gemfile、go.mod 等)并检查 prepare、postinstall、build 或类似的脚本。工作区列表 中的第一个条目是主工作区。通过将主仓库根目录与缺失项的相对路径组合来构建预期路径。如果该项在主仓库中也不存在,则停止并通知用户。
确保父目录存在于工作区中。
计算从符号链接位置到源文件的相对路径:
perl -e 'use File::Spec; print File::Spec->abs2rel($ARGV[0], $ARGV[1])' "<source-path>" "<symlink-parent-dir>"
创建符号链接:
ln -sfn "<relative-path-to-source>" "<target-path-in-worktree>"
ls -la、test -e)。每周安装次数
1
仓库
GitHub 星标数
4
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
git rev-parse --git-common-dirgit rev-parse --git-dirgit worktree listgit rev-parse --show-toplevelResolve the missing file or path described in: $ARGUMENTS
$ARGUMENTS is empty, stop immediately and tell the user to provide the error message or missing path. Do nothing else.Git common dir and Git dir resolve to the same path, this is not a worktree. Stop and tell the user the missing file issue is unrelated to worktrees. Do nothing else.Extract the missing file or directory path(s) from $ARGUMENTS. It may be:
src/config/keys)Cannot find module './config/secrets.js')Resolve each path relative to the project root. Canonicalize it and verify the absolute path is strictly within the project root. If it escapes the project root (e.g. via ../ traversal), refuse the operation and inform the user.
If multiple paths are provided, repeat the workflow below for each one.
Skip this step if the missing item is clearly not something an install command would generate (e.g. credentials, API keys, .env files, config secrets).
Otherwise:
package.json, requirements.txt, Gemfile, go.mod, etc.) and check for prepare, postinstall, build, or similar scripts.The first entry in Worktree list is the main worktree. Construct the expected path by combining the main repo root with the relative path of the missing item. If the item does not exist in the main repo either, stop and inform the user.
Ensure the parent directory exists in the worktree.
Compute the relative path from the symlink location to the source:
perl -e 'use File::Spec; print File::Spec->abs2rel($ARGV[0], $ARGV[1])' "<source-path>" "<symlink-parent-dir>"
Create the symlink:
ln -sfn "<relative-path-to-source>" "<target-path-in-worktree>"
ls -la, test -e).Weekly Installs
1
Repository
GitHub Stars
4
First Seen
1 day ago
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装