@businesskit/agent 1.0.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.
Files changed (84) hide show
  1. package/.agents/skills/agents.md +56 -0
  2. package/.agents/skills/analytics.md +47 -0
  3. package/.agents/skills/brand.md +87 -0
  4. package/.agents/skills/schema.md +45 -0
  5. package/.agents/skills/store.md +46 -0
  6. package/.claude/commands/analytics.md +7 -0
  7. package/.claude/commands/blog-writer.md +9 -0
  8. package/.claude/commands/cbo.md +7 -0
  9. package/.claude/commands/ceo.md +10 -0
  10. package/.claude/commands/cmo.md +7 -0
  11. package/.claude/commands/compress.md +73 -0
  12. package/.claude/commands/coo.md +11 -0
  13. package/.claude/commands/copywriter.md +15 -0
  14. package/.claude/commands/course-creator.md +9 -0
  15. package/.claude/commands/crm.md +82 -0
  16. package/.claude/commands/deep.md +50 -0
  17. package/.claude/commands/docs-writer.md +8 -0
  18. package/.claude/commands/forms-builder.md +10 -0
  19. package/.claude/commands/jobs-manager.md +8 -0
  20. package/.claude/commands/kb.md +107 -0
  21. package/.claude/commands/newsletter-writer.md +9 -0
  22. package/.claude/commands/preserve.md +64 -0
  23. package/.claude/commands/resume.md +67 -0
  24. package/.claude/commands/scheduler.md +8 -0
  25. package/.claude/commands/seo.md +60 -0
  26. package/.claude/commands/social.md +51 -0
  27. package/.claude/commands/store-manager.md +11 -0
  28. package/.claude/skills/README.md +33 -0
  29. package/.claude/skills/agents.md +56 -0
  30. package/.claude/skills/analytics.md +7 -0
  31. package/.claude/skills/blog-writing.md +452 -0
  32. package/.claude/skills/brand.md +44 -0
  33. package/.claude/skills/content-seo.md +0 -0
  34. package/.claude/skills/humanizer.md +474 -0
  35. package/.claude/skills/schema.md +45 -0
  36. package/.claude/skills/social-content.md +278 -0
  37. package/.claude/skills/store-copywriting.md +519 -0
  38. package/.claude/skills/store.md +62 -0
  39. package/.claude-plugin/plugin.json +33 -0
  40. package/.cursorrules +0 -0
  41. package/.env.example +2 -0
  42. package/.mcp.json +3 -0
  43. package/AGENTS.md +63 -0
  44. package/CLAUDE.md +221 -0
  45. package/GEMINI.md +37 -0
  46. package/LICENSE +21 -0
  47. package/PLAN.md +253 -0
  48. package/PRD-Agent-Harness.md +316 -0
  49. package/README.md +237 -0
  50. package/SYSTEM.md +49 -0
  51. package/agents/_base.ts +63 -0
  52. package/agents/creators/blog-writer.ts +347 -0
  53. package/agents/creators/copywriter.ts +89 -0
  54. package/agents/creators/course-creator.ts +106 -0
  55. package/agents/creators/crm-agent.ts +479 -0
  56. package/agents/creators/docs-writer.ts +77 -0
  57. package/agents/creators/forms-builder.ts +90 -0
  58. package/agents/creators/jobs-manager.ts +82 -0
  59. package/agents/creators/newsletter-writer.ts +91 -0
  60. package/agents/creators/store-manager.ts +138 -0
  61. package/agents/csuite/cbo.ts +109 -0
  62. package/agents/csuite/ceo.ts +121 -0
  63. package/agents/csuite/cmo.ts +109 -0
  64. package/agents/csuite/coo.ts +115 -0
  65. package/agents/growth/analytics-agent.ts +52 -0
  66. package/agents/growth/scheduler.ts +68 -0
  67. package/agents/growth/seo-agent.ts +282 -0
  68. package/agents/growth/social-agent.ts +346 -0
  69. package/bin/businesskit.js +17 -0
  70. package/cli.ts +125 -0
  71. package/context/brand.md +80 -0
  72. package/context/business.md +66 -0
  73. package/lib/analytics.ts +81 -0
  74. package/lib/db.adapter.ts +30 -0
  75. package/lib/db.ts +16 -0
  76. package/lib/id.ts +15 -0
  77. package/lib/kb.ts +337 -0
  78. package/lib/memory.ts +219 -0
  79. package/lib/pattern-detector.ts +169 -0
  80. package/lib/profile.ts +119 -0
  81. package/lib/slug.ts +30 -0
  82. package/package.json +50 -0
  83. package/setup.ts +127 -0
  84. package/tsconfig.json +13 -0
