Communitygithub.com

opensource-pipeline

オープンソースパイプライン:プライベートプロジェクトをフォーク、サニタイズ、パッケージ化して安全に公開します。3つのエージェント(フォーカー、サニタイザー、パッケージャー)を連携させます。

opensource-pipeline とは?

このスキルは、プライベートリポジトリを安全にオープンソース公開するための3段階パイプラインを提供します。最初の「フォーク」段階では、シークレットや認証情報を除去し、内部参照をプレースホルダーに置き換え、.env.exampleを生成します。次に「サニタイズ」段階で、シークレットスキャン、PIIスキャン、内部参照スキャン、危険ファイルチェック、設定の完全性チェック、Git履歴監査の6つのカテゴリ全てを実行し、PASS/FAILの判定を下します。FAILの場合は最大3回まで再試行でき、合格後は「パッケージ」段階に進み、CLAUDE.md、setup.sh、README.md、LICENSE、CONTRIBUTING.md、GitHub Issueテンプレートを自動生成します。最終的にユーザーの承認を得て、gh repo createコマンドでGitHubに公開します。対応しているコマンドは/opensource fork(全パイプライン実行)、/opensource verify(検証のみ)、/opensource package(パッケージ化のみ)、/opensource list(ステージング一覧表示)、/opensource status(進行状況確認)です。主にClaude CodeやCodexなどのAIエージェント環境で動作し、企業の内部プロジェクトを外部公開する際のセキュリティリスクを大幅に低減します。

対応✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/opensource-pipeline

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

オープンソースパイプラインスキル

3段階のパイプラインを通じて、あらゆるプロジェクトを安全にオープンソース化します: Fork (シークレットを除去) → Sanitize (クリーンであることを確認) → Package (CLAUDE.md + setup.sh + README を生成)。

アクティブ化のタイミング

  • ユーザーが「このプロジェクトをオープンソース化して」または「これを公開にして」と言った場合
  • ユーザーがプライベートリポジトリを公開リリース用に準備したい場合
  • ユーザーがGitHubにプッシュする前にシークレットを除去する必要がある場合
  • ユーザーが /opensource fork、/opensource verify、または /opensource package を呼び出した場合

コマンド

コマンドアクション
/opensource fork PROJECTフルパイプライン: fork + sanitize + package
/opensource verify PROJECT既存のリポジトリでサニタイズを実行
/opensource package PROJECTCLAUDE.md + setup.sh + README を生成
/opensource listステージング中の全プロジェクトを表示
/opensource status PROJECTステージングされたプロジェクトのレポートを表示

プロトコル

/opensource fork PROJECT

フルパイプライン — メインワークフロー。

ステップ1: パラメーターの収集

プロジェクトのパスを解決します。PROJECT に / が含まれている場合は、パス(絶対パスまたは相対パス)として扱います。それ以外の場合は、カレントワーキングディレクトリ、$HOME/PROJECT を確認し、それでも見つからなければユーザーに問い合わせます。

SOURCE_PATH="<解決された絶対パス>"
STAGING_PATH="$HOME/opensource-staging/${PROJECT_NAME}"

ユーザーに質問します:

  1. 「どのプロジェクトですか?」(見つからなかった場合)
  2. 「ライセンスは?(MIT / Apache-2.0 / GPL-3.0 / BSD-3-Clause)」
  3. 「GitHub org またはユーザー名は?」(デフォルト: gh api user -q .login で検出)
  4. 「GitHub リポジトリ名は?」(デフォルト: プロジェクト名)
  5. 「README 用の説明は?」(プロジェクトを分析して提案)

ステップ2: ステージングディレクトリの作成

mkdir -p $HOME/opensource-staging/

ステップ3: Forker エージェントの実行

opensource-forker エージェントを起動:

Agent(
  description="{PROJECT} をオープンソース用にフォーク",
  subagent_type="opensource-forker",
  prompt="""
オープンソースリリース用にプロジェクトをフォークします。

ソース: {SOURCE_PATH}
ターゲット: {STAGING_PATH}
ライセンス: {chosen_license}

完全なフォークプロトコルに従ってください:
1. ファイルをコピー(.git, node_modules, __pycache__, .venv は除外)
2. すべてのシークレットと認証情報を除去
3. 内部参照をプレースホルダーに置換
4. .env.example を生成
5. git 履歴をクリーンアップ
6. {STAGING_PATH}/FORK_REPORT.md に FORK_REPORT.md を生成
"""
)
```\n
完了を待ちます。`{STAGING_PATH}/FORK_REPORT.md` を読み取ります。

#### ステップ4: Sanitizer エージェントの実行

`opensource-sanitizer` エージェントを起動:

Agent( description="{PROJECT} のサニタイズを検証", subagent_type="opensource-sanitizer", prompt=""" オープンソースフォークのサニタイズを検証します。

プロジェクト: {STAGING_PATH} ソース(参照用): {SOURCE_PATH}

すべてのスキャンカテゴリを実行:

  1. シークレットスキャン(CRITICAL)
  2. PII スキャン(CRITICAL)
  3. 内部参照スキャン(CRITICAL)
  4. 危険なファイルチェック(CRITICAL)
  5. 設定の完全性チェック(WARNING)
  6. Git 履歴監査

{STAGING_PATH} 内に PASS/FAIL 判定付きの SANITIZATION_REPORT.md を生成。 """ )


完了を待ちます。`{STAGING_PATH}/SANITIZATION_REPORT.md` を読み取ります。

**FAIL の場合:** ユーザーに結果を表示。「これらを修正して再スキャンしますか、それとも中断しますか?」と質問。
- 修正する場合: 修正を適用し、サニタイザーを再実行(最大 3 回の再試行 — 3 回 FAIL した後は、すべての結果を提示し、ユーザーに手動修正を依頼)
- 中断する場合: ステージングディレクトリをクリーンアップ

**PASS または PASS WITH WARNINGS の場合:** ステップ5に進みます。

#### ステップ5: Packager エージェントの実行

`opensource-packager` エージェントを起動:

Agent( description="{PROJECT} をオープンソース用にパッケージ化", subagent_type="opensource-packager", prompt=""" プロジェクト用のオープンソースパッケージを生成します。

プロジェクト: {STAGING_PATH} ライセンス: {chosen_license} プロジェクト名: {PROJECT_NAME} 説明: {description} GitHub リポジトリ: {github_repo}

生成:

  1. CLAUDE.md(コマンド、アーキテクチャ、主要ファイル)
  2. setup.sh(ワンコマンドブートストラップ、実行可能にする)
  3. README.md(または既存のものを拡張)
  4. LICENSE
  5. CONTRIBUTING.md
  6. .github/ISSUE_TEMPLATE/(bug_report.md、feature_request.md) """ )

#### ステップ6: 最終レビュー

ユーザーに表示:

オープンソースフォーク準備完了: {PROJECT_NAME}

場所: {STAGING_PATH} ライセンス: {license} 生成されたファイル:

  • CLAUDE.md
  • setup.sh(実行可能)
  • README.md
  • LICENSE
  • CONTRIBUTING.md
  • .env.example({N} 変数)

サニタイズ: {sanitization_verdict}

次のステップ:

  1. レビュー: cd {STAGING_PATH}
  2. リポジトリ作成: gh repo create {github_org}/{github_repo} --public
  3. プッシュ: git remote add origin ... && git push -u origin main

GitHub 作成を続行しますか?(yes/no/review first)


#### ステップ7: GitHub 公開(ユーザーの承認後)

```bash
cd "{STAGING_PATH}"
gh repo create "{github_org}/{github_repo}" --public --source=. --push --description "{description}"

/opensource verify PROJECT

サニタイザーを単独で実行します。パスを解決: PROJECT に / が含まれている場合はパスとして扱います。それ以外の場合は $HOME/opensource-staging/PROJECT、次に $HOME/PROJECT、最後にカレントディレクトリを確認します。

Agent(
  subagent_type="opensource-sanitizer",
  prompt="サニタイズを検証: {resolved_path}。6 つのスキャンカテゴリすべてを実行し、SANITIZATION_REPORT.md を生成。"
)

/opensource package PROJECT

パッケージャーを単独で実行します。「ライセンスは?」と「説明は?」を尋ね、その後:

Agent(
  subagent_type="opensource-packager",
  prompt="パッケージ化: {resolved_path} ..."
)

/opensource list

ls -d $HOME/opensource-staging/*/

各プロジェクトをパイプラインの進行状況(FORK_REPORT.md、SANITIZATION_REPORT.md、CLAUDE.md の有無)とともに表示します。


/opensource status PROJECT

cat $HOME/opensource-staging/${PROJECT}/SANITIZATION_REPORT.md
cat $HOME/opensource-staging/${PROJECT}/FORK_REPORT.md

ステージングレイアウト

$HOME/opensource-staging/
  my-project/
    FORK_REPORT.md           # フォーカーエージェントから
    SANITIZATION_REPORT.md   # サニタイザーエージェントから
    CLAUDE.md                # パッケージャーエージェントから
    setup.sh                 # パッケージャーエージェントから
    README.md                # パッケージャーエージェントから
    .env.example             # フォーカーエージェントから
    ...                      # サニタイズされたプロジェクトファイル

アンチパターン

  • 決して ユーザーの承認なしに GitHub にプッシュしない
  • 決して サニタイザーをスキップしない — それは安全ゲートです
  • 決して サニタイザーで FAIL した場合、すべての重大な問題を修正せずに先に進まない
  • 決して .env、*.pem、または credentials.json をステージングディレクトリに残さない

ベストプラクティス

  • 新しいリリースでは常にフルパイプライン(fork → sanitize → package)を実行する
  • ステージングディレクトリは明示的にクリーンアップされるまで保持される — レビューに使用する
  • 公開前に手動修正後は必ずサニタイザーを再実行する
  • シークレットは削除するのではなくパラメーター化する — プロジェクトの機能を維持する

関連スキル

サニタイザーで使用されるシークレット検出パターンについては、security-review を参照してください。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

関連スキル