Claude-skill-registry auditing-pre-release-security
Audits security and supply-chain risk between two git refs, 预发布安全审计
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/auditing-pre-release-security" ~/.claude/skills/majiayu000-claude-skill-registry-auditing-pre-release-security && rm -rf "$T"
manifest:
skills/data/auditing-pre-release-security/SKILL.mdtags
source content
Pre-Release Security Audit (Between Any Two Git Refs)
This skill compares any two git refs (tag/branch/commit SHA) and audits:
- Source-code diffs for security regressions
- Dependency changes (direct + transitive) and lockfile determinism
- Newly introduced package behaviors inside
node_modules - CI/CD workflow risks in
and build configs (Expo/EAS).github/workflows
The output is a Chinese Markdown report, with a unique title and filename containing the refs to avoid overwrites.
0) Mandatory: confirm audit range (BASE_REF, TARGET_REF)
Ref rules
- Accepted: tag / branch / commit SHA
= starting point,BASE_REF
= ending point (release candidate)TARGET_REF
If refs are not explicitly provided by the user
Ask exactly once before doing any work:
Which two git refs should I compare? (e.g.
→v5.19.0, orrelease/v5.20.0→main)feature/xxx
If only one ref is provided
Ask for the missing ref. Do not assume defaults unless the user explicitly says:
- “latest tag → HEAD”
- or provides an equivalent instruction.
1) Output requirements (hard constraints)
- Report language: Chinese
- Report filename must include refs to avoid collisions:
security-audit__${BASE_REF_SAFE}__to__${TARGET_REF_SAFE}.md
/BASE_REF_SAFE
must replaceTARGET_REF_SAFE
with/
(or__
) for filesystem safety.-
- Report title must include refs:
# 安全预审报告(${BASE_REF} → ${TARGET_REF})
- Evidence must be traceable: file path + line numbers (when possible) + short snippet.
2) Safety rules (must follow)
- Never print or paste secrets: mnemonics/seed phrases, private keys, signing payloads, API keys, tokens, cookies, session IDs.
- If command outputs may contain secrets (env dumps, logs), redact before writing to the report.
- Prefer short excerpts; do not paste large bundles.
3) Execution checklist
Step A — Verify refs and collect context
- Verify both refs exist:
git rev-parse --verify "${BASE_REF}^{commit}"git rev-parse --verify "${TARGET_REF}^{commit}"
- Record:
- BASE_SHA, TARGET_SHA
- Working tree clean?
git status --porcelain
- List changed files:
git diff --name-status "${BASE_REF}..${TARGET_REF}"
Step B — Collect key diffs
Focus on:
- Source:
**/*.{js,ts,tsx} - Dependencies:
,**/package.jsonyarn.lock - CI:
.github/workflows/** - Expo/EAS configs:
,eas.json
,app.json
, build scriptsapp.config.*
Step C — Dependency delta (direct deps)
- For each changed
, compute:package.json- Added / removed / updated deps (include workspace path)
- Version range policy checks:
- Flag
/*
as High risklatest - Flag
/^
as Medium risk (explain why this matters for release determinism)~
- Flag
- If deps changed but
did not, flag as High risk.yarn.lock
Step D — Lockfile determinism (best-effort)
- Detect Yarn flavor:
yarn -v - Try one:
- Yarn Berry:
yarn install --immutable - Yarn Classic:
yarn install --frozen-lockfile
- Yarn Berry:
- Record anomalies:
,resolutions
, non-registry sources, unexpected downloads.patches
Step E — Known vulnerability scanning (best-effort)
-
(if available)yarn audit -
againstosv-scanner
(if available)yarn.lock - If missing tools, note “not run + reason”.
Step F — New dependency deep inspection (node_modules)
For each newly added direct dependency:
- Inspect
:<pkg>/package.json
,preinstall
,install
scriptspostinstall- entry points (
,main
,module
)exports - binary/native artifacts (
,bin/
).node
- Keyword scan (case-insensitive) in its installed code:
- Sensitive:
privateKey|mnemonic|seed|keystore|passphrase - Storage:
localStorage|indexedDB|AsyncStorage|keychain|keystore - Network:
fetch|axios|XMLHttpRequest|http|https|WebSocket|ws - Dynamic exec:
eval|new Function|child_process|spawn|exec - Install hooks:
preinstall|install|postinstall
- Sensitive:
- If hits exist: include path + line + short snippet and explain expected vs suspicious behavior.
- Assign risk rating: Low / Medium / High.
Step G — Source diff security review (AI reasoning step)
Within
${BASE_REF}..${TARGET_REF} diffs, prioritize:
- signing flows / key handling / mnemonic
- network layer / RPC / telemetry
- storage layer (local/secure storage)
- logging / analytics / error reporting Output: suspicious changes list (each with summary, impact, evidence excerpt).
Step H — CI/CD & build pipeline risks
Inspect
.github/workflows/** and build configs:
- Flag
(High)uses: ...@latest - Flag floating tags not pinned to SHA (Medium, note risk)
- Check
for over-broad scopespermissions: - Flag remote script execution patterns (curl|bash, remote downloads)
- Note install safety (
, etc.)--ignore-scripts - Expo/EAS: flag hooks that download remote code, run arbitrary scripts, or leak env into logs
4) Report template (must follow; Chinese output)
Write the report to:
security-audit__${BASE_REF_SAFE}__to__${TARGET_REF_SAFE}.md