@patricksardinha/agentkit-cli 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENT_WORKFLOW.md +129 -55
- package/CLAUDE.md +59 -34
- package/PLAYBOOK.md +192 -0
- package/PROJECT_BLUEPRINT.md +52 -0
- package/README.md +248 -167
- package/agents/agent-1-infra/skills.md +46 -0
- package/agents/agent-2-detectors/skills.md +38 -0
- package/agents/agent-3-generators/skills.md +43 -0
- package/agents/agent-4-commands/skills.md +37 -0
- package/dist/cli.cjs +149 -49
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +149 -49
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/add.ts +22 -15
- package/src/commands/init.ts +1 -1
- package/src/generators/playbookGenerator.ts +136 -36
- package/tests/commands/add.test.ts +1 -1
- package/tests/generators/playbookGenerator.test.ts +140 -48
package/README.md
CHANGED
|
@@ -16,24 +16,39 @@ When you run `npm create vite@latest`, it scaffolds a complete React project in
|
|
|
16
16
|
|
|
17
17
|
It scaffolds the *orchestration layer* that sits on top of any project: the files that tell Claude Code **who** to be, **what** to build, **how** to divide the work across specialized agents, and **exactly what to do** — step by step, without you having to prompt each agent manually.
|
|
18
18
|
|
|
19
|
+
You open Claude Code, type one instruction, and it runs the entire workflow autonomously.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Core Design Principle — No AI Inside the Tool
|
|
24
|
+
|
|
25
|
+
AgentKit contains **no AI**. No API calls, no LLM integration, no costs, no API key required.
|
|
26
|
+
|
|
27
|
+
This is a deliberate choice. AgentKit is a **structural tool** — it generates the scaffolding, the rules, and the execution framework. The intelligence comes from two places:
|
|
28
|
+
|
|
29
|
+
- **You** — you optionally write a `PROJECT_BLUEPRINT.md` describing what you want to build
|
|
30
|
+
- **Claude Code** — it either reads your blueprint or asks you questions, decomposes the project into specialized agents, then executes them in sequence
|
|
31
|
+
|
|
32
|
+
This separation means AgentKit works with any LLM and never becomes outdated
|
|
33
|
+
as AI models improve. The tool itself costs nothing to run — but be aware:
|
|
34
|
+
|
|
35
|
+
- **Claude Code or any hosted LLM** requires a paid subscription to the
|
|
36
|
+
provider (Anthropic, OpenAI, etc.)
|
|
37
|
+
- **Local models via Ollama** are free to run, but require a machine with
|
|
38
|
+
sufficient RAM and ideally a dedicated GPU — a standard laptop may
|
|
39
|
+
struggle with larger models
|
|
40
|
+
- **AgentKit itself** has no cost, no API key, and no usage limits
|
|
41
|
+
|
|
19
42
|
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
├── AGENT_WORKFLOW.md ← roadmap
|
|
28
|
-
├── PLAYBOOK.md ← execution guide
|
|
29
|
-
└── agents/ ← per-agent skills
|
|
30
|
-
├── agent-1-infra/
|
|
31
|
-
├── agent-2-auth/
|
|
32
|
-
└── agent-3-features/
|
|
43
|
+
You (optionally write a blueprint)
|
|
44
|
+
↓
|
|
45
|
+
AgentKit CLI (generates the structure)
|
|
46
|
+
↓
|
|
47
|
+
Claude Code (discovers or reads blueprint → decomposes → executes)
|
|
48
|
+
↓
|
|
49
|
+
Your finished project
|
|
33
50
|
```
|
|
34
51
|
|
|
35
|
-
You open Claude Code, type one instruction, and it runs the entire workflow autonomously.
|
|
36
|
-
|
|
37
52
|
---
|
|
38
53
|
|
|
39
54
|
## The Problem It Solves
|
|
@@ -42,194 +57,177 @@ Most developers using Claude Code today work with a single, long-running convers
|
|
|
42
57
|
|
|
43
58
|
- **Context gets polluted** — one agent accumulates unrelated concerns
|
|
44
59
|
- **No reusability** — you re-explain conventions on every project
|
|
45
|
-
- **No parallelism** — everything is sequential without a coordination layer
|
|
46
60
|
- **No audit trail** — no document captures decisions made
|
|
47
61
|
- **Manual orchestration** — you have to manage agent transitions yourself
|
|
62
|
+
- **Poor decomposition** — most developers don't know how to split work into optimal agents
|
|
48
63
|
|
|
49
|
-
AgentKit
|
|
64
|
+
AgentKit solves all five — including the last one, by always delegating decomposition to Claude Code, whether or not you provide a blueprint.
|
|
50
65
|
|
|
51
66
|
---
|
|
52
67
|
|
|
53
68
|
## How It Works
|
|
54
69
|
|
|
70
|
+
AgentKit always runs in two phases inside Claude Code. **Phase 0 always runs first**, regardless of whether you provided a blueprint. The difference is only the *source* of information.
|
|
71
|
+
|
|
72
|
+
### Without blueprint — Phase 0 asks you
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx @patricksardinha/agentkit-cli init
|
|
55
76
|
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
│
|
|
60
|
-
▼
|
|
61
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
62
|
-
│ AgentKit CLI │
|
|
63
|
-
│ │
|
|
64
|
-
│ 1. Scans the project directory │
|
|
65
|
-
│ → reads package.json, Cargo.toml, requirements.txt… │
|
|
66
|
-
│ │
|
|
67
|
-
│ 2. Detects the stack │
|
|
68
|
-
│ → React · Next.js · Tauri · FastAPI · Express · Node │
|
|
69
|
-
│ → TypeScript? Tailwind? Prisma? Testing setup? │
|
|
70
|
-
│ │
|
|
71
|
-
│ 3. Reads your blueprint (optional) │
|
|
72
|
-
│ → parses features, requirements, architecture notes │
|
|
73
|
-
│ → generates agents tailored to YOUR features │
|
|
74
|
-
│ │
|
|
75
|
-
│ 4. Generates the orchestration layer │
|
|
76
|
-
│ → CLAUDE.md (conventions, stack, rules) │
|
|
77
|
-
│ → AGENT_WORKFLOW.md (agents, scope, dependencies) │
|
|
78
|
-
│ → PLAYBOOK.md (autonomous execution guide) │
|
|
79
|
-
│ → agents/agent-N-*/ (per-agent skills folders) │
|
|
80
|
-
└─────────────────────────┬───────────────────────────────────────┘
|
|
81
|
-
│
|
|
82
|
-
▼
|
|
83
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
84
|
-
│ Step 2 — You open Claude Code and type ONE instruction: │
|
|
85
|
-
│ │
|
|
86
|
-
│ "Read PLAYBOOK.md and execute the procedure." │
|
|
87
|
-
│ │
|
|
88
|
-
│ Claude Code then runs autonomously: │
|
|
89
|
-
│ │
|
|
90
|
-
│ Agent 1 → Infra & Setup │
|
|
91
|
-
│ runs: npm run build │
|
|
92
|
-
│ ✅ passes → moves to Agent 2 │
|
|
93
|
-
│ ❌ fails → analyzes error, fixes, retries (max 3x) │
|
|
94
|
-
│ ↓ │
|
|
95
|
-
│ Agent 2 → Auth & Data Layer │
|
|
96
|
-
│ runs: npm test │
|
|
97
|
-
│ ✅ passes → moves to Agent 3 │
|
|
98
|
-
│ ↓ │
|
|
99
|
-
│ Agent 3 → Features │
|
|
100
|
-
│ runs: npm test │
|
|
101
|
-
│ ✅ passes → moves to Agent 4 │
|
|
102
|
-
│ ↓ │
|
|
103
|
-
│ Agent 4 → Docs & Deploy │
|
|
104
|
-
│ ✅ 🎉 Workflow complete │
|
|
105
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
77
|
+
|
|
78
|
+
When Claude Code reads the generated PLAYBOOK, it starts with **Phase 0 — Project Discovery**: it asks you three questions directly in the chat and waits for your answers before decomposing anything.
|
|
79
|
+
|
|
106
80
|
```
|
|
81
|
+
Claude Code: "Before I start, I need to understand what you want to build.
|
|
107
82
|
|
|
108
|
-
|
|
83
|
+
1. What is this project? (one sentence)
|
|
84
|
+
2. What are the main features you want to build?
|
|
85
|
+
3. Any tech constraints or architecture preferences?
|
|
109
86
|
|
|
110
|
-
|
|
87
|
+
Please answer and I'll propose an agent decomposition."
|
|
111
88
|
|
|
112
|
-
|
|
89
|
+
You: "It's a desktop app where I log my dev sessions.
|
|
90
|
+
Features: session logging, weekly summaries, natural language search.
|
|
91
|
+
Constraints: Tauri v2, all local, no cloud, Ollama for AI."
|
|
113
92
|
|
|
114
|
-
|
|
93
|
+
Claude Code: "I've decomposed the project into 5 agents:
|
|
94
|
+
1. Infra & Tauri Setup
|
|
95
|
+
2. Data Layer (Dexie)
|
|
96
|
+
3. Ollama Integration
|
|
97
|
+
4. RAG & Search
|
|
98
|
+
5. UI & Features
|
|
99
|
+
Should I proceed?"
|
|
115
100
|
|
|
116
|
-
|
|
101
|
+
You: "Yes." ← then execution begins
|
|
102
|
+
```
|
|
117
103
|
|
|
118
|
-
|
|
104
|
+
### With blueprint — Phase 0 reads your file
|
|
119
105
|
|
|
120
|
-
|
|
106
|
+
Write a `PROJECT_BLUEPRINT.md` at the root of your project in plain language — just describe what you want to build. No agents, no structure, no technical layers required.
|
|
121
107
|
|
|
122
108
|
```bash
|
|
123
|
-
# In any project directory
|
|
124
|
-
npx @patricksardinha/agentkit-cli init
|
|
125
|
-
|
|
126
|
-
# With a blueprint for feature-specific agents
|
|
127
109
|
npx @patricksardinha/agentkit-cli init --blueprint PROJECT_BLUEPRINT.md
|
|
128
|
-
|
|
129
|
-
# Add a new feature to an existing project
|
|
130
|
-
npx @patricksardinha/agentkit-cli add --feature "add PDF export system"
|
|
131
|
-
|
|
132
|
-
# Check workflow status
|
|
133
|
-
npx @patricksardinha/agentkit-cli status
|
|
134
110
|
```
|
|
135
111
|
|
|
136
|
-
|
|
112
|
+
When Claude Code reads the generated PLAYBOOK, it starts with **Phase 0 — Agent Decomposition**: it reads your blueprint and proposes an agent structure before writing any code.
|
|
113
|
+
|
|
137
114
|
```
|
|
138
|
-
|
|
115
|
+
Claude Code: "I've read PROJECT_BLUEPRINT.md and decomposed the project into 5 agents:
|
|
116
|
+
1. Infra & Tauri Setup
|
|
117
|
+
2. Data Layer (Dexie)
|
|
118
|
+
3. Ollama Integration
|
|
119
|
+
4. RAG & Search
|
|
120
|
+
5. UI & Features
|
|
121
|
+
Should I proceed?"
|
|
122
|
+
|
|
123
|
+
You: "Yes." ← then execution begins
|
|
139
124
|
```
|
|
140
125
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
## The Blueprint File
|
|
144
|
-
|
|
145
|
-
The `--blueprint` flag transforms AgentKit from a generic scaffold tool into a project-specific orchestrator.
|
|
146
|
-
|
|
147
|
-
Without a blueprint, AgentKit generates standard agents based on your stack (Components, Hooks, Pages, Tests for React). With a blueprint, it reads your feature requirements and generates agents tailored to exactly what you want to build.
|
|
148
|
-
|
|
149
|
-
**Example `PROJECT_BLUEPRINT.md`:**
|
|
126
|
+
**A good blueprint looks like this:**
|
|
150
127
|
|
|
151
128
|
```markdown
|
|
152
|
-
#
|
|
129
|
+
# DevLog Desktop — Blueprint
|
|
130
|
+
|
|
131
|
+
## Goal
|
|
132
|
+
A desktop app where I log my dev sessions as I work.
|
|
133
|
+
At the end of the week it generates a summary I can paste into my standup.
|
|
134
|
+
I also want to search my history in natural language.
|
|
153
135
|
|
|
154
136
|
## Features
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
137
|
+
- Create a session: what I worked on, how long, blockers encountered
|
|
138
|
+
- Weekly summary generated automatically from local history
|
|
139
|
+
- Natural language search across all past sessions (RAG)
|
|
140
|
+
- Export summaries as markdown for standups
|
|
141
|
+
- Dark/light theme, minimal UI
|
|
159
142
|
|
|
160
143
|
## Tech constraints
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
144
|
+
- Desktop app — Tauri v2 (Windows first)
|
|
145
|
+
- All data stays local — no cloud, no auth required
|
|
146
|
+
- React 19 + TypeScript + Tailwind v4
|
|
147
|
+
- Dexie for local storage (IndexedDB)
|
|
148
|
+
- Ollama for local AI (summaries + embeddings) — no API key
|
|
164
149
|
|
|
165
150
|
## Architecture notes
|
|
166
|
-
- Supabase
|
|
167
|
-
-
|
|
168
|
-
|
|
151
|
+
- No Supabase — bypass auth entirely
|
|
152
|
+
- RAG: generate embeddings with nomic-embed-text, store in Dexie,
|
|
153
|
+
search by cosine similarity
|
|
154
|
+
- Export via Tauri fs plugin
|
|
169
155
|
```
|
|
170
156
|
|
|
171
|
-
|
|
157
|
+
### Phase 1 — Execution (same in both cases)
|
|
172
158
|
|
|
173
|
-
|
|
174
|
-
## Agent 1 · Infra & Tauri Setup
|
|
175
|
-
Scope : Vite + React + Tauri + Tailwind, i18n config
|
|
176
|
-
Criteria : npm run dev opens without error
|
|
177
|
-
|
|
178
|
-
## Agent 2 · Auth & Supabase
|
|
179
|
-
Scope : Supabase client, email/password auth, bypass mode
|
|
180
|
-
Criteria : login/logout functional, npm test passes
|
|
159
|
+
Once you validate the decomposition, Claude Code executes each agent autonomously:
|
|
181
160
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
161
|
+
```
|
|
162
|
+
Agent 1 → Infra & Tauri Setup
|
|
163
|
+
reads : CLAUDE.md + agents/agent-1-infra/skills.md
|
|
164
|
+
runs : npm run tauri:dev
|
|
165
|
+
✅ passes → moves to Agent 2
|
|
166
|
+
❌ fails → analyzes error, fixes, retries (max 3 times)
|
|
167
|
+
→ after 3 failures: asks for human intervention
|
|
168
|
+
↓
|
|
169
|
+
Agent 2 → Data Layer (Dexie)
|
|
170
|
+
reads : CLAUDE.md + agents/agent-2-data/skills.md
|
|
171
|
+
runs : npm test
|
|
172
|
+
✅ passes → moves to Agent 3
|
|
173
|
+
↓
|
|
174
|
+
...
|
|
175
|
+
↓
|
|
176
|
+
Agent N → last agent
|
|
177
|
+
✅ 🎉 Workflow complete
|
|
178
|
+
```
|
|
185
179
|
|
|
186
|
-
|
|
187
|
-
Scope : chart components, data hooks, mock data
|
|
188
|
-
Criteria : charts render, npm test passes
|
|
180
|
+
### The one instruction
|
|
189
181
|
|
|
190
|
-
|
|
191
|
-
Scope : PDF generation from dashboard data
|
|
192
|
-
Criteria : export produces valid PDF, npm test passes
|
|
182
|
+
In both cases, the instruction to give Claude Code is identical:
|
|
193
183
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Criteria : npm run tauri:build produces installer
|
|
184
|
+
```
|
|
185
|
+
Read PLAYBOOK.md and execute the procedure.
|
|
197
186
|
```
|
|
198
187
|
|
|
199
188
|
---
|
|
200
189
|
|
|
201
|
-
##
|
|
202
|
-
|
|
203
|
-
Each agent gets its own folder under `agents/`. Drop any `.md` files there — API documentation, database schemas, business conventions, examples — and the agent reads them before starting.
|
|
190
|
+
## The Generated Files
|
|
204
191
|
|
|
205
192
|
```
|
|
206
|
-
|
|
207
|
-
├──
|
|
208
|
-
│
|
|
209
|
-
|
|
210
|
-
├──
|
|
211
|
-
|
|
212
|
-
│
|
|
193
|
+
my-project/
|
|
194
|
+
├── PROJECT_BLUEPRINT.md ← your input (untouched, optional)
|
|
195
|
+
│
|
|
196
|
+
├── CLAUDE.md ← generated: conventions, stack, rules
|
|
197
|
+
├── AGENT_WORKFLOW.md ← placeholder: Claude Code fills this in Phase 0
|
|
198
|
+
├── PLAYBOOK.md ← generated: Phase 0 + Phase 1 execution engine
|
|
199
|
+
│
|
|
200
|
+
└── agents/ ← generated: per-agent skill folders
|
|
201
|
+
├── agent-1-infra/
|
|
202
|
+
│ └── skills.md ← fill in infra-specific context
|
|
203
|
+
├── agent-2-data/
|
|
204
|
+
│ └── skills.md ← fill in data-specific context
|
|
205
|
+
└── agent-3-features/
|
|
206
|
+
└── skills.md ← fill in feature-specific context
|
|
213
207
|
```
|
|
214
208
|
|
|
215
|
-
|
|
209
|
+
**`CLAUDE.md`** — the standing brief for every agent. Covers stack, conventions, forbidden patterns, commands, and definition of done. Read by every agent at the start of their session.
|
|
216
210
|
|
|
217
|
-
|
|
218
|
-
|
|
211
|
+
**`AGENT_WORKFLOW.md`** — starts as a placeholder. Claude Code fills it during Phase 0. Becomes the single source of truth for the project roadmap.
|
|
212
|
+
|
|
213
|
+
**`PLAYBOOK.md`** — the execution engine. Phase 0 is always present (Discovery or Decomposition depending on whether a blueprint was provided). Phase 1 contains the agent execution loop with retry logic and human escalation.
|
|
219
214
|
|
|
220
|
-
|
|
221
|
-
|
|
215
|
+
**`agents/agent-N-slug/skills.md`** — per-agent context files. Auto-generated as templates. Only the relevant agent reads its own file — bounded context by design. Add any `.md` files alongside `skills.md` and the agent reads those too.
|
|
216
|
+
|
|
217
|
+
---
|
|
222
218
|
|
|
223
|
-
##
|
|
224
|
-
- Supabase URL :
|
|
225
|
-
- Tables involved :
|
|
226
|
-
- Expected RLS :
|
|
219
|
+
## Optionally Enrich the Skills Files
|
|
227
220
|
|
|
228
|
-
|
|
229
|
-
<!-- paste API docs, schemas, examples here -->
|
|
221
|
+
Before running Claude Code, drop context-specific `.md` files into any agent's folder:
|
|
230
222
|
|
|
231
|
-
|
|
232
|
-
|
|
223
|
+
```
|
|
224
|
+
agents/
|
|
225
|
+
├── agent-3-ollama/
|
|
226
|
+
│ ├── skills.md ← auto-generated template
|
|
227
|
+
│ └── ollama-api-reference.md ← you add this: Ollama API docs
|
|
228
|
+
└── agent-4-rag/
|
|
229
|
+
├── skills.md
|
|
230
|
+
└── cosine-similarity-example.md ← you add this: algorithm reference
|
|
233
231
|
```
|
|
234
232
|
|
|
235
233
|
---
|
|
@@ -246,13 +244,15 @@ AgentKit:
|
|
|
246
244
|
1. Reads your existing `AGENT_WORKFLOW.md` to find the last agent number
|
|
247
245
|
2. Appends a new agent block scoped to the new feature
|
|
248
246
|
3. Creates `agents/agent-N-csv-export/skills.md`
|
|
249
|
-
4. Regenerates `PLAYBOOK.md`
|
|
247
|
+
4. Regenerates `PLAYBOOK.md` **without Phase 0** — the initial decomposition is already done
|
|
250
248
|
|
|
251
249
|
Then in Claude Code:
|
|
252
250
|
```
|
|
253
251
|
Read PLAYBOOK.md and execute only the agents that haven't been completed yet.
|
|
254
252
|
```
|
|
255
253
|
|
|
254
|
+
Phase 0 only ever runs once — during the initial `agentkit init`. Iterations go straight to execution.
|
|
255
|
+
|
|
256
256
|
---
|
|
257
257
|
|
|
258
258
|
## Supported Stacks
|
|
@@ -267,37 +267,108 @@ Read PLAYBOOK.md and execute only the agents that haven't been completed yet.
|
|
|
267
267
|
| **Node.js** | `package.json` (generic) | Scripts, modules, CI/CD |
|
|
268
268
|
| **Unknown** | fallback | Generic editable workflow |
|
|
269
269
|
|
|
270
|
-
Stack detection is additive — TypeScript, Tailwind, Prisma, and testing setup are detected on top of the primary framework and enrich all generated files accordingly.
|
|
271
|
-
|
|
272
270
|
---
|
|
273
271
|
|
|
274
272
|
## Design Philosophy
|
|
275
273
|
|
|
276
|
-
###
|
|
274
|
+
### No AI in the tool — by design
|
|
275
|
+
|
|
276
|
+
Integrating an LLM into AgentKit would mean choosing a provider, managing API keys, adding costs, and coupling the tool to a specific model that will become outdated. Instead, AgentKit is purely structural — it generates files that any LLM can read and act on. The intelligence lives in Claude Code (or whatever tool you use), not in AgentKit.
|
|
277
|
+
|
|
278
|
+
### Phase 0 always runs — with or without blueprint
|
|
279
|
+
|
|
280
|
+
The key insight: most developers don't know how to optimally decompose a project into agents. AgentKit solves this by always delegating decomposition to Claude Code. With a blueprint, Claude Code reads the file. Without one, it asks you three questions. Either way, you never have to think about agents yourself — that's Claude Code's job.
|
|
281
|
+
|
|
282
|
+
### You write intent, Claude Code writes structure
|
|
283
|
+
|
|
284
|
+
Whether you write a blueprint or answer questions in chat, you describe *what* you want to build, not *how*. The decomposition into agents — which layer goes first, what the success criteria should be — is always decided by Claude Code during Phase 0.
|
|
277
285
|
|
|
278
|
-
|
|
286
|
+
### Phase 0 runs once, iterations skip it
|
|
279
287
|
|
|
280
|
-
|
|
288
|
+
Phase 0 is only present in the PLAYBOOK generated by `agentkit init`. When you run `agentkit add --feature`, the regenerated PLAYBOOK goes straight to Phase 1 — the initial planning is done, you're just adding to it.
|
|
281
289
|
|
|
282
|
-
|
|
290
|
+
### Bounded context per agent
|
|
283
291
|
|
|
284
|
-
|
|
292
|
+
Each agent reads only `CLAUDE.md` and its own `skills.md`. An infrastructure agent doesn't see your business logic. A features agent doesn't see your CI/CD configuration. This produces better output and prevents agents from making decisions outside their scope.
|
|
285
293
|
|
|
286
|
-
|
|
294
|
+
### Verifiable success criteria
|
|
295
|
+
|
|
296
|
+
Every agent ends with a runnable check — not a goal, a gate. The PLAYBOOK enforces them. You always know exactly which agents have succeeded and which haven't.
|
|
287
297
|
|
|
288
298
|
---
|
|
289
299
|
|
|
290
300
|
## Meta: AgentKit Was Built With AgentKit
|
|
291
301
|
|
|
292
|
-
This CLI was built using the exact workflow it generates.
|
|
302
|
+
This CLI was built using the exact workflow it generates.
|
|
303
|
+
|
|
304
|
+
### A little note
|
|
305
|
+
|
|
306
|
+
The `CLAUDE.md`, `AGENT_WORKFLOW.md`, and `PLAYBOOK.md` files at the root of
|
|
307
|
+
this repo are **illustrative** — they were written after the fact to show what
|
|
308
|
+
AgentKit would have generated had it existed at the start of this project.
|
|
309
|
+
This is the inherent bootstrapping paradox: you can't use a tool to build itself
|
|
310
|
+
before the tool exists.
|
|
311
|
+
|
|
312
|
+
`PROJECT_BLUEPRINT.md` however is **genuine** — it reflects the actual vision
|
|
313
|
+
of the project from the beginning, including the Phase 0 decomposition principle
|
|
314
|
+
that was central to the design.
|
|
315
|
+
|
|
316
|
+
These four files serve as a concrete, real-world example of what AgentKit
|
|
317
|
+
generates — on the same project rather than a separate demo repo. When you
|
|
318
|
+
use AgentKit on your own project, the files it generates will follow exactly
|
|
319
|
+
this structure.
|
|
320
|
+
|
|
321
|
+
### How it would have worked
|
|
293
322
|
|
|
294
323
|
```
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
324
|
+
Step 1 — Write PROJECT_BLUEPRINT.md (genuine)
|
|
325
|
+
Described the CLI's features, constraints, and architecture in plain language.
|
|
326
|
+
No agents, no layers — just intent.
|
|
327
|
+
|
|
328
|
+
Step 2 — npx agentkit init --blueprint PROJECT_BLUEPRINT.md
|
|
329
|
+
AgentKit detects: Node.js + TypeScript stack
|
|
330
|
+
Generates: CLAUDE.md, AGENT_WORKFLOW.md (placeholder), PLAYBOOK.md, agents/
|
|
331
|
+
|
|
332
|
+
Step 3 — "Read PLAYBOOK.md and execute the procedure."
|
|
333
|
+
|
|
334
|
+
Phase 0 — Decomposition
|
|
335
|
+
Claude Code reads PROJECT_BLUEPRINT.md.
|
|
336
|
+
Proposes 4 agents, waits for validation.
|
|
337
|
+
|
|
338
|
+
"I have decomposed the project into 4 agents:
|
|
339
|
+
1. Infra & Setup
|
|
340
|
+
2. Detectors
|
|
341
|
+
3. Generators & Templates
|
|
342
|
+
4. Commands CLI
|
|
343
|
+
Should I proceed?"
|
|
344
|
+
|
|
345
|
+
Human: "Yes."
|
|
346
|
+
|
|
347
|
+
Phase 1 — Execution
|
|
348
|
+
|
|
349
|
+
Agent 1 · Infra & Setup
|
|
350
|
+
skills : agents/agent-1-infra/skills.md
|
|
351
|
+
runs : npm run build ✅
|
|
352
|
+
|
|
353
|
+
Agent 2 · Detectors
|
|
354
|
+
skills : agents/agent-2-detectors/skills.md
|
|
355
|
+
runs : npm test ✅
|
|
356
|
+
|
|
357
|
+
Agent 3 · Generators & Templates
|
|
358
|
+
skills : agents/agent-3-generators/skills.md
|
|
359
|
+
runs : npm test ✅
|
|
360
|
+
|
|
361
|
+
Agent 4 · Commands CLI
|
|
362
|
+
skills : agents/agent-4-commands/skills.md
|
|
363
|
+
runs : npm run build && node dist/cli.js --help ✅
|
|
364
|
+
|
|
365
|
+
🎉 Workflow complete
|
|
299
366
|
```
|
|
300
367
|
|
|
368
|
+
The `CLAUDE.md`, `AGENT_WORKFLOW.md`, and `PLAYBOOK.md` in this repo show
|
|
369
|
+
exactly what each file looks like after AgentKit generates it and Claude Code
|
|
370
|
+
fills it in. Use them as a reference when writing your own `PROJECT_BLUEPRINT.md`.
|
|
371
|
+
|
|
301
372
|
---
|
|
302
373
|
|
|
303
374
|
## Project Structure
|
|
@@ -316,8 +387,8 @@ agentkit-cli/
|
|
|
316
387
|
│ ├── generators/
|
|
317
388
|
│ │ ├── claudeMdGenerator.ts
|
|
318
389
|
│ │ ├── workflowGenerator.ts
|
|
319
|
-
│ │ ├── playbookGenerator.ts ←
|
|
320
|
-
│ │ └── skillsGenerator.ts
|
|
390
|
+
│ │ ├── playbookGenerator.ts ← Phase 0 (Discovery or Decomposition) + Phase 1
|
|
391
|
+
│ │ └── skillsGenerator.ts
|
|
321
392
|
│ ├── templates/
|
|
322
393
|
│ │ ├── react.ts
|
|
323
394
|
│ │ ├── nextjs.ts
|
|
@@ -329,6 +400,16 @@ agentkit-cli/
|
|
|
329
400
|
│ └── utils/
|
|
330
401
|
│ └── logger.ts
|
|
331
402
|
├── tests/
|
|
403
|
+
├── agents/
|
|
404
|
+
│ ├── agent-1-infra/
|
|
405
|
+
│ │ └── skills.md
|
|
406
|
+
│ ├── agent-2-detectors/
|
|
407
|
+
│ │ └── skills.md
|
|
408
|
+
│ ├── agent-3-generators/
|
|
409
|
+
│ │ └── skills.md
|
|
410
|
+
│ └── agent-4-commands/
|
|
411
|
+
│ └── skills.md
|
|
412
|
+
├── PROJECT_BLUEPRINT.md
|
|
332
413
|
├── CLAUDE.md
|
|
333
414
|
├── AGENT_WORKFLOW.md
|
|
334
415
|
├── PLAYBOOK.md
|
|
@@ -344,7 +425,7 @@ To add a new stack template:
|
|
|
344
425
|
|
|
345
426
|
1. Create `src/templates/your-stack.ts` — export `claudeMd(stack)` and `workflow(stack)`
|
|
346
427
|
2. Add detection in `src/detectors/stackDetector.ts`
|
|
347
|
-
3. Register in
|
|
428
|
+
3. Register in `src/generators/claudeMdGenerator.ts` and `workflowGenerator.ts`
|
|
348
429
|
4. Add fixtures in `tests/detectors/` and tests in `tests/generators/`
|
|
349
430
|
|
|
350
431
|
---
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Skills — Agent 1 · Infra & Setup
|
|
2
|
+
|
|
3
|
+
> This file is read by Agent 1 before starting its work.
|
|
4
|
+
> It contains project-specific context that enriches the agent's understanding
|
|
5
|
+
> beyond what is in CLAUDE.md.
|
|
6
|
+
|
|
7
|
+
## Technical context
|
|
8
|
+
|
|
9
|
+
- Package name : @patricksardinha/agentkit-cli
|
|
10
|
+
- Node.js target : 20+
|
|
11
|
+
- Output formats : ESM + CJS (tsup dual build)
|
|
12
|
+
- Binary name : `agentkit` (mapped in package.json `bin` field)
|
|
13
|
+
- Registry : npm (scoped, public)
|
|
14
|
+
|
|
15
|
+
## publishConfig requirement
|
|
16
|
+
|
|
17
|
+
The package.json must include:
|
|
18
|
+
```json
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
Without this, npm treats scoped packages as private and blocks publishing.
|
|
24
|
+
|
|
25
|
+
## GitHub Actions release trigger
|
|
26
|
+
|
|
27
|
+
The workflow must trigger on `v*` tags only (not branch pushes).
|
|
28
|
+
The npm publish step must use:
|
|
29
|
+
```yaml
|
|
30
|
+
- run: npm publish --access public
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
33
|
+
```
|
|
34
|
+
The NPM_TOKEN must be an Automation token (not Granular) to bypass 2FA.
|
|
35
|
+
|
|
36
|
+
## tsup configuration
|
|
37
|
+
|
|
38
|
+
Dual output is required for compatibility:
|
|
39
|
+
```ts
|
|
40
|
+
export default defineConfig({
|
|
41
|
+
entry: ['src/cli.ts'],
|
|
42
|
+
format: ['esm', 'cjs'],
|
|
43
|
+
dts: true,
|
|
44
|
+
clean: true,
|
|
45
|
+
})
|
|
46
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Skills — Agent 2 · Detectors
|
|
2
|
+
|
|
3
|
+
> This file is read by Agent 2 before starting its work.
|
|
4
|
+
|
|
5
|
+
## StackInfo type
|
|
6
|
+
|
|
7
|
+
The detector must return this exact shape:
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface StackInfo {
|
|
11
|
+
framework: 'react' | 'nextjs' | 'tauri' | 'fastapi' | 'express' | 'node' | 'unknown'
|
|
12
|
+
hasTypeScript: boolean
|
|
13
|
+
extras: string[] // e.g. ['tailwind', 'prisma', 'testing']
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Detection priority
|
|
18
|
+
|
|
19
|
+
Frameworks are detected in this order (first match wins):
|
|
20
|
+
1. tauri — `src-tauri/` directory exists
|
|
21
|
+
2. nextjs — `next` key in package.json dependencies
|
|
22
|
+
3. react — `react` key in package.json dependencies
|
|
23
|
+
4. fastapi — `fastapi` in requirements.txt
|
|
24
|
+
5. express — `express` key in package.json dependencies
|
|
25
|
+
6. node — package.json exists (fallback)
|
|
26
|
+
7. unknown — nothing found
|
|
27
|
+
|
|
28
|
+
## Extras detection
|
|
29
|
+
|
|
30
|
+
- typescript : `typescript` in devDependencies OR tsconfig.json exists
|
|
31
|
+
- tailwind : `tailwindcss` in dependencies or devDependencies
|
|
32
|
+
- prisma : `prisma` in devDependencies OR prisma/ directory exists
|
|
33
|
+
- testing : `vitest` or `jest` in devDependencies
|
|
34
|
+
|
|
35
|
+
## Test fixtures
|
|
36
|
+
|
|
37
|
+
Use in-memory mock file systems for tests — do not read the actual
|
|
38
|
+
agentkit-cli project files as fixtures, as this creates circular dependencies.
|