Why this one
Rebuilding this site was the obvious first experiment, because it has every property that makes a task hard to delegate: a legacy codebase I do not control, content that must not be lost, URLs that must keep working, and a definition of "done" that is objective enough to check.
If the agent breaks something here, I will notice. That is the point of starting with it.
Setup
| Source | A Next.js blog, ~150 posts, deployed behind Cloudflare |
| Target | Astro, static output, Markdown content |
| Harness | DeepSeek Harness, single agent with shell access |
| Constraint | The source repo is not accessible - the live site is the only source |
| Budget | One working session |
The inaccessible repository turned out to be the defining constraint. No git clone, no database
dump, no export button. Everything has to come off the rendered pages.
Method
Decomposed into three steps, each independently checkable:
- Crawl - discover every post URL from the paginated listing, then fetch and convert each post to Markdown.
- Normalise - repair metadata, strip template artefacts, write files into the target content tree.
- Verify - count what went in against what came out; confirm every old URL has a redirect.
The decomposition is the hypothesis. Attempting this as one instruction - "port the blog to Astro" would have produced a plausible-looking site with silent content loss, which is the worst possible outcome because it is the one I would not notice for months.
Run log
Discovery. 31 listing pages, 5 posts per page. Parsing the listing turned out to be the right move: the listing carries title, date, tags, and description for each post, while the individual post pages do not render tags in a stable container. My first crawl pulled tags from the post page and got empty arrays for a quarter of the archive.
Body extraction. Each post renders its content inside a div.prose. Extracting it needs a
balanced tag scan, not a regex - the content contains nested divs. Converted with Turndown plus the
GFM plugin; code fences preserve their language from the language-* class.
Template artefacts. The old template repeated the post title as an H1 inside the content
block. Twelve posts came through with the title duplicated - the first sign that "content preserved"
is not the same as "content correct".
Two junk records. One was a stray README page that had been published by accident. One had no
metadata at all in the listing. Dropped one, derived the title from its heading for the other.
Harness friction, not content friction. Two environment problems cost more time than the migration logic:
- The package manager's isolated
node_moduleslayout meant the build tool could not resolve a transitive dependency. The error surfaced as a missingmrimodule, which looks like a corrupt install and is actually a linker setting. - The build tool's telemetry tried to write to
%APPDATA%, outside the sandbox, and failed the build withEPERMbefore any compilation happened.
Neither is a content bug. Both would have stopped a naive "just port it" run dead, and neither would be visible in a demo.
Results so far
| Metric | Count |
|---|---|
| Posts reachable from pagination | 149 |
| Orphans recovered from in-body links | 1 |
| Posts archived | 149 |
| Skipped | 1 (accidental README) |
| Duplicate H1s stripped | 12 |
| Redirects generated | 156 |
| Content migrated | ~1.5 MB Markdown |
The site advertises 151 posts. Pagination exposes 149; scanning the converted bodies for internal
links recovered one more that the listing never showed, and one "post" was an accidentally published
README. That lands at 149 archived. The remaining gap is unreachable by any crawler, which is a
finding in itself: the old site has no sitemap and no index of its own content, so anything unlisted
is effectively invisible.
What I believe now
The decomposition held. Each step produced an artefact I could count, which is what made the result verifiable rather than merely plausible. The interesting failure was not any single conversion bug - it was that the cheap check (does the file exist) passes for content that is subtly wrong. Only counting titles against headings caught the duplicated-H1 class of error.
Status stays running: redirects are generated but not yet exercised against the live host, and that is the only test that matters for URL preservation.