Version: 1.0.0
For: OpenClaw compatible agents
Description: Analyze weekly GitHub trending repositories with strategic First Principles thinking
LLM 生成的引用有两大幻觉风险:
${99} for a 10-item list)解决方案: LLM 只输出 ${N} 占位符,标题和链接由 replace_refs.py 脚本从权威 JSON 中注入。
This skill requires feedship v1.8.0+. Use the local project version:
cd /Users/y3/feedship && uv run feedship --version
Verify fetch command is available:
cd /Users/y3/feedship && uv run feedship fetch --help
User triggers:
"GitHub trending", "开源趋势", "每周开源热点", "GitHub 周报", "开发者趋势洞察", "github trending analysis"
The agent will activate this skill and run the Generate Trending Report flow (see section 3).
Schedule weekly reports every Monday at 9 AM Beijing time:
openclaw cron add \
--name "feedship-github-trending" \
--agent feedship-github-trending \
--cron "0 9 * * 1" \
--tz Asia/Shanghai \
--session isolated \
--announce \
--channel <your-channel> \
--to <your-destination> \
--timeout-seconds 600 \
--message "使用 feedship-github-trending skill 生成本周开源趋势分析。" \
--thinking xhigh
# 提取 GitHub trending 数据
cd /Users/y3/feedship && uv run feedship fetch \
--url "https://github.com/trending?since=weekly" \
--json > /tmp/github_trending.json
# 验证数据
python3 -c "
import json
data = json.load(open('/tmp/github_trending.json'))
articles = data.get('articles', [])
print(f'获取到 {len(articles)} 个 trending 仓库')
for i, a in enumerate(articles[:5]):
stars = a.get('meta', {}).get('stars', 0)
print(f'{i}. [{stars}★] {a.get(\"title\", \"\")[:80]}')
"
输出示例:
获取到 25 个 trending 仓库
0. [110927★] microsoft/markitdown: Python tool for converting files...
1. [95748★] NousResearch/hermes-agent: The agent that grows with you
2. [53271★] forrestchang/andrej-karpathy-skills: A single CLAUDE.md file...
从 references/prompt.md 读取提示词模板:
# 读取提示词模板
PROMPT=$(cat skills/feedship-github-trending/references/prompt.md)
# 将仓库数据格式化为简洁的标题列表
python3 -c "
import json
data = json.load(open('/tmp/github_trending.json'))
articles = data.get('articles', [])
for i, a in enumerate(articles[:10]): # 取前 10 个
stars = a.get('meta', {}).get('stars', 0)
lang = a.get('meta', {}).get('language', '')
title = a.get('title', '').split(']', 1)[-1].strip() if ']' in a.get('title', '') else a.get('title', '')
desc = a.get('description', '')[:100]
print(f'{i}. [{stars}★] {lang} - {title}')
print(f' {desc}')
"
将 $FULL_PROMPT 发送给 LLM(MiniMax-M2.7 或同类模型)生成分析。
⚠️ 重要提示给 LLM: 在回复中,严格只使用 ${N} 格式引用仓库,禁止展开标题或链接。最多引用 10 个仓库(${0} 到 ${9})。
# 准备 JSON 数据
GITHUB_TRENDING_JSON=$(cat /tmp/github_trending.json | python3 -c "
import json, sys
data = json.load(sys.stdin)
# 简化:只保留前 10 个
data['articles'] = data.get('articles', [])[:10]
print(json.dumps(data))
")
# 替换引用
cat LLM_OUTPUT.txt | GITHUB_TRENDING_JSON="$GITHUB_TRENDING_JSON" \
python3 skills/feedship-github-trending/scripts/replace_refs.py > /tmp/trending_final.md
脚本功能:
${N} → owner/repo (stars★)${3,7} → 展开为两个独立链接(逗号分隔)[无效引用 #N]读取 /tmp/trending_final.md 输出给用户。
完整的提示词模板位于 references/prompt.md,包含:
${N},禁止展开标题/链接| Problem | Solution |
|---|---|
| --------- | ---------- |
feedship: command not found | 使用 cd /Users/y3/feedship && uv run feedship |
fetch: Error fetching URL | GitHub 可能限制了请求,检查网络或添加延时 |
| Empty article list | GitHub trending 页面结构可能变化,需更新解析逻辑 |
大量 [无效引用 #N] | LLM 引用了不存在的编号(只应引用 ${0}-${9}),检查 prompt.md 中的 Citation Rules |
| LLM 直接展开标题/链接 | 在 Step 3 发送时强调:禁止展开链接,只输出 ${N} |
共 1 个版本