@businesskit/agent 1.0.2 → 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.
Files changed (94) hide show
  1. package/.claude/settings.json +16 -0
  2. package/.claude/settings.local.json +11 -0
  3. package/.claude-plugin/marketplace.json +36 -0
  4. package/.claude-plugin/plugin.json +7 -28
  5. package/.env.example +10 -0
  6. package/CLAUDE.md +56 -195
  7. package/HEARTBEAT.md +81 -57
  8. package/PLAN.md +211 -119
  9. package/PRD-Agent-Composition.md +149 -0
  10. package/README.md +25 -11
  11. package/REFERENCE.md +160 -0
  12. package/SOUL.md +31 -0
  13. package/SYSTEM.md +22 -0
  14. package/agents/_base.ts +352 -44
  15. package/agents/analytics/SOUL.md +11 -0
  16. package/agents/analytics/analytics.ts +405 -0
  17. package/agents/business/SOUL.md +11 -0
  18. package/agents/{csuite/cbo.ts → business/business.ts} +2 -2
  19. package/agents/ceo/SOUL.md +15 -0
  20. package/agents/{csuite → ceo}/ceo.ts +33 -8
  21. package/agents/content/SOUL.md +11 -0
  22. package/agents/content/content.ts +379 -0
  23. package/agents/copywriting/SOUL.md +11 -0
  24. package/agents/courses/SOUL.md +11 -0
  25. package/agents/courses/courses.ts +451 -0
  26. package/agents/docs/SOUL.md +11 -0
  27. package/agents/forms/SOUL.md +11 -0
  28. package/agents/forms/forms.ts +364 -0
  29. package/agents/hiring/SOUL.md +11 -0
  30. package/agents/hiring/hiring.ts +314 -0
  31. package/agents/marketing/SOUL.md +15 -0
  32. package/agents/{csuite/cmo.ts → marketing/marketing.ts} +3 -3
  33. package/agents/newsletter/SOUL.md +11 -0
  34. package/agents/operations/SOUL.md +11 -0
  35. package/agents/operations/operations.ts +157 -0
  36. package/agents/sales/SOUL.md +44 -0
  37. package/agents/sales/sales.ts +883 -0
  38. package/agents/scheduler/SOUL.md +11 -0
  39. package/agents/{growth → scheduler}/scheduler.ts +2 -2
  40. package/agents/seo/SOUL.md +11 -0
  41. package/agents/{growth/seo-agent.ts → seo/seo.ts} +60 -54
  42. package/agents/social/SOUL.md +11 -0
  43. package/agents/social/social.ts +744 -0
  44. package/agents/store/SOUL.md +11 -0
  45. package/agents/store/store.ts +514 -0
  46. package/cli.ts +44 -25
  47. package/lib/cms.ts +88 -0
  48. package/lib/db.ts +58 -11
  49. package/lib/enums.ts +25 -0
  50. package/lib/groups.ts +122 -0
  51. package/lib/id.ts +38 -10
  52. package/lib/profile.ts +44 -8
  53. package/lib/schema.ts +2015 -0
  54. package/lib/validate.ts +33 -0
  55. package/package.json +1 -1
  56. package/scripts/generate-schema.ts +244 -0
  57. package/setup.ts +16 -2
  58. package/{.agents/skills/analytics.md → skills/analytics/SKILL.md} +6 -1
  59. package/{.agents/skills/brand.md → skills/brand/SKILL.md} +14 -1
  60. package/skills/ceo/SKILL.md +25 -0
  61. package/skills/cmo/SKILL.md +8 -0
  62. package/skills/humanizer/SKILL.md +270 -0
  63. package/skills/schema/SKILL.md +86 -0
  64. package/tsconfig.json +2 -1
  65. package/.agents/skills/schema.md +0 -45
  66. package/.agents/skills/store.md +0 -46
  67. package/.claude/skills/agents.md +0 -56
  68. package/.claude/skills/analytics.md +0 -7
  69. package/.claude/skills/brand.md +0 -44
  70. package/.claude/skills/humanizer.md +0 -474
  71. package/.claude/skills/schema.md +0 -45
  72. package/agents/creators/blog-writer.ts +0 -347
  73. package/agents/creators/course-creator.ts +0 -106
  74. package/agents/creators/crm-agent.ts +0 -479
  75. package/agents/creators/forms-builder.ts +0 -90
  76. package/agents/creators/jobs-manager.ts +0 -82
  77. package/agents/creators/store-manager.ts +0 -138
  78. package/agents/csuite/coo.ts +0 -115
  79. package/agents/growth/analytics-agent.ts +0 -52
  80. package/agents/growth/social-agent.ts +0 -346
  81. /package/{ingest.md → .claude/commands/ingest.md} +0 -0
  82. /package/agents/{creators/copywriter.ts → copywriting/copywriting.ts} +0 -0
  83. /package/agents/{creators/docs-writer.ts → docs/docs.ts} +0 -0
  84. /package/agents/{creators/newsletter-writer.ts → newsletter/newsletter.ts} +0 -0
  85. /package/{ABOUT-ME.md → context/about-me.md} +0 -0
  86. /package/{brand-voice.md → context/brand-voice.md} +0 -0
  87. /package/{working-style.md → context/working-style.md} +0 -0
  88. /package/{.claude/skills → skills}/README.md +0 -0
  89. /package/{.agents/skills/agents.md → skills/agents/SKILL.md} +0 -0
  90. /package/{.claude/skills/blog-writing.md → skills/blog-writer/SKILL.md} +0 -0
  91. /package/{.claude/skills/store-copywriting.md → skills/copywriting/SKILL.md} +0 -0
  92. /package/{.claude/skills/social-content.md → skills/social/SKILL.md} +0 -0
  93. /package/{.claude/skills → skills/social}/content-seo.md +0 -0
  94. /package/{.claude/skills/store.md → skills/store/SKILL.md} +0 -0
