mcpField
S
sharing-skills

sharing-skills

github.com/jackspaceAgent 工作流1635 次安装12 周前更新
代码仓库

关于 sharing-skills

sharing-skills 是将本地技能贡献回上游仓库的操作指南,面向技能作者。它按分支、编辑、提交、推送和创建 PR 的流程说明贡献步骤,并要求技能先经过测试。

主要功能

  1. 01同步上游并创建功能分支
  2. 02提交并推送技能更改
  3. 03使用 gh CLI 创建 PR
  4. 04要求技能经过测试

适用场景

  1. 01向上游分享通用技能
  2. 02单独提交便于审查的技能更改

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jackspace/claudeskillz --skill sharing-skills

安装后在 Claude Code 中输入/sharing-skills确认已加载。

附带文件SKILL.json

详细介绍

分享技能

概述

将本地分支中的技能贡献回上游仓库。

工作流: 分支 → 编辑/创建技能 → 提交 → 推送 → PR

何时分享

适合分享的情况:

  • 技能适用范围广(并非特定于某个项目)
  • 其他人也能从中受益的模式/技术
  • 经过充分测试并有文档说明
  • 遵循 writing-skills 指南

适合保留为个人技能的情况:

  • 特定于某个项目或组织
  • 处于实验阶段或不稳定
  • 包含敏感信息
  • 过于狭窄/小众,不适合普遍使用

前提条件

  • 已安装并完成身份验证的 gh CLI
  • 工作目录为 ~/.config/superpowers/skills/(本地克隆)
  • 必须: 使用 writing-skills TDD 流程测试技能

分享工作流

1. 确保位于 Main 分支并已同步
cd ~/.config/superpowers/skills/
git checkout main
git pull upstream main
git push origin main  # Push to your fork
2. 创建功能分支
# Branch name: add-skillname-skill
skill_name="your-skill-name"
git checkout -b "add-${skill_name}-skill"
3. 创建或编辑技能
# Work on your skill in skills/
# Create new skill or edit existing one
# Skill should be in skills/category/skill-name/SKILL.md
4. 提交更改
# Add and commit
git add skills/your-skill-name/
git commit -m "Add ${skill_name} skill

$(cat <<'EOF'
Brief description of what this skill does and why it's useful.

Tested with: [describe testing approach]
EOF
)"
5. 推送到你的 Fork
git push -u origin "add-${skill_name}-skill"
6. 创建拉取请求
# Create PR to upstream using gh CLI
gh pr create \
  --repo upstream-org/upstream-repo \
  --title "Add ${skill_name} skill" \
  --body "$(cat <<'EOF'
## Summary
Brief description of the skill and what problem it solves.

## Testing
Describe how you tested this skill (pressure scenarios, baseline tests, etc.).

## Context
Any additional context about why this skill is needed and how it should be used.
EOF
)"

完整示例

以下是分享名为“async-patterns”的技能的完整示例:

# 1. Sync with upstream
cd ~/.config/superpowers/skills/
git checkout main
git pull upstream main
git push origin main

# 2. Create branch
git checkout -b "add-async-patterns-skill"

# 3. Create/edit the skill
# (Work on skills/async-patterns/SKILL.md)

# 4. Commit
git add skills/async-patterns/
git commit -m "Add async-patterns skill

Patterns for handling asynchronous operations in tests and application code.

Tested with: Multiple pressure scenarios testing agent compliance."

# 5. Push
git push -u origin "add-async-patterns-skill"

# 6. Create PR
gh pr create \
  --repo upstream-org/upstream-repo \
  --title "Add async-patterns skill" \
  --body "## Summary
Patterns for handling asynchronous operations correctly in tests and application code.

## Testing
Tested with multiple application scenarios. Agents successfully apply patterns to new code.

## Context
Addresses common async pitfalls like race conditions, improper error handling, and timing issues."

PR 合并后

PR 合并后:

  1. 同步本地 Main 分支:
cd ~/.config/superpowers/skills/
git checkout main
git pull upstream main
git push origin main
  1. 删除功能分支:
git branch -d "add-${skill_name}-skill"
git push origin --delete "add-${skill_name}-skill"

故障排除

“gh: command not found”

“Permission denied (publickey)”

“Skill already exists”

  • 你正在创建一个修改版
  • 考虑使用不同的技能名称,或联系该技能的维护者协调

PR 合并冲突

  • 变基到最新的上游版本:git fetch upstream && git rebase upstream/main
  • 解决冲突
  • 强制推送:git push -f origin your-branch

多技能贡献

请勿在一个 PR 中打包多个技能。

每个技能都应:

  • 使用独立的功能分支
  • 创建独立的 PR
  • 可独立审查

原因: 每个技能都可以独立审查、迭代和合并。

相关技能

  • writing-skills - 必须:分享前如何创建经过充分测试的技能

评论

支持 Markdown