H
Howardism
Plate II機器翻譯 · machine-translatedENHOWARDISM

Vertical Slice Tracer Bullets

PublishedMay 6, 2026FiledConceptTagsAgent EngineeringSoftware DesignPlanningReading5 minSourceAI-synthesised

將 Pragmatic-Programmer 的 tracer-bullet 模式套用到 agent 任務拆解;縱向切片優於橫向分層;以帶阻塞依賴邊的 Kanban 取代編號式的階段計畫

Vertical Slice Tracer Bullets 的插圖

資料來源#

摘要#

概念借自 The Pragmatic Programmer,由 Matt Pocock 套用到 agent 任務拆解上:在規劃一項功能時,要把它縱向切片(一條穿透每一層的細窄路徑——schema → service → API → UI),而不是橫向切片(先做完所有 schema,再做完所有 service,最後才做 UI)。縱向切片在第一片完成後就能提供端到端的回饋;橫向切片則要等到第三階段才會有回饋。agents 一定會預設選擇橫向——對 agent 友善的規劃必須主動對抗這種偏誤。

「tracer bullet」的意象#

夜間的防空炮手看不見子彈飛到哪裡。鍍磷的曳光彈在飛行中會發光,每六發出現一顆,炮手便能在天空看到一道光線並修正瞄準。縱向切片是同樣的道理:每一片切片都會在端到端產出可見訊號,讓開發者(以及 agent)有機會修正方向。

為何 agents 偏好橫向——而它們不該這麼做#

針對程式設計任務訓練出來的 agents,習慣以一層一層的方式拆解工作:

  • 階段一:所有 schema 變更
  • 階段二:所有 service
  • 階段三:所有 UI

這種做法易讀,但要等到階段三才會出現整合過的回饋。一旦原始假設(資料形狀、service 邊界、UI 流程)有任何錯誤,代價都要在最後才付出。對 agents 而言,情況比人類更糟,因為 agents 並沒有能在飛行途中捕捉到不一致之處的端到端心智模型。

同樣這個功能換成縱向切片,大致是這樣:

  • 第 1 片:一種事件類型的 schema + 寫入一筆事件的 service + 顯示一筆事件計數的儀表板區塊
  • 第 2 片:第二種事件類型,更深的邏輯,更廣的 UI
  • 第 3 片:回填、打磨、邊界情境

每一片切片都會合併進主分支。每一片都讓使用者有東西可以 QA。每一片都能在下一片依賴它之前先被 QA 過。

Kanban 勝過多階段計畫#

任務一旦被縱向切片,Pocock 主張改用帶阻塞依賴邊的 Kanban,而不是編號式的階段清單:

  • 多階段計畫 ⇒ 一個 agent 一次只能依序處理一項任務。
  • 標明阻塞依賴邊的 Kanban ⇒ 多個 agents 可以並行抓取沒有被阻塞的工單。

這個 Kanban 以 issues/ 目錄底下的 markdown 檔案(或是 GitHub issues)實體化,並在 frontmatter 中以 blocked-by: 明確標示依賴關係。Ralph loop 會在每次迭代時挑出下一張被標記為 AFK、且沒有被阻塞的工單。Pocock 的 Sandcastle 函式庫會把這個選擇過程並行化:planner agent 挑出 N 張可並行的工單,扇出(fan-out)到 N 個 git worktrees 中的 N 個 implementer agents,再扇入(fan-in)交給一個 merger agent。

切片品質規則#

Pocock 的 prd-to-issues 技能會強制執行縱向切片規則。當 agent 提出的切片其實是橫向的——例如只給出「create the gamification service」這一條——規則就會觸發:

「我特別希望在第一個縱向切片中看到 schema 變更或某些 schema 變更。我希望看到一個新的 service 被建立出來,並在前端有一個最小化的呈現。」

一片「好的」第一片切片 = 「Award points for lesson completion visible on dashboard」(同時碰到 schema、service、route、UI)。

為何這不只是 agile-with-extra-steps#

這個做法的形態其實和 agile/XP 時代的薄切片(thin slicing)一樣。它現在之所以重要,是因為 agents 特別會預設採用橫向分層——很可能是因為它們訓練資料中,絕大多數程式設計教學/任務都是那樣組織的。如果不明確地推它,即便是強模型也會輸出分層式的結果。

相關連結#

待解決的問題#

  • 一旦被告知,planner agent 就能被信任會縱向切片嗎?還是它需要一個會標出橫向切片的驗證器?Pocock 的經驗是:至少到 4.7 為止,還需要那個驗證器。
  • 切片粒度該怎麼拿捏?切得太薄=大量合併衝突;切得太厚=又退回橫向。

資料來源#

§ end
About this piece

Articles in this journal are synthesised by AI agents from a curated wiki and are refreshed automatically as new concepts arrive. Topics, framing, and editorial direction are curated by Howardism.

Cited by 12
  • Agent Harness Engineering

    Patterns for scaffolding long-running LLM agents: environment design, progressive context disclosure, mechanical archit…

  • Agent Loop Pattern

    `/loop` (cron-scheduled) and Ralph Wiggum (backlog-draining) loops as next-generation agent primitive; AFK execution, p…

  • Building Is Cheap, Arguing Is Expensive

    "In technical debate, code wins": generate three PRs vs whiteboard; prototype over design doc; reduce design docs

  • Claude Code Best Practices

    Anthropic's guide to effective Claude Code usage: context management, verification-driven development, explore→plan→cod…

  • Context Window Smart Zone

    Smart zone vs dumb zone (Dex Hardy / Matt Pocock): quadratic attention scaling, ~100K marker independent of advertised…

  • Deep Modules for Agents

    Ousterhout deep-vs-shallow modules applied to agent-friendly codebases; push-vs-pull instruction delivery; reviewer in…

  • Design Concept Grilling

    Matt Pocock's `grill-me` skill; reach Brooks "design concept" before any plan; counter to specs-to-code; PRD as destina…

  • Learning to Co-Work with AI: A Software Engineer's Field Guide

    Field guide for software engineers in the AI era: 6 skill clusters (taste, harness, alignment-first planning, agent-fri…

  • Matt Pocock

    Independent AI-coding educator; built Sandcastle library; smart-zone/grill-me/tracer-bullets pedagogical framing; "bad…

  • AI Engineering & Agent Tooling

    Map of Content for the ai-engineering domain — 36 concepts. Curated entry point; see Home for all domains.

  • Narrow Wedge into a Legacy Market

    Disrupt without being feature-complete: be the best for a narrow customer profile (tech cos outgrowing QuickBooks); Goo…

  • Open Questions Backlog

    _96 pages with open questions, as of 2026-06-14._

Related articles
  • Design Concept Grilling

    Matt Pocock's `grill-me` skill; reach Brooks "design concept" before any plan; counter to specs-to-code; PRD as destina…

  • Agent Loop Pattern

    `/loop` (cron-scheduled) and Ralph Wiggum (backlog-draining) loops as next-generation agent primitive; AFK execution, p…

  • Deep Modules for Agents

    Ousterhout deep-vs-shallow modules applied to agent-friendly codebases; push-vs-pull instruction delivery; reviewer in…

  • Context Window Smart Zone

    Smart zone vs dumb zone (Dex Hardy / Matt Pocock): quadratic attention scaling, ~100K marker independent of advertised…

  • Agent Harness Engineering

    Patterns for scaffolding long-running LLM agents: environment design, progressive context disclosure, mechanical archit…