skill-hunter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill Hunter
Skill Hunter
Use when: You need to discover existing skills from GitHub repositories that use AI agent frameworks (pi, cursor, opencode, etc.) - searches across multiple agent directories to find reusable skill patterns, implementations, and best practices.
适用场景: 当你需要从使用AI agent框架(pi、cursor、opencode等)的GitHub仓库中发现现有Skill时使用——可跨多个agent目录搜索,找到可复用的Skill模式、实现方案及最佳实践。
Core Capability
核心能力
Search GitHub for skills in AI agent repositories using path-based search to discover:
- Skill implementations from other projects
- Common patterns and approaches
- Reusable skill definitions
- Best practices from the community
通过基于路径的搜索在GitHub的AI agent仓库中查找Skill,可发现:
- 其他项目中的Skill实现
- 通用模式与方法
- 可复用的Skill定义
- 社区总结的最佳实践
Prerequisites
前置条件
- CLI installed and authenticated
gh - for JSON processing
jq - environment variable set (or will auto-detect)
$DOTFILES_REPO_ROOT - Skills stored in
$DOTFILES_REPO_ROOT/ai/files/skills/
- 已安装并认证CLI
gh - 已安装用于JSON处理
jq - 已设置环境变量(或会自动检测)
$DOTFILES_REPO_ROOT - Skill存储在目录下
$DOTFILES_REPO_ROOT/ai/files/skills/
GitHub Search Syntax
GitHub搜索语法
The core search pattern targets skill directories in AI agent repos:
bash
path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)\/skills?\/.*\.md$/This pattern finds files in paths like:
.pi/skills/.ai/skills/.opencode/skill/pi/skills/agents/skills/cursor/skills/factory/skill/
核心搜索模式针对AI agent仓库中的Skill目录:
bash
path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)\/skills?\/.*\.md$/该模式可匹配如下路径中的文件:
.pi/skills/.ai/skills/.opencode/skill/pi/skills/agents/skills/cursor/skills/factory/skill/
Implementation Pattern
实现模式
1. Basic Skill Search
1. 基础Skill搜索
Search for all skills matching a keyword:
bash
undefined搜索所有匹配关键词的Skill:
bash
undefinedSearch for skills related to "testing"
Search for skills related to "testing"
gh search code "testing path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "testing path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Search for zellij skills
Search for zellij skills
gh search code "zellij path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefinedgh search code "zellij path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefined2. Find Skills by File Type
2. 按文件类型查找Skill
Search for specific file types (e.g., all SKILL.md files):
bash
undefined搜索特定文件类型(例如所有SKILL.md文件):
bash
undefinedFind SKILL.md files
Find SKILL.md files
gh search code "SKILL.md path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 50
gh search code "SKILL.md path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 50
Find skill implementations in TypeScript
Find skill implementations in TypeScript
gh search code "extension:ts path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "extension:ts path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Find shell script skills
Find shell script skills
gh search code "extension:sh path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefinedgh search code "extension:sh path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefined3. Language-Specific Skills
3. 特定语言的Skill
bash
undefinedbash
undefinedFind Python skills
Find Python skills
gh search code "language:python path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "language:python path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Find JavaScript/TypeScript skills
Find JavaScript/TypeScript skills
gh search code "language:typescript path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "language:typescript path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Find Rust skills
Find Rust skills
gh search code "language:rust path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefinedgh search code "language:rust path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefined4. Find Skills by Domain
4. 按领域查找Skill
bash
undefinedbash
undefinedDatabase skills
Database skills
gh search code "database OR postgres OR mysql path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "database OR postgres OR mysql path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
DevOps skills
DevOps skills
gh search code "docker OR kubernetes OR terraform path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "docker OR kubernetes OR terraform path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Web development skills
Web development skills
gh search code "react OR vue OR angular path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
gh search code "react OR vue OR angular path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
Testing skills
Testing skills
gh search code "playwright OR selenium OR jest path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefinedgh search code "playwright OR selenium OR jest path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 20
undefined5. Discover Popular Repositories
5. 发现热门仓库
Find repos with the most skills:
bash
undefined查找包含最多Skill的仓库:
bash
undefinedSearch and group by repository
Search and group by repository
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 100 --json repository,path |
jq -r '.[] | .repository.fullName' | sort | uniq -c | sort -rn | head -10
jq -r '.[] | .repository.fullName' | sort | uniq -c | sort -rn | head -10
undefinedgh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/" --limit 100 --json repository,path |
jq -r '.[] | .repository.fullName' | sort | uniq -c | sort -rn | head -10
jq -r '.[] | .repository.fullName' | sort | uniq -c | sort -rn | head -10
undefined6. Download and Inspect Skills
6. 下载并查看Skill
Once you find an interesting skill:
bash
undefined找到感兴趣的Skill后:
bash
undefinedView a specific file directly
View a specific file directly
gh browse <owner>/<repo> --branch main <path-to-skill-file>
gh browse <owner>/<repo> --branch main <path-to-skill-file>
Clone the entire repository
Clone the entire repository
gh repo clone <owner>/<repo>
gh repo clone <owner>/<repo>
Download a specific file
Download a specific file
gh api repos/<owner>/<repo>/contents/<path-to-skill-file>
--jq '.content' | base64 -d > downloaded-skill.md
--jq '.content' | base64 -d > downloaded-skill.md
undefinedgh api repos/<owner>/<repo>/contents/<path-to-skill-file>
--jq '.content' | base64 -d > downloaded-skill.md
--jq '.content' | base64 -d > downloaded-skill.md
undefinedComplete Workflow Example
完整工作流示例
Scenario: Finding and Adapting a Zellij Skill
场景:查找并适配Zellij Skill
bash
undefinedbash
undefined1. Search for zellij skills
1. Search for zellij skills
echo "Searching for zellij skills..."
gh search code "zellij path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url
--limit 20
--json repository,path,url
echo "Searching for zellij skills..."
gh search code "zellij path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url
--limit 20
--json repository,path,url
2. Search more broadly for terminal multiplexer skills
2. Search more broadly for terminal multiplexer skills
echo "Searching for terminal/tmux/multiplexer skills..."
gh search code "tmux OR terminal OR multiplexer path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url
--limit 20
--json repository,path,url
echo "Searching for terminal/tmux/multiplexer skills..."
gh search code "tmux OR terminal OR multiplexer path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url
--limit 20
--json repository,path,url
3. Examine a promising result
3. Examine a promising result
REPO="username/repo-name"
SKILL_PATH=".pi/skills/terminal-management/SKILL.md"
gh api "repos/${REPO}/contents/${SKILL_PATH}"
--jq '.content' | base64 -d | less
--jq '.content' | base64 -d | less
REPO="username/repo-name"
SKILL_PATH=".pi/skills/terminal-management/SKILL.md"
gh api "repos/${REPO}/contents/${SKILL_PATH}"
--jq '.content' | base64 -d | less
--jq '.content' | base64 -d | less
4. Download for adaptation
4. Download for adaptation
gh api "repos/${REPO}/contents/${SKILL_PATH}"
--jq '.content' | base64 -d > /tmp/reference-skill.md
--jq '.content' | base64 -d > /tmp/reference-skill.md
echo "Downloaded to /tmp/reference-skill.md for review"
undefinedgh api "repos/${REPO}/contents/${SKILL_PATH}"
--jq '.content' | base64 -d > /tmp/reference-skill.md
--jq '.content' | base64 -d > /tmp/reference-skill.md
echo "Downloaded to /tmp/reference-skill.md for review"
undefinedAdvanced Search Patterns
高级搜索模式
Find Recently Updated Skills
查找最近更新的Skill
bash
undefinedbash
undefinedSkills updated in the last month
Skills updated in the last month
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ pushed:>$(date -d '1 month ago' +%Y-%m-%d)"
--limit 30
--limit 30
undefinedgh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ pushed:>$(date -d '1 month ago' +%Y-%m-%d)"
--limit 30
--limit 30
undefinedFind Skills by Star Count
按星标数量查找Skill
bash
undefinedbash
undefinedSkills from popular repositories (>100 stars)
Skills from popular repositories (>100 stars)
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ stars:>100"
--limit 30
--limit 30
undefinedgh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ stars:>100"
--limit 30
--limit 30
undefinedFind Skills with Specific Patterns
查找包含特定模式的Skill
bash
undefinedbash
undefinedSkills that use subagents
Skills that use subagents
gh search code "subagent path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
gh search code "subagent path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
Skills that use MCP (Model Context Protocol)
Skills that use MCP (Model Context Protocol)
gh search code "MCP OR 'Model Context Protocol' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
gh search code "MCP OR 'Model Context Protocol' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
Skills with tool implementations
Skills with tool implementations
gh search code "tool OR function_call path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefinedgh search code "tool OR function_call path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefinedOutput Processing
输出处理
Extract and Format Results
提取并格式化结果
bash
undefinedbash
undefinedGet a clean list of repositories with skills
Get a clean list of repositories with skills
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 100
--json repository |
jq -r '.[].repository | "(.fullName) - (.description // "No description")"' |
sort -u
--limit 100
--json repository |
jq -r '.[].repository | "(.fullName) - (.description // "No description")"' |
sort -u
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 100
--json repository |
jq -r '.[].repository | "(.fullName) - (.description // "No description")"' |
sort -u
--limit 100
--json repository |
jq -r '.[].repository | "(.fullName) - (.description // "No description")"' |
sort -u
Create a markdown report of found skills
Create a markdown report of found skills
gh search code "SKILL.md path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 50
--json repository,path,url |
jq -r '.[] | "- (.repository.fullName)) - (.path))"' > skills-report.md
--limit 50
--json repository,path,url |
jq -r '.[] | "- (.repository.fullName)) - (.path))"' > skills-report.md
undefinedgh search code "SKILL.md path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 50
--json repository,path,url |
jq -r '.[] | "- (.repository.fullName)) - (.path))"' > skills-report.md
--limit 50
--json repository,path,url |
jq -r '.[] | "- (.repository.fullName)) - (.path))"' > skills-report.md
undefinedCommon Use Cases
常见使用场景
1. Before Writing a New Skill
1. 编写新Skill之前
bash
undefinedbash
undefinedCheck if someone already solved this problem
Check if someone already solved this problem
SKILL_TOPIC="docker"
gh search code "${SKILL_TOPIC} path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url |
jq -r '.[] | "[(.repository.fullName)] (.path)\n (.url)\n"'
--limit 20
--json repository,path,url |
jq -r '.[] | "[(.repository.fullName)] (.path)\n (.url)\n"'
undefinedSKILL_TOPIC="docker"
gh search code "${SKILL_TOPIC} path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--json repository,path,url |
jq -r '.[] | "[(.repository.fullName)] (.path)\n (.url)\n"'
--limit 20
--json repository,path,url |
jq -r '.[] | "[(.repository.fullName)] (.path)\n (.url)\n"'
undefined2. Finding Best Practices
2. 查找最佳实践
bash
undefinedbash
undefinedFind skills with comprehensive documentation
Find skills with comprehensive documentation
gh search code "## Prerequisites OR ## Requirements OR ## Installation path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--limit 30
undefinedgh search code "## Prerequisites OR ## Requirements OR ## Installation path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--limit 30
undefined3. Discovering Skill Patterns
3. 发现Skill模式
bash
undefinedbash
undefinedFind skills that use specific frameworks
Find skills that use specific frameworks
gh search code "playwright OR puppeteer OR selenium path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefinedgh search code "playwright OR puppeteer OR selenium path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefinedIntegration with Dotfiles
与Dotfiles集成
Save Discovered Skills for Reference
保存发现的Skill用于参考
Skills should be stored in your Dotfiles repo under . When discovering skills, save them to a research directory first:
ai/files/skills/bash
undefinedSkill应存储在你的Dotfiles仓库的目录下。发现Skill时,先将其保存到研究目录:
ai/files/skills/bash
undefinedUse dotfiles environment variable (fallback to detection if not set)
Use dotfiles environment variable (fallback to detection if not set)
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
RESEARCH_DIR="${DOTFILES_ROOT}/ai/files/skills-research"
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
RESEARCH_DIR="${DOTFILES_ROOT}/ai/files/skills-research"
Create a skills research directory
Create a skills research directory
mkdir -p "${RESEARCH_DIR}"
mkdir -p "${RESEARCH_DIR}"
Download and categorize interesting skills
Download and categorize interesting skills
CATEGORY="terminal-management"
mkdir -p "${RESEARCH_DIR}/${CATEGORY}"
CATEGORY="terminal-management"
mkdir -p "${RESEARCH_DIR}/${CATEGORY}"
Save search results
Save search results
gh search code "tmux OR zellij OR screen path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--json repository,path,url > "${RESEARCH_DIR}/${CATEGORY}/search-results.json"
--limit 30
--json repository,path,url > "${RESEARCH_DIR}/${CATEGORY}/search-results.json"
gh search code "tmux OR zellij OR screen path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--json repository,path,url > "${RESEARCH_DIR}/${CATEGORY}/search-results.json"
--limit 30
--json repository,path,url > "${RESEARCH_DIR}/${CATEGORY}/search-results.json"
Extract and download top results
Extract and download top results
jq -r '.[] | "(.repository.fullName)|(.path)|(.url)"'
"${RESEARCH_DIR}/${CATEGORY}/search-results.json" |
head -5 |
while IFS='|' read repo path url; do echo "Downloading: ${repo} - ${path}" gh api "repos/${repo}/contents/${path}" --jq '.content' | base64 -d >
"${RESEARCH_DIR}/${CATEGORY}/$(echo ${repo} | tr '/' '-')-$(basename ${path})" done
"${RESEARCH_DIR}/${CATEGORY}/search-results.json" |
head -5 |
while IFS='|' read repo path url; do echo "Downloading: ${repo} - ${path}" gh api "repos/${repo}/contents/${path}" --jq '.content' | base64 -d >
"${RESEARCH_DIR}/${CATEGORY}/$(echo ${repo} | tr '/' '-')-$(basename ${path})" done
undefinedjq -r '.[] | "(.repository.fullName)|(.path)|(.url)"'
"${RESEARCH_DIR}/${CATEGORY}/search-results.json" |
head -5 |
while IFS='|' read repo path url; do echo "Downloading: ${repo} - ${path}" gh api "repos/${repo}/contents/${path}" --jq '.content' | base64 -d >
"${RESEARCH_DIR}/${CATEGORY}/$(echo ${repo} | tr '/' '-')-$(basename ${path})" done
"${RESEARCH_DIR}/${CATEGORY}/search-results.json" |
head -5 |
while IFS='|' read repo path url; do echo "Downloading: ${repo} - ${path}" gh api "repos/${repo}/contents/${path}" --jq '.content' | base64 -d >
"${RESEARCH_DIR}/${CATEGORY}/$(echo ${repo} | tr '/' '-')-$(basename ${path})" done
undefinedSuggest Storage Location
建议存储位置
After downloading and reviewing a skill, suggest appropriate locations within :
ai/files/skills/bash
undefined下载并查看Skill后,建议将其存储在下的合适位置:
ai/files/skills/bash
undefinedFunction to suggest skill locations
Function to suggest skill locations
suggest_skill_location() {
local skill_name="$1"
local skill_content="$2"
echo "📂 Where should '${skill_name}' be stored in ai/files/skills/?"
echo ""
Analyze content to suggest locations
if grep -qi "github|gh cli|pull request|pr|issue" "${skill_content}"; then
echo "1. ai/files/skills/github/${skill_name}/"
echo " ✓ GitHub-related functionality"
fi
if grep -qi "test|playwright|selenium|cypress" "${skill_content}"; then
echo "2. ai/files/skills/devtools/${skill_name}/"
echo " ✓ Development and testing tools"
fi
if grep -qi "project|task|planning|tracking" "${skill_content}"; then
echo "3. ai/files/skills/projectmanagement/${skill_name}/"
echo " ✓ Project management and workflow"
fi
if grep -qi "design|ui|ux|figma" "${skill_content}"; then
echo "4. ai/files/skills/design/${skill_name}/"
echo " ✓ Design-related skills"
fi
if grep -qi "research|search|discover" "${skill_content}"; then
echo "5. ai/files/skills/research/${skill_name}/"
echo " ✓ Research and discovery"
fi
echo ""
echo "Choose a number (1-5), or provide your own path:"
echo "Example: ai/files/skills/custom-category/${skill_name}/"
}
suggest_skill_location() {
local skill_name="$1"
local skill_content="$2"
echo "📂 Where should '${skill_name}' be stored in ai/files/skills/?"
echo ""
Analyze content to suggest locations
if grep -qi "github|gh cli|pull request|pr|issue" "${skill_content}"; then
echo "1. ai/files/skills/github/${skill_name}/"
echo " ✓ GitHub-related functionality"
fi
if grep -qi "test|playwright|selenium|cypress" "${skill_content}"; then
echo "2. ai/files/skills/devtools/${skill_name}/"
echo " ✓ Development and testing tools"
fi
if grep -qi "project|task|planning|tracking" "${skill_content}"; then
echo "3. ai/files/skills/projectmanagement/${skill_name}/"
echo " ✓ Project management and workflow"
fi
if grep -qi "design|ui|ux|figma" "${skill_content}"; then
echo "4. ai/files/skills/design/${skill_name}/"
echo " ✓ Design-related skills"
fi
if grep -qi "research|search|discover" "${skill_content}"; then
echo "5. ai/files/skills/research/${skill_name}/"
echo " ✓ Research and discovery"
fi
echo ""
echo "Choose a number (1-5), or provide your own path:"
echo "Example: ai/files/skills/custom-category/${skill_name}/"
}
Usage example
Usage example
SKILL_FILE="${RESEARCH_DIR}/terminal-management/example-skill.md"
SKILL_NAME="zellij-manager"
suggest_skill_location "${SKILL_NAME}" "${SKILL_FILE}"
read -r location_choice
case $location_choice in
- TARGET_DIR="${SKILLS_ROOT}/github/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/devtools/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/projectmanagement/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/design/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/research/${SKILL_NAME}" ;; *) # User provided custom path if [[ "$location_choice" =~ ^ai/files/skills/ ]]; then TARGET_DIR="${DOTFILES_ROOT}/${location_choice}" else TARGET_DIR="${SKILLS_ROOT}/${location_choice}" fi ;; esac
SKILL_FILE="${RESEARCH_DIR}/terminal-management/example-skill.md"
SKILL_NAME="zellij-manager"
suggest_skill_location "${SKILL_NAME}" "${SKILL_FILE}"
read -r location_choice
case $location_choice in
- TARGET_DIR="${SKILLS_ROOT}/github/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/devtools/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/projectmanagement/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/design/${SKILL_NAME}" ;;
- TARGET_DIR="${SKILLS_ROOT}/research/${SKILL_NAME}" ;; *) # User provided custom path if [[ "$location_choice" =~ ^ai/files/skills/ ]]; then TARGET_DIR="${DOTFILES_ROOT}/${location_choice}" else TARGET_DIR="${SKILLS_ROOT}/${location_choice}" fi ;; esac
Create target directory and move skill
Create target directory and move skill
mkdir -p "${TARGET_DIR}"
cp "${SKILL_FILE}" "${TARGET_DIR}/SKILL.md"
echo "✅ Skill moved to: ${TARGET_DIR}"
undefinedmkdir -p "${TARGET_DIR}"
cp "${SKILL_FILE}" "${TARGET_DIR}/SKILL.md"
echo "✅ Skill moved to: ${TARGET_DIR}"
undefinedTips and Tricks
技巧与窍门
1. Fuzzy Matching with Wildcards
1. 通配符模糊匹配
The regex in the path already handles variations like vs with the quantifier.
skillskills?路径中的正则表达式已通过量词处理了与这类变体。
?skillskills2. Combine with Other Search Terms
2. 组合其他搜索词
bash
undefinedbash
undefinedFind skills that mention specific tools
Find skills that mention specific tools
gh search code "gh cli OR 'github cli' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefinedgh search code "gh cli OR 'github cli' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 20
--limit 20
undefined3. Language-Specific Searches
3. 特定语言搜索
bash
undefinedbash
undefinedFind skills written in specific languages with content search
Find skills written in specific languages with content search
gh search code "language:markdown 'use when' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--limit 30
undefinedgh search code "language:markdown 'use when' path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30
--limit 30
undefined4. Exclude Certain Repos
4. 排除特定仓库
bash
undefinedbash
undefinedSearch but exclude your own repos
Search but exclude your own repos
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ -user:yourusername"
--limit 30
--limit 30
undefinedgh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/ -user:yourusername"
--limit 30
--limit 30
undefinedError Handling
错误处理
bash
undefinedbash
undefinedCheck if gh CLI is installed and authenticated
Check if gh CLI is installed and authenticated
if ! command -v gh &> /dev/null; then
echo "Error: GitHub CLI (gh) is not installed"
echo "Install with: brew install gh (macOS) or apt install gh (Linux)"
exit 1
fi
if ! gh auth status &> /dev/null; then
echo "Error: Not authenticated with GitHub"
echo "Run: gh auth login"
exit 1
fi
if ! command -v gh &> /dev/null; then
echo "Error: GitHub CLI (gh) is not installed"
echo "Install with: brew install gh (macOS) or apt install gh (Linux)"
exit 1
fi
if ! gh auth status &> /dev/null; then
echo "Error: Not authenticated with GitHub"
echo "Run: gh auth login"
exit 1
fi
Handle rate limiting
Handle rate limiting
gh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30 || { echo "Error: GitHub API rate limit exceeded" echo "Check status: gh api rate_limit" exit 1 }
--limit 30 || { echo "Error: GitHub API rate limit exceeded" echo "Check status: gh api rate_limit" exit 1 }
undefinedgh search code "path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 30 || { echo "Error: GitHub API rate limit exceeded" echo "Check status: gh api rate_limit" exit 1 }
--limit 30 || { echo "Error: GitHub API rate limit exceeded" echo "Check status: gh api rate_limit" exit 1 }
undefinedBest Practices
最佳实践
- Start Broad, Then Narrow: Begin with general searches, then refine based on results
- Check Multiple Frameworks: Skills from cursor might work in pi and vice versa
- Look for Patterns: Similar problems often have similar solutions across repos
- Respect Licenses: Check repository licenses before adapting code
- Credit Sources: When adapting skills, note the original source
- Update Your Own Skills: Share back improved versions to help others
- 由广到窄:先从通用搜索开始,再根据结果逐步细化
- 多框架检查:cursor中的Skill也可能在pi中适用,反之亦然
- 寻找模式:相似问题通常在不同仓库中有相似的解决方案
- 尊重许可证:在适配代码前检查仓库许可证
- 注明来源:适配Skill时,记录原始来源
- 更新自有Skill:分享改进后的版本,帮助他人
Example: Complete Skill Discovery Session
示例:完整的Skill发现会话
bash
#!/bin/bashbash
#!/bin/bashskill-discovery.sh - Discover and analyze skills for a specific topic
skill-discovery.sh - Discover and analyze skills for a specific topic
TOPIC="${1:-testing}"
TOPIC="${1:-testing}"
Use dotfiles environment variable
Use dotfiles environment variable
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
RESEARCH_DIR="${DOTFILES_ROOT}/ai/files/skills-research"
OUTPUT_DIR="${RESEARCH_DIR}/${TOPIC}"
mkdir -p "${OUTPUT_DIR}"
echo "🔍 Discovering skills related to: ${TOPIC}"
echo "📍 Dotfiles: ${DOTFILES_ROOT}"
echo "📂 Research output: ${OUTPUT_DIR}"
echo ""
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
RESEARCH_DIR="${DOTFILES_ROOT}/ai/files/skills-research"
OUTPUT_DIR="${RESEARCH_DIR}/${TOPIC}"
mkdir -p "${OUTPUT_DIR}"
echo "🔍 Discovering skills related to: ${TOPIC}"
echo "📍 Dotfiles: ${DOTFILES_ROOT}"
echo "📂 Research output: ${OUTPUT_DIR}"
echo ""
1. Initial search
1. Initial search
echo "Step 1: Searching GitHub..."
gh search code "${TOPIC} path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 50
--json repository,path,url \
--limit 50
--json repository,path,url \
"${OUTPUT_DIR}/search-results.json"
RESULT_COUNT=$(jq length "${OUTPUT_DIR}/search-results.json")
echo "Found ${RESULT_COUNT} results"
echo "Step 1: Searching GitHub..."
gh search code "${TOPIC} path:/^./.?(opencode|ai|llm|claude|codex|agents|pi|cursor|factory)/skills?/.*.md$/"
--limit 50
--json repository,path,url \
--limit 50
--json repository,path,url \
"${OUTPUT_DIR}/search-results.json"
RESULT_COUNT=$(jq length "${OUTPUT_DIR}/search-results.json")
echo "Found ${RESULT_COUNT} results"
2. Analyze repositories
2. Analyze repositories
echo "Step 2: Analyzing repositories..."
jq -r '.[].repository.fullName' "${OUTPUT_DIR}/search-results.json" |
sort | uniq -c | sort -rn |
head -10 > "${OUTPUT_DIR}/top-repos.txt"
sort | uniq -c | sort -rn |
head -10 > "${OUTPUT_DIR}/top-repos.txt"
echo "Top repositories with ${TOPIC} skills:"
cat "${OUTPUT_DIR}/top-repos.txt"
echo "Step 2: Analyzing repositories..."
jq -r '.[].repository.fullName' "${OUTPUT_DIR}/search-results.json" |
sort | uniq -c | sort -rn |
head -10 > "${OUTPUT_DIR}/top-repos.txt"
sort | uniq -c | sort -rn |
head -10 > "${OUTPUT_DIR}/top-repos.txt"
echo "Top repositories with ${TOPIC} skills:"
cat "${OUTPUT_DIR}/top-repos.txt"
3. Download top 3 skill files
3. Download top 3 skill files
echo "Step 3: Downloading sample skills..."
jq -r '.[0:3] | .[] | "(.repository.fullName)|(.path)"'
"${OUTPUT_DIR}/search-results.json" |
while IFS='|' read repo path; do filename=$(echo "${repo}-${path}" | tr '/' '-') echo " Downloading: ${repo}/${path}" gh api "repos/${repo}/contents/${path}"
--jq '.content' | base64 -d
> "${OUTPUT_DIR}/${filename}" 2>/dev/null ||
echo " Failed to download" done
"${OUTPUT_DIR}/search-results.json" |
while IFS='|' read repo path; do filename=$(echo "${repo}-${path}" | tr '/' '-') echo " Downloading: ${repo}/${path}" gh api "repos/${repo}/contents/${path}"
--jq '.content' | base64 -d
> "${OUTPUT_DIR}/${filename}" 2>/dev/null ||
echo " Failed to download" done
echo "Step 3: Downloading sample skills..."
jq -r '.[0:3] | .[] | "(.repository.fullName)|(.path)"'
"${OUTPUT_DIR}/search-results.json" |
while IFS='|' read repo path; do filename=$(echo "${repo}-${path}" | tr '/' '-') echo " Downloading: ${repo}/${path}" gh api "repos/${repo}/contents/${path}"
--jq '.content' | base64 -d
> "${OUTPUT_DIR}/${filename}" 2>/dev/null ||
echo " Failed to download" done
"${OUTPUT_DIR}/search-results.json" |
while IFS='|' read repo path; do filename=$(echo "${repo}-${path}" | tr '/' '-') echo " Downloading: ${repo}/${path}" gh api "repos/${repo}/contents/${path}"
--jq '.content' | base64 -d
> "${OUTPUT_DIR}/${filename}" 2>/dev/null ||
echo " Failed to download" done
4. Create summary report
4. Create summary report
echo "Step 4: Creating summary report..."
cat > "${OUTPUT_DIR}/DISCOVERY-REPORT.md" << EOF
echo "Step 4: Creating summary report..."
cat > "${OUTPUT_DIR}/DISCOVERY-REPORT.md" << EOF
Skill Discovery Report: ${TOPIC}
Skill Discovery Report: ${TOPIC}
Date: $(date)
Total Results: ${RESULT_COUNT}
Dotfiles Root: ${DOTFILES_ROOT}
Date: $(date)
Total Results: ${RESULT_COUNT}
Dotfiles Root: ${DOTFILES_ROOT}
Top Repositories
Top Repositories
```
$(cat "${OUTPUT_DIR}/top-repos.txt")
```
```
$(cat "${OUTPUT_DIR}/top-repos.txt")
```
All Results
All Results
$(jq -r '.[] | "- (.repository.fullName)) - (.path))"'
"${OUTPUT_DIR}/search-results.json")
"${OUTPUT_DIR}/search-results.json")
$(jq -r '.[] | "- (.repository.fullName)) - (.path))"'
"${OUTPUT_DIR}/search-results.json")
"${OUTPUT_DIR}/search-results.json")
Storage Locations
Storage Locations
Review downloaded skills and determine appropriate location in:
```
${SKILLS_ROOT}/
├── github/ # GitHub-related functionality
├── devtools/ # Development and testing tools
├── projectmanagement/ # Project and task management
├── design/ # Design and UI/UX tools
├── research/ # Research and discovery
├── superpowers/ # Advanced meta-skills
├── experts/ # Domain expert personas
└── [custom]/ # Your custom categories
```
Review downloaded skills and determine appropriate location in:
```
${SKILLS_ROOT}/
├── github/ # GitHub-related functionality
├── devtools/ # Development and testing tools
├── projectmanagement/ # Project and task management
├── design/ # Design and UI/UX tools
├── research/ # Research and discovery
├── superpowers/ # Advanced meta-skills
├── experts/ # Domain expert personas
└── [custom]/ # Your custom categories
```
Next Steps
Next Steps
- Review downloaded skill files in: ${OUTPUT_DIR}
- Identify common patterns and best practices
- Choose appropriate location in ai/files/skills/
- Adapt for your use case
- Consider contributing improvements back
- Review downloaded skill files in: ${OUTPUT_DIR}
- Identify common patterns and best practices
- Choose appropriate location in ai/files/skills/
- Adapt for your use case
- Consider contributing improvements back
Move to Skills Directory
Move to Skills Directory
```bash
```bash
Example: Move adapted skill to appropriate location
Example: Move adapted skill to appropriate location
SKILL_NAME="my-new-skill"
SKILL_NAME="my-new-skill"
Option 1: GitHub-related
Option 1: GitHub-related
mkdir -p "${SKILLS_ROOT}/github/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/github/${SKILL_NAME}/SKILL.md"
mkdir -p "${SKILLS_ROOT}/github/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/github/${SKILL_NAME}/SKILL.md"
Option 2: DevTools
Option 2: DevTools
mkdir -p "${SKILLS_ROOT}/devtools/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/devtools/${SKILL_NAME}/SKILL.md"
mkdir -p "${SKILLS_ROOT}/devtools/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/devtools/${SKILL_NAME}/SKILL.md"
Option 3: Custom location
Option 3: Custom location
mkdir -p "${SKILLS_ROOT}/custom-category/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/custom-category/${SKILL_NAME}/SKILL.md"
```
EOF
echo "✅ Discovery complete! Report saved to: ${OUTPUT_DIR}/DISCOVERY-REPORT.md"
echo ""
echo "Next: Review skills and move to ${SKILLS_ROOT}/"
undefinedmkdir -p "${SKILLS_ROOT}/custom-category/${SKILL_NAME}"
cp adapted-skill.md "${SKILLS_ROOT}/custom-category/${SKILL_NAME}/SKILL.md"
```
EOF
echo "✅ Discovery complete! Report saved to: ${OUTPUT_DIR}/DISCOVERY-REPORT.md"
echo ""
echo "Next: Review skills and move to ${SKILLS_ROOT}/"
undefinedSkill Storage Workflow
Skill存储工作流
After discovering and adapting a skill, follow this workflow:
发现并适配Skill后,遵循以下工作流:
1. Analyze Skill Content
1. 分析Skill内容
Review the skill to determine its primary purpose:
bash
SKILL_FILE="downloaded-skill.md"
echo "Analyzing skill content..."
echo ""
echo "Contains GitHub functionality:" $(grep -qi "github\|gh cli" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains testing tools:" $(grep -qi "test\|playwright\|selenium" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains project management:" $(grep -qi "project\|task\|planning" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains design tools:" $(grep -qi "design\|ui\|figma" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains research tools:" $(grep -qi "research\|search\|discover" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")查看Skill以确定其主要用途:
bash
SKILL_FILE="downloaded-skill.md"
echo "Analyzing skill content..."
echo ""
echo "Contains GitHub functionality:" $(grep -qi "github\|gh cli" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains testing tools:" $(grep -qi "test\|playwright\|selenium" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains project management:" $(grep -qi "project\|task\|planning" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains design tools:" $(grep -qi "design\|ui\|figma" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")
echo "Contains research tools:" $(grep -qi "research\|search\|discover" "$SKILL_FILE" && echo "✓ Yes" || echo "✗ No")2. Present Storage Options
2. 展示存储选项
Present 1-3 suggested locations based on content analysis:
📂 Where should this skill be stored in ai/files/skills/?
Suggested locations:
1. ai/files/skills/github/skill-name/
✓ Contains GitHub API usage
✓ Uses gh CLI extensively
2. ai/files/skills/research/skill-name/
✓ Primary purpose is discovery/research
✓ Searches external sources
3. ai/files/skills/devtools/skill-name/
✓ Developer tooling functionality
✓ Enhances development workflow
Choose a number (1-3), or provide your own path:
Example: ai/files/skills/custom-category/skill-name/根据内容分析展示1-3个建议存储位置:
📂 Where should this skill be stored in ai/files/skills/?
Suggested locations:
1. ai/files/skills/github/skill-name/
✓ Contains GitHub API usage
✓ Uses gh CLI extensively
2. ai/files/skills/research/skill-name/
✓ Primary purpose is discovery/research
✓ Searches external sources
3. ai/files/skills/devtools/skill-name/
✓ Developer tooling functionality
✓ Enhances development workflow
Choose a number (1-3), or provide your own path:
Example: ai/files/skills/custom-category/skill-name/3. Interactive Selection Script
3. 交互式选择脚本
bash
#!/bin/bashbash
#!/bin/bashstore-skill.sh - Interactive skill storage helper
store-skill.sh - Interactive skill storage helper
SKILL_FILE="$1"
SKILL_NAME="$2"
if [[ -z "$SKILL_FILE" || -z "$SKILL_NAME" ]]; then
echo "Usage: $0 <skill-file> <skill-name>"
exit 1
fi
SKILL_FILE="$1"
SKILL_NAME="$2"
if [[ -z "$SKILL_FILE" || -z "$SKILL_NAME" ]]; then
echo "Usage: $0 <skill-file> <skill-name>"
exit 1
fi
Use dotfiles environment variable
Use dotfiles environment variable
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
DOTFILES_ROOT="${DOTFILES_REPO_ROOT:-$(git rev-parse --show-toplevel 2>/dev/null || echo "${HOME}/Projects/dotfiles")}"
SKILLS_ROOT="${DOTFILES_ROOT}/ai/files/skills"
Analyze content
Analyze content
echo "🔍 Analyzing skill content..."
echo ""
SUGGESTIONS=()
COUNT=1
if grep -qi "github|gh cli|pull request|issue" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:github:GitHub-related functionality")
echo "${COUNT}. ai/files/skills/github/${SKILL_NAME}/"
echo " ✓ GitHub-related functionality"
echo ""
((COUNT++))
fi
if grep -qi "test|playwright|selenium|cypress|jest" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:devtools:Testing and development tools")
echo "${COUNT}. ai/files/skills/devtools/${SKILL_NAME}/"
echo " ✓ Testing and development tools"
echo ""
((COUNT++))
fi
if grep -qi "project|task|planning|tracking|workflow" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:projectmanagement:Project management")
echo "${COUNT}. ai/files/skills/projectmanagement/${SKILL_NAME}/"
echo " ✓ Project management and workflow"
echo ""
((COUNT++))
fi
if grep -qi "design|ui|ux|figma|sketch" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:design:Design tools")
echo "${COUNT}. ai/files/skills/design/${SKILL_NAME}/"
echo " ✓ Design and UI/UX tools"
echo ""
((COUNT++))
fi
if grep -qi "research|search|discover|analyze" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:research:Research and discovery")
echo "${COUNT}. ai/files/skills/research/${SKILL_NAME}/"
echo " ✓ Research and discovery"
echo ""
((COUNT++))
fi
echo "🔍 Analyzing skill content..."
echo ""
SUGGESTIONS=()
COUNT=1
if grep -qi "github|gh cli|pull request|issue" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:github:GitHub-related functionality")
echo "${COUNT}. ai/files/skills/github/${SKILL_NAME}/"
echo " ✓ GitHub-related functionality"
echo ""
((COUNT++))
fi
if grep -qi "test|playwright|selenium|cypress|jest" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:devtools:Testing and development tools")
echo "${COUNT}. ai/files/skills/devtools/${SKILL_NAME}/"
echo " ✓ Testing and development tools"
echo ""
((COUNT++))
fi
if grep -qi "project|task|planning|tracking|workflow" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:projectmanagement:Project management")
echo "${COUNT}. ai/files/skills/projectmanagement/${SKILL_NAME}/"
echo " ✓ Project management and workflow"
echo ""
((COUNT++))
fi
if grep -qi "design|ui|ux|figma|sketch" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:design:Design tools")
echo "${COUNT}. ai/files/skills/design/${SKILL_NAME}/"
echo " ✓ Design and UI/UX tools"
echo ""
((COUNT++))
fi
if grep -qi "research|search|discover|analyze" "$SKILL_FILE"; then
SUGGESTIONS+=("${COUNT}:research:Research and discovery")
echo "${COUNT}. ai/files/skills/research/${SKILL_NAME}/"
echo " ✓ Research and discovery"
echo ""
((COUNT++))
fi
If no suggestions, show common categories
If no suggestions, show common categories
if [[ ${#SUGGESTIONS[@]} -eq 0 ]]; then
echo "No specific category detected. Common options:"
echo ""
echo "1. ai/files/skills/devtools/${SKILL_NAME}/"
echo "2. ai/files/skills/superpowers/${SKILL_NAME}/"
echo "3. ai/files/skills/experts/${SKILL_NAME}/"
echo ""
fi
echo "Choose a number, or provide your own path:"
echo "Example: ai/files/skills/my-category/${SKILL_NAME}/"
echo ""
read -r -p "Selection: " choice
if [[ ${#SUGGESTIONS[@]} -eq 0 ]]; then
echo "No specific category detected. Common options:"
echo ""
echo "1. ai/files/skills/devtools/${SKILL_NAME}/"
echo "2. ai/files/skills/superpowers/${SKILL_NAME}/"
echo "3. ai/files/skills/experts/${SKILL_NAME}/"
echo ""
fi
echo "Choose a number, or provide your own path:"
echo "Example: ai/files/skills/my-category/${SKILL_NAME}/"
echo ""
read -r -p "Selection: " choice
Process choice
Process choice
TARGET_DIR=""
if [[ "$choice" =~ ^[0-9]+$ ]] && [[ "$choice" -le "${#SUGGESTIONS[@]}" ]]; then
Numbered choice
CATEGORY=$(echo "${SUGGESTIONS[$((choice-1))]}" | cut -d: -f2)
TARGET_DIR="${SKILLS_ROOT}/${CATEGORY}/${SKILL_NAME}"
elif [[ "$choice" =~ ^ai/files/skills/ ]]; then
Full path provided
TARGET_DIR="${DOTFILES_ROOT}/${choice}"
else
Relative path assumed
TARGET_DIR="${SKILLS_ROOT}/${choice}"
fi
TARGET_DIR=""
if [[ "$choice" =~ ^[0-9]+$ ]] && [[ "$choice" -le "${#SUGGESTIONS[@]}" ]]; then
Numbered choice
CATEGORY=$(echo "${SUGGESTIONS[$((choice-1))]}" | cut -d: -f2)
TARGET_DIR="${SKILLS_ROOT}/${CATEGORY}/${SKILL_NAME}"
elif [[ "$choice" =~ ^ai/files/skills/ ]]; then
Full path provided
TARGET_DIR="${DOTFILES_ROOT}/${choice}"
else
Relative path assumed
TARGET_DIR="${SKILLS_ROOT}/${choice}"
fi
Create and copy
Create and copy
mkdir -p "${TARGET_DIR}"
cp "${SKILL_FILE}" "${TARGET_DIR}/SKILL.md"
echo ""
echo "✅ Skill stored at: ${TARGET_DIR}/SKILL.md"
echo ""
echo "Next steps:"
echo "1. Review and edit: ${TARGET_DIR}/SKILL.md"
echo "2. Add frontmatter if needed (name, description)"
echo "3. Commit to dotfiles repo"
undefinedmkdir -p "${TARGET_DIR}"
cp "${SKILL_FILE}" "${TARGET_DIR}/SKILL.md"
echo ""
echo "✅ Skill stored at: ${TARGET_DIR}/SKILL.md"
echo ""
echo "Next steps:"
echo "1. Review and edit: ${TARGET_DIR}/SKILL.md"
echo "2. Add frontmatter if needed (name, description)"
echo "3. Commit to dotfiles repo"
undefined4. Commit to Dotfiles
4. 提交到Dotfiles
After storing the skill:
bash
cd "${DOTFILES_ROOT}"
git add "ai/files/skills/${CATEGORY}/${SKILL_NAME}/"
git commit -m "feat(skills): add ${SKILL_NAME} skill
Discovered from GitHub search, adapted for local use.
Stored in ${CATEGORY} category."
git push存储Skill后:
bash
cd "${DOTFILES_ROOT}"
git add "ai/files/skills/${CATEGORY}/${SKILL_NAME}/"
git commit -m "feat(skills): add ${SKILL_NAME} skill
Discovered from GitHub search, adapted for local use.
Stored in ${CATEGORY} category."
git pushSee Also
另请参阅
- github: Core GitHub CLI skill
- writing-skills: Creating and editing skills
- superpowers/brainstorming: Design before implementation
- github: 核心GitHub CLI Skill
- writing-skills: 创建与编辑Skill
- superpowers/brainstorming: 实现前的设计环节