I built a CLI that scaffolds agentic workflows for Claude Code
I built a CLI that scaffolds agentic workflows for Claude Code
我开发了一个为 Claude Code 构建代理工作流的 CLI 工具
Most developers using Claude Code work the same way: one long conversation, manual prompting between tasks, context that grows until the model loses track of what it was doing. It works — but it doesn’t scale. I built AgentKit to fix this. It’s a CLI that generates the orchestration layer for any project: the files that tell Claude Code who to be, what to build, and how to hand off work between specialized agents — automatically.
大多数使用 Claude Code 的开发者工作方式如出一辙:一个冗长的对话窗口,在任务之间手动输入提示词,随着上下文不断堆积,模型最终会丢失任务进度。这种方法虽然可行,但无法扩展。为了解决这个问题,我开发了 AgentKit。它是一个 CLI 工具,可以为任何项目生成编排层:通过自动生成文件,告诉 Claude Code 它的角色定位、构建目标,以及如何在不同专业代理之间进行任务交接。
How it works
工作原理
You write a plain-language blueprint describing what you want to build: 你只需用通俗易懂的语言编写一份蓝图,描述你想构建的内容:
# Todo App — Blueprint
## Goal
A simple web todo app with task creation, completion, and filtering.
## Tech constraints
- Next.js 14 + TypeScript + Tailwind
- localStorage for persistence, no backend
You run one command: npx @patricksardinha/agentkit-cli init --blueprint PROJECT_BLUEPRINT.md
你只需运行一条命令:npx @patricksardinha/agentkit-cli init --blueprint PROJECT_BLUEPRINT.md
AgentKit generates four files: AgentKit 会生成四个文件:
-
CLAUDE.md — the standing brief every agent reads before starting
-
AGENT_WORKFLOW.md — a placeholder Claude Code fills during Phase 0
-
PLAYBOOK.md — the autonomous execution engine
-
README.md — project documentation extracted from your blueprint
-
CLAUDE.md — 每个代理在开始工作前都会阅读的常驻简报
-
AGENT_WORKFLOW.md — Claude Code 在第 0 阶段填写的占位符
-
PLAYBOOK.md — 自主执行引擎
-
README.md — 从你的蓝图中提取的项目文档
Then you open Claude Code and type one instruction: “Read PLAYBOOK.md and execute the procedure.” 然后,你打开 Claude Code 并输入一条指令:“阅读 PLAYBOOK.md 并执行该流程。”
What happens next
接下来会发生什么
Claude Code runs in three phases automatically. Claude Code 会自动运行三个阶段。
Phase 0 — Decomposition: it reads your blueprint and proposes a list of specialized agents. You validate before anything gets built. 第 0 阶段 — 分解: 它会读取你的蓝图并提议一系列专业代理。在开始构建之前,你需要进行确认。
Skills enrichment pause: Claude Code creates the agent folders and waits. You can drop API docs, schemas, or any context files into the relevant agent folder before execution starts. 技能增强暂停: Claude Code 会创建代理文件夹并等待。在执行开始前,你可以将 API 文档、架构图或任何上下文文件放入相关的代理文件夹中。
Phase 1 — Execution: each agent runs in sequence, validates its success criterion, retries on failure, and escalates to you only when genuinely blocked. 第 1 阶段 — 执行: 每个代理按顺序运行,验证其成功标准,在失败时重试,并且仅在真正遇到阻碍时才会向你求助。
A real example
真实案例
I used AgentKit to build DevLog Desktop — a Tauri v2 app with local RAG via Ollama. 我使用 AgentKit 构建了 DevLog Desktop —— 一个通过 Ollama 实现本地 RAG 的 Tauri v2 应用。
Result after one Claude Code session: 在一次 Claude Code 会话后的成果:
-
6 agents executed autonomously
-
68 tests passing
-
Windows installer produced (MSI + NSIS)
-
Full EN/FR i18n, dark mode, semantic search
-
6 个代理自主执行
-
68 个测试用例通过
-
生成了 Windows 安装程序 (MSI + NSIS)
-
完整的英/法双语支持、深色模式、语义搜索
Design choices
设计选择
No AI inside the tool. AgentKit is purely structural — it generates markdown files. The intelligence lives in Claude Code, not in AgentKit. This means no API key, no costs, no vendor lock-in. 工具内部不含 AI。 AgentKit 纯粹是结构性的——它只生成 Markdown 文件。智能核心在于 Claude Code,而非 AgentKit。这意味着无需 API 密钥、没有额外成本,也不会被供应商锁定。
Phase 0 always runs. Most developers don’t know how to optimally split work into agents. AgentKit delegates that decision to Claude Code every time, whether or not you provide a blueprint. You describe intent, Claude Code designs the structure. 第 0 阶段始终运行。 大多数开发者不知道如何将工作最优地拆分给代理。AgentKit 每次都会将该决策委托给 Claude Code,无论你是否提供了蓝图。你描述意图,Claude Code 设计结构。
Stack detection first, interactive fallback. AgentKit reads your project directory to detect the stack. If nothing is found (new empty project), it asks you interactively from a list of supported stacks: React, Next.js, Tauri, FastAPI, Express, Node.js. 优先检测技术栈,交互式兜底。 AgentKit 会读取你的项目目录以检测技术栈。如果未检测到(新空项目),它会通过交互方式让你从支持的列表中选择:React, Next.js, Tauri, FastAPI, Express, Node.js。
Try it
尝试使用
# On any project (empty or existing)
npx @patricksardinha/agentkit-cli init
# With a blueprint
npx @patricksardinha/agentkit-cli init --blueprint PROJECT_BLUEPRINT.md
# Add a feature to an existing project
npx @patricksardinha/agentkit-cli add --feature "add dark mode"
GitHub: https://github.com/patricksardinha/agentkit-cli npm: https://www.npmjs.com/package/@patricksardinha/agentkit-cli
Feedback welcome. 欢迎提供反馈。