Communitygithub.com

opensource-pipeline

开源管道:对私有项目进行分支、清理和打包,以安全地公开发布。串联3个智能体(分支器、清理器、打包器)。触发命令。

opensource-pipeline 是什么?

该技能提供了一条完整的开源发布流水线,通过**Fork(分支)→ Sanitize(清洗)→ Package(打包)**三个阶段,安全地将私有项目转化为可公开发布的开源项目。它适用于需要清理密钥、凭证、内部引用等敏感信息,并为项目生成CLAUDE.md、setup.sh、README.md等标准化开源文件的场景。支持Claude Code等智能体平台,通过一系列命令(如`/opensource fork`、`/opensource verify`、`/opensource package`)进行交互。工作流程包括创建独立的分支目录、运行分支器复制文件并清除敏感内容、运行清洗器进行六类扫描验证、运行打包器生成完整开源模板,最后获得用户批准后推送到GitHub。该技能内置安全保护机制,确保所有关键问题修复后才能发布,并提供了项目状态查看和独立扫描、打包等辅助功能。

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

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

开源管道技能

通过一个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 PROJECT生成 CLAUDE.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="分支 {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
"""
)

等待完成。读取 {STAGING_PATH}/FORK_REPORT.md。

步骤4:运行清洗器智能体

生成 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}/ 内生成 SANITIZATION_REPORT.md,包含 PASS/FAIL 判定。
"""
)

等待完成。读取 {STAGING_PATH}/SANITIZATION_REPORT.md。

如果结果为 FAIL: 向用户展示发现。询问:“修复这些问题并重新扫描,还是中止?”

  • 如果修复:应用修复,重新运行清洗器(最多重试3次——3次FAIL后,展示所有发现并让用户手动修复)
  • 如果中止:清理暂存目录

如果结果为 PASS 或 PASS WITH WARNINGS: 继续到步骤5。

步骤5:运行打包器智能体

生成 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仓库?(是/否/先审查)

步骤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 留在暂存目录中

最佳实践

  • 对于新版本,始终运行完整管道(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/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.

相关技能