@businesskit/agent 1.0.3 → 1.0.5

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.
Files changed (130) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.cursor-plugin/plugin.json +25 -0
  3. package/.cursorrules +10 -0
  4. package/.superconsole-plugin/plugin.json +32 -0
  5. package/AGENTS.md +94 -63
  6. package/CLAUDE.md +11 -65
  7. package/GEMINI.md +11 -34
  8. package/README.md +106 -153
  9. package/assets/logo.svg +3 -0
  10. package/bin/businesskit.js +11 -17
  11. package/commands/add-contact.md +47 -0
  12. package/commands/add-inventory-from-invoice.md +80 -0
  13. package/commands/adjust-stock.md +46 -0
  14. package/commands/capabilities.md +33 -0
  15. package/commands/check-stock.md +43 -0
  16. package/commands/create-component.md +109 -0
  17. package/commands/create-invoice.md +69 -0
  18. package/commands/create-new-bill.md +65 -0
  19. package/commands/create-page.md +96 -0
  20. package/commands/list-components.md +41 -0
  21. package/commands/list-content.md +46 -0
  22. package/commands/list-pages.md +45 -0
  23. package/commands/publish-page.md +64 -0
  24. package/commands/send-invoice.md +42 -0
  25. package/commands/seo-audit.md +36 -0
  26. package/commands/update-contact.md +46 -0
  27. package/commands/update-content.md +47 -0
  28. package/commands/update-page.md +55 -0
  29. package/commands/update-price.md +47 -0
  30. package/commands/write-blog.md +52 -0
  31. package/commands/write-docs.md +84 -0
  32. package/commands/write-guide.md +46 -0
  33. package/commands/write-newsletter.md +46 -0
  34. package/mcp_config.json +8 -0
  35. package/package.json +34 -23
  36. package/plugin.json +32 -0
  37. package/scripts/generate-schema.ts +244 -0
  38. package/scripts/setup.sh +134 -0
  39. package/scripts/setup.ts +92 -0
  40. package/server.json +21 -0
  41. package/skills/README.md +19 -27
  42. package/skills/billing/SKILL.md +64 -0
  43. package/skills/brand/SKILL.md +30 -86
  44. package/skills/copywriting/SKILL.md +1 -1
  45. package/skills/crm/SKILL.md +38 -0
  46. package/skills/docs-cms/SKILL.md +53 -0
  47. package/skills/docs-cms/references/how-to.md +383 -0
  48. package/skills/inbox/SKILL.md +49 -0
  49. package/skills/inventory/SKILL.md +69 -0
  50. package/skills/pages/SKILL.md +169 -0
  51. package/skills/pages/references/sections-catalog.json +950 -0
  52. package/skills/social/SKILL.md +1 -1
  53. package/templates/antigravity.json +8 -0
  54. package/templates/claude-code.mcp.json +8 -0
  55. package/templates/cursor.mcp.json +8 -0
  56. package/templates/vscode.mcp.json +9 -0
  57. package/.claude/commands/analytics.md +0 -7
  58. package/.claude/commands/blog-writer.md +0 -9
  59. package/.claude/commands/cbo.md +0 -7
  60. package/.claude/commands/ceo.md +0 -10
  61. package/.claude/commands/cmo.md +0 -7
  62. package/.claude/commands/compress.md +0 -73
  63. package/.claude/commands/coo.md +0 -11
  64. package/.claude/commands/copywriter.md +0 -15
  65. package/.claude/commands/course-creator.md +0 -9
  66. package/.claude/commands/crm.md +0 -591
  67. package/.claude/commands/deep.md +0 -50
  68. package/.claude/commands/docs-writer.md +0 -8
  69. package/.claude/commands/forms-builder.md +0 -10
  70. package/.claude/commands/jobs-manager.md +0 -8
  71. package/.claude/commands/kb.md +0 -107
  72. package/.claude/commands/newsletter-writer.md +0 -9
  73. package/.claude/commands/preserve.md +0 -64
  74. package/.claude/commands/resume.md +0 -67
  75. package/.claude/commands/scheduler.md +0 -8
  76. package/.claude/commands/seo.md +0 -60
  77. package/.claude/commands/social.md +0 -51
  78. package/.claude/commands/store-manager.md +0 -11
  79. package/.env.example +0 -2
  80. package/.mcp.json +0 -3
  81. package/ABOUT-ME.md +0 -96
  82. package/HEARTBEAT.md +0 -105
  83. package/PLAN.md +0 -384
  84. package/PRD-Agent-Composition.md +0 -149
  85. package/PRD-Agent-Harness.md +0 -316
  86. package/REFERENCE.md +0 -124
  87. package/SOUL.md +0 -148
  88. package/SYSTEM.md +0 -71
  89. package/agents/_base.ts +0 -63
  90. package/agents/creators/blog-writer.ts +0 -347
  91. package/agents/creators/copywriter.ts +0 -89
  92. package/agents/creators/course-creator.ts +0 -106
  93. package/agents/creators/crm-agent.ts +0 -479
  94. package/agents/creators/docs-writer.ts +0 -77
  95. package/agents/creators/forms-builder.ts +0 -90
  96. package/agents/creators/jobs-manager.ts +0 -82
  97. package/agents/creators/newsletter-writer.ts +0 -91
  98. package/agents/creators/store-manager.ts +0 -138
  99. package/agents/csuite/cbo.ts +0 -109
  100. package/agents/csuite/ceo.ts +0 -121
  101. package/agents/csuite/cmo.ts +0 -109
  102. package/agents/csuite/coo.ts +0 -115
  103. package/agents/growth/analytics-agent.ts +0 -52
  104. package/agents/growth/scheduler.ts +0 -68
  105. package/agents/growth/seo-agent.ts +0 -282
  106. package/agents/growth/social-agent.ts +0 -346
  107. package/brand-voice.md +0 -127
  108. package/cli.ts +0 -125
  109. package/context/brand.md +0 -80
  110. package/context/business.md +0 -66
  111. package/ingest.md +0 -110
  112. package/lib/analytics.ts +0 -81
  113. package/lib/db.adapter.ts +0 -30
  114. package/lib/db.ts +0 -16
  115. package/lib/id.ts +0 -15
  116. package/lib/kb.ts +0 -337
  117. package/lib/memory.ts +0 -219
  118. package/lib/pattern-detector.ts +0 -169
  119. package/lib/profile.ts +0 -119
  120. package/lib/slug.ts +0 -30
  121. package/setup.ts +0 -127
  122. package/skills/agents/SKILL.md +0 -56
  123. package/skills/analytics/SKILL.md +0 -52
  124. package/skills/blog-writer/SKILL.md +0 -452
  125. package/skills/ceo/SKILL.md +0 -25
  126. package/skills/cmo/SKILL.md +0 -8
  127. package/skills/schema/SKILL.md +0 -45
  128. package/skills/store/SKILL.md +0 -62
  129. package/tsconfig.json +0 -13
  130. package/working-style.md +0 -87
package/PLAN.md DELETED
@@ -1,384 +0,0 @@
1
- # BusinessKit Agent — Master Build Plan
2
-
3
- > One-man army. Autonomous. Profile-isolated. Turso-powered.
4
- > Built to run locally (Phase 1), in-app via MCP (Phase 2), autonomous on CF Workflows (Phase 3).
5
-
6
- ---
7
-
8
- ## The Mental Model
9
-
10
- ```
11
- profile_id = one business = one isolated universe
12
- Every agent operates within exactly one profile.
13
- All reads/writes are scoped to profile_id. No exceptions.
14
- ```
15
-
16
- **Store** = all digital commerce:
17
- digital downloads, courses, 1:1 meetings, webinars, events, listings, sponsorships, services.
18
- These all live in the `products` table under different `type` values.
19
-
20
- ---
21
-
22
- ## Agent Roster
23
-
24
- ### C-Suite (Intelligence + Strategy)
25
-
26
- | Title | File | Role |
27
- |---|---|---|
28
- | CEO | `agents/csuite/ceo.ts` | Weekly briefing, cross-agent orchestration, priority setting |
29
- | CMO | `agents/csuite/cmo.ts` | Campaign strategy, content calendar, growth recommendations |
30
- | COO | `agents/csuite/coo.ts` | Content pipeline, publish queue, scheduling oversight |
31
- | CBO | `agents/csuite/cbo.ts` | Revenue analysis, product strategy, pricing recommendations |
32
-
33
- ### Content Creators
34
-
35
- | Title | File | Writes to |
36
- |---|---|---|
37
- | Blog Writer | `agents/creators/blog-writer.ts` | `posts` |
38
- | Newsletter Writer | `agents/creators/newsletter-writer.ts` | `subscribers` + email via SES/Resend |
39
- | Copywriter | `agents/creators/copywriter.ts` | `pages`, `products.description`, `links` |
40
- | Course Creator | `agents/creators/course-creator.ts` | `products` (type=course) + lessons JSON |
41
- | Store Manager | `agents/creators/store-manager.ts` | `products` (downloads, services, webinars, events, listings, sponsorships, meetings) |
42
- | Jobs Manager | `agents/creators/jobs-manager.ts` | `job_listings` + `job_applications` |
43
- | Forms Builder | `agents/creators/forms-builder.ts` | `forms` + `questions` |
44
- | Docs Writer | `agents/creators/docs-writer.ts` | `doc_collections` + `doc_articles` |
45
-
46
- ### Growth & Intelligence
47
-
48
- | Title | File | Role |
49
- |---|---|---|
50
- | SEO Agent | `agents/growth/seo-agent.ts` | `collections`, slugs, meta, OG tags |
51
- | Analytics Agent | `agents/growth/analytics-agent.ts` | All analytics tables — reads only, never writes |
52
- | Social Agent | `agents/growth/social-agent.ts` | `credentials.n8n_webhook_url` → social platforms |
53
- | Scheduler | `agents/growth/scheduler.ts` | `published=0 + date <= now()` → flips published=1 |
54
-
55
- ---
56
-
57
- ## Current Repository Structure
58
-
59
- ```
60
- businesskit-agent/ ← repo root
61
- │
62
- ├── .agents/
63
- │ └── skills/
64
- │ ├── README.md
65
- │ ├── agents.md
66
- │ ├── analytics.md
67
- │ ├── brand.md
68
- │ ├── schema.md
69
- │ └── store.md
70
- │
71
- ├── .claude-plugin/
72
- │ ├── plugin.json
73
- │ └── marketplace.json
74
- │
75
- ├── .claude/
76
- │ ├── commands/
77
- │ │ ├── analytics.md
78
- │ │ ├── blog-writer.md
79
- │ │ ├── cbo.md
80
- │ │ ├── ceo.md
81
- │ │ ├── cmo.md
82
- │ │ ├── compress.md
83
- │ │ ├── coo.md
84
- │ │ ├── copywriter.md
85
- │ │ ├── course-creator.md
86
- │ │ ├── crm.md
87
- │ │ ├── deep.md
88
- │ │ ├── docs-writer.md
89
- │ │ ├── forms-builder.md
90
- │ │ ├── ingest.md
91
- │ │ ├── jobs-manager.md
92
- │ │ ├── kb.md
93
- │ │ ├── newsletter-writer.md
94
- │ │ ├── preserve.md
95
- │ │ ├── resume.md
96
- │ │ ├── scheduler.md
97
- │ │ ├── seo.md
98
- │ │ ├── social.md
99
- │ │ └── store-manager.md
100
- │ └── skills/
101
- │ ├── README.md
102
- │ ├── agents.md
103
- │ ├── analytics.md
104
- │ ├── brand.md
105
- │ ├── schema.md
106
- │ └── store.md
107
- │
108
- ├── agents/
109
- │ ├── _base.ts
110
- │ ├── creators/
111
- │ │ ├── blog-writer.ts
112
- │ │ ├── copywriter.ts
113
- │ │ ├── course-creator.ts
114
- │ │ ├── crm-agent.ts
115
- │ │ ├── docs-writer.ts
116
- │ │ ├── forms-builder.ts
117
- │ │ ├── jobs-manager.ts
118
- │ │ ├── newsletter-writer.ts
119
- │ │ └── store-manager.ts
120
- │ ├── csuite/
121
- │ │ ├── cbo.ts
122
- │ │ ├── ceo.ts
123
- │ │ ├── cmo.ts
124
- │ │ └── coo.ts
125
- │ └── growth/
126
- │ ├── analytics-agent.ts
127
- │ ├── scheduler.ts
128
- │ ├── seo-agent.ts
129
- │ └── social-agent.ts
130
- │
131
- ├── bin/
132
- │ └── businesskit.js
133
- │
134
- ├── CC-Session-Logs/
135
- │ └── .gitkeep
136
- │
137
- ├── context/
138
- │ ├── about-me.md
139
- │ ├── brand-voice.md
140
- │ ├── brand.md
141
- │ ├── business.md
142
- │ └── working-style.md
143
- │
144
- ├── lib/
145
- │ ├── analytics.ts
146
- │ ├── db.adapter.ts
147
- │ ├── db.ts
148
- │ ├── id.ts
149
- │ ├── kb.ts
150
- │ ├── memory.ts
151
- │ ├── pattern-detector.ts
152
- │ ├── profile.ts
153
- │ ├── progress.ts
154
- │ └── slug.ts
155
- │
156
- ├── skills/
157
- │ ├── brand/SKILL.md ← load when writing content
158
- │ ├── analytics/SKILL.md ← load when reading analytics
159
- │ ├── store/SKILL.md ← load for products/pricing
160
- │ ├── schema/SKILL.md ← load for DB queries
161
- │ ├── agents/SKILL.md ← load for routing decisions
162
- │ ├── ceo/SKILL.md ← plugin skill
163
- │ ├── crm/SKILL.md ← plugin skill
164
- │ ├── blog-writer/SKILL.md ← plugin skill
165
- │ └── ingest/SKILL.md ← plugin skill
166
- │
167
- ├── .cursorrules
168
- ├── .env.example
169
- ├── .gitignore
170
- ├── .mcp.json
171
- ├── AGENTS.md
172
- ├── CLAUDE.md
173
- ├── CURSOR-PLAN.md
174
- ├── GEMINI.md
175
- ├── HEARTBEAT.md
176
- ├── PLAN.md
177
- ├── PRD-Agent-Composition.md
178
- ├── PRD-Agent-Harness.md
179
- ├── README.md
180
- ├── SOUL.md
181
- ├── SYSTEM.md
182
- ├── agents.ts
183
- ├── cli.ts
184
- ├── memory.md
185
- ├── package.json
186
- ├── provision-migrations.ts
187
- ├── setup.ts
188
- └── tsconfig.json
189
- ```
190
-
191
- ---
192
-
193
- ## Skills vs Commands
194
-
195
- | Location | What | When it runs |
196
- |---|---|---|
197
- | `.claude/skills/` | Background knowledge — schema, brand, store types, analytics patterns | Auto-loaded on every conversation |
198
- | `.claude/commands/` | Step-by-step task instructions per agent | Only when user types `/command-name` |
199
-
200
- Skills are **passive context**. Commands are **active triggers**.
201
-
202
- ---
203
-
204
- ## Phase 1 — Local Repo ✅ Complete
205
-
206
- **Goal**: Users clone → drop in `.env` → run any agent via Claude Code, Cowork, or terminal.
207
-
208
- ```bash
209
- git clone https://github.com/businesskit/businesskit-agent
210
- cd businesskit-agent
211
- npm install
212
- cp .env.example .env # paste TURSO_URL + TURSO_TOKEN from BusinessKit dashboard
213
- npm run setup # verify connection
214
- # Open in Claude Code → type /ceo for first briefing
215
- ```
216
-
217
- **CLI**:
218
-
219
- ```bash
220
- npx tsx cli.ts ceo # CEO weekly briefing
221
- npx tsx cli.ts blog-writer # list posts
222
- npx tsx cli.ts scheduler hourly # run publish queue
223
- ```
224
-
225
- **Delivered**:
226
-
227
- - [x] `CLAUDE.md` — full schema, brand rules, agent roster
228
- - [x] `lib/` — 6 files: db, db.adapter, id, slug, profile, analytics
229
- - [x] `agents/_base.ts` — BaseAgent with profile isolation
230
- - [x] 16 agents: 4 C-Suite + 8 Creators + 4 Growth
231
- - [x] 16 slash commands in `.claude/commands/`
232
- - [x] 5 skill files in `.claude/skills/`
233
- - [x] `cli.ts` — universal terminal entry point
234
- - [x] `.claude-plugin/plugin.json`
235
- - [x] `README.md` + `.env.example` + `setup.ts`
236
-
237
- ---
238
-
239
- ## Phase 2 — In-App (Qwik + CF Worker)
240
-
241
- **Goal**: Same agents, same code, running inside the BusinessKit dashboard via MCP tool calls.
242
-
243
- **The only change**: swap the DB client source.
244
-
245
- ```ts
246
- // Phase 1 — local, reads from .env
247
- const ceo = new CEO()
248
-
249
- // Phase 2 — CF Worker, reads from sharedMap set by plugin.ts
250
- import { createAgentDB } from '~/lib/db.adapter'
251
- const ceo = new CEO(createAgentDB(event))
252
- ```
253
-
254
- **Deliverables**:
255
-
256
- - [ ] Copy `agents/` + `lib/` into `src/lib/agents/` in the Qwik app
257
- - [ ] `/api/mcp` route in `src/routes/api/mcp/index.tsx`
258
- - [ ] One MCP tool definition per agent action
259
- - [ ] Session auth → `sharedMap["userClient"]` → `createAgentDB(event)`
260
-
261
- ---
262
-
263
- ## Phase 3 — Autonomous (CF Workflows + Durable Objects)
264
-
265
- **Goal**: Agents run on cron with no user present.
266
-
267
- **Deliverables**:
268
-
269
- - [ ] `scheduler.ts` as CF Durable Object (stub already in file — uncomment to activate)
270
- - [ ] Weekly CEO briefing → n8n → email/Slack (`0 8 * * 1`)
271
- - [ ] Hourly publish queue → flips `published=1` + triggers Social Agent (`0 * * * *`)
272
- - [ ] CMO auto-generates content calendar → creates drafts via Blog Writer / Store Manager
273
- - [ ] Newsletter Writer sends on schedule via SES/Resend
274
-
275
- ---
276
-
277
- ## Design Rules
278
-
279
- - **Minimal code** — raw libSQL, no ORM, no boilerplate beyond BaseAgent
280
- - **profile_id on every write** — enforced in BaseAgent, never per-agent
281
- - **No hard deletes** — always `hidden=1`
282
- - **No credentials in logs** — credentials table is read-only, never output values
283
- - **One file per agent** — file name = command name (kebab-case)
284
- - **Composable** — C-Suite calls Growth calls Creators. Never reverse.
285
- - **n8n = external integration layer** — social posting, email delivery
286
- - **CF Workflows = cron layer** — Scheduler designed for Durable Objects from day one
287
- - **Same codebase, two transports** — `db.adapter.ts` is the only diff between Phase 1 and 2
288
-
289
- ---
290
-
291
- ## Phase 2 Additions — Agent Infrastructure (from Hermes + Karpathy patterns)
292
-
293
- ### New tables (defined in agents.ts)
294
-
295
- | Table | Purpose |
296
- |---|---|
297
- | `agents` | Registry — one row per agent type, tracks last_run, auto_approve, pending skill suggestions |
298
- | `agent_skills` | Live instruction skills — editable from dashboard, version-tracked |
299
- | `agent_memory` | Rolling 20-row session log — dual-write (Turso + memory.md) |
300
- | `agent_notes` | Persistent knowledge artifacts — Karpathy wiki pattern (research, analysis, briefings) |
301
- | `agent_files` | Files agent produces — SEO reports, blog exports, CRM data — visible in dashboard |
302
- | `agent_tasks` | Tasks: manual + scheduled + auto-detected from patterns (Hermes pattern) |
303
- | `agent_conversations` | Future agentic chat UI — table only, implementation deferred |
304
-
305
- ### Hermes pattern: auto-skill generation
306
-
307
- When an agent performs the same action 3+ times in 7 days:
308
-
309
- 1. `detectAndSuggestSkill()` in `_base.ts` detects the pattern
310
- 2. Creates a pending `agent_tasks` row (status='detected')
311
- 3. Sets `pending_skill_suggestion` on the `agents` row
312
- 4. Dashboard surfaces it: "CEO detected you want Monday briefings — add as task?"
313
- 5. User approves → status='active', auto_run=1, skill is_active=1
314
- 6. Rejects → status='cancelled'
315
-
316
- ### Karpathy wiki pattern: agent_notes
317
-
318
- Agents write persistent knowledge to `agent_notes`, not just ephemeral `agent_memory`.
319
-
320
- - CEO briefing → saved as note (type='briefing')
321
- - SEO audit findings → saved as note (type='analysis')
322
- - CRM lead research → saved as note (type='research', source_id=contact_id)
323
- - Notes link to each other via related_note_ids JSON
324
- - Dashboard shows all notes, filterable by agent and type
325
-
326
- ### Dashboard routes (main Qwik app)
327
-
328
- - `/dashboard/agents` — agent roster grid
329
- - `/dashboard/agents/[agentType]` — agent detail (memory, skills, tasks, files, notes tabs)
330
- - `/dashboard/agents/files` — all files across all agents
331
-
332
- ### Build order
333
-
334
- See CURSOR-PLAN.md for step-by-step Cursor prompts.
335
- Do Phase 0 → 1 → 2 in order. Phase 3–5 are optional enhancements.
336
-
337
- ---
338
-
339
- ## Architecture Principles (learned from production)
340
-
341
- ### Backend-as-context (Nainsi principle)
342
-
343
- Same app, same model, same prompt: 10.4M tokens vs 3.7M tokens.
344
- The difference: treating the backend as part of the agent's context window.
345
-
346
- **Applied to this repo:**
347
-
348
- - `HEARTBEAT.md` is a structured snapshot — one read, no DB calls, full business state
349
- - Skills load on demand, never all at once
350
- - `agent_kb` index (slug+summary) loaded before content — never full content scan
351
- - Every DB query returns only what's needed — no `SELECT *` on large tables
352
-
353
- **The counterintuitive part:** better models make poor infrastructure MORE expensive.
354
- A capable model explores more deeply when context is missing. Design for no exploration.
355
-
356
- ### Skillify every failure (Garry Tan principle)
357
-
358
- Every agent mistake → permanent structural fix, not a re-prompt.
359
- Deterministic work (date math, row counts, routing) → `lib/` functions, not LLM reasoning.
360
- Every skill in `agent_skills` must be registered in `CLAUDE.md` skills table or it's dark.
361
-
362
- ---
363
-
364
- ## Phase 2 — Dependencies to add when ready
365
-
366
- ### Spectrum (photon.codes)
367
-
368
- `npm install spectrum-ts` — connects agents to iMessage, Telegram, WhatsApp, Slack, Discord, Instagram.
369
- Edge-first, <1s latency. Use when users want to talk to their agents via messaging instead of terminal.
370
- Add to `lib/channels/` — wrap Spectrum adapters per platform, route inbound messages to correct agent.
371
-
372
- **Phase 2 channel architecture:**
373
-
374
- ```
375
- User sends iMessage/WhatsApp/Telegram
376
- → Spectrum adapter receives
377
- → routes to correct agent based on message content
378
- → agent reads HEARTBEAT.md + relevant skills
379
- → writes response back via Spectrum
380
- → logs to agent_memory
381
- ```
382
-
383
- Not needed for Phase 1 (Claude Code / Cowork covers it).
384
- Add when users ask for "talk to my CEO agent on WhatsApp."
@@ -1,149 +0,0 @@
1
- # Agent Composition Pattern
2
-
3
- > "Build your marketing assets template, then use that to build skills
4
- > to further automate your workflow." — Claude Design tutorial
5
- >
6
- > "Once I have this design system skills, I can continue to build all
7
- > the skills on top." — same
8
-
9
- ---
10
-
11
- ## The pattern
12
-
13
- Single agents are useful. Composed agents are a system.
14
-
15
- ```
16
- User: "Launch the April product campaign"
17
- ↓
18
- CEO agent (orchestrator)
19
- ├─ delegates to CMO → campaign strategy + brief
20
- ├─ delegates to Blog Writer → campaign blog post
21
- ├─ delegates to Social Agent → 3 platform posts from brief
22
- ├─ delegates to Newsletter Writer → launch email to subscribers
23
- └─ delegates to Store Manager → product visibility + pricing check
24
-
25
- Result: full campaign from one instruction
26
- ```
27
-
28
- ---
29
-
30
- ## How it works technically
31
-
32
- Each agent in `agents/` has a `runCommand()` method.
33
- The CEO (orchestrator) calls those methods directly:
34
-
35
- ```ts
36
- // CEO orchestrating a campaign launch
37
- async launchCampaign(productId: string) {
38
- // 1. Get product context
39
- const product = await this.db.getProduct(productId)
40
-
41
- // 2. Delegate to CMO for strategy
42
- const brief = await this.cmo.campaignBrief(product)
43
-
44
- // 3. Parallel: content + social + email
45
- const [post, socialPosts, email] = await Promise.all([
46
- this.blogWriter.writePost(brief),
47
- this.socialAgent.createCampaignPosts(brief),
48
- this.newsletterWriter.draftLaunchEmail(brief),
49
- ])
50
-
51
- // 4. Push everything to agent_reports
52
- await this.pushReport('campaign-launch', { brief, post, socialPosts, email })
53
-
54
- // 5. Surface pending approvals
55
- return { pending: [post.id, ...socialPosts.map(p => p.id), email.id] }
56
- }
57
- ```
58
-
59
- ---
60
-
61
- ## Skill composition (from Claude Design tutorial)
62
-
63
- Skills compose the same way:
64
-
65
- ```
66
- brand.md (foundation)
67
- └─ campaign-planning skill (calls brand.md + analytics.md)
68
- └─ carousel skill (calls brand.md + campaign brief)
69
- └─ campaign manager agent (orchestrates all above)
70
- ```
71
-
72
- The campaign manager in the tutorial took one brief and produced:
73
-
74
- - Campaign planning deck (slides)
75
- - Performance tracker (Excel with formulas)
76
- - Social carousel posts (3 on-brand variations)
77
- - Animated video (HTML motion graphics)
78
- - Landing page (with embedded video)
79
-
80
- In 25 minutes, unattended.
81
-
82
- Your equivalent: `/ceo launch-campaign` → brief → blog post + social posts
83
- - newsletter + product settings checked + pending approvals surfaced.
84
-
85
- ---
86
-
87
- ## Three orchestration modes
88
-
89
- ### 1. Sequential (default)
90
-
91
- Agent A finishes → result passes to Agent B.
92
- Use for: workflows where each step depends on the last.
93
-
94
- ```
95
- CMO brief → Blog Writer uses brief → Social Agent repurposes post
96
- ```
97
-
98
- ### 2. Parallel (faster, for independent tasks)
99
-
100
- Agents run simultaneously. Use for: independent deliverables from same input.
101
-
102
- ```
103
- Campaign brief → [Blog Writer + Social Agent + Newsletter Writer] in parallel
104
- ```
105
-
106
- ### 3. Human-gated (approval required)
107
-
108
- Agent completes step → surfaces to user → user approves → next step.
109
- Use for: anything that goes public (posts, emails, price changes).
110
-
111
- ```
112
- Social Agent drafts → approval_status='pending' → user approves → publishes
113
- ```
114
-
115
- ---
116
-
117
- ## What the Shopify video showed
118
-
119
- The Shopify AI toolkit installs as a Claude Code plugin with slash commands.
120
- Same pattern as your `.claude/commands/`:
121
-
122
- ```
123
- /shopify → SEO audit, conversion analysis, AOV report, bulk updates
124
- /ceo → business briefing, campaign launch, pending approvals
125
- /crm → contact management, deal pipeline, outreach
126
- ```
127
-
128
- The difference: Shopify connects to one external store.
129
- Your repo connects to the user's entire business database.
130
-
131
- Shopify's approach also validated: one tool (Claude Code) as the connective
132
- tissue between all their tools (Klaviyo, Canva, Clarity). That's your model —
133
- one `bk` command connecting all their business data.
134
-
135
- ---
136
-
137
- ## Skills vs agents — the distinction
138
-
139
- | | Skills | Agents |
140
- |---|---|---|
141
- | What | Instructions + rules | Executable code |
142
- | Where | `.agents/skills/*.md` + `agent_skills` table | `agents/**/*.ts` |
143
- | Load time | On demand | On demand |
144
- | Can call other | Skills only | Agents + skills |
145
- | Has memory | No | Via `agent_memory` |
146
- | Persists output | No | Via `agent_reports` |
147
-
148
- Skills teach agents *how* to approach something.
149
- Agents *do* the thing and remember it.