rsshub-route-developer
npx skills add https://github.com/chuyinan2023/rsshub-route-developer --skill rsshub-route-developer
Agent 安装分布
Skill 文档
RSSHub Route Developer
Develop RSSHub routes that turn any website into an RSS feed. Follow the six phases below in order.
Phase 1: Environment Setup
Check if an RSSHub repository clone exists in the working directory or a nearby path.
If no clone exists:
git clone https://github.com/DIYgod/RSSHub.git && cd RSSHub && pnpm install
If clone exists: verify node_modules/ exists. Run pnpm install if not.
Requirements: Node.js >= 22, pnpm (install via npm install -g pnpm if missing).
Phase 2: Analyze Target Page
- Fetch the page and inspect the HTML source
- Determine rendering type:
- SSR: HTML contains article data directly â use
got+cheerio - CSR: data loaded via JS â look for JSON API endpoints in network requests first; use Puppeteer only as last resort
- SSR: HTML contains article data directly â use
- Identify CSS selectors for: list container, title, link, date/time, author, image
- Check detail pages â if list page lacks full content, plan per-article fetches
- Note the date format for
parseDatecompatibility
Phase 3: Generate Route Code
Create three files under lib/routes/{namespace}/. Read references/route-templates.md for complete templates, type definitions, and common patterns.
lib/routes/{namespace}/
âââ namespace.ts # Site metadata (use secondary domain as namespace, all lowercase)
âââ {route-name}.ts # Route handler
âââ radar.ts # Browser extension discovery rules
Handler workflow
- Build URL from route parameters
- Fetch list page with
got, parse withcheerio - Extract items (title, link, pubDate, author)
- Fetch full article content per item via
cache.tryGet - Parse dates with
parseDatefrom@/utils/parse-date - Return
{ title, link, description, image, item }
RSSHub-specific conventions
- Import
gotfrom@/utils/got,cachefrom@/utils/cache(not from npm directly) - Access route params via Hono:
ctx.req.param('name'),ctx.req.query('name') - Set all
featuresflags tofalseunless specifically needed - Valid categories:
popular,social-media,new-media,traditional-media,bbs,blog,programming,design,live,multimedia,picture,anime,program-update,university,forecast,travel,shopping,game,reading,government,study,journal,finance,other
Phase 4: Local Testing
- Start dev server:
pnpm run dev(port 1200) - Test:
curl http://localhost:1200/{namespace}/{route-path} - Verify: items exist, descriptions are non-empty, dates parse correctly
Common issues:
- Empty descriptions â wrong selector for article body; inspect actual detail page HTML
- Stale cache after fix â restart dev server
- Port 1200 in use â kill existing process
- No items â site may be CSR (check view-source vs rendered DOM)
Phase 5: Code Quality
pnpm run format
pnpm run lint
pnpm run format (oxfmt) reformats files across the repo. After running, discard unrelated changes with git checkout -- ., then stage only route files.
Phase 6: Submit PR
Read references/pr-submission.md for the complete PR workflow: fork/branch strategy, commit format, mandatory PR template, and checklist guidance.
Critical: the PR body must include a ```routes fenced code block with route paths. PRs missing this are automatically closed.