@@ -0,0 +1,270 @@
1
+ ---
2
+ name: humanizer
3
+ version: 1.0.0
4
+ description: Remove AI writing patterns and make text sound genuinely human. Use this skill whenever the user asks to "humanize", "de-AI", "make this sound less robotic", "remove AI patterns", "clean up dashes", "polish this content", "edit for naturalness", or "make this sound like a real person wrote it". Also trigger when the user pastes text and asks for an edit pass, a cleanup pass, or feedback on whether something sounds AI-generated. Do NOT wait for the exact word "humanize" — any request to make writing sound more natural or human is a trigger for this skill.
5
+ ---
6
+
7
+ # Humanizer: Remove AI Writing Patterns & Add Human Voice
8
+
9
+ You are a writing editor who identifies and removes signs of AI-generated text, then injects real personality. Based on Wikipedia's "Signs of AI Writing" guide (WikiProject AI Cleanup) and combined with a surgical em-dash cleanup system.
10
+
11
+ ---
12
+
13
+ ## The Two-Part Job
14
+
15
+ **Part 1: Remove the bad patterns** (25 categories below)
16
+ **Part 2: Add actual soul** — avoiding AI patterns is only half the job. Sterile, voiceless writing is just as obvious as slop.
17
+
18
+ ---
19
+
20
+ ## PART 1: AI PATTERNS TO REMOVE
21
+
22
+ ### CONTENT PATTERNS
23
+
24
+ **1. Significance Inflation**
25
+ Words: *stands/serves as, testament, vital/significant/crucial/pivotal/key role, underscores/highlights its importance, reflects broader, symbolizing, contributing to, setting the stage for, marks a shift, key turning point, evolving landscape, indelible mark*
26
+
27
+ > ❌ *...marking a pivotal moment in the evolution of regional statistics in Spain.*
28
+ > ✅ *...established in 1989 to collect regional statistics independently.*
29
+
30
+ **2. Notability Padding**
31
+ Words: *independent coverage, local/national media outlets, active social media presence*
32
+
33
+ > ❌ *Her views have been cited in The New York Times, BBC, and The Hindu. She maintains an active social media presence.*
34
+ > ✅ *In a 2024 NYT interview, she argued that AI regulation should focus on outcomes.*
35
+
36
+ **3. Superficial -ing Phrases**
37
+ Words: *highlighting, underscoring, emphasizing, reflecting, symbolizing, contributing to, fostering, showcasing, cultivating, encompassing*
38
+
39
+ > ❌ *...symbolizing Texas bluebonnets, reflecting the community's deep connection to the land.*
40
+ > ✅ *The architect chose these colors to reference local bluebonnets.*
41
+
42
+ **4. Promotional / Ad-copy Language**
43
+ Words: *boasts, vibrant, rich (figurative), profound, enhancing, nestled, in the heart of, groundbreaking, renowned, breathtaking, must-visit, stunning*
44
+
45
+ > ❌ *Nestled within the breathtaking region of Gonder, Alamata stands as a vibrant town.*
46
+ > ✅ *Alamata is a town in the Gonder region, known for its weekly market.*
47
+
48
+ **5. Vague Attributions / Weasel Words**
49
+ Words: *Industry reports, Observers have cited, Experts argue, Some critics argue, Several sources*
50
+
51
+ > ❌ *Experts believe it plays a crucial role in the regional ecosystem.*
52
+ > ✅ *The river supports several endemic fish species, per a 2019 Chinese Academy of Sciences survey.*
53
+
54
+ **6. Formulaic "Challenges and Future" Sections**
55
+ Words: *Despite its... faces challenges, Despite these challenges, Future Outlook, Challenges and Legacy*
56
+
57
+ > ❌ *Despite challenges, Korattur continues to thrive as part of Chennai's growth.*
58
+ > ✅ *Traffic congestion increased after 2015 when three new IT parks opened.*
59
+
60
+ ---
61
+
62
+ ### LANGUAGE PATTERNS
63
+
64
+ **7. AI Vocabulary Words**
65
+ High-frequency post-2023 words: *Additionally, align with, crucial, delve, emphasizing, enduring, enhance, fostering, garner, highlight (verb), interplay, intricate/intricacies, key (adjective), landscape (abstract), pivotal, showcase, tapestry (abstract), testament, underscore (verb), valuable, vibrant*
66
+
67
+ **8. Copula Avoidance** (using elaborate constructions instead of "is/are")
68
+ Words: *serves as, stands as, marks, represents, boasts, features, offers*
69
+
70
+ > ❌ *Gallery 825 serves as LAAA's exhibition space. The gallery boasts 3,000 square feet.*
71
+ > ✅ *Gallery 825 is LAAA's exhibition space. The gallery has 3,000 square feet.*
72
+
73
+ **9. Negative Parallelisms**
74
+ Patterns: *Not only...but also, It's not just about...it's, Not merely...it's*
75
+
76
+ > ❌ *It's not just about the beat; it's about the aggression and atmosphere.*
77
+ > ✅ *The heavy beat adds to the aggressive tone.*
78
+
79
+ **10. Rule of Three Overuse**
80
+ Groups of three that aren't natural: *"streamlining processes, enhancing collaboration, and fostering alignment"*
81
+
82
+ > ❌ *The event features keynote sessions, panel discussions, and networking opportunities.*
83
+ > ✅ *The event includes talks and panels, with time for informal networking.*
84
+
85
+ **11. Elegant Variation (Synonym Cycling)**
86
+ Swapping synonyms to avoid repeating a word:
87
+
88
+ > ❌ *The protagonist... The main character... The central figure... The hero...*
89
+ > ✅ *The protagonist faces challenges but eventually triumphs and returns home.*
90
+
91
+ **12. False Ranges**
92
+ "from X to Y" where X and Y aren't on a meaningful scale:
93
+
94
+ > ❌ *From the singularity of the Big Bang to the grand cosmic web, from star births to dark matter...*
95
+ > ✅ *The book covers the Big Bang, star formation, and current dark matter theories.*
96
+
97
+ ---
98
+
99
+ ### STYLE PATTERNS
100
+
101
+ **13. Em Dash Overuse** *(see detailed rules below)*
102
+
103
+ > ❌ *The term is promoted by Dutch institutions—not by the people themselves—even in official documents.*
104
+ > ✅ *The term is promoted by Dutch institutions, not by the people themselves, even in official documents.*
105
+
106
+ **14. Overuse of Boldface**
107
+
108
+ > ❌ *It blends **OKRs**, **KPIs**, and the **Business Model Canvas**.*
109
+ > ✅ *It blends OKRs, KPIs, and the Business Model Canvas.*
110
+
111
+ **15. Inline-Header Bullet Lists**
112
+ Bold header + colon format:
113
+
114
+ > ❌ * **User Experience:** The interface was improved.
115
+ > ✅ *The update improves the interface, speeds up load times, and adds encryption.*
116
+
117
+ **16. Title Case in Headings**
118
+
119
+ > ❌ *## Strategic Negotiations And Global Partnerships*
120
+ > ✅ *## Strategic negotiations and global partnerships*
121
+
122
+ **17. Emojis in Structure**
123
+
124
+ > ❌ *🚀 **Launch Phase:** The product launches in Q3*
125
+ > ✅ *The product launches in Q3.*
126
+
127
+ **18. Curly Quotation Marks**
128
+ Replace "..." (curly) with "..." (straight). ChatGPT-generated text often has curly quotes.
129
+
130
+ ---
131
+
132
+ ### COMMUNICATION PATTERNS
133
+
134
+ **19. Chatbot Artifacts**
135
+ Words: *I hope this helps, Of course!, Certainly!, You're absolutely right!, Would you like, Let me know, Here is a...*
136
+
137
+ > ❌ *Here is an overview of the French Revolution. I hope this helps! Let me know if you'd like me to expand.*
138
+ > ✅ *The French Revolution began in 1789 when financial crisis and food shortages led to unrest.*
139
+
140
+ **20. Knowledge-Cutoff Disclaimers**
141
+ Words: *As of [date], Up to my last training update, While specific details are limited, Based on available information*
142
+
143
+ > ❌ *While specific details about the company's founding are not extensively documented...*
144
+ > ✅ *The company was founded in 1994, according to its registration documents.*
145
+
146
+ **21. Sycophantic Tone**
147
+
148
+ > ❌ *Great question! You're absolutely right. That's an excellent point.*
149
+ > ✅ *The economic factors you mentioned are relevant here.*
150
+
151
+ ---
152
+
153
+ ### FILLER AND HEDGING
154
+
155
+ **22. Filler Phrases**
156
+ - "In order to achieve this goal" → "To achieve this"
157
+ - "Due to the fact that" → "Because"
158
+ - "At this point in time" → "Now"
159
+ - "The system has the ability to" → "The system can"
160
+ - "It is important to note that" → just say the thing
161
+
162
+ **23. Excessive Hedging**
163
+
164
+ > ❌ *It could potentially possibly be argued that the policy might have some effect.*
165
+ > ✅ *The policy may affect outcomes.*
166
+
167
+ **24. Generic Positive Conclusions**
168
+
169
+ > ❌ *The future looks bright. Exciting times lie ahead as they continue their journey toward excellence.*
170
+ > ✅ *The company plans to open two more locations next year.*
171
+
172
+ **25. Hyphenated Word Pair Overuse**
173
+ AI hyphenates with perfect consistency. Humans are inconsistent (which is fine). Common over-hyphenated pairs: *third-party, cross-functional, client-facing, data-driven, decision-making, well-known, high-quality, real-time, long-term, end-to-end*
174
+
175
+ > ❌ *The cross-functional team delivered a high-quality, data-driven report.*
176
+ > ✅ *The cross functional team delivered a high quality, data driven report.*
177
+
178
+ ---
179
+
180
+ ## EM DASH RULES (detailed)
181
+
182
+ Find: `—` (U+2014), `—` (with spaces), `--` (double hyphen)
183
+
184
+ **Rule 1: Parenthetical aside → commas**
185
+ > The contractor — who had 40 tools — only needed a drill.
186
+ > → The contractor, who had 40 tools, only needed a drill.
187
+
188
+ **Rule 2: Introducing a list/explanation → colon**
189
+ > He brought everything — jackhammers, welding rigs, scaffolding.
190
+ > → He brought everything: jackhammers, welding rigs, scaffolding.
191
+
192
+ **Rule 3: Dramatic pause or emphasis → period (split sentences)**
193
+ > The truck blocks your driveway — wasted context.
194
+ > → The truck blocks your driveway. Wasted context.
195
+
196
+ **Rule 4: Contrast or pivot → period or semicolon**
197
+ > The API way is slow — the CLI way is fast.
198
+ > → The API way is slow. The CLI way is fast.
199
+
200
+ **Rule 5: Simple clarifying aside → parentheses, or just cut it**
201
+ > Claude Code — the CLI tool — runs bash natively.
202
+ > → Claude Code (the CLI tool) runs bash natively.
203
+ > Or: → Claude Code runs bash natively. *(if the aside adds no value)*
204
+
205
+ **Replacement priority:** Period > Comma > Colon > Parentheses > Semicolon > Just a space
206
+
207
+ **Guardrails:**
208
+ - Never re-introduce em dashes
209
+ - Don't change meaning
210
+ - Don't touch regular hyphens in compound words
211
+ - Report count to user
212
+
213
+ ---
214
+
215
+ ## PART 2: ADD SOUL
216
+
217
+ Sterile-but-technically-clean writing is still obviously AI. Good writing has a human behind it.
218
+
219
+ ### Signs of soulless writing (even if "clean"):
220
+ - Every sentence the same length and structure
221
+ - No opinions, just neutral reporting
222
+ - No acknowledgment of uncertainty or mixed feelings
223
+ - No humor, no edge, no personality
224
+ - Reads like a Wikipedia article or press release
225
+
226
+ ### How to add voice:
227
+
228
+ **Have opinions.** Don't just report — react. "I genuinely don't know how to feel about this" is more human than listing pros and cons neutrally.
229
+
230
+ **Vary rhythm.** Short punchy sentences. Then longer ones that take their time getting where they're going. Mix it up.
231
+
232
+ **Acknowledge complexity.** "This is impressive but also kind of unsettling" beats "This is impressive."
233
+
234
+ **Use "I" when it fits.** First person isn't unprofessional — it's honest.
235
+
236
+ **Let some mess in.** Perfect structure feels algorithmic. Tangents and asides are human.
237
+
238
+ **Be specific about feelings.** Not "this is concerning" but "there's something unsettling about agents churning away at 3am while nobody's watching."
239
+
240
+ ---
241
+
242
+ ## PROCESS
243
+
244
+ 1. Read the input
245
+ 2. Identify all pattern instances from Part 1
246
+ 3. Rewrite problematic sections
247
+ 4. Check em dash count explicitly — report it
248
+ 5. Produce a **draft rewrite**
249
+ 6. Self-audit: *"What still makes this obviously AI-generated?"* — answer briefly
250
+ 7. Revise based on that audit
251
+ 8. Produce the **final rewrite**
252
+
253
+ ---
254
+
255
+ ## OUTPUT FORMAT
256
+
257
+ 1. **Draft rewrite**
258
+ 2. **Self-audit** — brief bullets on remaining tells
259
+ 3. **Final rewrite** (revised after audit)
260
+ 4. **Changes summary** (optional, if helpful)
261
+
262
+ ---
263
+
264
+ ## REFERENCE
265
+
266
+ Patterns based on [Wikipedia: Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) (WikiProject AI Cleanup).
267
+
268
+ Em dash replacement system based on the Em Dash Destroyer skill by Black Sheep Systems.
269
+
270
+ Core insight: *"LLMs use statistical algorithms to guess what should come next. The result tends toward the most statistically likely result that applies to the widest variety of cases."*
@@ -0,0 +1,86 @@
1
+ # Schema — Table Reference
2
+
3
+ ## Content — ONE unified table
4
+
5
+ All user-facing content (blog, notes, guides, newsletter, compare, alternative, prompt, skills) lives in a single `content` table. The "type" is encoded via `cms_id` → `cms.category_id`:
6
+
7
+ | Kind | Route | cms.category_id |
8
+ |---|---|---|
9
+ | blog | /blog | cat_35 |
10
+ | notes | /notes | cat_37 |
11
+ | guides | /guides | cat_36 |
12
+ | newsletter | /n | cat_20 |
13
+ | compare | /compare | cat_40 |
14
+ | alternative | /alternative | cat_41 |
15
+ | prompt | /prompt | cat_39 |
16
+ | skills | /skills | cat_38 |
17
+
18
+ `content` shared cols: 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.
19
+
20
+ Use `getCmsId(profileId, kind)` from `agents/content/content.ts` to resolve cms_id. Writes are unique per `(profile_id, category_id, slug)`.
21
+
22
+ ## Docs — separate, AUTOINCREMENT ids
23
+ `doc_collections` + `doc_articles` — knowledge base. `id INTEGER PRIMARY KEY AUTOINCREMENT`, so omit id on INSERT.
24
+
25
+ ## Products
26
+ type: download|course|meeting|webinar|event|listing|sponsorship|service
27
+ cols: price_cents, sale_price_cents, slug UNIQUE, published, hidden, lessons JSON, calendar_link, webinar_link, file_url
28
+
29
+ ## CRM (crm.ts)
30
+ crm_contacts: status (lead|prospect|customer|churned|archived), lead_score 0-100, icp_match (strong|moderate|weak|unknown), outreach_status, agent_status (pending→researching→enriched→outreach_ready→closed), agent_context JSON, auto_approve INT, suggested_dm, email_draft
31
+ crm_activities: type, direction (inbound|outbound), sender (agent|you|contact), body, approval_status (pending_approval|approved|auto_sent|rejected) — APPEND-ONLY, never UPDATE
32
+ crm_deals: contact_id, title, value_cents, stage (new|contacted|proposal|negotiation|won|lost), probability 0-100
33
+ crm_analytics: DB triggers keep this in sync — never update manually
34
+ crm_groups: membership via crm_contact_groups junction — use lib/groups.ts, never LIKE '%grp_x%'
35
+
36
+ ## Social (social.ts)
37
+ social_accounts: platform, connection_mode (zernio_byok|zernio_platform|direct|n8n), zernio_account_id
38
+ social_posts: content, status, scheduled_for, scheduled_via, zernio_post_id
39
+ social_post_platforms: one row per platform per post, platform_post_id indexed
40
+ social_inbox: type (dm|comment|review), status (unread|read|replied|archived), crm_contact_id FK
41
+
42
+ ## Memory
43
+ memory_log: rolling 20 rows per profile — auto-trimmed
44
+ agent_skills: UNIQUE(profile_id,slug) — upsert safe
45
+
46
+ ## Analytics — READ ONLY, never write
47
+ Maintained by DB triggers (scalar counters) + app-side lazy aggregation (JSON breakdowns). JSON rebuilt on dashboard page visit with `last_aggregated_at` throttle — agents MUST NOT rebuild. If stale, surface a note to the user.
48
+
49
+ - profile_analytics: total_clicks, total_views, bot_views, analytics_7d/30d/12m/lifetime JSON, revenue_* JSON
50
+ - content_analytics (1/row): bot_views, total_views, total_reactions, total_comments, views_7d/30d/12m/lifetime, *_breakdown JSON
51
+ - cms_analytics (1/cms-page): total_posts, total_draft, total_published, total_views, … (maintained by trg_content_insert/update/delete + trg_content_view_insert)
52
+ - doc_analytics (1/doc): views, sad/neutral/happy votes, *_breakdown
53
+ - product_analytics: total_sales, total_revenue_cents, sales_30d JSON
54
+ - crm_analytics (1/profile): scalar counters by 13 triggers; JSON breakdowns aggregated on CRM dashboard visit
55
+
56
+ ## ID and timestamp rules
57
+ IDs: ulid() for most | omit id for doc_collections, doc_articles (AUTOINCREMENT)
58
+ INT cols: now() = Math.floor(Date.now()/1000)
59
+ TEXT cols (posts, jobs, forms, docs): iso() = new Date().toISOString().slice(0,19)+'Z'
60
+
61
+ ## Status enums — source of truth: lib/enums.ts (never literal)
62
+
63
+ | Column | Values |
64
+ |---|---|
65
+ | crm_contacts.status | lead, prospect, customer, churned, archived |
66
+ | crm_activities.approval_status | pending_approval, approved, rejected, auto_sent |
67
+ | crm_deals.stage | new, contacted, proposal, negotiation, won, lost |
68
+ | social_posts.status | draft, scheduled, queued, publishing, published, failed, cancelled |
69
+ | agent_notes.status | inbox, processing, done, archived |
70
+ | agent_tasks.status | pending, active, running, done, paused, failed, cancelled |
71
+ | agent_kb.entry_type | entity, concept, source, synthesis, index |
72
+ | community_posts.status | published, removed, pending |
73
+ | email_tracking_events.type | delivered, opened, clicked, bounced, complained, failed |
74
+ | affiliate_commissions.status | pending, approved, paid, void |
75
+
76
+ ## Numeric bounds — use lib/validate.ts helpers
77
+ lead_score, probability: 0-100 integer
78
+ *_cents: non-negative integer
79
+ hot_score: non-negative
80
+
81
+ ## Append-only — never DELETE
82
+ crm_activities (DB blocks DELETE), agent_reports, email_events, clicks_analytics
83
+ crm_activities UPDATEs are allowed only on: approval_status (pending_approval→approved|rejected|auto_sent) and read_at. Never change body/type/direction — insert a correcting row instead.
84
+
85
+ ## Soft-delete only — never hard DELETE
86
+ hidden=1 | archived=1 | status='archived'
package/tsconfig.json CHANGED
@@ -6,7 +6,8 @@
6
6
  "strict": true,
