---
name: garrytan-hackernews-frontpage
description: "Scrape the Hacker News front page (titles, points, comment counts)."
license: "MIT"
metadata:
  decimalai-skill-id: "e2496e18-2502-435d-b5d0-6baae7bd6d29"
  decimalai-version-id: "8fb42a0f-2fdc-4c61-b7e0-ec9bd60cc0af"
  decimalai-version: "1"
  decimalai-body-sha256: "7b4c896f42bfc91e24b21abdb511b363d0912d01ce6a317ef788ab536650a220"
  decimalai-name: "garrytan/hackernews-frontpage"
  decimalai-format: "1"
  decimalai-invocation: "model"
  decimalai-category: "research"
  decimalai-source: "https://app.decimal.ai/s/garrytan-hackernews-frontpage@1/SKILL.md"
---
# 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.
