opensource-skill-to-github
БесплатноЗапускает вложенные скриптыНе проверенQuickly open-source a local skill to GitHub (primary) and optionally clawhub.com. Workflow: slug pre-check, fork to opensourceskills, strip internal info…
от songhonglei1 494 установки в других каталогахОб этом скилле
Open-source a Local Skill to GitHub (+ optional clawhub.com)
- Version: 1.0.19
- License: MIT
- Author: Evan Song · github.com/Songhonglei
- Repository: https://github.com/Songhonglei/build-better-skills/tree/main/skills/opensource-skill-to-github
把一个本地 skill 端到端开源到 GitHub(主)+ clawhub.com(可选)。 基于多个 skill 开源实践沉淀的完整方法论(见
references/opensource_playbook.md)+ 11 条剔除清单 + 16 项 checklist。 质量优先:每个决策点(LICENSE / slug 冲突 / 内网信息残留 / token)必须等用户拍板。
设计哲学
- 副本而非演进:原 skill 一行不动;副本放
opensourceskills/<slug>/,独立 commit / 版本号 / sign。 - 混合形态:能脚本化的(剔除扫描、git init、frontmatter 校验)走脚本;需要决策的(LICENSE、slug rename、token、敏感部门 visibility)走对话。
- 首版 v1.0.0:clawhub 用户期望"成熟" first release,不用 v0.x 试探。
- GitHub 主、clawhub 副:本 skill 默认走 GitHub,clawhub 在 §6 可选。skills.sh 通过 GitHub 自动同步无需单独操作。
- 不硬编码身份 + 一次配置永久用:所有作者/handle/邮箱通过持久化 profile 自动读取,跨 agent / 跨 workspace / skill 重装都不丢。
首次使用:配置开源身份(一次性,跨 agent 持久化)
bash scripts/setup_profile.sh
# 交互式问 3 个字段:
# Author name (如 "Evan Song")
# GitHub handle (如 "Songhonglei")
# Author email (推荐 GitHub noreply: "<handle>@users.noreply.github.com")
# 写入 ~/.config/opensource-skill-to-github/profile.env (chmod 600)
为什么这么放:
- 在用户
$HOME而非 skill 目录 → skill 升级/重装不丢 - 在用户
$HOME而非 workspace → 换 agent / 换 workspace 仍有效(适配 OpenClaw / Claude Code / Cursor 等任意环境) - XDG 兼容(
$XDG_CONFIG_HOME优先),符合 Linux / macOS 用户文件规范
身份取值优先级(高 → 低):
- 脚本命令行参数显式传入
OSG_AUTHOR_NAME/OSG_GITHUB_HANDLE/OSG_AUTHOR_EMAIL环境变量(适合 CI/CD 或临时覆盖)~/.config/opensource-skill-to-github/profile.env← 主要载体git config --global user.name/user.email兜底- 仍缺失 → 报错并指引跑
scripts/setup_profile.sh
常用命令:
bash scripts/setup_profile.sh # 首次/重新引导
bash scripts/setup_profile.sh --show # 查看当前生效配置 + 来源
bash scripts/setup_profile.sh --path # 打印 profile 路径
bash scripts/setup_profile.sh --non-interactive # CI 模式,从 env 读
GitHub push token 配置(可选):
github_push.sh 支持把 token 做成配置项,避免每次真实 repo 发布都重新让用户粘贴。
优先级为:
GITHUB_TOKEN(一次性环境变量)OSG_GITHUB_TOKEN(长期环境变量或 profile;明文,不推荐)OSG_GITHUB_TOKEN_CMD(推荐;命令 stdout 第一行返回 token)gh auth token(已登录 GitHub CLI 时自动读取)
推荐写法:
# 放进 ~/.config/opensource-skill-to-github/profile.env
OSG_GITHUB_TOKEN_CMD="gh auth token"
# 或使用 macOS Keychain,不把 PAT 明文写入 profile
OSG_GITHUB_TOKEN_CMD="security find-generic-password -a $USER -s opensource-skill-to-github.github-token -w"
脚本不会把 token 写入 git remote、命令输出或 memory。若使用一次性 PAT,推送后仍应撤销。
工作流总览(10 步)
每步后面标注「类型」:🔧 脚本(可直接跑)/ 💬 对话(需用户拍板)/ 🔗 引用(调其他 skill)。
⚠️ 首次使用先跑
scripts/setup_profile.sh配置开源身份(见上节)。已配置过的用户跳过此步。
| 步骤 | 类型 | 工具 |
|---|---|---|
| 0. slug 预检 | 🔧 | scripts/precheck.sh <slug> |
| 1. 决策框架 4 问 | 💬 | 对话 |
| 2. 副本化 | 🔧 | scripts/fork.sh |
| 3. 11 条剔除清单扫描 + 拍板 | 🔧 → 💬 | scripts/strip_scan.sh 跑完用户拍板每处 |
| 4. SKILL.md frontmatter 规范化 | 🔧 → 💬 | scripts/check_frontmatter.py + 手工 edit |
| 5. LICENSE 拍板 + 生成 | 💬 → 🔧 | 对话选类型 → scripts/gen_license.sh(author 自动从 profile 读) |
| 6. README + CHANGELOG + .gitignore 生成 | 🔧 | scripts/scaffold.sh(author/handle 自动从 profile 读;changelog 独立文件) |
| 7. 本地 git init | 🔧 | scripts/git_init.sh(user.name/email 自动从 profile 读) |
| 8. UGLIC 自审(推荐) | 🔗 | 调 glic-check skill |
| 9. GitHub repo 创建(用户手工)+ push | 💬 → 🔧 | 用户建 repo + scripts/github_push.sh <fork> <repo-name>(handle 自动拼);mono-repo 改走子目录增量发版 → §9.4 |
| 10. clawhub 发版(可选)+ memory 沉淀 | 🔧 → 💬 | scripts/clawhub_publish.sh(已登录免 token)+ 沉淀文档 |
| 11. 腾讯 skillhub.cn 发版(可选) | 🔧 | SKILLHUB_CN_TOKEN=skh_xxx scripts/skillhub_cn_publish.sh <fork> |
一键前 6 步:
scripts/run_all.sh <源skill名或绝对路径> [<new-slug>]会串联 precheck→fork→strip_scan→license→scaffold→git_init(strip 命中仍需人工拍板; push / clawhub / skillhub.cn 因需 token + 确认不自动跑,脚本结束打印手动指引)。
跨 agent 通用性(v1.0.3)
本 skill 可移植到非 OpenClaw 的 agent(Claude Code / Cursor 等):
- 源 skill 定位:
fork.sh支持传 skill 绝对路径,或按名在多目录探测 ($SKILLS_DIR→~/.claude/skills→~/.cursor/skills→./skills→~/.openclaw/workspace/skills) - 输出目录:
OPENSOURCE_OUT_DIR覆盖(默认./opensourceskills) - 独立 git repo:
git_init.sh只认 fork 自己的.git,即使 fork 位于某个已是 git repo 的 工作区内也不会误提交到父仓库(v1.0.3 修复,附二次校验) - 内网关键词表:
OSG_STRIP_KEYWORDSenv 或strip_keywords.txt文件自定义(换公司内网词)
Dependencies
System commands
- bash (≥ 4.0)
- git (任意现代版本,新建 repo 推荐 ≥ 2.28 支持
-b main,老 git 有symbolic-ref兜底) - python3 (≥ 3.8,仅
scripts/check_frontmatter.py使用,零外部包依赖) - curl (用于 Step 9 GitHub repo 存在性预探测 + push 后 sha 验真 + skillhub.cn 发布,可选/按需)
- rsync (用于
fork.sh排除 node_modules 复制,缺失时自动回退cp -r) - node + npm (用于安装
clawhubCLI;只在 Step 0 预检和 Step 10 clawhub publish 时需要) - clawhub CLI (
npm install -g clawhub,只在用 clawhub 渠道时需要)
macOS 兼容
base64已做兜底(-w0BSD 不支持 → 回退base64 | tr -d '\n')- 其它命令(
find/grep/sed/awk)使用 POSIX 子集,
Установить opensource-skill-to-github в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл opensource-skill-to-github?
Quickly open-source a local skill to GitHub (primary) and optionally clawhub.com. Workflow: slug pre-check, fork to opensourceskills, strip internal info, normalize SKILL.md, generate LICENSE/README, init git, push to GitHub with configurable token source, and optionally publish to clawhub. Use when the user says "open-source this skill", "把这个 skill 开源", "发到 github", "publish skill publicly", or "把本地 skill 发开源". Hard rules: never modify the original skill in place, never auto-add force/yes flags, never write tokens to git/remote/memory, and ask the user at decision points.
Как установить скилл opensource-skill-to-github?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл opensource-skill-to-github запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic