知识库

Eye(FR) → Mill(skill) → Library(/app)

← 返回列表
Hacker News · 2026-05-13 · 已成文 · 来源 file

生产级 Agent SDK 建站应把长时 agent loop 与短时 API 拆进程,用预置可编译 starter(如 Astro)+ 严格 allowed_tools/sandbox,并用 session resume 把编辑成本降一个数量级,而不是每次从零生成文件树。

为什么重要

直接示范 Claude Agent SDK 的工程化:queue、sandbox、progress tool、resume、静态输出门禁;对 harness/sandbox/成本控制有可迁移模式。

正文

生产级 Agent SDK 建站应把长时 agent loop 与短时 API 拆进程,用预置可编译 starter(如 Astro)+ 严格 allowed_tools/sandbox,并用 session resume 把编辑成本降一个数量级,而不是每次从零生成文件树。

Claim

生产级 Agent SDK 建站应把长时 agent loop 与短时 API 拆进程,用预置可编译 starter(如 Astro)+ 严格 allowed_tools/sandbox,并用 session resume 把编辑成本降一个数量级,而不是每次从零生成文件树。

Why it matters

直接示范 Claude Agent SDK 的工程化:queue、sandbox、progress tool、resume、静态输出门禁;对 harness/sandbox/成本控制有可迁移模式。

Summary

SiteSpin:对话式建站。架构=客户端 → JWT API → Postgres 队列(LISTEN/NOTIFY + SKIP LOCKED) → worker 内 Claude Agent SDK。 工具:Read/Write/Edit/Bash + 自定义 update_status MCP;无出网/库访问。 首次生成 ~$1 / 3–4min;resume 编辑 ~$0.10 / 20–30s。目标 Lighthouse 100、极低 JS。 图像上传先 vision 分类 role 再交给生成 agent。

Actions

  • (none)

Evidence

  • (none)

Caveats

  • (none)

Research queries

  • (none)

Body

正文

背景

Show HN 博文详解基于 Claude Agent SDK 的对话式建站 SiteSpin,是 harness 工程化的一手案例。

机制

  1. 拆分:API 短事务;worker 跑 agent
  2. 队列:Postgres INSERT + NOTIFY;claim 用 SKIP LOCKED + lease
  3. Loop:预拷贝 Astro → 改写 → build → Vercel
  4. Resume:同 pipeline,resume=session_id 降本
  5. 图像:上传时 vision 分类 role,减轻主 loop 负担

取舍

统一容器 vs 独立扩展;Postgres 队列 vs 外部 MQ(作者选可观测性)。静态优先牺牲交互组件生态。

动作

对照上列 5 条落地 checklist 审计自有 agent 产品。

结合的源文章

主源
Show HN: A website builder on the Claude Agent SDK
打开原文 ↗

原文快照

展开 / 收起快照

Technical background: Each agent loop begins with a real Astro project template pre-copied into the workspace. Rather than generating a file tree from scratch, Claude extends and modifies this known-good baseline. This design decision avoids the inefficiency and inconsistency of model-generated scaffolding. By working within a prebuilt, compilable structure, the model can focus on high-value tasks such as copywriting, layout, and visual hierarchy. Full architecture explanation on agent loop, Postgres-as-queue, edit-via-resume, and more can be found here: https://www.adamhsn.com/blog/conversational-website-builder-...


Comments URL: https://news.ycombinator.com/item?id=48121320

Points: 2

# Comments: 0