用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SocketDev/action --skill setup-repo命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Propagate a wheelhouse template change across fleet repos: worktrees, push/PR fallback, cleanup.
Run this repo's GitHub Actions locally with Agent-CI before pushing CI-sensitive changes.
Audit package exports for dead, internal-only, or weakly-consumed subpaths before pruning.
基于 SOC 职业分类
正在显示 SKILL.md
| name | setup-repo |
| description | Repo onboarding wizard: tokens, keychain, shell bridge, tools, hooks, initialization. |
Master onboarding wizard. Runs each setup phase in order, skips phases already complete, and surfaces a clear summary at the end.
/setup-security-tools reports missing tools or a bad token| Script | What it does |
|---|---|
node scripts/fleet/setup/token.mts | API token → OS keychain + shell rc bridge |
node scripts/fleet/setup/claude-config.mts | Harden ~/.claude.json (copyOnSelect: false) |
node scripts/fleet/install-sfw.mts | Socket Firewall shims |
/setup-security-tools (agentshield, zizmor) | Security scanners — installed by the SessionStart hook, not standalone scripts |
/setup-repo runs all scripts in the order below and produces a summary.
Run each phase in order. Skip any phase whose check reports "already done." After all phases, print a summary table.
node --version # must be >= 22.6
pnpm --version # must be present
git config user.email # must be set
If Node < 22.6: stop and tell the engineer to upgrade (nvm / fnm recommended). The native host and type-stripping require Node 22.6+.
Check for an existing token:
node .claude/hooks/fleet/setup-security-tools/install.mts --check-token
If missing or --rotate was passed, run the interactive install to prompt and persist to the OS keychain:
node .claude/hooks/fleet/setup-security-tools/install.mts
This writes SOCKET_API_TOKEN and SOCKET_API_KEY to the OS keychain:
security add-generic-password, service socket-cli)secret-tool store, service socket-cliSkip if the token is already present and --rotate was not passed.
Ensures SOCKET_API_KEY is exported in the user's shell so every terminal session has it without a keychain read.
Runs automatically as part of Phase 1 (wireBridgeIntoShellRc in operator-prompts.mts). Verify it landed:
grep -l "SOCKET_API_KEY" ~/.zshrc ~/.bashrc ~/.bash_profile ~/.config/fish/config.fish 2>/dev/null | head -1
If missing (CI machine, fish shell, non-standard rc): tell the engineer to add:
export SOCKET_API_KEY="$(security find-generic-password -s socket-cli -a SOCKET_API_KEY -w 2>/dev/null)"
Installs the Chrome native messaging host manifest so the Trusted Publisher extension can read the token from the keychain without requiring SOCKET_API_TOKEN in the browser environment.
node -e "import('@socketsecurity/lib-stable/native-messaging/install').then(m => {
const r = m.installNativeHost({ allowedOrigins: ['*'] })
console.log('installed:', r.manifestPaths.join(', '))
})"
Manifest lands at:
~/Library/Application Support/Google/Chrome/NativeMessagingHosts/dev.socket.trusted_publisher_host.json~/.config/google-chrome/NativeMessagingHosts/dev.socket.trusted_publisher_host.json%APPDATA%\Google\Chrome\User Data\NativeMessagingHosts\ + HKCU registry keySkip if the manifest file already exists and the token hasn't rotated.
Runs the full security toolchain installer:
node .claude/hooks/fleet/setup-security-tools/install.mts
Installs: AgentShield, Zizmor, SFW (Socket Firewall), TruffleHog, Trivy, OpenGrep, uv, Janus, cdxgen, synp. Each is skipped if already current.
After install, add the SFW shim directory to PATH if not already present:
export PATH="$HOME/.socket/_wheelhouse/shims:$PATH"
pnpm install # install deps
pnpm run check --all # verify the repo is green
If pnpm run check fails, surface the failures and stop — the repo needs fixing before it's usable.
After all phases complete, print:
Phase Status
─────────────────────── ──────────────────────────────
Preflight ✓ Node 22.14 / pnpm 10.x
API Token ✓ found via keychain (SOCKET_API_TOKEN)
Shell RC Bridge ✓ ~/.zshrc
Native Messaging Host ✓ ~/Library/...NativeMessagingHosts/...json
Security Tools ✓ AgentShield · Zizmor · SFW · 7 more
Repo Init ✓ pnpm install + check passed
Pass these in chat when invoking:
| Option | Effect |
|---|---|
--rotate | Re-prompt for the API token even if one exists |
--skip-tools | Skip Phase 4 (security tools) — useful on CI/headless |
--skip-native-host | Skip Phase 3 (native messaging host) — non-browser environments |
--check | Check-only mode: report what's missing without installing anything |
setup-security-tools/install.mts which already handles idempotency — re-running is safe.installNativeHost) is in @socketsecurity/lib-stable/native-messaging/install. If that module isn't built yet (pre-6.0.8), skip gracefully.getCI() returns true). In CI, skip Phases 1–3 silently and report "CI environment — keychain setup skipped."pnpm install + check) is the only phase that can fail the wizard hard. All other failures are surfaced as warnings with recovery hints.