Index of every page on this site: llms.txt
All skills
garrytan avatar

/hackernews-frontpage

@8586794 official
by Garry Tangarrytan/gstack142k stars
20,987
Run it yourself

Scrape the Hacker News front page (titles, points, comment counts).

Use this Skill: https://skilld.dev/gh/garrytan/gstack/hackernews-frontpage

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈22 tokens for metadata: the name and description. ≈275 when used: this file.

Description uses 1.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈90 characters, or 1.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning18d3 checks · Risk SAFE
  • Gen Agent Trust Hub18d

    The skill is a reference implementation for scraping Hacker News and is generally safe. It exhibits a potential surface for indirect prompt injection due to processing external web content and performs a benign local command execution to locate configuration files.

  • Socket18d

    No alerts

  • Snyk18d

    Risk: MEDIUM · 1 issue

Signed by skilld at 8586794. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 7 months ago
host
news.ycombinator.com
trusted
true
source
human
Other metadata
version
1.0.0
args
[]
triggers
[
  "scrape hacker news frontpage",
  "scrape hn frontpage",
  "get hn top stories",
  "latest hacker news stories"
]
  • scraping
  • hackernews
  • web-scraping
  • json
  • parsing
  • html

README badge

README badge for garrytan/gstack/hackernews-frontpage

Scrapes the Hacker News front page and returns the top 30 stories as JSON, with rank, title, URL, points, and comment count for each story. Used to fetch the latest HN top stories programmatically without authentication.

Generated from the current SKILL.md.

What data does this skill extract from Hacker News?
It returns the top 30 stories from the front page, each with rank, title, URL, point count, and comment count as JSON.
Does this skill require authentication?
No. It scrapes the public Hacker News front page with no login or API key needed.
What happens if Hacker News changes its HTML structure?
The skill includes a bundled test fixture that will catch selector breakage before the skill fails in production.
Can I filter results by score or comment count?
The skill returns all 30 front-page stories without filtering; you would need to post-process the JSON output yourself.

Generated from the current SKILL.md. These answers refresh after source changes.