open-source-prep

open-source-prep is a skill for Claude Code from iamzhihuix/happy-claude-skills. It costs 149 tokens per session (2,328 once invoked), scanned A, original, MIT.

A workflow for preparing a private software project to become an open-source repository. Open source means the code is published so others can inspect, use, and contribute to it.

In plain words
What is it for?
Use it to scan code and Git history for tokens, choose and create a software license, add README and contributor documents, and check ownership or trademark risks.
Why use it?
It checks for leaked secrets and missing project documents before publication, helping prevent accidental exposure and unclear usage rights.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Good fit Use it to scan code and Git history for tokens, choose and create a software license, add README and contributor documents, and check ownership or trademark risks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/iamzhihuix/happy-claude-skills/open-source-prep
Install

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.

Any agent
npx skills add iamzhihuix/happy-claude-skills --skill open-source-prep
Clone the repo
git clone --depth 1 https://github.com/iamzhihuix/happy-claude-skills

Made for: Claude Code.

Its marketplace also offers this one on its own, as the plugin open-source-prep/plugin install open-source-prep after adding the marketplace above.

Wrote 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.

agentmods badge for open-source-prep

README.md
[![agentmods](https://agentmods.dev/badge/skills/iamzhihuix/happy-claude-skills/open-source-prep/github.svg)](https://agentmods.dev/skills/iamzhihuix/happy-claude-skills/open-source-prep)
Your own site
<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.

agentmods 80×15 button for open-source-prep

Your own site · 80×15
<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>
Per session 149 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,328 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 11d ago against content hash 0fa28d096c4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

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.

skills/open-source-prep/SKILL.md · 187 lines

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 前检查一下有没有泄漏"

重要原则

  1. 密钥扫描是 gating step — 发现真实密钥时必须停下来让用户先清理,不能直接继续
  2. 生成的文档用英文 — 面向国际贡献者;和用户对话用中文
  3. LICENSE 文件必须命名为 LICENSE(大写无后缀),GitHub 才识别
  4. 所有真实 token 示例必须用 ...REDACTED... 占位符 — 即使是用户主动粘贴进来的
  5. 不要直接 push 或切 public — 先让用户检查 diff,手动 commit+push+切可见性

工作流

Phase 1: 密钥 & 敏感文件扫描(BLOCKING)

必须先做,发现问题要停下。扫描三个地方:

  1. 当前工作区文件(包括未追踪的)
  2. 已 staged / 已 committed 的内容
  3. 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.production
  • credentials.json, secrets.json
  • *.pem, *.key, *.p12, *.pfx
  • id_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 字符全大写 + 数字等)

发现真密钥时

  1. 列出文件 + 行号 + 截断显示(eyJhbGc...[12 chars]...abcd 前后各 4 位,中间省略)
  2. 提供处理建议:
    • 如果在工作区 → 移到 .env 并加入 .gitignore
    • 如果已 commit 未 push → git filter-repogit reset --soft HEAD~1
    • 如果已 push → 必须立即撤销这个 token(本工具无法从 GitHub 删除已泄漏的 commit),然后 git filter-repo --invert-paths + force push
  3. 停止后续步骤,让用户处理后再重跑

Read the full file on GitHub · 187 lines

Files

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.

Changes

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.

  1. 11d ago First seen · 187 lines · 149 tokens per session scan A 0fa28d096c4e

Subscribe to this mod's changes

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.

Related

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.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

regulatory-research-fallback

Fallback workflow for regulatory research when web extraction tools fail on government PDFs.

HKUDS/OpenSpace · 20 tokens

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.

x-cmd/x-cmd · 57 tokens

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.

Klotzkette/claude-fuer-deutsches-recht · 69 tokens

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…

cwinvestments/memstack · 121 tokens

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…

LegalQuants/lq-ai · 79 tokens