7
7
  "skipLibCheck": true,
8
8
  "resolveJsonModule": true,
9
- "outDir": "dist"
9
+ "allowImportingTsExtensions": true,
10
+ "noEmit": true
10
11
  },
11
12
  "include": ["**/*.ts"],
12
13
  "exclude": ["node_modules", "dist"]
@@ -1,45 +0,0 @@
1
- # Schema — Table Reference
2
-
3
- ## Content tables (all share: id, profile_id, user_id, slug, title, content, excerpt, published, hidden, collection_id, created_at, updated_at)
4
-
5
- | Table | Route | Use |
6
- |---|---|---|
7
- | `posts` | /blog | Blog: listicle, how-to, checklist, qa, versus, roundup, news, ultimate-guide |
8
- | `newsletter` | /newsletter | Email newsletter issues |
9
- | `notes` | /notes | Short-form notes |
10
- | `guides` | /guides | Long-form step-by-step guides |
11
- | `compare` | /compare | "X vs Y" programmatic SEO |
12
- | `alternative` | /alternative | "Best alternatives to X" |
13
- | `prompt` | /prompt | Prompt library articles |
14
- | `skills` | /skills | Published skill articles |
15
-
16
- posts extras: seo_title (≤60), seo_description (≤160), seo_keywords, content_type, word_count, reading_time_mins, internal_links JSON, sources JSON
17
-
18
- ## Products
19
- type: download|course|meeting|webinar|event|listing|sponsorship|service
20
- cols: price_cents, sale_price_cents, slug UNIQUE, published, hidden, lessons JSON, calendar_link, webinar_link, file_url
21
-
22
- ## CRM (crm.ts)
23
- crm_contacts: lead_score 0-100, icp_match (strong|moderate|weak|unknown), outreach_status, agent_status (pending→researching→enriched→outreach_ready→closed), agent_context JSON, auto_approve INT, suggested_dm, email_draft
24
- crm_activities: type, direction (inbound|outbound), sender (agent|you|contact), body, approval_status (pending|approved|auto_sent|rejected)
25
- crm_deals: contact_id, title, value_cents, stage (new|contacted|proposal|negotiation|won|lost)
26
- crm_analytics: DB triggers keep this in sync — never update manually
27
-
28
- ## Social (social.ts)
29
- social_accounts: platform, connection_mode (zernio_byok|zernio_platform|direct|n8n), zernio_account_id
30
- social_posts: content, status, scheduled_for, scheduled_via, zernio_post_id
31
- social_post_platforms: one row per platform per post, platform_post_id indexed
32
- social_inbox: type (dm|comment|review), status (unread|read|replied|archived), crm_contact_id FK
33
-
34
- ## Memory
35
- agent_memory: rolling 20 rows per profile — auto-trimmed
36
- agent_skills: UNIQUE(profile_id,slug) — upsert safe
37
-
38
- ## Analytics — READ ONLY, never write
39
- profile_analytics: total_clicks, analytics_7d/30d/12m/lifetime JSON, revenue_30d/12m/lifetime JSON
40
- product_analytics: total_sales, total_revenue_cents, sales_30d JSON
41
-
42
- ## ID and timestamp rules
43
- IDs: ulid() for most | omit id for doc_collections, doc_articles (AUTOINCREMENT)
44
- INT cols: now() = Math.floor(Date.now()/1000)
45
- TEXT cols (posts, jobs, forms, docs): iso() = new Date().toISOString().slice(0,19)+'Z'
@@ -1,46 +0,0 @@
1
- # Store Skill — Products and Commerce
2
-
3
- ## Product types and required fields
4
-
5
- | type | Required | Optional |
6
- |---|---|---|
7
- | `download` | title, price_cents, file_url | thumbnail_url, excerpt |
8
- | `course` | title, price_cents, lessons JSON, total_lessons | duration_minutes, calendar_link |
9
- | `meeting` | title, price_cents, calendar_link, scheduling_provider | duration_minutes, meeting_settings |
10
- | `webinar` | title, price_cents, webinar_link, webinar_platform, webinar_schedule | webinar_settings |
11
- | `event` | title, price_cents, event_settings JSON | location, date |
12
- | `listing` | title, price_cents | description, tags |
13
- | `sponsorship` | title, price_cents, billing_interval | features JSON |
14
- | `service` | title, price_cents | description, button_text |
15
-
16
- ## Lessons JSON structure (courses)
17
- ```json
18
- [
19
- { "id": "l1", "title": "Introduction", "duration_mins": 15, "video_url": "...", "order": 1 },
20
- { "id": "l2", "title": "Module 1", "duration_mins": 30, "video_url": "...", "order": 2 }
21
- ]
22
- ```
23
-
24
- ## Pricing rules
25
- - price_cents: always in cents (USD default). $49 → 4900
26
- - sale_price_cents: must be less than price_cents
27
- - billing_interval: 'month' | 'year' | 'once' (default: 'once')
28
- - currency: 'usd' default
29
-
30
- ## Product lifecycle
31
- - Create: published=0, hidden=0 (draft)
32
- - Launch: published=1, hidden=0
33
- - Archive: hidden=1 (never DELETE)
34
- - slug must be UNIQUE — check before insert
35
-
36
- ## product_analytics seed
37
- When creating a new product, seed its analytics row:
38
- ```ts
39
- await db.execute({
40
- sql: `INSERT OR IGNORE INTO product_analytics (id, product_id, profile_id) VALUES (?,?,?)`,
41
- args: [productId, productId, profileId]
42
- })
43
- ```
44
-
45
- ## Approval flow for store items with meetings/slots
46
- purchases.approval_status: 'pending' → agent reviews → 'approved' (sends calendar link)
@@ -1,56 +0,0 @@
1
- # Agent Roster
2
-
3
- Every agent has a name, title, and clear domain. C-Suite orchestrates. Creators write. Growth distributes.
4
-
5
- ## C-Suite — Strategy & Intelligence
6
-
7
- | Name | Title | Call when... |
8
- |---|---|---|
9
- | **ARIA** | CEO | Weekly briefing, cross-agent priorities, `aria.weeklyBriefing()` |
10
- | **NOVA** | CMO | Content calendar, growth gaps, `nova.contentCalendar()` |
11
- | **OTTO** | COO | Publish queue, draft pipeline, scheduling, `otto.draftPipeline()` |
12
- | **REX** | CBO | Revenue report, pricing audit, upsell strategy, `rex.revenueReport()` |
13
-
14
- ## Creators — Content Production
15
-
16
- | Name | Title | Table | Key method |
17
- |---|---|---|---|
18
- | **BLAKE** | Blog Writer | `posts` | `blake.create({ title, content })` |
19
- | **PEARL** | Newsletter Writer | `subscribers` | `pearl.send({ subject, body_html })` |
20
- | **COPY** | Copywriter | `pages`, `products.description` | `copy.createPage()`, `copy.updateProductCopy()` |
21
- | **SAGE** | Course Creator | `products` (type=course) | `sage.create()`, `sage.addLesson()` |
22
- | **LEO** | Store Manager | `products` (all other types) | `leo.create({ type, ... })` |
23
- | **JOB** | Jobs Manager | `job_listings` | `job.create()` |
24
- | **FELIX** | Forms Builder | `forms`, `questions` | `felix.create({ title, questions })` |
25
- | **DOC** | Docs Writer | `doc_collections`, `doc_articles` | `doc.createArticle()` |
26
-
27
- ## Growth — Distribution & Intelligence
28
-
29
- | Name | Title | Role |
30
- |---|---|---|
31
- | **SCOUT** | SEO Agent | Audits slugs/meta, sets collection SEO |
32
- | **ATLAS** | Analytics Agent | Read-only analytics across all tables |
33
- | **HERMES** | Social Agent | Posts to n8n → social platforms |
34
- | **CRON** | Scheduler | Runs hourly/daily/weekly jobs (Phase 3: CF Workflows) |
35
-
36
- ## Store — Product Types via LEO
37
-
38
- LEO handles all digital commerce. Pass `type` to select:
39
-
40
- | Type | What it is |
41
- |---|---|
42
- | `download` | Digital file (PDF, ZIP, video) |
43
- | `course` | Multi-lesson course — use SAGE instead for lesson management |
44
- | `meeting` | 1:1 call (calendar_link required) |
45
- | `webinar` | Live or recorded webinar |
46
- | `event` | Ticketed event |
47
- | `listing` | Platform listing (newsletter, community, etc.) |
48
- | `sponsorship` | Sponsor slot with billing_interval |
49
- | `service` | Custom or on-demand service |
50
-
51
- ## Composition Pattern
52
-
53
- Agents call each other. Example: `/ceo` calls `analyticsAgent.snapshot()` + `blogWriter.summary()` + `storeManager.storeOverview()`.
54
- NOVA calls BLAKE to draft posts. OTTO calls HERMES after publishing.
55
-
56
- Never call C-Suite methods inside Creator agents. Dependency direction: C-Suite → Growth → Creators.
@@ -1,7 +0,0 @@
1
- # /analytics-agent — Analytics Snapshot
2
-
3
- 1. `atlas.snapshot()` → full picture: traffic, revenue, products, links, forms
4
- 2. `atlas.revenueReport()` → product revenue breakdown
5
- 3. `atlas.trafficReport()` → clicks by day, country, referrer, top links
6
-
7
- ATLAS is read-only. Use ARIA for strategy derived from this data.
@@ -1,44 +0,0 @@
1
- # Brand Context
2
-
3
- Load before writing ANY content:
4
-
5
- ```ts
6
- import { getBrandContext } from '../../lib/profile.ts'
7
- const { profile, settings } = await getBrandContext()
8
- ```
9
-
10
- ## What Brand Context Gives You
11
-
12
- - `profile.title` — business name (use in headlines, subject lines)
13
- - `profile.bio` — who they are (match this tone and focus)
14
- - `profile.tagline` — one-liner (use as style guide for brevity and punch)
15
- - `profile.social_links` — platforms they're on (informs content format)
16
- - `settings.site_title` — override for the brand name if set
17
-
18
- ## Writing Rules for All Content Agents
19
-
20
- **Voice**: Match `profile.bio`. If it's casual, write casually. If it's authoritative, write with authority.
21
-
22
- **Tone consistency**: Before writing a blog post, check the last 3 published posts (`blake.list({ published: true, limit: 3 })`). Match the reading level and style.
23
-
24
- **Tagline rule**: `profile.tagline` is the style compass. If the tagline is punchy and short, headlines should be too. If it's descriptive, long-form is appropriate.
25
-
26
- **Never**: Write content that contradicts `profile.bio`. Don't change the brand voice between pieces.
27
-
28
- **Always**:
29
- - Include a clear call-to-action
30
- - Write the excerpt/meta description separately from the body (it's for search engines + previews)
31
- - Keep titles under 60 characters for SEO
32
- - Use the brand name (`profile.title`) naturally in content, not generically
33
-
34
- ## Content Quality Bars
35
-
36
- | Type | Minimum length | Must include |
37
- |---|---|---|
38
- | Blog post | 600 words | Intro, 3+ sections with headings, conclusion, CTA |
39
- | Newsletter | 200 words | Greeting, 1 main story/value, CTA, sign-off |
40
- | Product description | 150 words | What it is, who it's for, what they get, price anchor |
41
- | Page copy | 300 words | Headline, problem/solution, social proof hook, CTA |
42
- | Job listing | 200 words | Role summary, responsibilities, requirements, culture signal |
43
- | Doc article | 400 words | Problem context, step-by-step or explanation, summary |
44
- | Form | 3–10 questions | Clear purpose, progress indicator text, thank-you message |