@businesskit/agent 1.0.4 → 1.0.7

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 (190) 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 +62 -0
  5. package/AGENTS.md +105 -63
  6. package/CLAUDE.md +11 -84
  7. package/GEMINI.md +11 -34
  8. package/README.md +95 -154
  9. package/assets/logo.svg +3 -0
  10. package/bin/businesskit.js +45 -18
  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/brief.md +12 -0
  15. package/commands/capabilities.md +33 -0
  16. package/commands/chase.md +12 -0
  17. package/commands/check-stock.md +43 -0
  18. package/commands/create-component.md +109 -0
  19. package/commands/create-invoice.md +69 -0
  20. package/commands/create-new-bill.md +65 -0
  21. package/commands/create-page.md +124 -0
  22. package/commands/crm.md +13 -0
  23. package/commands/followups.md +13 -0
  24. package/commands/list-components.md +41 -0
  25. package/commands/list-content.md +46 -0
  26. package/commands/list-pages.md +45 -0
  27. package/commands/pipeline.md +13 -0
  28. package/commands/publish-page.md +64 -0
  29. package/commands/send-invoice.md +42 -0
  30. package/commands/seo-audit.md +36 -0
  31. package/commands/update-agent.md +33 -0
  32. package/commands/update-contact.md +46 -0
  33. package/commands/update-content.md +48 -0
  34. package/commands/update-page.md +56 -0
  35. package/commands/update-price.md +47 -0
  36. package/commands/write-blog.md +56 -0
  37. package/commands/write-docs.md +90 -0
  38. package/commands/write-guide.md +51 -0
  39. package/commands/write-newsletter.md +50 -0
  40. package/dist/server.js +4099 -0
  41. package/mcp_config.json +12 -0
  42. package/package.json +54 -25
  43. package/plugin.json +32 -0
  44. package/scripts/setup.sh +169 -0
  45. package/scripts/setup.ts +129 -0
  46. package/scripts/update.sh +56 -0
  47. package/server.json +21 -0
  48. package/skills/README.md +20 -27
  49. package/skills/billing/SKILL.md +64 -0
  50. package/skills/brand/SKILL.md +30 -86
  51. package/skills/cms/SKILL.md +111 -0
  52. package/skills/cms/references/cms-hubs.md +84 -0
  53. package/skills/cms/references/html-blocks.md +177 -0
  54. package/skills/copywriting/SKILL.md +1 -1
  55. package/skills/crm/SKILL.md +24 -0
  56. package/skills/docs/SKILL.md +65 -0
  57. package/skills/docs/references/how-to.md +155 -0
  58. package/skills/inbox/SKILL.md +49 -0
  59. package/skills/inventory/SKILL.md +69 -0
  60. package/skills/pages/SKILL.md +214 -0
  61. package/skills/pages/references/sections-catalog.json +1183 -0
  62. package/skills/social/SKILL.md +84 -211
  63. package/skills/social/evals/evals.json +66 -0
  64. package/skills/social/evals/rubric.md +26 -0
  65. package/skills/social/examples/repurposing-blog-to-social.md +93 -0
  66. package/skills/social/examples/weekly-content-calendar.md +30 -0
  67. package/skills/social/linkedin/SKILL.md +107 -0
  68. package/skills/social/linkedin/evals/evals.json +106 -0
  69. package/skills/social/linkedin/evals/rubric.md +28 -0
  70. package/skills/social/linkedin/examples/gasp-weekly-sprint.md +24 -0
  71. package/skills/social/linkedin/examples/growth-posts-by-format.md +140 -0
  72. package/skills/social/linkedin/references/gasp-funnel-and-calibration.md +90 -0
  73. package/skills/social/linkedin/references/six-growth-formats.md +114 -0
  74. package/skills/social/references/platforms.md +76 -0
  75. package/skills/social/references/post-templates.md +105 -0
  76. package/skills/social/references/reverse-engineering.md +62 -0
  77. package/src/data/sections-catalog.json +950 -0
  78. package/src/db.ts +170 -0
  79. package/src/server.ts +75 -0
  80. package/src/tools/content.ts +326 -0
  81. package/src/tools/crm.ts +1416 -0
  82. package/src/tools/domains.ts +89 -0
  83. package/src/tools/inbox.ts +270 -0
  84. package/src/tools/index.ts +116 -0
  85. package/src/tools/pages.ts +1217 -0
  86. package/src/tools/shop.ts +771 -0
  87. package/src/tools/system.ts +94 -0
  88. package/src/tools/types.ts +17 -0
  89. package/templates/antigravity.json +8 -0
  90. package/templates/claude-code.mcp.json +8 -0
  91. package/templates/cursor.mcp.json +8 -0
  92. package/templates/vscode.mcp.json +9 -0
  93. package/.claude/commands/analytics.md +0 -7
  94. package/.claude/commands/blog-writer.md +0 -9
  95. package/.claude/commands/cbo.md +0 -7
  96. package/.claude/commands/ceo.md +0 -10
  97. package/.claude/commands/cmo.md +0 -7
  98. package/.claude/commands/compress.md +0 -73
  99. package/.claude/commands/coo.md +0 -11
  100. package/.claude/commands/copywriter.md +0 -15
  101. package/.claude/commands/course-creator.md +0 -9
  102. package/.claude/commands/crm.md +0 -591
  103. package/.claude/commands/deep.md +0 -50
  104. package/.claude/commands/docs-writer.md +0 -8
  105. package/.claude/commands/forms-builder.md +0 -10
  106. package/.claude/commands/ingest.md +0 -110
  107. package/.claude/commands/jobs-manager.md +0 -8
  108. package/.claude/commands/kb.md +0 -107
  109. package/.claude/commands/newsletter-writer.md +0 -9
  110. package/.claude/commands/preserve.md +0 -64
  111. package/.claude/commands/resume.md +0 -67
  112. package/.claude/commands/scheduler.md +0 -8
  113. package/.claude/commands/seo.md +0 -60
  114. package/.claude/commands/social.md +0 -51
  115. package/.claude/commands/store-manager.md +0 -11
  116. package/.claude/settings.json +0 -16
  117. package/.claude/settings.local.json +0 -11
  118. package/.env.example +0 -12
  119. package/.mcp.json +0 -3
  120. package/HEARTBEAT.md +0 -105
  121. package/PLAN.md +0 -345
  122. package/PRD-Agent-Composition.md +0 -149
  123. package/PRD-Agent-Harness.md +0 -316
  124. package/REFERENCE.md +0 -160
  125. package/SOUL.md +0 -148
  126. package/SYSTEM.md +0 -71
  127. package/agents/_base.ts +0 -371
  128. package/agents/analytics/SOUL.md +0 -11
  129. package/agents/analytics/analytics.ts +0 -405
  130. package/agents/business/SOUL.md +0 -11
  131. package/agents/business/business.ts +0 -109
  132. package/agents/ceo/SOUL.md +0 -15
  133. package/agents/ceo/ceo.ts +0 -146
  134. package/agents/content/SOUL.md +0 -11
  135. package/agents/content/content.ts +0 -379
  136. package/agents/copywriting/SOUL.md +0 -11
  137. package/agents/copywriting/copywriting.ts +0 -89
  138. package/agents/courses/SOUL.md +0 -11
  139. package/agents/courses/courses.ts +0 -451
  140. package/agents/docs/SOUL.md +0 -11
  141. package/agents/docs/docs.ts +0 -77
  142. package/agents/forms/SOUL.md +0 -11
  143. package/agents/forms/forms.ts +0 -364
  144. package/agents/hiring/SOUL.md +0 -11
  145. package/agents/hiring/hiring.ts +0 -314
  146. package/agents/marketing/SOUL.md +0 -15
  147. package/agents/marketing/marketing.ts +0 -109
  148. package/agents/newsletter/SOUL.md +0 -11
  149. package/agents/newsletter/newsletter.ts +0 -91
  150. package/agents/operations/SOUL.md +0 -11
  151. package/agents/operations/operations.ts +0 -157
  152. package/agents/sales/SOUL.md +0 -44
  153. package/agents/sales/sales.ts +0 -883
  154. package/agents/scheduler/SOUL.md +0 -11
  155. package/agents/scheduler/scheduler.ts +0 -68
  156. package/agents/seo/SOUL.md +0 -11
  157. package/agents/seo/seo.ts +0 -288
  158. package/agents/social/SOUL.md +0 -11
  159. package/agents/social/social.ts +0 -744
  160. package/agents/store/SOUL.md +0 -11
  161. package/agents/store/store.ts +0 -514
  162. package/cli.ts +0 -144
  163. package/context/about-me.md +0 -96
  164. package/context/brand-voice.md +0 -127
  165. package/context/brand.md +0 -80
  166. package/context/business.md +0 -66
  167. package/context/working-style.md +0 -87
  168. package/lib/analytics.ts +0 -81
  169. package/lib/cms.ts +0 -88
  170. package/lib/db.adapter.ts +0 -30
  171. package/lib/db.ts +0 -63
  172. package/lib/enums.ts +0 -25
  173. package/lib/groups.ts +0 -122
  174. package/lib/id.ts +0 -43
  175. package/lib/kb.ts +0 -337
  176. package/lib/memory.ts +0 -219
  177. package/lib/pattern-detector.ts +0 -169
  178. package/lib/profile.ts +0 -155
  179. package/lib/schema.ts +0 -2015
  180. package/lib/slug.ts +0 -30
  181. package/lib/validate.ts +0 -33
  182. package/setup.ts +0 -141
  183. package/skills/agents/SKILL.md +0 -56
  184. package/skills/analytics/SKILL.md +0 -52
  185. package/skills/blog-writer/SKILL.md +0 -452
  186. package/skills/ceo/SKILL.md +0 -25
  187. package/skills/cmo/SKILL.md +0 -8
  188. package/skills/schema/SKILL.md +0 -86
  189. package/skills/store/SKILL.md +0 -62
  190. package/tsconfig.json +0 -14
