Communitygithub.com

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

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

オープンソースパイプライン とは?

このスキルは、プライベートプロジェクトを安全にオープンソース化するための3段階パイプラインを提供します。まず「フォーク」段階では、.gitやnode_modulesなどの不要ファイルを除外し、秘密情報や認証情報をすべて除去したコピーを作成します。次に「サニタイズ」段階では、シークレット、PII、内部参照、危険ファイル、設定の完全性、Git履歴の6つのカテゴリをスキャンし、PASS/FAILの判定を下します。最後に「パッケージ」段階で、CLAUDE.md、setup.sh、README.md、LICENSE、CONTRIBUTING.md、GitHub Issueテンプレートなどを生成します。CLAUDE Code、Cursor、CodexなどのAIエージェント環境で動作し、`/opensource` コマンド群(fork、verify、package、list、status)を提供します。ユーザーの承認なしにGitHubへプッシュすることはなく、サニタイザーは必須のセーフティゲートとして機能します。

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

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

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

ドキュメント

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

任意のプロジェクトを安全にオープンソース化するための3段階パイプライン:フォーク(シークレット除去)→ サニタイズ(クリーン性確認)→ パッケージ(CLAUDE.md + setup.sh + README)。

起動タイミング

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

コマンド

コマンドアクション
/opensource fork PROJECTフルパイプライン:フォーク + サニタイズ + パッケージ
/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 の組織またはユーザー名は?」(デフォルト:gh api user -q .login で検出)
  4. 「GitHub リポジトリ名は?」(デフォルト:プロジェクト名)
  5. 「README の説明は?」(プロジェクトを解析して提案)

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

mkdir -p $HOME/opensource-staging/

ステップ 3:フォーカーエージェントの実行

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

Agent(
  description="Fork {PROJECT} for open-source",
  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 を生成
"""
)

完了を待ちます。{STAGING_PATH}/FORK_REPORT.md を読み込みます。

ステップ 4:サニタイザーエージェントの実行

opensource-sanitizer エージェントを起動します:

Agent(
  description="Verify {PROJECT} sanitization",
  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:パッケージャーエージェントの実行

opensource-packager エージェントを起動します:

Agent(
  description="Package {PROJECT} for open-source",
  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 公開(ユーザー承認時)

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 をステージングディレクトリに残してはいけません

ベストプラクティス

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

関連スキル

サニタイザーが使用するシークレット検出パターンについては、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/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

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.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル