@businesskit/agent 1.0.3 → 1.0.4
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/.claude/settings.json +16 -0
- package/.claude/settings.local.json +11 -0
- package/.env.example +10 -0
- package/CLAUDE.md +32 -13
- package/PLAN.md +95 -134
- package/REFERENCE.md +60 -24
- package/agents/_base.ts +352 -44
- package/agents/analytics/SOUL.md +11 -0
- package/agents/analytics/analytics.ts +405 -0
- package/agents/business/SOUL.md +11 -0
- package/agents/{csuite/cbo.ts → business/business.ts} +2 -2
- package/agents/ceo/SOUL.md +15 -0
- package/agents/{csuite → ceo}/ceo.ts +33 -8
- package/agents/content/SOUL.md +11 -0
- package/agents/content/content.ts +379 -0
- package/agents/copywriting/SOUL.md +11 -0
- package/agents/courses/SOUL.md +11 -0
- package/agents/courses/courses.ts +451 -0
- package/agents/docs/SOUL.md +11 -0
- package/agents/forms/SOUL.md +11 -0
- package/agents/forms/forms.ts +364 -0
- package/agents/hiring/SOUL.md +11 -0
- package/agents/hiring/hiring.ts +314 -0
- package/agents/marketing/SOUL.md +15 -0
- package/agents/{csuite/cmo.ts → marketing/marketing.ts} +3 -3
- package/agents/newsletter/SOUL.md +11 -0
- package/agents/operations/SOUL.md +11 -0
- package/agents/operations/operations.ts +157 -0
- package/agents/sales/SOUL.md +44 -0
- package/agents/sales/sales.ts +883 -0
- package/agents/scheduler/SOUL.md +11 -0
- package/agents/{growth → scheduler}/scheduler.ts +2 -2
- package/agents/seo/SOUL.md +11 -0
- package/agents/{growth/seo-agent.ts → seo/seo.ts} +60 -54
- package/agents/social/SOUL.md +11 -0
- package/agents/social/social.ts +744 -0
- package/agents/store/SOUL.md +11 -0
- package/agents/store/store.ts +514 -0
- package/cli.ts +44 -25
- package/lib/cms.ts +88 -0
- package/lib/db.ts +58 -11
- package/lib/enums.ts +25 -0
- package/lib/groups.ts +122 -0
- package/lib/id.ts +38 -10
- package/lib/profile.ts +44 -8
- package/lib/schema.ts +2015 -0
- package/lib/validate.ts +33 -0
- package/package.json +1 -1
- package/scripts/generate-schema.ts +244 -0
- package/setup.ts +16 -2
- package/skills/schema/SKILL.md +57 -16
- package/tsconfig.json +2 -1
- package/agents/creators/blog-writer.ts +0 -347
- package/agents/creators/course-creator.ts +0 -106
- package/agents/creators/crm-agent.ts +0 -479
- package/agents/creators/forms-builder.ts +0 -90
- package/agents/creators/jobs-manager.ts +0 -82
- package/agents/creators/store-manager.ts +0 -138
- package/agents/csuite/coo.ts +0 -115
- package/agents/growth/analytics-agent.ts +0 -52
- package/agents/growth/social-agent.ts +0 -346
- /package/{ingest.md → .claude/commands/ingest.md} +0 -0
- /package/agents/{creators/copywriter.ts → copywriting/copywriting.ts} +0 -0
- /package/agents/{creators/docs-writer.ts → docs/docs.ts} +0 -0
- /package/agents/{creators/newsletter-writer.ts → newsletter/newsletter.ts} +0 -0
- /package/{ABOUT-ME.md → context/about-me.md} +0 -0
- /package/{brand-voice.md → context/brand-voice.md} +0 -0
- /package/{working-style.md → context/working-style.md} +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"autocompact_percentage_override": 75,
|
|
3
|
+
"env": {
|
|
4
|
+
"BASH_MAX_OUTPUT_LENGTH": "150000"
|
|
5
|
+
},
|
|
6
|
+
"permissions": {
|
|
7
|
+
"deny": [
|
|
8
|
+
"Read(node_modules/**)",
|
|
9
|
+
"Read(dist/**)",
|
|
10
|
+
"Read(.next/**)",
|
|
11
|
+
"Read(coverage/**)",
|
|
12
|
+
"Read(*.lock)",
|
|
13
|
+
"Read(.git/**)"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
package/.env.example
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
TURSO_URL=libsql://your-db.turso.io
|
|
2
2
|
TURSO_TOKEN=your-token
|
|
3
|
+
|
|
4
|
+
# Optional: pick one profile when your UserDB has more than one.
|
|
5
|
+
# Agents auto-detect the single profile when this is unset (normal case).
|
|
6
|
+
# Get the id from BusinessKit → Settings → Credentials, or via:
|
|
7
|
+
# SELECT id, slug, title FROM profiles;
|
|
8
|
+
# PROFILE_ID=
|
|
9
|
+
|
|
10
|
+
# Optional: read replica URL for faster agent briefings (Turso embedded replica).
|
|
11
|
+
# When set, db.execute (reads) hits the replica; writes always go to TURSO_URL.
|
|
12
|
+
# TURSO_REPLICA_URL=libsql://your-db-replica.turso.io
|
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BusinessKit Agent
|
|
2
2
|
|
|
3
|
-
Run an entire business from your database.
|
|
3
|
+
Run an entire business from your database. 18 agents — CEO, Sales, Marketing, Social, SEO, Content and more.
|
|
4
4
|
|
|
5
5
|
Credentials in `.env`: `TURSO_URL` + `TURSO_TOKEN` (BusinessKit → Settings → Credentials)
|
|
6
6
|
|
|
@@ -16,18 +16,28 @@ Credentials in `.env`: `TURSO_URL` + `TURSO_TOKEN` (BusinessKit → Settings →
|
|
|
16
16
|
|
|
17
17
|
## What to do when asked
|
|
18
18
|
|
|
19
|
-
| User says |
|
|
19
|
+
| User says | Agent |
|
|
20
20
|
|---|---|
|
|
21
|
-
| "brief me" / "what's happening" |
|
|
22
|
-
| "
|
|
23
|
-
| "
|
|
24
|
-
| "
|
|
25
|
-
| "leads" / "contacts" / "outreach" |
|
|
26
|
-
| "
|
|
27
|
-
| "
|
|
28
|
-
| "
|
|
29
|
-
| "
|
|
30
|
-
|
|
|
21
|
+
| "brief me" / "what's happening" / "priorities" | **ceo** — load HEARTBEAT.md first |
|
|
22
|
+
| "marketing" / "content calendar" / "growth strategy" | **marketing** |
|
|
23
|
+
| "revenue" / "pricing" / "business performance" | **business** |
|
|
24
|
+
| "operations" / "publish queue" / "task management" | **operations** |
|
|
25
|
+
| "leads" / "contacts" / "outreach" / "deals" | **sales** — approval gate on all sends |
|
|
26
|
+
| "write a post" / "blog" / "guide" / "listicle" | **content** — load brand-voice.md first |
|
|
27
|
+
| "newsletter" / "email subscribers" | **newsletter** — approval before send |
|
|
28
|
+
| "copy" / "landing page copy" / "bio" | **copywriting** |
|
|
29
|
+
| "post to Twitter/LinkedIn" / "social" | **social** |
|
|
30
|
+
| "SEO" / "meta" / "LLM visibility" | **seo** |
|
|
31
|
+
| "analytics" / "traffic" / "how many clicks" | **analytics** — read-only |
|
|
32
|
+
| "product" / "launch" / "store item" | **store** |
|
|
33
|
+
| "course" / "lessons" / "module" | **courses** |
|
|
34
|
+
| "job listing" / "hiring" / "applications" | **hiring** |
|
|
35
|
+
| "form" / "intake" / "waitlist" | **forms** |
|
|
36
|
+
| "docs" / "knowledge base" / "help article" | **docs** |
|
|
37
|
+
| "schedule" / "cron" / "queue" | **scheduler** |
|
|
38
|
+
| "page" / "design" / "page builder" | **design** |
|
|
39
|
+
| "process my notes" / "update KB" | `/ingest` command |
|
|
40
|
+
| don't know → check | `skills/ceo/SKILL.md` |
|
|
31
41
|
|
|
32
42
|
---
|
|
33
43
|
|
|
@@ -65,4 +75,13 @@ User states a preference → add to `memory.md` → apply immediately.
|
|
|
65
75
|
|
|
66
76
|
---
|
|
67
77
|
|
|
68
|
-
|
|
78
|
+
## Deeper context — read on demand
|
|
79
|
+
|
|
80
|
+
| Need | File |
|
|
81
|
+
|---|---|
|
|
82
|
+
| How the repo wires to UserDB, BaseAgent contract, invariants | `ARCHITECTURE.md` |
|
|
83
|
+
| Per-file inventory: agents/, lib/, skills/, commands | `CODEBASE.md` |
|
|
84
|
+
| Which agent writes to which tables + trigger map | `DOMAINS.md` |
|
|
85
|
+
| Code patterns — profile_id, idempotency, enums, soft-delete | `CONVENTIONS.md` |
|
|
86
|
+
| Full schema + agent roster + Phase 2 swap | `REFERENCE.md` |
|
|
87
|
+
| Roadmap, folder map, Phase 1/2/3 | `PLAN.md` |
|
package/PLAN.md
CHANGED
|
@@ -23,118 +23,89 @@ These all live in the `products` table under different `type` values.
|
|
|
23
23
|
|
|
24
24
|
### C-Suite (Intelligence + Strategy)
|
|
25
25
|
|
|
26
|
-
| Title | File | Role |
|
|
26
|
+
| Title | Folder / File | Role |
|
|
27
27
|
|---|---|---|
|
|
28
|
-
| CEO | `agents/
|
|
29
|
-
| CMO | `agents/
|
|
30
|
-
| COO | `agents/
|
|
31
|
-
| CBO | `agents/
|
|
28
|
+
| CEO | `agents/ceo/ceo.ts` | Weekly briefing, cross-agent orchestration, priority setting |
|
|
29
|
+
| Marketing (CMO) | `agents/marketing/marketing.ts` | Campaign strategy, content calendar, growth recommendations |
|
|
30
|
+
| Operations (COO) | `agents/operations/operations.ts` | Content pipeline, publish queue, scheduling oversight |
|
|
31
|
+
| Business (CBO) | `agents/business/business.ts` | Revenue analysis, product strategy, pricing recommendations |
|
|
32
32
|
|
|
33
33
|
### Content Creators
|
|
34
34
|
|
|
35
|
-
| Title | File | Writes to |
|
|
35
|
+
| Title | Folder / File | Writes to |
|
|
36
36
|
|---|---|---|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
37
|
+
| Sales (CRM) | `agents/sales/sales.ts` | `crm_*` — contacts, deals, activities, proposals, invoices |
|
|
38
|
+
| Content (Blog Writer) | `agents/content/content.ts` | `posts`, `compare`, `alternative`, `prompt`, `notes`, `guides` |
|
|
39
|
+
| Newsletter | `agents/newsletter/newsletter.ts` | `subscribers` + email via SES/Resend |
|
|
40
|
+
| Copywriting | `agents/copywriting/copywriting.ts` | `pages`, `products.description`, `links` |
|
|
41
|
+
| Courses | `agents/courses/courses.ts` | `products` (type=course) + lessons JSON |
|
|
42
|
+
| Store | `agents/store/store.ts` | `products` (downloads, services, webinars, events, listings, sponsorships, meetings) |
|
|
43
|
+
| Hiring | `agents/hiring/hiring.ts` | `job_listings` + `job_applications` |
|
|
44
|
+
| Forms | `agents/forms/forms.ts` | `forms` + `questions` |
|
|
45
|
+
| Docs | `agents/docs/docs.ts` | `doc_collections` + `doc_articles` |
|
|
45
46
|
|
|
46
47
|
### Growth & Intelligence
|
|
47
48
|
|
|
48
|
-
| Title | File | Role |
|
|
49
|
+
| Title | Folder / File | Role |
|
|
49
50
|
|---|---|---|
|
|
50
|
-
| SEO
|
|
51
|
-
| Analytics
|
|
52
|
-
| Social
|
|
53
|
-
| Scheduler | `agents/
|
|
51
|
+
| SEO | `agents/seo/seo.ts` | `collections`, slugs, meta, OG tags |
|
|
52
|
+
| Analytics | `agents/analytics/analytics.ts` | All analytics tables — reads only, never writes |
|
|
53
|
+
| Social | `agents/social/social.ts` | `credentials.n8n_webhook_url` → social platforms |
|
|
54
|
+
| Scheduler | `agents/scheduler/scheduler.ts` | `published=0 + date <= now()` → flips published=1 |
|
|
54
55
|
|
|
55
56
|
---
|
|
56
57
|
|
|
57
58
|
## Current Repository Structure
|
|
58
59
|
|
|
60
|
+
One folder per agent. Each folder has `SOUL.md` (identity + rules) + `<agent>.ts` (implementation).
|
|
61
|
+
|
|
59
62
|
```
|
|
60
63
|
businesskit-agent/ ← repo root
|
|
61
64
|
│
|
|
62
|
-
├── .agents/
|
|
63
|
-
│ └── skills/
|
|
64
|
-
│ ├── README.md
|
|
65
|
-
│ ├── agents.md
|
|
66
|
-
│ ├── analytics.md
|
|
67
|
-
│ ├── brand.md
|
|
68
|
-
│ ├── schema.md
|
|
69
|
-
│ └── store.md
|
|
70
|
-
│
|
|
71
65
|
├── .claude-plugin/
|
|
72
66
|
│ ├── plugin.json
|
|
73
67
|
│ └── marketplace.json
|
|
74
68
|
│
|
|
75
69
|
├── .claude/
|
|
76
|
-
│ ├── commands/
|
|
77
|
-
│ │ ├── analytics.md
|
|
78
|
-
│ │ ├──
|
|
79
|
-
│ │ ├──
|
|
80
|
-
│ │ ├──
|
|
81
|
-
│ │ ├──
|
|
82
|
-
│ │ ├──
|
|
83
|
-
│ │ ├──
|
|
84
|
-
│ │ ├──
|
|
85
|
-
│ │
|
|
86
|
-
│
|
|
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
|
|
70
|
+
│ ├── commands/ ← slash-command bodies (user-facing names kept stable)
|
|
71
|
+
│ │ ├── analytics.md blog-writer.md cbo.md
|
|
72
|
+
│ │ ├── ceo.md cmo.md compress.md
|
|
73
|
+
│ │ ├── coo.md copywriter.md course-creator.md
|
|
74
|
+
│ │ ├── crm.md deep.md docs-writer.md
|
|
75
|
+
│ │ ├── forms-builder.md ingest.md jobs-manager.md
|
|
76
|
+
│ │ ├── kb.md newsletter-writer.md
|
|
77
|
+
│ │ ├── preserve.md resume.md scheduler.md
|
|
78
|
+
│ │ ├── seo.md social.md store-manager.md
|
|
79
|
+
│ │ └── settings.json
|
|
80
|
+
│ └── skills/ ← auto-loaded skills (see also top-level skills/)
|
|
107
81
|
│
|
|
108
|
-
├── agents/
|
|
109
|
-
│ ├── _base.ts
|
|
110
|
-
│
|
|
111
|
-
│
|
|
112
|
-
│
|
|
113
|
-
│
|
|
114
|
-
│
|
|
115
|
-
│
|
|
116
|
-
│ │
|
|
117
|
-
│
|
|
118
|
-
│
|
|
119
|
-
│
|
|
120
|
-
│ ├──
|
|
121
|
-
│
|
|
122
|
-
│
|
|
123
|
-
│
|
|
124
|
-
│
|
|
125
|
-
│
|
|
126
|
-
│
|
|
127
|
-
│
|
|
128
|
-
│
|
|
129
|
-
│
|
|
82
|
+
├── agents/ ← one folder per agent, SOUL.md + <agent>.ts
|
|
83
|
+
│ ├── _base.ts ← BaseAgent — profile iso, idempotency, txn, audit
|
|
84
|
+
│ │
|
|
85
|
+
│ ├── ceo/ SOUL.md + ceo.ts
|
|
86
|
+
│ ├── marketing/ SOUL.md + marketing.ts (CMO role)
|
|
87
|
+
│ ├── operations/ SOUL.md + operations.ts (COO role)
|
|
88
|
+
│ ├── business/ SOUL.md + business.ts (CBO role)
|
|
89
|
+
│ ├── sales/ SOUL.md + sales.ts (CRM pipeline)
|
|
90
|
+
│ │
|
|
91
|
+
│ ├── content/ SOUL.md + content.ts (blog writer)
|
|
92
|
+
│ ├── newsletter/ SOUL.md + newsletter.ts
|
|
93
|
+
│ ├── copywriting/ SOUL.md + copywriting.ts
|
|
94
|
+
│ ├── courses/ SOUL.md + courses.ts
|
|
95
|
+
│ ├── store/ SOUL.md + store.ts
|
|
96
|
+
│ ├── hiring/ SOUL.md + hiring.ts (job listings)
|
|
97
|
+
│ ├── forms/ SOUL.md + forms.ts
|
|
98
|
+
│ ├── docs/ SOUL.md + docs.ts
|
|
99
|
+
│ │
|
|
100
|
+
│ ├── analytics/ SOUL.md + analytics.ts
|
|
101
|
+
│ ├── seo/ SOUL.md + seo.ts
|
|
102
|
+
│ ├── social/ SOUL.md + social.ts
|
|
103
|
+
│ └── scheduler/ SOUL.md + scheduler.ts
|
|
130
104
|
│
|
|
131
105
|
├── bin/
|
|
132
106
|
│ └── businesskit.js
|
|
133
107
|
│
|
|
134
|
-
├──
|
|
135
|
-
│ └── .gitkeep
|
|
136
|
-
│
|
|
137
|
-
├── context/
|
|
108
|
+
├── context/ ← Brand Foundation — fill in once
|
|
138
109
|
│ ├── about-me.md
|
|
139
110
|
│ ├── brand-voice.md
|
|
140
111
|
│ ├── brand.md
|
|
@@ -142,50 +113,40 @@ businesskit-agent/ ← repo root
|
|
|
142
113
|
│ └── working-style.md
|
|
143
114
|
│
|
|
144
115
|
├── lib/
|
|
145
|
-
│ ├── analytics.ts
|
|
146
|
-
│ ├── db.adapter.ts
|
|
147
|
-
│ ├── db.ts
|
|
148
|
-
│ ├──
|
|
149
|
-
│ ├──
|
|
150
|
-
│ ├──
|
|
151
|
-
│ ├──
|
|
152
|
-
│ ├──
|
|
153
|
-
│ ├──
|
|
154
|
-
│
|
|
116
|
+
│ ├── analytics.ts ← analytics summaries
|
|
117
|
+
│ ├── db.adapter.ts ← Phase 1↔2 swap point
|
|
118
|
+
│ ├── db.ts ← Turso client, withRetry, txn, reader/writer split (P0-2, P0-3, P1-4)
|
|
119
|
+
│ ├── enums.ts ← single source of truth for status strings (P0-5)
|
|
120
|
+
│ ├── groups.ts ← crm_contact_groups junction helpers (P0-4)
|
|
121
|
+
│ ├── id.ts ← ulid, iso, now, generateIdempotencyKey (P0-1)
|
|
122
|
+
│ ├── kb.ts ← KB query helpers
|
|
123
|
+
│ ├── memory.ts ← dual-write agent_memory + memory.md
|
|
124
|
+
│ ├── pattern-detector.ts ← Hermes skill-detection
|
|
125
|
+
│ ├── profile.ts ← BrandContext loader
|
|
126
|
+
│ ├── slug.ts ← slug utilities
|
|
127
|
+
│ └── validate.ts ← numeric bounds guards (P0-8)
|
|
155
128
|
│
|
|
156
|
-
├── skills/
|
|
157
|
-
│ ├──
|
|
158
|
-
│ ├── analytics/SKILL.md
|
|
159
|
-
│ ├──
|
|
160
|
-
│ ├──
|
|
161
|
-
│ ├──
|
|
162
|
-
│ ├──
|
|
163
|
-
│ ├──
|
|
164
|
-
│ ├──
|
|
165
|
-
│
|
|
129
|
+
├── skills/ ← on-demand domain skills
|
|
130
|
+
│ ├── agents/SKILL.md ← load for routing decisions
|
|
131
|
+
│ ├── analytics/SKILL.md ← load when reading analytics
|
|
132
|
+
│ ├── blog-writer/SKILL.md
|
|
133
|
+
│ ├── brand/SKILL.md ← load when writing content
|
|
134
|
+
│ ├── ceo/SKILL.md
|
|
135
|
+
│ ├── cmo/SKILL.md
|
|
136
|
+
│ ├── copywriting/SKILL.md
|
|
137
|
+
│ ├── humanizer/SKILL.md
|
|
138
|
+
│ ├── sales/ ← reserved (empty)
|
|
139
|
+
│ ├── schema/SKILL.md ← load for DB queries
|
|
140
|
+
│ ├── social/{SKILL.md, content-seo.md}
|
|
141
|
+
│ └── store/SKILL.md
|
|
166
142
|
│
|
|
167
|
-
├──
|
|
168
|
-
├── .env.example
|
|
169
|
-
├── .
|
|
170
|
-
├── .
|
|
171
|
-
├──
|
|
172
|
-
├──
|
|
173
|
-
├──
|
|
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
|
|
143
|
+
├── memory/ ← per-session state (gitignored)
|
|
144
|
+
├── .cursorrules .env.example .gitignore .mcp.json
|
|
145
|
+
├── AGENTS.md CLAUDE.md GEMINI.md HEARTBEAT.md
|
|
146
|
+
├── PLAN.md PRD-Agent-Composition.md PRD-Agent-Harness.md
|
|
147
|
+
├── README.md REFERENCE.md SOUL.md SYSTEM.md
|
|
148
|
+
├── cli.ts setup.ts memory.md
|
|
149
|
+
├── package.json package-lock.json tsconfig.json
|
|
189
150
|
```
|
|
190
151
|
|
|
191
152
|
---
|
|
@@ -225,14 +186,14 @@ npx tsx cli.ts scheduler hourly # run publish queue
|
|
|
225
186
|
**Delivered**:
|
|
226
187
|
|
|
227
188
|
- [x] `CLAUDE.md` — full schema, brand rules, agent roster
|
|
228
|
-
- [x] `lib/` —
|
|
229
|
-
- [x] `agents/_base.ts` — BaseAgent
|
|
230
|
-
- [x]
|
|
231
|
-
- [x]
|
|
232
|
-
- [x]
|
|
233
|
-
- [x] `cli.ts` — universal terminal entry point
|
|
189
|
+
- [x] `lib/` — db (withRetry + txn + reader/writer), id (+ idempotency key), enums, groups junction, validate, memory, profile, kb, analytics, slug
|
|
190
|
+
- [x] `agents/_base.ts` — BaseAgent: profile iso, idempotency (P0-1), txn (P0-2), audit (P0-6), APPEND_ONLY guard (P0-7), logMemory retention (P1-2), single-profile factory (P1-7)
|
|
191
|
+
- [x] 17 agents, one folder each, SOUL.md + `<agent>.ts`
|
|
192
|
+
- [x] 22 slash commands in `.claude/commands/` (+ `settings.json`)
|
|
193
|
+
- [x] Skills in `skills/<domain>/SKILL.md` — loaded on demand
|
|
194
|
+
- [x] `cli.ts` — universal terminal entry point with legacy-name aliases
|
|
234
195
|
- [x] `.claude-plugin/plugin.json`
|
|
235
|
-
- [x] `README.md` + `.env.example` + `setup.ts`
|
|
196
|
+
- [x] `README.md` + `.env.example` (+ optional `TURSO_REPLICA_URL`) + `setup.ts`
|
|
236
197
|
|
|
237
198
|
---
|
|
238
199
|
|
package/REFERENCE.md
CHANGED
|
@@ -33,18 +33,17 @@
|
|
|
33
33
|
|
|
34
34
|
## Schema Quick Reference
|
|
35
35
|
|
|
36
|
-
### Content
|
|
36
|
+
### Content — unified `content` table
|
|
37
37
|
|
|
38
|
-
All
|
|
38
|
+
All blog/notes/guides/newsletter/compare/alternative/prompt/skills content lives in the single `content` table, keyed by `cms_id` (one row per section in `cms`, which has a `category_id`). There is no `posts`/`newsletter`/`notes`/... table.
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
| `doc_articles` | INT AUTOINCREMENT id, collection_id |
|
|
40
|
+
Shared columns: `id, cms_id, category_id, profile_id, user_id, slug, title, content, excerpt, published, hidden, collection_id, seo_title (≤60), seo_description (≤160), seo_keywords, word_count, reading_time_mins, internal_links (int), sources JSON, created_at, updated_at`.
|
|
41
|
+
|
|
42
|
+
Resolve cms_id for a kind via `getCmsId(profileId, kind)` in `agents/content/content.ts`. The unique index is `(profile_id, category_id, slug)`.
|
|
43
|
+
|
|
44
|
+
Kind → category_id: blog=cat_35, notes=cat_37, guides=cat_36, newsletter=cat_20, compare=cat_40, alternative=cat_41, prompt=cat_39, skills=cat_38.
|
|
45
|
+
|
|
46
|
+
Docs are separate (INT AUTOINCREMENT ids): `doc_collections`, `doc_articles`.
|
|
48
47
|
|
|
49
48
|
### Products
|
|
50
49
|
|
|
@@ -53,13 +52,44 @@ type: download|course|meeting|webinar|event|listing|sponsorship|service
|
|
|
53
52
|
price_cents INT | slug UNIQUE | published | hidden=1 to archive
|
|
54
53
|
```
|
|
55
54
|
|
|
56
|
-
### CRM
|
|
55
|
+
### Sales (CRM)
|
|
57
56
|
|
|
58
57
|
```
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
-- Contacts (dashboard route: /dashboard/contacts/[id]/)
|
|
59
|
+
crm_contacts: lead_score(0-100), icp_match, outreach_status, agent_status,
|
|
60
|
+
auto_approve, suggested_dm, conversation_thread JSON,
|
|
61
|
+
agent_context JSON, is_duplicate, duplicate_of
|
|
62
|
+
|
|
63
|
+
-- Pipeline
|
|
64
|
+
crm_deals: stage (new|contacted|proposal|negotiation|won|lost)
|
|
65
|
+
value_cents, probability, expected_close_at, line_items JSON
|
|
66
|
+
|
|
67
|
+
-- Activity timeline — APPEND-ONLY, never UPDATE
|
|
68
|
+
crm_activities: approval_status (pending_approval→approved|auto_sent|rejected)
|
|
69
|
+
direction (outbound|inbound), sender (agent|you|contact)
|
|
70
|
+
type (dm|email|call|meeting|note|task_done|purchase|agent_action)
|
|
71
|
+
|
|
72
|
+
-- Supporting tables
|
|
73
|
+
crm_tasks: status (open|done), due_at, priority
|
|
74
|
+
crm_notes: pinned, body (rich text) — editable unlike activities
|
|
75
|
+
crm_groups: name, icon — membership via crm_contact_groups junction table
|
|
76
|
+
NEVER use LIKE '%grp_x%' — use lib/groups.ts helpers
|
|
77
|
+
crm_templates: type (dm|email|follow_up|proposal), reply_rate_pct
|
|
78
|
+
crm_proposals: public_slug, status (draft|sent|viewed|signed|paid|expired|declined)
|
|
79
|
+
email_opened_at, email_open_count, email_clicked_at
|
|
80
|
+
crm_invoices: invoice_number, public_slug, line_items JSON, total_cents
|
|
81
|
+
email_opened_at, email_open_count, email_clicked_at
|
|
82
|
+
crm_imports: source (csv|linkedin|twitter|apollo|agent), status
|
|
83
|
+
crm_analytics: DB TRIGGERS manage ALL counters — NEVER write manually
|
|
84
|
+
total_pending_approvals, reply_rate_pct, forecast_*_cents
|
|
85
|
+
|
|
86
|
+
-- Key rules for sales agent
|
|
87
|
+
1. approval_status='pending_approval' on ALL outbound activities — never auto_send
|
|
88
|
+
unless contact.auto_approve=1
|
|
89
|
+
2. crm_activities is append-only — insert correcting row, never UPDATE
|
|
90
|
+
3. crm_analytics is trigger-managed — never INSERT or UPDATE
|
|
91
|
+
4. Groups: use lib/groups.ts not JSON LIKE queries
|
|
92
|
+
5. Proposals/invoices: email tracking columns written by email_events triggers
|
|
63
93
|
```
|
|
64
94
|
|
|
65
95
|
### Social
|
|
@@ -93,25 +123,31 @@ iso() = new Date().toISOString().slice(0,19)+'Z' — TEXT timestamp columns
|
|
|
93
123
|
|
|
94
124
|
```
|
|
95
125
|
cat_1=links cat_15=startups cat_18=courses cat_19=downloads
|
|
96
|
-
|
|
126
|
+
cat_31=jobs cat_32=docs cat_34=forms cat_35=blog
|
|
97
127
|
```
|
|
98
128
|
|
|
99
129
|
---
|
|
100
130
|
|
|
101
|
-
## Agent Roster
|
|
131
|
+
## Agent Roster (18 agents)
|
|
132
|
+
|
|
133
|
+
### C-Suite
|
|
134
|
+
|
|
135
|
+
ceo (orchestrator, can_create=1, can_assign=1)
|
|
136
|
+
operations (can_assign=1), business
|
|
137
|
+
|
|
138
|
+
### Marketing
|
|
102
139
|
|
|
103
|
-
|
|
140
|
+
marketing, content, newsletter, copywriting, social, seo
|
|
104
141
|
|
|
105
|
-
|
|
142
|
+
### Operations
|
|
106
143
|
|
|
107
|
-
|
|
144
|
+
store, courses, hiring, forms, docs, scheduler, design
|
|
108
145
|
|
|
109
|
-
|
|
110
|
-
store-manager, jobs-manager, forms-builder, docs-writer, crm-agent
|
|
146
|
+
### Business
|
|
111
147
|
|
|
112
|
-
|
|
148
|
+
sales, analytics
|
|
113
149
|
|
|
114
|
-
|
|
150
|
+
**Reporting:** operations/business/marketing → ceo. All others → their group lead.
|
|
115
151
|
|
|
116
152
|
---
|
|
117
153
|
|