package/lib/slug.ts DELETED
@@ -1,30 +0,0 @@
1
- import { db } from './db.ts'
2
-
3
- export const toSlug = (s: string) =>
4
- s.toLowerCase().trim()
5
- .replace(/[^\w\s-]/g, '').replace(/[\s_]+/g, '-')
6
- .replace(/-+/g, '-').replace(/^-|-$/g, '').slice(0, 100)
7
-
8
- /**
9
- * Generate a unique slug within a table.
10
- * Products use global uniqueness (no profile scope).
11
- * All other tables scope uniqueness to profile_id.
12
- */
13
- export async function uniqueSlug(
14
- table: string,
15
- title: string,
16
- profileId?: string
17
- ): Promise<string> {
18
- const base = toSlug(title)
19
- let slug = base, i = 0
20
- while (true) {
21
- const { rows } = await db.execute({
22
- sql: profileId
23
- ? `SELECT 1 FROM ${table} WHERE slug=? AND profile_id=? LIMIT 1`
24
- : `SELECT 1 FROM ${table} WHERE slug=? LIMIT 1`,
25
- args: profileId ? [slug, profileId] : [slug],
26
- })
27
- if (!rows.length) return slug
28
- slug = `${base}-${++i}`
29
- }
30
- }
package/lib/validate.ts DELETED
@@ -1,33 +0,0 @@
1
- // lib/validate.ts
2
- // Guard numeric fields before DB writes.
3
- // DB triggers will reject out-of-bounds — catch early for clearer errors.
4
-
5
- export function leadScore(n: number): number {
6
- if (!Number.isFinite(n) || n < 0 || n > 100)
7
- throw new Error(`lead_score must be 0–100, got ${n}`)
8
- return Math.round(n)
9
- }
10
-
11
- export function probability(n: number): number {
12
- if (!Number.isFinite(n) || n < 0 || n > 100)
13
- throw new Error(`probability must be 0–100, got ${n}`)
14
- return Math.round(n)
15
- }
16
-
17
- export function cents(n: number): number {
18
- if (!Number.isFinite(n) || n < 0 || !Number.isInteger(n))
19
- throw new Error(`cents must be non-negative integer, got ${n}`)
20
- return n
21
- }
22
-
23
- export function hotScore(n: number): number {
24
- if (!Number.isFinite(n) || n < 0)
25
- throw new Error(`hot_score must be >= 0, got ${n}`)
26
- return n
27
- }
28
-
29
- export function slug(s: string): string {
30
- if (!s || s.length > 200)
31
- throw new Error(`slug must be 1–200 chars, got "${s}"`)
32
- return s.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/-+/g, '-')
33
- }
package/setup.ts DELETED
@@ -1,141 +0,0 @@
1
- /**
2
- * setup.ts — verify everything works after cloning.
3
- * Usage: npm run setup
4
- */
5
-
6
- import { existsSync } from 'fs'
7
- import { readFileSync } from 'fs'
8
- import { createClient } from '@libsql/client/web'
9
-
10
- const BOLD = '\x1b[1m'
11
- const GREEN = '\x1b[32m'
12
- const RED = '\x1b[31m'
13
- const DIM = '\x1b[2m'
14
- const RESET = '\x1b[0m'
15
-
16
- const ok = (msg: string) => console.log(`${GREEN}✓${RESET} ${msg}`)
17
- const err = (msg: string) => console.error(`${RED}✗${RESET} ${msg}`)
18
- const dim = (msg: string) => console.log(`${DIM} ${msg}${RESET}`)
19
-
20
- console.log(`\n${BOLD}BusinessKit Agent — Setup Check${RESET}\n`)
21
-
22
- // ── Step 1: .env exists ───────────────────────────────────────────────────────
23
- console.log('1. Checking .env file...')
24
- if (!existsSync('.env')) {
25
- err('.env not found')
26
- dim('Run: cp .env.example .env')
27
- dim('Then paste TURSO_URL and TURSO_TOKEN from BusinessKit → Settings → Credentials')
28
- process.exit(1)
29
- }
30
-
31
- // Parse .env manually (no dotenv dependency needed for setup)
32
- const env: Record<string, string> = {}
33
- readFileSync('.env', 'utf8').split('\n').forEach(line => {
34
- const [k, ...v] = line.split('=')
35
- if (k && v.length) env[k.trim()] = v.join('=').trim().replace(/^["']|["']$/g, '')
36
- })
37
-
38
- const TURSO_URL = env.TURSO_URL || process.env.TURSO_URL || ''
39
- const TURSO_TOKEN = env.TURSO_TOKEN || process.env.TURSO_TOKEN || ''
40
-
41
- if (!TURSO_URL) {
42
- err('TURSO_URL is missing from .env')
43
- dim('Find it at: BusinessKit → Settings → Credentials')
44
- process.exit(1)
45
- }
46
- if (!TURSO_TOKEN) {
47
- err('TURSO_TOKEN is missing from .env')
48
- dim('Find it at: BusinessKit → Settings → Credentials')
49
- process.exit(1)
50
- }
51
- if (!TURSO_URL.startsWith('libsql://')) {
52
- err(`TURSO_URL looks wrong: "${TURSO_URL}"`)
53
- dim('It should start with libsql://')
54
- process.exit(1)
55
- }
56
- ok('.env found with TURSO_URL and TURSO_TOKEN')
57
-
58
- // ── Step 2: Turso connection ──────────────────────────────────────────────────
59
- console.log('\n2. Testing Turso connection...')
60
- let db: ReturnType<typeof createClient>
61
- try {
62
- db = createClient({ url: TURSO_URL, authToken: TURSO_TOKEN })
63
- await db.execute('SELECT 1')
64
- ok('Turso connected')
65
- } catch (e: any) {
66
- err(`Turso connection failed: ${e.message}`)
67
- dim('Check TURSO_URL and TURSO_TOKEN — make sure they match exactly')
68
- dim('Token must not have extra spaces or quotes')
69
- process.exit(1)
70
- }
71
-
72
- // ── Step 3: Profile exists ────────────────────────────────────────────────────
73
- console.log('\n3. Loading your profile...')
74
- const PROFILE_ID = env.PROFILE_ID || process.env.PROFILE_ID || ''
75
- try {
76
- const { rows } = await db.execute('SELECT id, slug, title FROM profiles')
77
- if (!rows.length) {
78
- err('No profile found in your database')
79
- dim('Complete BusinessKit onboarding at businesskit.io first')
80
- dim('Then come back and run: npm run setup')
81
- process.exit(1)
82
- }
83
- if (rows.length > 1 && !PROFILE_ID) {
84
- err(`Found ${rows.length} profiles — set PROFILE_ID in .env to pick one:`)
85
- for (const r of rows) dim(` ${r.id} (${r.title} @${r.slug})`)
86
- process.exit(1)
87
- }
88
- const p = PROFILE_ID
89
- ? rows.find(r => r.id === PROFILE_ID)
90
- : rows[0]
91
- if (!p) {
92
- err(`PROFILE_ID=${PROFILE_ID} not found in your database`)
93
- dim('Available:')
94
- for (const r of rows) dim(` ${r.id} (${r.title} @${r.slug})`)
95
- process.exit(1)
96
- }
97
- ok(`Profile: ${p.title} (@${p.slug})`)
98
- dim(`Profile ID: ${p.id}`)
99
- } catch (e: any) {
100
- err(`Could not read profiles table: ${e.message}`)
101
- dim('Your database may not be provisioned yet')
102
- dim('Complete BusinessKit onboarding first')
103
- process.exit(1)
104
- }
105
-
106
- // ── Step 4: Key agent tables exist ───────────────────────────────────────────
107
- console.log('\n4. Checking database tables...')
108
- const requiredTables = ['profiles', 'posts', 'products', 'subscribers', 'crm_contacts', 'social_posts']
109
- const missing: string[] = []
110
-
111
- for (const table of requiredTables) {
112
- try {
113
- await db.execute(`SELECT 1 FROM ${table} LIMIT 0`)
114
- } catch {
115
- missing.push(table)
116
- }
117
- }
118
-
119
- if (missing.length) {
120
- err(`Missing tables: ${missing.join(', ')}`)
121
- dim('Your DB may not be fully provisioned')
122
- dim('Go to BusinessKit → Dashboard → Status and click "Provision"')
123
- process.exit(1)
124
- }
125
- ok(`All required tables found`)
126
-
127
- // ── Step 5: Node version ──────────────────────────────────────────────────────
128
- console.log('\n5. Checking Node.js version...')
129
- const [major] = process.versions.node.split('.').map(Number)
130
- if (major < 18) {
131
- err(`Node.js ${process.versions.node} is too old (need 18+)`)
132
- dim('Install Node.js 18+ from nodejs.org')
133
- process.exit(1)
134
- }
135
- ok(`Node.js ${process.versions.node}`)
136
-
137
- // ── Done ──────────────────────────────────────────────────────────────────────
138
- console.log(`\n${GREEN}${BOLD}✅ All checks passed.${RESET}\n`)
139
- console.log(`Open this folder in Claude Code and type ${BOLD}/ceo${RESET} to start.\n`)
140
- console.log(`Or run from terminal:`)
141
- console.log(` ${DIM}npx tsx cli.ts ceo${RESET}\n`)
@@ -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,52 +0,0 @@
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
- ```
10
- analytics_7d = [n, n, n, n, n, n, n] → last 7 days, oldest first
11
- analytics_30d = [n, n, ..., n] → last 30 days
12
- analytics_12m = [n, n, ..., n] → last 12 months
13
- analytics_24h = [n, n, ..., n] → last 24 hours (hourly)
14
- ```
15
-
16
- ### Lifetime object
17
-
18
- ```
19
- analytics_lifetime = { "2026-03": 142, "2026-04": 89, ... }
20
- revenue_lifetime = { "2026-03": 42000, "2026-04": 15000, ... }
21
- // values are counts (clicks) or cents (revenue)
22
- ```
23
-
24
- ### Breakdown objects (country, device, referrer)
25
-
26
- ```
27
- country_clicks = { "US": 420, "GB": 88, "IN": 45, ... }
28
- device_clicks = { "mobile": 312, "desktop": 201 }
29
- referrer_clicks = { "twitter.com": 88, "direct": 204, ... }
30
- ```
31
-
32
- ## Key metrics to surface in briefings
33
-
34
- **Traffic**: total_clicks, top country, top referrer, 30d trend (compare last 30d vs prior 30d)
35
- **Revenue**: total_earnings (cents → divide by 100), total_sales count, top product by revenue
36
- **Content**: posts published this month, drafts waiting, newsletter subscribers
37
- **Social**: posts published, scheduled, accounts connected
38
-
39
- ## Revenue trend calculation
40
-
41
- ```ts
42
- const months = Object.entries(revenue_lifetime).sort()
43
- const last = months.slice(-1)[0]?.[1] ?? 0
44
- const prior = months.slice(-2,-1)[0]?.[1] ?? 0
45
- const trend = prior > 0 ? ((last - prior) / prior * 100).toFixed(1) + '%' : 'N/A'
46
- ```
47
-
48
- ## Never write to analytics tables
49
-
50
- Analytics are updated by the app on user actions (clicks, purchases).
51
- Agents read analytics. The app writes analytics. Never reverse this.
52
- Exception: seed a product_analytics or link_analytics row when creating a new product/link.