@businesskit/agent 1.0.5 → 1.0.8

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 (83) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.cursor-plugin/plugin.json +1 -1
  4. package/.superconsole-plugin/plugin.json +61 -31
  5. package/AGENTS.md +33 -15
  6. package/README.md +101 -113
  7. package/bin/businesskit.js +47 -8
  8. package/commands/brief.md +12 -0
  9. package/commands/chase.md +12 -0
  10. package/commands/competitors.md +12 -0
  11. package/commands/create-page.md +43 -15
  12. package/commands/crm.md +13 -0
  13. package/commands/drafts.md +12 -0
  14. package/commands/followups.md +13 -0
  15. package/commands/inbox-rules.md +12 -0
  16. package/commands/inbox.md +13 -0
  17. package/commands/otp.md +12 -0
  18. package/commands/pipeline.md +13 -0
  19. package/commands/post.md +12 -0
  20. package/commands/reply.md +12 -0
  21. package/commands/repurpose.md +12 -0
  22. package/commands/social-analytics.md +12 -0
  23. package/commands/social-inbox.md +12 -0
  24. package/commands/social-reply.md +12 -0
  25. package/commands/social.md +12 -0
  26. package/commands/triage.md +12 -0
  27. package/commands/update-agent.md +33 -0
  28. package/commands/update-content.md +1 -0
  29. package/commands/update-page.md +3 -2
  30. package/commands/write-blog.md +4 -0
  31. package/commands/write-docs.md +6 -0
  32. package/commands/write-guide.md +5 -0
  33. package/commands/write-newsletter.md +4 -0
  34. package/dist/server.js +7513 -0
  35. package/mcp_config.json +6 -2
  36. package/package.json +25 -5
  37. package/plugin.json +1 -1
  38. package/scripts/release.js +200 -0
  39. package/scripts/setup.sh +70 -35
  40. package/scripts/setup.ts +58 -21
  41. package/scripts/update.sh +56 -0
  42. package/server.json +3 -3
  43. package/skills/README.md +3 -2
  44. package/skills/cms/SKILL.md +111 -0
  45. package/skills/cms/references/cms-hubs.md +84 -0
  46. package/skills/cms/references/html-blocks.md +177 -0
  47. package/skills/crm/SKILL.md +15 -29
  48. package/skills/docs/SKILL.md +65 -0
  49. package/skills/docs/references/how-to.md +155 -0
  50. package/skills/inbox/SKILL.md +32 -40
  51. package/skills/pages/SKILL.md +62 -17
  52. package/skills/pages/references/sections-catalog.json +377 -144
  53. package/skills/social/SKILL.md +83 -210
  54. package/skills/social/evals/evals.json +66 -0
  55. package/skills/social/evals/rubric.md +26 -0
  56. package/skills/social/examples/repurposing-blog-to-social.md +93 -0
  57. package/skills/social/examples/weekly-content-calendar.md +30 -0
  58. package/skills/social/linkedin/SKILL.md +107 -0
  59. package/skills/social/linkedin/evals/evals.json +106 -0
  60. package/skills/social/linkedin/evals/rubric.md +28 -0
  61. package/skills/social/linkedin/examples/gasp-weekly-sprint.md +24 -0
  62. package/skills/social/linkedin/examples/growth-posts-by-format.md +140 -0
  63. package/skills/social/linkedin/references/gasp-funnel-and-calibration.md +90 -0
  64. package/skills/social/linkedin/references/six-growth-formats.md +114 -0
  65. package/skills/social/references/platforms.md +76 -0
  66. package/skills/social/references/post-templates.md +105 -0
  67. package/skills/social/references/reverse-engineering.md +62 -0
  68. package/src/data/sections-catalog.json +950 -0
  69. package/src/db.ts +181 -0
  70. package/src/server.ts +119 -0
  71. package/src/tools/content.ts +326 -0
  72. package/src/tools/crm.ts +1416 -0
  73. package/src/tools/domains.ts +89 -0
  74. package/src/tools/inbox.ts +1400 -0
  75. package/src/tools/index.ts +138 -0
  76. package/src/tools/pages.ts +1217 -0
  77. package/src/tools/shop.ts +771 -0
  78. package/src/tools/social.ts +2131 -0
  79. package/src/tools/system.ts +96 -0
  80. package/src/tools/types.ts +17 -0
  81. package/src/worker-tick.ts +394 -0
  82. package/skills/docs-cms/SKILL.md +0 -53
  83. package/skills/docs-cms/references/how-to.md +0 -383
@@ -1,383 +0,0 @@
1
- # How-To: Publishing BusinessKit Documentation from Outside the App (MCP & Turso DB)
2
-
3
- This guide documents the exact workflow, database schemas, semantic rules, and automation scripts used to author, manage, and publish documentation for **BusinessKit** from outside the desktop app (e.g. using an autonomous AI coding agent via MCP or direct database execution).
4
-
5
- ---
6
-
7
- ## 1. Operating Rules & Core Constraints
8
-
9
- Whenever authoring or publishing docs, these constraints must always be respected:
10
-
11
- | Constraint | Value / Rule | Why / Notes |
12
- | :--- | :--- | :--- |
13
- | **Target Profile** | `4628a5b1-ac05-4156-9d76-04bbd71119a1` | Profile title: **"BusinessKit"** (slug: `businesskit`). Never post to "BusinessKit India" or personal profiles. |
14
- | **Category ID** | `cat_32` | Canonical identifier for the **docs** category. All documentation articles and subcollections must have `category_id = 'cat_32'`. |
15
- | **Doc Title** | **$\le$ 3 words strictly** | E.g., `What Are Pages`, `Create New Page`, `Visual Page Editor`, `Install BusinessKit`. |
16
- | **SEO Title** | Prefixed with Domain | E.g., `Pages: Visual Drag and Drop Canvas Editor`, `Deploy: Connect Cloudflare Pages`. |
17
- | **No `<h1>` in HTML** | Prohibited in body | The article title is rendered by the layout as the primary `<h1>`. Body headings must start with `<h2>` then `<h3>`. |
18
- | **Accordions** | Collapsed by default | Must have `isOpen = false` and `aria-expanded="false"`. |
19
- | **Task Lists** | Pure semantic structure | No bullet markers. Uses vector SVG checkmarks without border hacks. |
20
- | **Status Column** | `published = 1` | The database column is `published` (integer `1` or `0`). There is **no `status` column** and **no `summary` column** in `content`. |
21
-
22
- ---
23
-
24
- ## 2. Database Architecture & Table Schemas
25
-
26
- BusinessKit uses Turso (libSQL). Tech docs are powered by two primary tables:
27
-
28
- ### A. `collections` Table Schema
29
-
30
- Organizes the sidebar navigation into root domains and nested subcollections.
31
-
32
- ```sql
33
- CREATE TABLE collections (
34
- id TEXT PRIMARY KEY, -- e.g., 'col_website', 'col_pg_start'
35
- title TEXT NOT NULL, -- e.g., 'Website & Pages', 'Get Started'
36
- slug TEXT NOT NULL, -- e.g., 'pages', 'pg-get-started'
37
- category_id TEXT, -- MUST be 'cat_32' for docs
38
- parent_id TEXT, -- NULL for root collections, parent id for subcollections
39
- order_index INTEGER, -- Sequence number (1..20 for root; 1..n for subcollections)
40
- sort_order INTEGER, -- Legacy sort weight (e.g. order_index * 10)
41
- icon TEXT, -- Optional emoji or icon identifier
42
- description TEXT -- Optional collection summary
43
- );
44
- ```
45
-
46
- #### Canonical Root Collection Order (`parent_id IS NULL`):
47
- 1. `col_docs_1` — Getting Started (`getting-started`)
48
- 2. `col_apps` — Apps (`apps`)
49
- 3. `col_dashboard` — Dashboard (`dashboard`)
50
- 4. `col_shop` — Shop (`shop`)
51
- 5. `col_products_inventory` — Products & Inventory (`products-inventory`)
52
- 6. `col_restaurant_cafe` — Restaurant & Café (`restaurant-cafe`)
53
- 7. `col_hotel_stays` — Hotel & Stays (`hotel-stays`)
54
- 8. `col_tax` — Tax (`tax`)
55
- 9. `col_accounts` — Accounts (`accounts`)
56
- 10. `col_link_in_bio` — Link in Bio (`link-in-bio`)
57
- 11. `col_website` — Website & Pages (`pages`)
58
- 12. `col_deploy` — Deploy (`deploy`)
59
- 13. `col_crm` — Crm (`crm`)
60
- 14. `col_social` — Social Media (`social`)
61
- 15. `col_store` — Online Store (`store`)
62
- 16. `col_content_cms` — Content & CMS (`content`)
63
- 17. `col_chat_agent` — Chat Agent (`chat-agent`)
64
- 18. `col_agents` — Autonomous Agents (`agents`)
65
- 19. `col_settings_account` — Settings & Account (`settings-account`)
66
- 20. `col_help_support` — Help & Support (`help`)
67
- 50. `col_fc5e3fb2c532` — Architecture & Core Systems (`architecture-core-systems`)
68
- 51. `col_docs_5` — API & Integrations (`api-and-integrations`)
69
-
70
- > [!NOTE]
71
- > Main collection titles must be **Capitalized, not ALL CAPITAL** (e.g. `Crm` instead of `CRM`). The sidebar auto-capitalizes via `formatCollectionTitle()`, but database consistency is preferred.
72
-
73
- ---
74
-
75
- ### B. `content` Table Schema
76
-
77
- Holds the actual documentation articles and markdown/HTML payloads.
78
-
79
- ```sql
80
- INSERT INTO content (
81
- id, -- Primary key, e.g. 'post_what_are_pages'
82
- profile_id, -- '4628a5b1-ac05-4156-9d76-04bbd71119a1' ("BusinessKit")
83
- user_id, -- Creator user ID
84
- updated_by, -- Updating user ID
85
- title, -- 3 words max, e.g. 'What Are Pages'
86
- slug, -- URL slug, e.g. 'what-are-pages'
87
- content, -- Pure semantic HTML (no Markdown, no <h1>)
88
- excerpt, -- Concise 1-2 sentence overview for SEO & previews
89
- published, -- 1 = published, 0 = draft
90
- category_id, -- MUST be 'cat_32'
91
- collection_id, -- Target child collection ID (e.g. 'col_pg_start')
92
- order_index, -- Article display order within collection (1, 2, 3...)
93
- seo_title, -- Prefixed SEO title (e.g. 'Pages: Visual Site Architecture')
94
- created_at, -- Unix timestamp (seconds)
95
- updated_at -- Unix timestamp (seconds)
96
- ) VALUES (...);
97
- ```
98
-
99
- > [!WARNING]
100
- > Do **NOT** pass `status: 'published'` or `summary: '...'` in your SQL queries. The columns are `published` (integer `1`) and `excerpt`.
101
-
102
- ---
103
-
104
- ## 3. Semantic HTML Guidelines for `content`
105
-
106
- When writing the article body HTML:
107
-
108
- ### A. Section Headings
109
- ```html
110
- <h2>First Major Topic</h2>
111
- <p>Explaining the architecture and functionality.</p>
112
-
113
- <h3>Subtopic or Specific Flow</h3>
114
- <p>Step-by-step description.</p>
115
- ```
116
-
117
- ### B. Task Lists & Checkboxes
118
- Task lists must use the standard TipTap/Docs schema:
119
- ```html
120
- <ul data-type="taskList" class="task-list tech-task-list">
121
- <li data-type="taskItem" class="task-list-item tech-task-item">
122
- <label><input type="checkbox" checked="checked" /></label>
123
- <div><p>Complete initial setup in the Pages workspace.</p></div>
124
- </li>
125
- <li data-type="taskItem" class="task-list-item tech-task-item">
126
- <label><input type="checkbox" /></label>
127
- <div><p>Attach custom components to the canvas.</p></div>
128
- </li>
129
- </ul>
130
- ```
131
-
132
- ### C. Collapsible Accordions (Must Be Collapsed by Default)
133
- ```html
134
- <div data-type="accordion-group" class="tech-accordion-group">
135
- <div data-type="accordion-item" class="tech-accordion-item" aria-expanded="false">
136
- <div data-type="accordion-title" class="tech-accordion-title">How do templates differ from native sections?</div>
137
- <div data-type="accordion-content" class="tech-accordion-content" hidden="hidden">
138
- <p>Native sections adapt their colors to the profile theme token automatically, while templates provide full-page layouts.</p>
139
- </div>
140
- </div>
141
- </div>
142
- ```
143
-
144
- ### D. Callout Cards
145
- ```html
146
- <div data-type="info-card" class="tech-callout tech-callout--info" role="note">
147
- <p><strong>Note:</strong> Changes made in the Visual Editor are auto-saved locally before publishing.</p>
148
- </div>
149
- ```
150
-
151
- ### E. Code Blocks
152
- Always HTML-escape `<` as `&lt;` and `>` as `&gt;`:
153
- ```html
154
- <pre><code class="language-bash">npm run build
155
- curl -X POST https://api.businesskit.io/v1/pages</code></pre>
156
- ```
157
-
158
- ---
159
-
160
- ## 4. Publishing Methods
161
-
162
- ### Method A: Via BusinessKit MCP Tools
163
-
164
- If the agent environment has the `businesskit` MCP server loaded:
165
-
166
- 1. **Verify / Switch Active Profile**:
167
- ```json
168
- // 1. List profiles to confirm ID
169
- call_mcp_tool("businesskit", "profile_list", {})
170
-
171
- // 2. Switch if not already on BusinessKit profile
172
- call_mcp_tool("businesskit", "profile_switch", {
173
- "profile_id": "4628a5b1-ac05-4156-9d76-04bbd71119a1"
174
- })
175
- ```
176
-
177
- 2. **Publish Content**:
178
- ```json
179
- call_mcp_tool("businesskit", "blog_post_create", {
180
- "title": "What Are Pages",
181
- "slug": "what-are-pages",
182
- "category_id": "cat_32",
183
- "collection_id": "col_pg_start",
184
- "body_html": "<h2>Overview</h2><p>Pages visual builder...</p>",
185
- "excerpt": "Visual website builder overview for BusinessKit.",
186
- "seo_title": "Pages: Overview and Visual Site Architecture",
187
- "published": 1
188
- })
189
- ```
190
-
191
- ---
192
-
193
- ### Method B: Via Direct Turso Database Script (Recommended for Batch Docs)
194
-
195
- When managing a domain with 5–30 articles and nested collections, executing a Node.js batch script is the fastest, atomic, and most reliable method.
196
-
197
- #### 1. Database Connection Utility (`turso-userdb.js`)
198
-
199
- ```javascript
200
- // scratch/turso-userdb.js
201
- const fs = require('fs');
202
- const path = require('path');
203
-
204
- // Extract user DB credentials from credentials cache or env
205
- const credsPath = path.join(process.env.HOME, 'Library/Application Support/io.businesskit.app/credentials.json');
206
- let dbUrl = process.env.TURSO_USER_DATABASE_URL;
207
- let dbToken = process.env.TURSO_USER_AUTH_TOKEN;
208
-
209
- if (!dbUrl && fs.existsSync(credsPath)) {
210
- const creds = JSON.parse(fs.readFileSync(credsPath, 'utf8'));
211
- dbUrl = creds.user_db_url;
212
- dbToken = creds.user_db_token;
213
- }
214
-
215
- async function execute(sql, args = []) {
216
- const endpoint = `${dbUrl.replace(/^libsql:\/\//, 'https://')}/v2/pipeline`;
217
- const response = await fetch(endpoint, {
218
- method: 'POST',
219
- headers: {
220
- 'Authorization': `Bearer ${dbToken}`,
221
- 'Content-Type': 'application/json',
222
- },
223
- body: JSON.stringify({
224
- requests: [{ type: 'execute', stmt: { sql, args } }],
225
- }),
226
- });
227
-
228
- const json = await response.json();
229
- if (json.results?.[0]?.type === 'error') {
230
- throw new Error(`SQLite error: ${json.results[0].error.message}`);
231
- }
232
- return json.results?.[0]?.response?.result;
233
- }
234
-
235
- module.exports = { execute };
236
- ```
237
-
238
- #### 2. Batch Collection & Article Publishing Script Template
239
-
240
- ```javascript
241
- // scratch/publish-domain-docs.js
242
- const fs = require('fs');
243
- const path = require('path');
244
- const { execute } = require('./turso-userdb');
245
-
246
- const PROFILE_ID = '4628a5b1-ac05-4156-9d76-04bbd71119a1';
247
- const USER_ID = 'a1b2c3d4-0001-4000-8000-000000000001';
248
- const CATEGORY_ID = 'cat_32';
249
-
250
- async function main() {
251
- console.log("Setting up collections...");
252
-
253
- // 1. Create or update Parent Root Collection
254
- await execute(`
255
- INSERT INTO collections (id, title, slug, category_id, parent_id, order_index, sort_order)
256
- VALUES ('col_domain', 'Domain Title', 'domain-slug', '${CATEGORY_ID}', NULL, 11, 110)
257
- ON CONFLICT(id) DO UPDATE SET title = 'Domain Title', slug = 'domain-slug', order_index = 11
258
- `);
259
-
260
- // 2. Create Child Collections
261
- const subcollections = [
262
- { id: 'col_dom_start', title: 'Get Started', slug: 'dom-get-started', order: 1 },
263
- { id: 'col_dom_features', title: 'Features', slug: 'dom-features', order: 2 }
264
- ];
265
-
266
- for (const sub of subcollections) {
267
- await execute(`
268
- INSERT INTO collections (id, title, slug, category_id, parent_id, order_index, sort_order)
269
- VALUES ('${sub.id}', '${sub.title}', '${sub.slug}', '${CATEGORY_ID}', 'col_domain', ${sub.order}, ${sub.order * 10})
270
- ON CONFLICT(id) DO UPDATE SET title = '${sub.title}', slug = '${sub.slug}', parent_id = 'col_domain', order_index = ${sub.order}
271
- `);
272
- }
273
-
274
- // 3. Insert and Publish Articles
275
- const articles = [
276
- {
277
- title: "What Are Pages",
278
- slug: "what-are-pages",
279
- collection_id: "col_dom_start",
280
- order_index: 1,
281
- seo_title: "Domain: Overview and Architecture",
282
- excerpt: "High-level overview of the feature set.",
283
- html: `<h2>Overview</h2><p>Feature explanation...</p>`
284
- }
285
- ];
286
-
287
- const now = Math.floor(Date.now() / 1000);
288
-
289
- for (const art of articles) {
290
- const id = `post_${art.slug.replace(/-/g, '_')}`;
291
- const escapedContent = art.html.replace(/'/g, "''");
292
- const escapedExcerpt = art.excerpt.replace(/'/g, "''");
293
- const escapedTitle = art.title.replace(/'/g, "''");
294
- const escapedSeo = art.seo_title.replace(/'/g, "''");
295
-
296
- const sql = `INSERT INTO content (
297
- id, profile_id, user_id, updated_by, title, slug, content, excerpt,
298
- published, category_id, collection_id, order_index, seo_title,
299
- created_at, updated_at
300
- ) VALUES (
301
- '${id}', '${PROFILE_ID}', '${USER_ID}', '${USER_ID}', '${escapedTitle}', '${art.slug}',
302
- '${escapedContent}', '${escapedExcerpt}',
303
- 1, '${CATEGORY_ID}', '${art.collection_id}', ${art.order_index}, '${escapedSeo}',
304
- ${now}, ${now}
305
- ) ON CONFLICT(id) DO UPDATE SET
306
- profile_id = '${PROFILE_ID}',
307
- title = '${escapedTitle}',
308
- slug = '${art.slug}',
309
- content = '${escapedContent}',
310
- excerpt = '${escapedExcerpt}',
311
- published = 1,
312
- category_id = '${CATEGORY_ID}',
313
- collection_id = '${art.collection_id}',
314
- order_index = ${art.order_index},
315
- seo_title = '${escapedSeo}',
316
- updated_at = ${now}`;
317
-
318
- await execute(sql);
319
- console.log(`Published ${art.title} -> ${art.collection_id}`);
320
- }
321
- }
322
-
323
- main().catch(console.error);
324
- ```
325
-
326
- ---
327
-
328
- ## 5. Dual Persistence: Saving Local Markdown Files
329
-
330
- Every published documentation article must also exist as a local markdown file under:
331
- `/Users/2.o/businesskit/documentation/content/<domain>/<slug>.md`
332
-
333
- ### Markdown File Format with YAML Frontmatter
334
-
335
- ```markdown
336
- ---
337
- title: "What Are Pages"
338
- slug: "what-are-pages"
339
- seo_title: "Pages: Overview and Visual Site Architecture"
340
- excerpt: "Understand how Pages lets you build responsive storefronts and landing pages with custom components."
341
- collection_id: "col_pg_start"
342
- category_id: "cat_32"
343
- order_index: 1
344
- published: true
345
- created_at: 1732204800
346
- ---
347
-
348
- <h2>Visual Site Architecture</h2>
349
- <p>Pages is BusinessKit's visual website builder...</p>
350
- ```
351
-
352
- ---
353
-
354
- ## 6. Verification & Health Check
355
-
356
- After creating or updating docs, always perform these 3 verification steps:
357
-
358
- 1. **Verify Database Records**:
359
- ```bash
360
- node -e "
361
- const { execute } = require('./scratch/turso-userdb');
362
- async function test() {
363
- const res = await execute(\"SELECT id, title, slug, collection_id, published FROM content WHERE category_id = 'cat_32' AND collection_id = 'YOUR_COL_ID'\");
364
- console.log(res.rows);
365
- }
366
- test();
367
- "
368
- ```
369
-
370
- 2. **Verify Sidebar Capitalization & Typography**:
371
- - Confirm root collections use Capitalized words (e.g. `Crm`, not `CRM`).
372
- - Confirm font weights use `400` with `-webkit-font-smoothing: antialiased`.
373
-
374
- 3. **Run Web Production Build**:
375
- ```bash
376
- npm --prefix /Users/2.o/businesskit/businesskit-web run build
377
- ```
378
- Must output:
379
- - `✓ Built client modules`
380
- - `✓ Built server (ssr) modules`
381
- - `✓ Type checked`
382
- - `✓ Lint checked`
383
- - Zero compilation or SSR routing errors.