---
name: substack-archive
description: >
  Archive all posts from a Substack publication as individual markdown files.
  Given a Substack URL (or subdomain), fetches every post from a specified date onward,
  converts HTML to markdown via pandoc, adds YAML frontmatter (title, date, url, author),
  names files in kebab-case, and sets file timestamps to the published date.
compatibility: Created for Zo Computer
metadata:
  author: rob.zo.computer
---

## Usage

```bash
bun run Skills/substack-archive/scripts/archive.ts <url> <output-dir> [--since YYYY-MM-DD] [--free-only]
```

- `url` — Full Substack URL or domain (e.g. `newsletter.squishy.computer`, `https://example.substack.com`)
- `output-dir` — Where to save the markdown files
- `--since YYYY-MM-DD` — Only fetch posts on or after this date (default: all)
- `--free-only` — Skip paid/subscriber-only posts (filters by `audience` field)

Each file gets:
- YAML frontmatter: title, date, url, author
- Filename from the post slug (kebab-case)
- File mtime/atime set to the published date
