Agent SkillsRedential/redential-cli › privacy-gate

privacy-gate

GitHub

在提交PR前执行隐私审查,确保代码不泄露数据。检查网络调用、架构变更及依赖项,运行隐私测试与机械扫描,保障数据边界合规。

.claude/skills/privacy-gate/SKILL.md Redential/redential-cli

触发场景

准备打开Pull Request之前 修改涉及检测逻辑、Schema、网络代码或可能导致数据外泄的文件时

安装

npx skills add Redential/redential-cli --skill privacy-gate -g -y
更多选项

非标准路径

npx skills add https://github.com/Redential/redential-cli/tree/main/.claude/skills/privacy-gate -g -y

不安装直接使用

npx skills use Redential/redential-cli@privacy-gate

指定 Agent (Claude Code)

npx skills add Redential/redential-cli --skill privacy-gate -a claude-code -g -y

安装 repo 全部 skill

npx skills add Redential/redential-cli --all -g -y

预览 repo 内 skill

npx skills add Redential/redential-cli --list

SKILL.md

Frontmatter
{
    "name": "privacy-gate",
    "description": "Run this repo's privacy review against your changes before opening a PR — the same gate maintainers apply. Use it before any PR, and always before one touching detection, schema, network code, or anything that could change what data leaves the machine."
}

Privacy gate

This repo's product is trust: the CLI promises that source code never leaves the machine and that everything which does leave is bounded, reviewable, and enumerable. Every PR is reviewed against that promise. This skill is the same review, run by you (or your agent) first, so the PR arrives already clean.

Authoritative sources — this skill summarizes them, they win on conflict: docs/principles.md, docs/privacy-tests.md, CONTRIBUTING.md ("The privacy rule").

Step 1 — the boundary question (before anything else)

Does the diff change WHAT data leaves the user's machine, or WHERE it is sent? Tripwires — any one means YES:

  • A new or changed field in the bundle (anything under schema/).
  • Any edit to taxonomy.json, or to hashing/salting (src/hash.ts, src/salt.ts).
  • A new network call anywhere, or any edit to src/login.ts, src/submit.ts, src/submit-command.ts, src/http-client.ts.
  • Any edit to src/secret-scan.ts or src/public-remote.ts.

If YES: stop before writing more code. The repo requires a prior discussion issue (the "Data boundary change" issue template) where the schema version bump and docs/schema.md/CHANGELOG.md entries are agreed first. A PR in these areas without a prior issue will not be merged, regardless of quality.

Step 2 — run the contract

npm test           # includes test/privacy/ — the contract
npx tsc --noEmit

If a test under test/privacy/ fails, the change is wrong, not the test. Do not adjust a privacy test to make a change pass; that inverts the whole model.

Step 3 — mechanical sweeps over the diff

Run each against your branch's diff (git diff main...HEAD):

# Network surface: scan/explain must make ZERO network calls. Direct network
# primitives are allowed in exactly three files (test/privacy/zero-network.test.ts):
# http-client.ts, login.ts, submit.ts; submit-command.ts only imports them.
git diff main...HEAD -- src ':(exclude)src/login.ts' ':(exclude)src/submit.ts' \
  ':(exclude)src/submit-command.ts' ':(exclude)src/http-client.ts' \
  | grep -nE '^\+.*(fetch\(|https?://|net\.|dgram|WebSocket)'

# Closed vocabulary: skill slugs live in taxonomy.json and signatures/, never in
# src/. The alternation mirrors taxonomy.json's full category set — if a new
# category lands there, add it here too.
git diff main...HEAD -- src | grep -nE '^\+.*"(auth|payments|ai|db|backend|frontend|infra|data|queues|testing|observability|email|realtime|storage)/'

# Supply chain: any new dependency requires written justification in the PR.
git diff main...HEAD -- package.json

# No postinstall scripts, ever.
grep -n 'postinstall' package.json

An empty result on each sweep is the expected state. A hit is not automatically a violation — but it must be explained in the PR description, in writing.

Step 4 — if the diff touches detection

Signature changes have their own contract (fixtures, near-miss negatives, dead-pattern checks) — run the add-signature skill in this directory, or read docs/signatures.md.

Step 5 — report in the PR

Paste a short block in the PR description:

Privacy gate: run
- Boundary question: NO (or: YES — prior issue #NN)
- npm test / tsc: green
- Sweeps: clean (or: hit in <file>, explained below)

A PR that arrives with this block gets reviewed faster, because it answers the reviewer's first four questions up front.

版本历史

  • 8b4a318 当前 2026-07-19 08:54

同 Skill 集合

.claude/skills/add-signature/SKILL.md

元信息

文件数
0
版本
8b4a318
Hash
11d3bde3
收录时间
2026-07-19 08:54

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-20 14:18
浙ICP备14020137号-1 $访客地图$