Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add iamzhihuix/happy-claude-skills --skill open-source-prepgit clone --depth 1 https://github.com/iamzhihuix/happy-claude-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/iamzhihuix/happy-claude-skills/open-source-prep)<a href="https://agentmods.dev/skills/iamzhihuix/happy-claude-skills/open-source-prep"><img src="https://agentmods.dev/badge/skills/iamzhihuix/happy-claude-skills/open-source-prep/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/iamzhihuix/happy-claude-skills/open-source-prep"><img src="https://agentmods.dev/badge/skills/iamzhihuix/happy-claude-skills/open-source-prep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00149 | $0.02328 |
| Opus 5 | $0.00075 | $0.01164 |
| Sonnet 5 | $0.00030 | $0.00466 |
| Haiku 4.5 | $0.00015 | $0.00233 |
Grade A, and why
open-source-prep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 187 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Open Source Prep
把私有项目整理成可安全开源的仓库。分 5 个阶段串行执行,密钥扫描必须最先通过才能进入后续步骤。
使用场景
用户说:
- "帮我把这个项目开源"
- "准备开源前要做什么"
- "选一个开源协议"
- "上传 GitHub 前检查一下有没有泄漏"
重要原则
- 密钥扫描是 gating step — 发现真实密钥时必须停下来让用户先清理,不能直接继续
- 生成的文档用英文 — 面向国际贡献者;和用户对话用中文
- LICENSE 文件必须命名为
LICENSE(大写无后缀),GitHub 才识别 - 所有真实 token 示例必须用
...REDACTED...占位符 — 即使是用户主动粘贴进来的 - 不要直接 push 或切 public — 先让用户检查 diff,手动 commit+push+切可见性
工作流
Phase 1: 密钥 & 敏感文件扫描(BLOCKING)
必须先做,发现问题要停下。扫描三个地方:
- 当前工作区文件(包括未追踪的)
- 已 staged / 已 committed 的内容
- git 全部历史(
git log --all -p)
扫描模式见 references/secrets-patterns.md。关键模式包括:
| 类型 | 模式 |
|---|---|
| JWT | eyJhbGc[0-9A-Za-z_-]{20,} |
| GitHub token | gh[posur]_[0-9A-Za-z]{36,} |
| OpenAI / Anthropic | sk-[a-zA-Z0-9]{20,}, sk-ant-[a-zA-Z0-9-]{40,} |
| AWS access key | AKIA[0-9A-Z]{16} |
| Google API key | AIza[0-9A-Za-z_-]{35} |
| Slack token | xox[baprs]-[0-9A-Za-z-]{10,} |
| Stripe | sk_live_[0-9A-Za-z]{20,} |
| 私钥 PEM | -----BEGIN.*PRIVATE KEY----- |
| 通用密码 | password\s*[:=]\s*["'][^"']{8,} |
敏感文件名(staged 时警报):
.env,.env.local,.env.productioncredentials.json,secrets.json*.pem,*.key,*.p12,*.pfxid_rsa,id_ed25519
执行命令(按项目大小自适应):
# 工作区扫描(含未追踪)
git ls-files --others --exclude-standard -z | xargs -0 grep -lE "<pattern>" 2>/dev/null
# 已追踪文件
git grep -nE "<pattern>" 2>/dev/null
# Git 历史
git log --all -p 2>/dev/null | grep -cE "<pattern>"
# 敏感文件名
git ls-files | grep -E "(^|/)(\.env|credentials\.json|.*\.(pem|key|p12|pfx))$"
区分真密钥 vs 占位符:
- ✅ 占位符:包含
.../REDACTED/example/test/xxx/dummy - ❌ 真密钥:没有明显占位符标记,且符合真实格式(如 JWT 是三段点分 base64url、AWS 是 20 字符全大写 + 数字等)
发现真密钥时:
- 列出文件 + 行号 + 截断显示(
eyJhbGc...[12 chars]...abcd前后各 4 位,中间省略) - 提供处理建议:
- 如果在工作区 → 移到
.env并加入.gitignore - 如果已 commit 未 push →
git filter-repo或git reset --soft HEAD~1 - 如果已 push → 必须立即撤销这个 token(本工具无法从 GitHub 删除已泄漏的 commit),然后
git filter-repo --invert-paths+ force push
- 如果在工作区 → 移到
- 停止后续步骤,让用户处理后再重跑
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 187 lines · 149 tokens per session scan A 0fa28d096c4e
open-source-prep is a skill published in the GitHub repository iamzhihuix/happy-claude-skills (306 stars, last pushed 4mo ago), licensed MIT. It adds 149 tokens to every session and 2,328 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
specification-writing
A workflow for writing complete patent specifications from patent claims and an invention disclosure. It adapts the document to a chosen jurisdiction, such as the US, Europe, or China.
regulatory-research-fallback
Fallback workflow for regulatory research when web extraction tools fail on government PDFs.
x-scorecard
OpenSSF Scorecard for assessing open source project security. Check security best practices and compliance. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.
gesellschaftsrechtliche-satzungen-agb
Für Gesellschaftsrechtliche Satzungen AGB Abgrenzung: ordnet Norm, Beweislast und Gegenargument; Ergebnis: Prüfprodukt mit Risiko und nächstem Schritt. Fachgebiet: AGB-Recht-Prüfer. Route: gesellschaftsrechtliche-satzungen-agb.
memstack-business-gdpr
Use this skill when the user says 'GDPR', 'data protection', 'privacy compliance', 'DPA', 'DSAR', 'data subject request', 'cookie consent', 'privacy audit', 'CCPA', or asks 'do I need GDPR for this repo'. Scans the repository to detect what personal data is collected, classifies sensitivity, determines whether GDPR…
nda-review
Use when the user uploads or pastes a non-disclosure agreement and asks for review, redline, risk assessment, or a recommendation on whether to sign. Identifies missing standard protections, one-sided or unusual provisions, and operational issues; produces a structured report with severity ratings and citations to…