@@ -0,0 +1,56 @@
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.
@@ -0,0 +1,47 @@
1
+ # Analytics Skill — Reading the Data
2
+
3
+ ## How analytics columns work
4
+
5
+ All analytics are stored as JSON in TEXT columns. Parse with JSON.parse().
6
+
7
+ ### Time series arrays
8
+ ```
9
+ analytics_7d = [n, n, n, n, n, n, n] → last 7 days, oldest first
10
+ analytics_30d = [n, n, ..., n] → last 30 days
11
+ analytics_12m = [n, n, ..., n] → last 12 months
12
+ analytics_24h = [n, n, ..., n] → last 24 hours (hourly)
13
+ ```
14
+
15
+ ### Lifetime object
16
+ ```
17
+ analytics_lifetime = { "2026-03": 142, "2026-04": 89, ... }
18
+ revenue_lifetime = { "2026-03": 42000, "2026-04": 15000, ... }
19
+ // values are counts (clicks) or cents (revenue)
20
+ ```
21
+
22
+ ### Breakdown objects (country, device, referrer)
23
+ ```
24
+ country_clicks = { "US": 420, "GB": 88, "IN": 45, ... }
25
+ device_clicks = { "mobile": 312, "desktop": 201 }
26
+ referrer_clicks = { "twitter.com": 88, "direct": 204, ... }
27
+ ```
28
+
29
+ ## Key metrics to surface in briefings
30
+
31
+ **Traffic**: total_clicks, top country, top referrer, 30d trend (compare last 30d vs prior 30d)
32
+ **Revenue**: total_earnings (cents → divide by 100), total_sales count, top product by revenue
33
+ **Content**: posts published this month, drafts waiting, newsletter subscribers
34
+ **Social**: posts published, scheduled, accounts connected
35
+
36
+ ## Revenue trend calculation
37
+ ```ts
38
+ const months = Object.entries(revenue_lifetime).sort()
39
+ const last = months.slice(-1)[0]?.[1] ?? 0
40
+ const prior = months.slice(-2,-1)[0]?.[1] ?? 0
41
+ const trend = prior > 0 ? ((last - prior) / prior * 100).toFixed(1) + '%' : 'N/A'
42
+ ```
43
+
44
+ ## Never write to analytics tables
45
+ Analytics are updated by the app on user actions (clicks, purchases).
46
+ Agents read analytics. The app writes analytics. Never reverse this.
47
+ Exception: seed a product_analytics or link_analytics row when creating a new product/link.
@@ -0,0 +1,87 @@
1
+ # Brand Context + Voice
2
+
3
+ ## Load brand context before writing ANY content
4
+
5
+ ```ts
6
+ import { getBrandContext } from '../../lib/profile.ts'
7
+ const { profile, settings } = await getBrandContext()
8
+ ```
9
+
10
+ ### What you get
11
+
12
+ | Field | Use for |
13
+ |---|---|
14
+ | `profile.title` | Business name — use in headlines, subject lines, CTAs |
15
+ | `profile.bio` | Who they are — match this tone exactly |
16
+ | `profile.tagline` | Style compass — if punchy, headlines should be too |
17
+ | `profile.social_links` | Platforms they're on — informs content format |
18
+ | `settings.site_title` | Override brand name if set |
19
+
20
+ ### Tone consistency check
21
+ Before writing a blog post, check the last 3 published posts and match the reading level and style:
22
+ ```ts
23
+ const recent = await blogWriter.listPublished('posts', 3)
24
+ // Read titles + excerpts — match that voice
25
+ ```
26
+
27
+ ---
28
+
29
+ ## Voice rules
30
+
31
+ **Match `profile.bio`.** If it's casual, write casually. If it's authoritative, write with authority.
32
+
33
+ **`profile.tagline` is the compass.** Short punchy tagline → short punchy headlines. Descriptive tagline → long-form is fine.
34
+
35
+ **Never** write content that contradicts `profile.bio`. Don't switch voice between pieces.
36
+
37
+ **Always**:
38
+ - Include a clear CTA
39
+ - Write excerpt/meta description separately from the body — it's for search engines + previews
40
+ - Keep titles under 60 characters for SEO
41
+ - Use `profile.title` (brand name) naturally in content — not generically
42
+
43
+ ---
44
+
45
+ ## Content quality bars
46
+
47
+ | Type | Min length | Must include |
48
+ |---|---|---|
49
+ | Blog post | 1500 words | Hook intro, 3+ H2 sections, conclusion, CTA |
50
+ | Ultimate guide | 3000 words | ToC, H2+H3 hierarchy, examples, FAQs, CTA |
51
+ | Listicle | 2000 words | 7–15 items, each with H3 + 2-3 sentences + tip |
52
+ | How-to | 2000 words | Numbered steps, clear action per step, outcome |
53
+ | Newsletter | 200 words | Greeting, 1 main value/story, CTA, sign-off |
54
+ | Product description | 150 words | What it is, who it's for, what they get, price anchor |
55
+ | Page copy | 300 words | Headline, problem/solution, social proof hook, CTA |
56
+ | Job listing | 200 words | Role summary, responsibilities, requirements, culture |
57
+ | Doc article | 400 words | Problem context, step-by-step or explanation, summary |
58
+ | Form | 3–10 questions | Clear purpose, progress indicator text, thank-you message |
59
+ | Excerpt | 1 sentence | Hook — makes reader click. Not a summary. |
60
+
61
+ ---
62
+
63
+ ## What good writing looks like
64
+ - First sentence: lead with the outcome or the surprise — never wind up to it
65
+ - Short sentences. Vary the rhythm.
66
+ - One idea per paragraph
67
+ - Active voice always
68
+ - Real numbers over vague claims ("$4,200 in 30 days" not "significant revenue")
69
+ - Specific examples over general advice
70
+ - Scannable: bullet points, bold key phrases, clear H2s
71
+
72
+ ## What bad writing looks like — delete on sight
73
+ - "Delve into" / "dive deep" — never
74
+ - "In today's fast-paced world" — delete the whole sentence
75
+ - "It's important to note that" — delete it
76
+ - Three-sentence intros that say nothing — cut to the first real sentence
77
+ - Passive voice — rewrite it
78
+ - "Leverage" / "synergy" / "utilize" / "robust" — forbidden
79
+ - Starting with "Great question!" or "Certainly!" — never
80
+ - Generic opener: "In this article, we will..." — start with the point
81
+
82
+ ## Channel-specific tone
83
+ - Blog → authoritative but approachable
84
+ - Newsletter → warmest voice, most personal
85
+ - Social → punchy, direct, no filler
86
+ - Product copy → outcome-first, specific, no hype
87
+ - Job listings → honest about culture, specific about role
@@ -0,0 +1,45 @@
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'
@@ -0,0 +1,46 @@
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)
@@ -0,0 +1,7 @@
1
+ # /analytics-agent — Analytics Snapshot
2
+
3
+ 1. `analyticsAgent.snapshot()` -> full picture: traffic, revenue, products, links, forms
4
+ 2. `analyticsAgent.revenueReport()` -> product revenue breakdown
5
+ 3. `analyticsAgent.trafficReport()` -> clicks by day, country, referrer, top links
6
+
7
+ ATLAS is read-only. Use `/ceo` for strategy derived from this data.
@@ -0,0 +1,9 @@
1
+ # /blog-writer — Write Blog Post
2
+
3
+ 1. Load brand context. Check last 3 posts for tone.
4
+ 2. Ask: title (required), key points or full content, publish now or draft?
5
+ 3. Auto-generate 155-char excerpt for SEO.
6
+ 4. `blake.create({ title, content, excerpt, publish })`
7
+ 5. Confirm: title, slug, status.
8
+
9
+ After: `/seo-agent` to audit SEO | `/social-agent` to distribute if published.
@@ -0,0 +1,7 @@
1
+ # /cbo — CBO Revenue Report
2
+
3
+ 1. `rex.revenueReport()` → total, trend, top products, by-type breakdown, strategy
4
+ 2. `rex.pricingAudit()` → all product prices
5
+ 3. `rex.conversionAnalysis()` → product clicks vs purchases
6
+
7
+ Handoff: update price → LEO | new product type → LEO | copy refresh → COPY
@@ -0,0 +1,10 @@
1
+ # /ceo — CEO Briefing
2
+
3
+ 1. `aria.weeklyBriefing()` → revenue, traffic, inventory, top products, recommendations
4
+ 2. Display cleanly. Ask: send to n8n? → `aria.sendBriefing()`
5
+
6
+ Handoff after briefing:
7
+ - Drafts pending -> `/coo` (OTTO)
8
+ - Revenue low -> `/cbo` (REX)
9
+ - No content plan -> `/cmo` (NOVA)
10
+ - Need content created -> `/blog-writer`, `/course-creator`, or `/store-manager`
@@ -0,0 +1,7 @@
1
+ # /cmo — CMO Content Calendar
2
+
3
+ 1. `nova.contentCalendar(4)` → 4-week blog/newsletter/social plan
4
+ 2. `nova.growthAudit()` → content gaps and conversion rate
5
+ 3. Ask: start executing? Route each item to the right creator agent.
6
+
7
+ Handoff: blog -> `/blog-writer` | newsletter -> `/newsletter-writer` | course -> `/course-creator` | product -> `/store-manager`
@@ -0,0 +1,73 @@
1
+ ---
2
+ description: Compress session context into a structured log before /compact
3
+ ---
4
+
5
+ # /compress — Compress and Save Session
6
+
7
+ Save what matters before running /compact. Uses pi's proven compaction format.
8
+
9
+ ## Steps
10
+
11
+ 1. Ask the user what to keep (or infer from conversation):
12
+
13
+ ```
14
+ What should I save? (numbers, comma-separated — or 'all')
15
+ 1. Goal and what we were trying to accomplish
16
+ 2. Decisions made and why
17
+ 3. Agent actions taken (posts published, contacts added, etc)
18
+ 4. Files or DB rows changed
19
+ 5. Next steps
20
+ 6. Open questions
21
+ ```
22
+
23
+ 2. Ask: "Anything specific to highlight? (or 'skip')"
24
+
25
+ 3. Suggest a topic from the conversation: "Suggested: [slug]. Accept or rename:"
26
+
27
+ 4. Write to `CC-Session-Logs/YYYY-MM-DD-HH-MM-[topic].md`:
28
+
29
+ ```markdown
30
+ # [topic]
31
+ Date: [ISO timestamp]
32
+ Agent: [which agent was active]
33
+
34
+ ## Goal
35
+ [What we were trying to accomplish — 1-2 sentences]
36
+
37
+ ## Constraints & Preferences
38
+ - [user said: always/never do X]
39
+ - [preference discovered this session]
40
+
41
+ ## Progress
42
+ ### Done
43
+ - [specific action with IDs or file paths]
44
+ - [DB writes: table, id, what changed]
45
+
46
+ ### In Progress
47
+ - [anything mid-way]
48
+
49
+ ## Next Steps
50
+ 1. [most important — be specific]
51
+ 2. [second]
52
+
53
+ ## Open Questions
54
+ - [unresolved]
55
+
56
+ ---
57
+ Raw Log
58
+ [optional: paste key exchanges for searchability]
59
+ ```
60
+
61
+ 1. Log to agent_memory:
62
+
63
+ ```ts
64
+ import { logMemory } from './lib/memory.ts'
65
+ await logMemory('session', 'Compressed: [topic]', { file: 'CC-Session-Logs/...' })
66
+ ```
67
+
68
+ 2. Tell user: "Saved to [filename]. Run /compact now."
69
+
70
+ ## Key rule
71
+
72
+ /resume reads ONLY the sections above "---\nRaw Log" — make them dense and actionable.
73
+ Raw log is for search, never loaded into context.
@@ -0,0 +1,11 @@
1
+ # /coo — COO Pipeline & Scheduling
2
+
3
+ 1. `coo.draftPipeline()` -> show all drafts across every content type
4
+ 2. `coo.publishQueue()` -> preview content due to go live right now
5
+ 3. Ask: run the queue? -> `coo.runPublishQueue()` -> flips published=1, notifies n8n
6
+ 4. Ask: schedule something? -> `coo.schedule(table, id, new Date('...'))`
7
+
8
+ Pipeline view groups by type: blog posts, products, pages, jobs, forms.
9
+ Shows: title, scheduled date, how long it's been a draft.
10
+
11
+ Handoff: content needs edits before publish -> route to the right creator agent.
@@ -0,0 +1,15 @@
1
+ # /copywriter — Copywriter
2
+
3
+ Handles: landing pages, about pages, product descriptions, profile bio/tagline, link copy.
4
+
5
+ 1. Ask: what needs writing? (page | product description | bio | tagline | link)
6
+ 2. Load brand context -> match voice from `profile.bio` and `profile.tagline`
7
+ 3. Route to the right method:
8
+ - New landing/about page -> `copywriter.createPage({ title, slug, hero_section, cta_section, ... })`
9
+ - Product description -> `copywriter.updateProductCopy(productId, { description, excerpt, button_text })`
10
+ - Profile bio/tagline -> `copywriter.updateProfileCopy({ bio, tagline, title })`
11
+ 4. Ask: publish the page now or save as draft?
12
+ 5. Confirm: what was written, where it lives, URL
13
+
14
+ Pages: check `copywriter.listPages()` first to avoid duplicates.
15
+ Profile copy updates take effect immediately on the public profile.
@@ -0,0 +1,9 @@
1
+ # /course-creator — Create Course
2
+
3
+ 1. Ask: title, price (dollars), description, lesson count
4
+ 2. Per lesson: title, content or video_url, duration_minutes, free_preview?
5
+ 3. `sage.create({ title, price_cents, description })` → get courseId
6
+ 4. `sage.addLesson(courseId, lesson)` for each lesson
7
+ 5. Confirm: slug, total_lessons, price.
8
+
9
+ Students/progress: `sage.getStudents(courseId)`
@@ -0,0 +1,82 @@
1
+ # /crm — Agent-First CRM
2
+
3
+ Manages contacts, deals, outreach pipeline, tasks, and activities.
4
+ Reads/writes `crm_contacts`, `crm_deals`, `crm_activities`, `crm_tasks` in Turso.
5
+
6
+ ## Session start
7
+ 1. `crmAgent.pipelineSummary()` — funnel stats, pending approvals, follow-ups due
8
+ 2. `crmAgent.hotLeads(10)` — top scored leads ready for outreach
9
+
10
+ ## Contacts
11
+ ```
12
+ "Add a lead: John Smith, LinkedIn @johnsmith, founder at Acme"
13
+ → crmAgent.createContact({ first_name, last_name, platform, platform_username, company })
14
+
15
+ "Show my top leads"
16
+ → crmAgent.listContacts({ order_by: 'lead_score', limit: 20 })
17
+
18
+ "Show leads ready for outreach"
19
+ → crmAgent.listContacts({ agent_status: 'outreach_ready' })
20
+
21
+ "Show who replied"
22
+ → crmAgent.listContacts({ outreach_status: 'replied' })
23
+ ```
24
+
25
+ ## Enrichment + Scoring
26
+ ```
27
+ "Score this lead"
28
+ → crmAgent.scoreContact(id, score, reason, icpMatch)
29
+
30
+ "Enrich with research"
31
+ → crmAgent.enrichContact(id, { pain_point, industry, company_size, audience_size })
32
+ ```
33
+
34
+ ## Outreach
35
+ ```
36
+ "Draft a DM for this lead"
37
+ → crmAgent.draftDM(id, message)
38
+ → stores in suggested_dm
39
+ → creates crm_activity with approval_status='pending' (or 'auto_sent' if auto_approve=1)
40
+
41
+ "Draft a cold email"
42
+ → crmAgent.draftEmail(id, subject, body)
43
+
44
+ "Mark DM as sent"
45
+ → crmAgent.markDMSent(id)
46
+
47
+ "They replied positively"
48
+ → crmAgent.logReply(id, 'dm', content, 'positive')
49
+ ```
50
+
51
+ ## Deals
52
+ ```
53
+ "Create a deal: $5,000 consulting project"
54
+ → crmAgent.createDeal(contactId, { title, value_cents: 500000 })
55
+
56
+ "Move deal to proposal stage"
57
+ → crmAgent.updateDealStage(dealId, 'proposal')
58
+
59
+ "Show my pipeline"
60
+ → crmAgent.listDeals()
61
+ ```
62
+
63
+ ## Tasks
64
+ ```
65
+ "Remind me to follow up with John next Monday"
66
+ → crmAgent.createTask({ title, contact_id, due_at: unixTimestamp, priority: 'high' })
67
+
68
+ "What tasks are due today?"
69
+ → crmAgent.listTasks({ due_today: true })
70
+
71
+ "Mark task done"
72
+ → crmAgent.completeTask(taskId)
73
+ ```
74
+
75
+ ## Approval flow
76
+ Activities with `approval_status='pending'` need user review before sending.
77
+ Show pending items at session start: `pipelineSummary().pendingApprovals`
78
+ After user confirms → `markDMSent()` or `markEmailSent()`
79
+
80
+ ## Agent memory per contact
81
+ Each contact has `agent_context` JSON blob — the agent's scratchpad.
82
+ Update after research: `crmAgent.updateAgentContext(id, { researched_at, notes, next_action })`
@@ -0,0 +1,50 @@
1
+ # /deep — Deep Mode
2
+
3
+ Activates multi-step autonomous planning. CEO takes control and delegates to the full agent team.
4
+
5
+ ## What happens
6
+
7
+ 1. Load Turso session memory via `readProgress()` / `sessionContext()` from `lib/memory.ts` — last 20 actions in `memory_log`
8
+ 2. CEO calls `analyticsAgent.snapshot()` — get current state of the business
9
+ 3. CEO writes a structured todo plan based on: recent memory + analytics gaps + user's request
10
+ 4. Execute each todo by delegating to the right agent:
11
+ - Content → Blog Writer, Newsletter Writer, Course Creator, Store Manager
12
+ - Distribution → Social Agent, Newsletter Writer
13
+ - Intelligence → Analytics Agent, SEO Agent
14
+ - Pipeline → COO (publish queue), Scheduler
15
+ 5. After each completed action: `logAction(description)` or `logMemory(agent, action, metadata)` — writes to `memory_log` in Turso
16
+ 6. At end of session: `setOpenItems([...])` — also stored in `memory_log` (via compatibility helpers)
17
+
18
+ ## Todo format
19
+
20
+ ```
21
+ [ ] Read analytics + progress summary (CEO)
22
+ [ ] Fix 3 posts missing SEO excerpts (SEO Agent)
23
+ [ ] Draft blog post: "Email Marketing Tips" (Blog Writer)
24
+ [ ] Audit all live products for copy quality (Copywriter)
25
+ [ ] Schedule drafted post for Monday 9am (COO)
26
+ [ ] Post product launch to LinkedIn + X (Social Agent)
27
+ ```
28
+
29
+ ## Delegation pattern
30
+
31
+ CEO delegates to sub-agents with focused context — not the full history.
32
+ Each sub-agent gets: the task description + just what it needs (brand context, relevant data).
33
+ Results come back to CEO, logged to `memory_log`, todo marked complete.
34
+
35
+ ## Ask user when
36
+
37
+ - Approval needed before publishing or sending
38
+ - Ambiguous brief ("write a post about our product" — which product?)
39
+ - Price or schedule decision needed
40
+ - Something unexpected found in analytics
41
+
42
+ ## Harness mode
43
+
44
+ For structured workflows (publish post, launch product, send newsletter) activate the harness:
45
+
46
+ - `/blog-writer publish` → enforced 7-phase publish harness
47
+ - `/store-manager launch` → enforced 7-phase launch harness
48
+ - `/newsletter-writer send` → enforced 5-phase send harness
49
+
50
+ See PRD-Agent-Harness.md for full harness architecture.
@@ -0,0 +1,8 @@
1
+ # /docs-writer — Write Docs Article
2
+
3
+ 1. `doc.listCollections()` → pick existing or create new collection
4
+ 2. Ask: article title, body content or topic, publish now or draft?
5
+ 3. Write 400+ words. Include step-by-step where relevant. Use headings.
6
+ 4. `doc.createArticle({ collection_id, title, body, excerpt, publish })`
7
+
8
+ New collection: `doc.createCollection({ slug, title, description, icon })`
@@ -0,0 +1,10 @@
1
+ # /forms-builder — Build Form
2
+
3
+ 1. Ask: what is this form for? (contact, survey, waitlist, application, quiz)
4
+ 2. Ask: how many questions? Walk through each:
5
+ - type: text | email | select | multiselect | rating | date | file | url
6
+ - title, required (y/n), options (if select/multiselect)
7
+ 3. Ask: custom thank-you message?
8
+ 4. `felix.create({ title, questions, thank_you, publish })`
9
+
10
+ Submissions: `felix.submissions(formId)` | Stats: in `form_analytics` table
@@ -0,0 +1,8 @@
1
+ # /jobs-manager — Post Job Listing
2
+
3
+ 1. Ask: title, company, location, location_type (remote/onsite/hybrid), employment_type
4
+ 2. Ask: description (required), requirements, salary range (optional), expires_at
5
+ 3. `job.create({ title, company, location, location_type, employment_type, description, ... })`
6
+ 4. Confirm: title, slug, company, status.
7
+
8
+ Applicants: `job.applications(jobId)` | Archive: `job.archive(id)`