skill-create
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePurpose
目的
This skill instructs AI agents on how to create new skills and add them to the shared repository at .
skillshttps://github.com/sourman/skills本技能用于指导AI Agent如何创建新技能,并将其添加到位于的共享仓库中。
https://github.com/sourman/skillsskillsRepository Location
仓库位置
The skills repository is located at:
- Remote:
https://github.com/sourman/skills - Local working copy: (or
/tmp/skillsin some environments)~/skills
技能仓库的地址如下:
- 远程仓库:
https://github.com/sourman/skills - 本地工作副本: (部分环境下为
/tmp/skills)~/skills
Skill Structure
技能结构
Each skill is a directory at the repository root containing a file:
SKILL.mdskills/
├── skill-name-1/
│ └── SKILL.md
├── skill-name-2/
│ └── SKILL.md
└── README.mdThe file must have:
SKILL.md- YAML frontmatter with and
namedescription - Markdown content with instructions for the AI agent
每个技能都是仓库根目录下的一个文件夹,其中包含一个文件:
SKILL.mdskills/
├── skill-name-1/
│ └── SKILL.md
├── skill-name-2/
│ └── SKILL.md
└── README.mdSKILL.md- 带有和
name的YAML前置元数据description - 供AI Agent查看的Markdown格式操作说明
Creating a New Skill
创建新技能
Step 1: Navigate to the Repository
步骤1:进入仓库目录
bash
cd /tmp/skillsbash
cd /tmp/skillsOR if it doesn't exist:
若仓库不存在则执行:
git clone git@github.com:sourman/skills.git /tmp/skills
cd /tmp/skills
undefinedgit clone git@github.com:sourman/skills.git /tmp/skills
cd /tmp/skills
undefinedStep 2: Create the Skill Directory
步骤2:创建技能文件夹
bash
mkdir <skill-name>Use kebab-case for skill names (e.g., , , ).
react-best-practicestypescript-eslintdocker-workflowbash
mkdir <skill-name>技能名称请使用kebab-case格式(例如:、、)。
react-best-practicestypescript-eslintdocker-workflowStep 3: Create the SKILL.md File
步骤3:创建SKILL.md文件
Create with the following structure:
<skill-name>/SKILL.mdmarkdown
---
name: skill-name
description: Brief one-line description of what this skill teaches the AI agent
---创建文件,结构如下:
<skill-name>/SKILL.mdmarkdown
---
name: skill-name
description: 对本技能教授内容的简短单行描述
---Skill Title
技能标题
A clear, concise description of what this skill covers.
清晰、简洁地描述本技能涵盖的内容。
What This Skill Covers
本技能涵盖的内容
- Topic area 1
- Topic area 2
- Topic area 3
- 主题领域1
- 主题领域2
- 主题领域3
Key Commands
核心命令
bash
undefinedbash
undefinedExample commands relevant to this skill
与本技能相关的示例命令
command --option value
undefinedcommand --option value
undefinedDetailed Instructions
详细操作说明
Provide detailed instructions, best practices, and workflows here.
在此处提供详细的操作步骤、最佳实践和工作流程。
When to Use This Skill
适用场景
Use this skill when:
- Condition 1
- Condition 2
**Frontmatter Requirements:**
- `name`: Must match the directory name (kebab-case)
- `description`: One-line summary for the skills directory在以下场景中使用本技能:
- 场景1
- 场景2
**前置元数据要求:**
- `name`:必须与文件夹名称一致(kebab-case格式)
- `description`:技能目录中展示的单行摘要Step 4: Add and Commit to Git
步骤4:Git提交与暂存
bash
undefinedbash
undefinedEnsure you're on the master branch
确保当前处于master分支
git checkout master
git checkout master
Add the new skill
暂存新技能
git add <skill-name>/
git add <skill-name>/
Commit with a descriptive message
提交并添加描述性信息
git commit -m "Add <skill-name> skill"
git commit -m "Add <skill-name> skill"
If the master branch doesn't exist, you might be on main:
若master分支不存在,可能当前处于main分支:
git checkout main
undefinedgit checkout main
undefinedStep 5: Push to GitHub
步骤5:推送到GitHub
bash
undefinedbash
undefinedPush the changes
推送变更
git push origin master
git push origin master
OR if on main:
若当前处于main分支则执行:
git push origin main
undefinedgit push origin main
undefinedExample: Creating a New Skill
示例:创建新技能
Here's a complete example of creating a skill called :
git-workflowbash
undefined以下是创建名为技能的完整示例:
git-workflowbash
undefined1. Navigate to repo
1. 进入仓库目录
cd /tmp/skills
cd /tmp/skills
2. Create directory
2. 创建文件夹
mkdir git-workflow
mkdir git-workflow
3. Create SKILL.md
3. 创建SKILL.md文件
cat > git-workflow/SKILL.md << 'EOF'
name: git-workflow description: Git best practices, branching strategies, and commit conventions
cat > git-workflow/SKILL.md << 'EOF'
name: git-workflow description: Git最佳实践、分支策略和提交规范
Git Workflow
Git工作流
This skill covers Git best practices for collaborative development.
本技能涵盖协作开发中的Git最佳实践。
Branch Naming
分支命名规则
Use descriptive branch names:
feature/add-user-authenticationfix/login-page-bugrefactor/database-connection
使用描述性的分支名称:
feature/add-user-authenticationfix/login-page-bugrefactor/database-connection
Commit Messages
提交信息规范
Follow conventional commits:
feat: add user authenticationfix: resolve login redirect issue- EOF
docs: update API documentation
遵循约定式提交规范:
feat: add user authenticationfix: resolve login redirect issue- EOF
docs: update API documentation
4. Commit
4. 提交变更
git add git-workflow/
git commit -m "Add git-workflow skill"
git add git-workflow/
git commit -m "Add git-workflow skill"
5. Push
5. 推送到远程仓库
git push origin master
undefinedgit push origin master
undefinedUpdating an Existing Skill
更新已有技能
To update an existing skill:
bash
cd /tmp/skills更新已有技能的操作步骤:
bash
cd /tmp/skillsEdit the skill file
编辑技能文件
vim <skill-name>/SKILL.md
vim <skill-name>/SKILL.md
Commit and push
提交并推送变更
git add <skill-name>/SKILL.md
git commit -m "Update <skill-name> skill: describe changes"
git push origin master
undefinedgit add <skill-name>/SKILL.md
git commit -m "Update <skill-name> skill: describe changes"
git push origin master
undefinedVerifying the Skill
技能验证
After pushing, verify the skill is accessible:
- Check GitHub: https://github.com/sourman/skills/tree/main/<skill-name>
- Test installation in another project:
bash
bun x skills add sourman/skills/<skill-name>
推送完成后,验证技能是否可正常访问:
- 查看GitHub页面:https://github.com/sourman/skills/tree/main/<skill-name>
- 在其他项目中测试安装:
bash
bun x skills add sourman/skills/<skill-name>
Important Notes
重要注意事项
- Always use kebab-case for skill directory names
- Frontmatter must match the directory name
name - Write clear descriptions - this is what agents see when listing skills
- Test your skill by installing it in a different project
- Keep skills focused - each skill should cover a specific domain or technology
- 始终使用kebab-case格式命名技能文件夹
- 前置元数据中的必须与文件夹名称一致
name - 编写清晰的描述 - 这是Agent在列出技能时看到的内容
- 测试技能 - 在其他项目中安装并验证
- 保持技能聚焦 - 每个技能应覆盖特定领域或技术
Troubleshooting
故障排除
Git Push Fails
Git推送失败
If push fails with "remote does not support password authentication":
bash
undefined若推送时提示“remote does not support password authentication”:
bash
undefinedEnsure SSH is set up correctly
确保SSH配置正确
ssh -T git@github.com
undefinedssh -T git@github.com
undefinedBranch Name Issues
分支名称问题
If you're not sure which branch you're on:
bash
git branch若不确定当前所在分支:
bash
git branchUse 'main' or 'master' accordingly
根据结果使用'main'或'master'分支
undefinedundefinedPermission Denied
权限不足
If you can't push:
- Verify you have push access to sourman/skills
- Check that you're authenticated as the correct user:
gh auth status
若无法推送:
- 验证是否拥有sourman/skills仓库的推送权限
- 检查当前认证用户是否正确:
gh auth status