hackernews-frontpage — Claude Code skill: top HN stories as JSON
Pulls the Hacker News front page and returns the top 30 stories as JSON with rank, title, link, points and comments.
MIT 311 installs ★ 142,291 updated 2026-10-25
npx skills add garrytan/gstack --skill hackernews-frontpage -a claude-codeWhat hackernews-frontpage does
The skill reads the Hacker News front page and prints the top 30 stories as one JSON document. Each record holds rank, title, link, points and comment count. Handy when an agent needs current HN headlines without you copying rows by hand.
Four moves: the daemon opens https://news.ycombinator.com, the skill reads the HTML, maps each row from tr.athing into a story record, then writes JSON to stdout. No arguments, no auth. One call: $B skill run hackernews-frontpage.
HN redesigns its markup eventually and the selectors stop matching. A bundled script.test.ts runs against a captured fixture, so the break shows up in tests before anyone gets an empty list. The call goes through the daemon, which has to be running.
What it helps with
- pull the top 30 HN stories as JSON for a digest
- collect headlines with points and comment counts
- check what climbed the front page in the last hour
- feed fresh HN links into an agent session
Example prompts for the agent
- Run
$B skill run hackernews-frontpageand show me the top 30 as JSON - Grab the first 30 stories from news.ycombinator.com with comment counts
- Pull the front page of Hacker News and sort the stories by points
How to install hackernews-frontpage
1Skills CLI (Vercel)
npx skills add garrytan/gstack --skill hackernews-frontpage -a claude-code2Manually: put the files in place
~/.claude/skills/hackernews-frontpage/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/hackernews-frontpage/
1Skills CLI (Vercel)
npx skills add garrytan/gstack --skill hackernews-frontpage -a codex2Manually: put the files in place
.agents/skills/hackernews-frontpage/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add garrytan/gstack --skill hackernews-frontpage -a cursor2Manually: put the files in place
.cursor/skills/hackernews-frontpage/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install garrytan/gstack browser-skills/hackernews-frontpage/SKILL.md2Manually: put the files in place
.github/skills/hackernews-frontpage/SKILL.md1Skills CLI (Vercel)
npx skills add garrytan/gstack --skill hackernews-frontpage -a gemini-cli2Platform CLI
gemini skills install https://github.com/garrytan/gstack --path browser-skills/hackernews-frontpageManually: put the files in place
.devin/skills/hackernews-frontpage/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add garrytan/gstack --skill hackernews-frontpage -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about hackernews-frontpage
How do I install hackernews-frontpage in Claude Code?
Run npx skills add garrytan/gstack --skill hackernews-frontpage -a claude-code. The skill lands at ~/.claude/skills/hackernews-frontpage/SKILL.md.
What does hackernews-frontpage do?
It scrapes the HN front page and prints JSON with 30 stories: rank, title, link, points and comments.
Why would the skill stop returning stories?
HN changes its markup, so the tr.athing selectors no longer match. The script.test.ts run against a captured fixture fails first.
Source text
SKILL.md · MIT
---
name: hackernews-frontpage
description: Scrape the Hacker News front page (titles, points, comment counts).
host: news.ycombinator.com
trusted: true
source: human
version: 1.0.0
args: []
triggers:
- scrape hacker news frontpage
- scrape hn frontpage
- get hn top stories
- latest hacker news stories
---
# Hacker News front-page scraper
Scrapes the Hacker News (`news.ycombinator.com`) front page and returns the
top 30 stories as JSON. Each story has its rank, title, link URL, point count,
and comment count.
## Usage
```
$ $B skill run hackernews-frontpage
{
"stories": [
{ "rank": 1, "title": "...", "url": "...", "points": 412, "comments": 87 },
...
],
"count": 30
}
```
## How it works
1. Navigates to `https://news.ycombinator.com` via the daemon.
2. Reads the page HTML.
3. Parses each story row (HN's stable `tr.athing` structure) into a typed
`Story` record.
4. Emits a single JSON document on stdout.
## Why this is the reference skill
`hackernews-frontpage` is the smallest interesting browser-skill: no auth,
stable HTML, deterministic output, file-fixture-friendly. Every Phase 1
component (SDK, scoped tokens, three-tier lookup, spawn lifecycle) is
exercised by `$B skill run hackernews-frontpage` and the bundled
`script.test.ts`.
When the HN HTML rotates and our selectors break, the test fails against the
captured fixture before users notice. That's the point.
© garrytan · MIT · garrytan/gstack