Agent-Operated CLI Architecture for Resumable AI-SDLC Workflows
An AI-SDLC practitioner article proposes an “Agent operates CLI” design in which the CLI owns workflow definitions, persistent state, deterministic checks, artifact registration, and stage advancement, while the Agent decides how to execute each phase. The model uses Workflow, Phase, and State abstractions, phase-bound skills, six human approval points, and hooks for resuming after context compression or a session change. The article says workflow correctness does not depend on hooks always running: when context is unclear, the Agent must first query State for the current phase, status, blockers, and next step. The design covers Claude Code and Codex environments.
The article provides a concrete division of responsibility for multi-session coding-agent workflows: deterministic tooling manages workflow structure and durable state, while agents handle execution and semantic judgment. It also addresses how work can continue across context compression and session changes without relying solely on chat history.
一次交付要走需求、设计、开发、验证、交付五个阶段,跨好几个会话,中间还会遇到上下文压缩和会话中断。阶段和阶段之间靠什么串起来,是设计工作流时第一个要回答的问题。
我们的答案是 Agent 操作 CLI:流程定义、进度和检查放在 CLI 里,Agent 决定每一步怎么做,并通过 CLI 命令查询进度、登记产物、请求推进。
本篇讲五件事:
- 为什么不全交给 Agent,也不全交给脚本;
- 工作流的三个核心概念 Workflow、Phase、State 各是什么,skill 怎样绑定到阶段上;
- 阶段之间怎么交接,State 怎么推进;
- 人在工作流里确认哪几件事;
- 压缩、换会话之后怎么接着走,hook 接在哪几个事件上。
第 01 篇的结尾说过,流程的正确性不能建立在「hook 一定会运行」上。这一篇讲 hook 之外,流程靠什么串起来。