商业产业 Hacker News Agent 2026-10-27T15:12 正文 ok 197 words

Show HN:规范优先(Specification-First)Agent 辅助开发插件与验证流程

英文标题:🔶 Show HN: Specification First Agentic Development Plugin and Prove

开发者 hleichsenring 在 Hacker News 上展示了一套基于“规范优先(Specification-First)”的 Agent 自动化开发插件工作流。该方案在编写代码前强制生成格式化规范文件并建立独立 Git 分支,通过独立上下文进行规格评审与范围剪裁,再自动推进代码编写、测试验证与决策归档。这种结合了严格工程门禁(Gate)的规范驱动流程,有效降低了代码生成 Agent 的失控与幻觉风险,为 Agentic 软件工程落地提供了严谨的实践参考。
打开原文相关 3 · 机会 0
media73.3 KB

中文

我想要一个小型的待办事项(Todo)应用。支持添加待办事项、勾选完成、筛选待办和已完成状态。仅在浏览器端运行,无需后端。

Read .spec-first/memory/MEMORY.md

Read src/main.ts

这是一个空的 Vite 初始项目,我将按照你的偏好使用 TypeScript 和 Vitest。页面刷新后待办事项需要保留吗?

是的,使用 localStorage 即可。

/spec-first:create-spec

Write 2026-10-27-7b2d-todos-first-version.yaml

规范已生成。需要我将其放到独立分支吗?

看起来没问题,继续。

Bash git worktree add -b spec/2026-10-27-7b2d …

规范 2026-10-27-7b2d 已放置在专属独立分支:包含 3 个步骤,3 条完成标准(done criteria)。

/spec-first:review-spec

Bash check-evidence.py evidence resolves: 1 spec

Agent 评审规范 2026-10-27-7b2d(采用全新上下文)

Edit 2026-10-27-7b2d-todos-first-version.yaml

裁剪后构建:移除了拖拽重排序功能,增加了空标题检查。两处修改均已应用。

/spec-first:apply-spec

计划:先实现 store,再实现列表界面,最后编写测试。继续执行?

继续。

Write src/todos.ts

Write src/TodoList.ts

Write src/todos.test.ts

Bash npm test 9 passed

Write .spec-first/decisions/2026-10-27-7b2d.yaml

构建并测试完成。已记录一条架构决策:选择 localStorage 而非 IndexedDB,因为几百条待办事项可以轻松承载。

/spec-first:deliver-spec

Bash git commit -m "feat: a first todo app (2026-10-27-7b2d)" gate: build, test passed

Bash gh pr create #12

Bash npm run dev localhost:5173

门禁检查通过,Pull Request #12 已创建。应用正运行在 localhost:5173。

English / 原文

I want a small todo app. Add todos, tick them off, filter open and done. Browser only, no backend.

Read .spec-first/memory/MEMORY.md

Read src/main.ts

It's an empty Vite starter, and I'll use TypeScript and Vitest as you prefer. Should todos survive a reload?

Yes, localStorage is fine.

/spec-first:create-spec

Write 2026-10-27-7b2d-todos-first-version.yaml

Here is the spec. Shall I put it on its own branch?

Looks right, go.

Bash git worktree add -b spec/2026-10-27-7b2d …

Spec 2026-10-27-7b2d is on its own branch: 3 steps, 3 done criteria.

/spec-first:review-spec

Bash check-evidence.py evidence resolves: 1 spec

Agent Review spec 2026-10-27-7b2d fresh context

Edit 2026-10-27-7b2d-todos-first-version.yaml

BUILD WITH CUTS. Drag to reorder is out, a check for empty titles is in. Both applied.

/spec-first:apply-spec

Plan: the store first, then the list, then the tests. Go?

Go.

Write src/todos.ts

Write src/TodoList.ts

Write src/todos.test.ts

Bash npm test 9 passed

Write .spec-first/decisions/2026-10-27-7b2d.yaml

Built and tested. One decision on record: localStorage over IndexedDB, because a few hundred todos fit easily.

/spec-first:deliver-spec

Bash git commit -m "feat: a first todo app (2026-10-27-7b2d)" gate: build, test passed

Bash gh pr create #12

Bash npm run dev localhost:5173

The gate passed and pull request #12 is open. The app runs on localhost:5173.