@businesskit/agent 1.0.3 → 1.0.5

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 (130) 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 +32 -0
  5. package/AGENTS.md +94 -63
  6. package/CLAUDE.md +11 -65
  7. package/GEMINI.md +11 -34
  8. package/README.md +106 -153
  9. package/assets/logo.svg +3 -0
  10. package/bin/businesskit.js +11 -17
  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/capabilities.md +33 -0
  15. package/commands/check-stock.md +43 -0
  16. package/commands/create-component.md +109 -0
  17. package/commands/create-invoice.md +69 -0
  18. package/commands/create-new-bill.md +65 -0
  19. package/commands/create-page.md +96 -0
  20. package/commands/list-components.md +41 -0
  21. package/commands/list-content.md +46 -0
  22. package/commands/list-pages.md +45 -0
  23. package/commands/publish-page.md +64 -0
  24. package/commands/send-invoice.md +42 -0
  25. package/commands/seo-audit.md +36 -0
  26. package/commands/update-contact.md +46 -0
  27. package/commands/update-content.md +47 -0
  28. package/commands/update-page.md +55 -0
  29. package/commands/update-price.md +47 -0
  30. package/commands/write-blog.md +52 -0
  31. package/commands/write-docs.md +84 -0
  32. package/commands/write-guide.md +46 -0
  33. package/commands/write-newsletter.md +46 -0
  34. package/mcp_config.json +8 -0
  35. package/package.json +34 -23
  36. package/plugin.json +32 -0
  37. package/scripts/generate-schema.ts +244 -0
  38. package/scripts/setup.sh +134 -0
  39. package/scripts/setup.ts +92 -0
  40. package/server.json +21 -0
  41. package/skills/README.md +19 -27
  42. package/skills/billing/SKILL.md +64 -0
  43. package/skills/brand/SKILL.md +30 -86
  44. package/skills/copywriting/SKILL.md +1 -1
  45. package/skills/crm/SKILL.md +38 -0
  46. package/skills/docs-cms/SKILL.md +53 -0
  47. package/skills/docs-cms/references/how-to.md +383 -0
  48. package/skills/inbox/SKILL.md +49 -0
  49. package/skills/inventory/SKILL.md +69 -0
  50. package/skills/pages/SKILL.md +169 -0
  51. package/skills/pages/references/sections-catalog.json +950 -0
  52. package/skills/social/SKILL.md +1 -1
  53. package/templates/antigravity.json +8 -0
  54. package/templates/claude-code.mcp.json +8 -0
  55. package/templates/cursor.mcp.json +8 -0
  56. package/templates/vscode.mcp.json +9 -0
  57. package/.claude/commands/analytics.md +0 -7
  58. package/.claude/commands/blog-writer.md +0 -9
  59. package/.claude/commands/cbo.md +0 -7
  60. package/.claude/commands/ceo.md +0 -10
  61. package/.claude/commands/cmo.md +0 -7
  62. package/.claude/commands/compress.md +0 -73
  63. package/.claude/commands/coo.md +0 -11
  64. package/.claude/commands/copywriter.md +0 -15
  65. package/.claude/commands/course-creator.md +0 -9
  66. package/.claude/commands/crm.md +0 -591
  67. package/.claude/commands/deep.md +0 -50
  68. package/.claude/commands/docs-writer.md +0 -8
  69. package/.claude/commands/forms-builder.md +0 -10
  70. package/.claude/commands/jobs-manager.md +0 -8
  71. package/.claude/commands/kb.md +0 -107
  72. package/.claude/commands/newsletter-writer.md +0 -9
  73. package/.claude/commands/preserve.md +0 -64
  74. package/.claude/commands/resume.md +0 -67
  75. package/.claude/commands/scheduler.md +0 -8
  76. package/.claude/commands/seo.md +0 -60
  77. package/.claude/commands/social.md +0 -51
  78. package/.claude/commands/store-manager.md +0 -11
  79. package/.env.example +0 -2
  80. package/.mcp.json +0 -3
  81. package/ABOUT-ME.md +0 -96
  82. package/HEARTBEAT.md +0 -105
  83. package/PLAN.md +0 -384
  84. package/PRD-Agent-Composition.md +0 -149
  85. package/PRD-Agent-Harness.md +0 -316
  86. package/REFERENCE.md +0 -124
  87. package/SOUL.md +0 -148
  88. package/SYSTEM.md +0 -71
  89. package/agents/_base.ts +0 -63
  90. package/agents/creators/blog-writer.ts +0 -347
  91. package/agents/creators/copywriter.ts +0 -89
  92. package/agents/creators/course-creator.ts +0 -106
  93. package/agents/creators/crm-agent.ts +0 -479
  94. package/agents/creators/docs-writer.ts +0 -77
  95. package/agents/creators/forms-builder.ts +0 -90
  96. package/agents/creators/jobs-manager.ts +0 -82
  97. package/agents/creators/newsletter-writer.ts +0 -91
  98. package/agents/creators/store-manager.ts +0 -138
  99. package/agents/csuite/cbo.ts +0 -109
  100. package/agents/csuite/ceo.ts +0 -121
  101. package/agents/csuite/cmo.ts +0 -109
  102. package/agents/csuite/coo.ts +0 -115
  103. package/agents/growth/analytics-agent.ts +0 -52
  104. package/agents/growth/scheduler.ts +0 -68
  105. package/agents/growth/seo-agent.ts +0 -282
  106. package/agents/growth/social-agent.ts +0 -346
  107. package/brand-voice.md +0 -127
  108. package/cli.ts +0 -125
  109. package/context/brand.md +0 -80
  110. package/context/business.md +0 -66
  111. package/ingest.md +0 -110
  112. package/lib/analytics.ts +0 -81
  113. package/lib/db.adapter.ts +0 -30
  114. package/lib/db.ts +0 -16
  115. package/lib/id.ts +0 -15
  116. package/lib/kb.ts +0 -337
  117. package/lib/memory.ts +0 -219
  118. package/lib/pattern-detector.ts +0 -169
  119. package/lib/profile.ts +0 -119
  120. package/lib/slug.ts +0 -30
  121. package/setup.ts +0 -127
  122. package/skills/agents/SKILL.md +0 -56
  123. package/skills/analytics/SKILL.md +0 -52
  124. package/skills/blog-writer/SKILL.md +0 -452
  125. package/skills/ceo/SKILL.md +0 -25
  126. package/skills/cmo/SKILL.md +0 -8
  127. package/skills/schema/SKILL.md +0 -45
  128. package/skills/store/SKILL.md +0 -62
  129. package/tsconfig.json +0 -13
  130. package/working-style.md +0 -87
package/README.md CHANGED
@@ -1,195 +1,148 @@
1
1
  # BusinessKit Agent
2
2
 
3
- Your agents are useless without a knowledge layer.
4
- This is the knowledge layer — plus the agents that read from it.
3
+ The universal autonomous agent workspace for **BusinessKit**. Operate, manage, and automate your entire business from any AI assistant or coding agent—including **Claude Code**, **Cursor**, **Antigravity**, **VS Code Copilot**, and **Gemini CLI**.
5
4
 
6
- 17 agents (CEO, CRM, Social, SEO, Blog Writer, and more) that read and write directly
7
- to your Turso database. Two layers:
5
+ ---
8
6
 
9
- **Brand Foundation (BF)** — static, you write once: `context/brand-voice.md`,
10
- `context/about-me.md`, `SOUL.md`. Agents read before producing anything.
7
+ ## What is BusinessKit Agent?
11
8
 
12
- **Knowledge Base Layer (KBL)** — dynamic, agents maintain: `agent_kb` table grows
13
- every session. Drop anything into `agent_notes` inbox — links, ideas, tweets, articles.
14
- Run `/ingest` and the agent compiles structured wiki pages with cross-links.
15
- Every question you ask gets filed back as a new entry. Knowledge compounds.
9
+ BusinessKit Agent connects your favorite AI agent directly to your local BusinessKit desktop app through the **Model Context Protocol (MCP)**.
16
10
 
17
- Works with Claude Code, Claude Cowork, Gemini CLI, Codex, and any terminal.
11
+ Instead of switching back and forth between apps and forms, your AI assistant can execute real business operations on your behalf:
12
+ - **Billing & POS**: Create walk-in POS receipts, parse handwritten bills, and draft formal customer invoices.
13
+ - **Inventory & Purchasing**: Scan supplier purchase invoices, automatically restock items, update moving average cost, and adjust inventory.
14
+ - **Website & Landing Pages**: Assemble responsive landing pages with native modular sections or create bespoke custom components.
15
+ - **Docs & Publishing**: Write and publish technical documentation, guides, newsletters, and SEO-optimized blog posts.
16
+ - **CRM & Contacts**: Register and organize clients, suppliers, and leads with tags and contact info.
17
+ - **Support Inbox**: Triage customer threads, extract 2FA verification codes, and draft email replies.
18
18
 
19
19
  ---
20
20
 
21
- ## Install — two ways
22
-
23
- ### Option A — Claude Code plugin (recommended)
24
-
25
- One command. Works across all projects. Auto-updates.
21
+ ## How It Works
26
22
 
27
- Open Claude Code terminal (`Ctrl+`` ` ``):
28
-
29
- ```bash
30
- /plugin marketplace add businesskitai/businesskit-agent
31
- /plugin install businesskit@businesskitai
32
- /reload-plugins
23
+ ```
24
+ AI Assistant / IDE
25
+ (Claude Code / Cursor / Antigravity / VS Code)
26
+ │
27
+ ├─ Reads Universal Commands & Skills (`commands/` & `skills/`)
28
+ │ └─ Editorial rules, page layouts, accounting workflows
29
+ │
30
+ └─ Calls BusinessKit MCP Server (`businesskit --mcp --profile <id>`)
31
+ │
32
+ └─ Native BusinessKit Engine
33
+ ├─ Automatic double-entry ledger balancing (`fin_journal_entries`)
34
+ ├─ Append-only stock & customer credit ledgers
35
+ ├─ Isolated local profile database
36
+ └─ Zero credential exposure (keys stay in OS Keychain)
33
37
  ```
34
38
 
35
- Enter your credentials when prompted — `TURSO_URL` and `TURSO_TOKEN` from BusinessKit → Settings → Credentials.
36
-
37
- Commands are namespaced: `/businesskit:ceo`, `/businesskit:crm`, `/businesskit:blog-writer` etc.
39
+ All business logic, financial ledger balancing, inventory calculations, and database operations are executed safely inside the native BusinessKit engine. Your database credentials never leak into LLM prompts.
38
40
 
39
41
  ---
40
42
 
41
- ### Option B — Clone for full access
42
-
43
- Source code, all agents, customise everything.
43
+ ## Quick Start
44
44
 
45
+ ### Option A: Install as Claude Code Plugin
45
46
  ```bash
46
- git clone https://github.com/businesskitai/businesskit-agent
47
- cd businesskit-agent
48
- npm install
49
- cp .env.example .env
50
- # Paste TURSO_URL and TURSO_TOKEN from BusinessKit → Settings → Credentials
51
- npm run setup
47
+ claude plugin add https://github.com/businesskitai/businesskit-agent
52
48
  ```
53
49
 
54
- Commands are direct: `/ceo`, `/crm`, `/blog-writer` etc.
55
-
56
- ---
57
-
58
- **Get credentials:** BusinessKit → Settings → Credentials → copy Turso URL and Token.
59
-
60
- ---
61
-
62
- ## Fill in your context (20 minutes, once)
63
-
64
- These files make every agent 10x better. Without them, agents guess.
65
-
66
- ```
67
- context/about-me.md → who you are, your background, credibility
68
- context/brand-voice.md → voice bible with real writing examples
69
- context/working-style.md → how you work, approval preferences, schedule
70
- context/business.md → goals, revenue model, 90-day targets
50
+ ### Option B: Run Universal Setup (All IDEs & Agents)
51
+ From inside this directory:
52
+ ```bash
53
+ ./bin/businesskit.js
54
+ # or: npx @businesskit/agent
55
+ # or: npm run setup
71
56
  ```
72
57
 
73
- **This is the most important step.** Shann Holmberg (Espressio) calls this the Brand Foundation —
74
- the static layer agents read before producing anything so the output sounds like you, not generic AI.
58
+ The setup script automatically:
59
+ 1. Detects your installed BusinessKit app (`/Applications/BusinessKit.app` on macOS, or build binary).
60
+ 2. Connects to your active organization profile.
61
+ 3. Configures your agent environment:
62
+ - **Claude Code**: generates `.mcp.json` and `.claude/commands`
63
+ - **Cursor**: generates `.cursor/mcp.json` and `.cursorrules`
64
+ - **Antigravity / Gemini CLI**: registers via `agy mcp add` / `.gemini/mcp_config.json`
65
+ - **VS Code**: generates `.vscode/mcp.json`
75
66
 
76
67
  ---
77
68
 
78
- ## How to use
69
+ ## Using With Your Agent
79
70
 
80
71
  ### Claude Code
81
-
82
- Open this folder. Type any slash command:
83
-
84
- ```
85
- /ceo → weekly business briefing, priorities, pending approvals
86
- /blog-writer → write posts, listicles, how-tos, comparisons
87
- /newsletter → draft and send newsletters
88
- /social → post to Twitter, LinkedIn, Instagram, TikTok (13 platforms)
89
- /crm → manage contacts, deals, outreach pipeline
90
- /seo → audit, fix meta, track LLM visibility
91
- /analytics → revenue, traffic, product performance
92
- /store → launch products, courses, services
93
- /ingest → process agent_notes inbox into knowledge base
94
- /kb → query your knowledge base
95
- /compress → save session before context runs out
96
- /resume → reload context next session
97
- ```
98
-
99
- ### Claude Cowork
100
-
101
- Install the BusinessKit plugin. Same commands, runs in your browser.
102
-
103
- ### Terminal
104
-
72
+ Open your terminal in this repository and start Claude:
105
73
  ```bash
106
- npx tsx cli.ts ceo
107
- npx tsx cli.ts blog-writer
108
- npx tsx cli.ts crm
109
- ```
110
-
111
- ---
112
-
113
- ## The knowledge layer
114
-
115
- Drop anything into your inbox:
116
-
117
- ```
118
- "add to notes: https://twitter.com/karpathy/status/... — useful for SEO strategy"
119
- "add to notes: idea — launch a free email course as lead magnet"
120
- "add to notes: competitor just raised prices, opportunity"
74
+ claude
121
75
  ```
122
-
123
- Run `/ingest` weekly. The agent reads each note, builds or updates wiki pages,
124
- cross-references related entries, marks contradictions as stale.
125
-
126
- Query anytime:
127
-
128
- ```
129
- /kb → "what do I know about email deliverability?"
130
- "what content formats performed best?"
131
- "what's my current positioning vs competitors?"
76
+ Type any slash command directly:
77
+ ```bash
78
+ /write-docs "Getting Started"
79
+ /create-page "About Us"
80
+ /create-new-bill 5 Box Tellzy 40 Tab @ ₹1258.83 -15%
132
81
  ```
133
82
 
134
- Every answer gets filed back. The knowledge base gets richer every session.
83
+ ### Antigravity & Gemini CLI
84
+ Antigravity connects via the registered `businesskit` MCP server and reads `AGENTS.md`, `commands/`, and `skills/`.
85
+ You can use natural language or slash triggers:
86
+ - *"Draft a customer invoice for Acme Corp with 10 units of consulting"*
87
+ - `/write-docs "Pages Architecture"`
88
+ - *"Restock items from this supplier bill"*
135
89
 
136
- ---
137
-
138
- ## Agents
139
-
140
- | Agent | What they do |
141
- |---|---|
142
- | **CEO** | Weekly briefing, revenue pulse, priorities, pending approvals |
143
- | **CMO** | Marketing strategy, content calendar, growth planning |
144
- | **COO** | Operations, publishing queue, task management |
145
- | **CBO** | Revenue analysis, pricing strategy, product performance |
146
- | **Blog Writer** | Posts, listicles, how-tos, comparisons, programmatic content |
147
- | **Newsletter Writer** | Drafts, subscriber analytics, send management |
148
- | **Copywriter** | Landing pages, product copy, profile bio |
149
- | **Course Creator** | Course structure, lessons, pricing, access |
150
- | **Store Manager** | Products, webinars, services, sponsorships, 1:1 calls |
151
- | **Jobs Manager** | Job listings, applications |
152
- | **Forms Builder** | Intake forms, waitlists, surveys |
153
- | **Docs Writer** | Knowledge base articles, FAQs |
154
- | **CRM Agent** | Contacts, deals, outreach pipeline with approval gates |
155
- | **Social Agent** | 13 platforms via Zernio, scheduling, inbox |
156
- | **Analytics Agent** | Revenue, traffic, product, email stats |
157
- | **SEO Agent** | Technical audit, meta, LLM visibility tracking |
158
- | **Scheduler** | Cron tasks, publish queue, Hermes pattern detection |
90
+ ### Cursor
91
+ Open this folder in Cursor (`cursor .`). Cursor detects `.cursorrules` and `.cursor/mcp.json`. Use natural language or slash commands with the agent:
92
+ - *"Create a landing page for our Black Friday Sale with hero, features, and pricing"*
93
+ - *"Check stock levels for Tellzy 40"*
159
94
 
160
95
  ---
161
96
 
162
- ## Cost
163
-
164
- Every agent is built to minimise token cost:
165
-
166
- - Skills loaded on demand — only what the task needs
167
- - KB index scanned first (slug + summary), content loaded only when needed
168
- - Reports pushed to Turso mid-conversation — never lost if session ends
169
- - `SYSTEM.md` enforces: do first, report after. No narrating what's about to happen.
170
-
171
- One founder moved from $130/5 days on a heavyweight agent setup to $10 on a lean
172
- knowledge-layer-first approach. That's the target.
97
+ ## Universal Commands (`commands/`)
98
+
99
+ All 23 universal commands match the BusinessKit in-app commands 1:1:
100
+
101
+ | Domain | Command | Description |
102
+ | :--- | :--- | :--- |
103
+ | **Docs & CMS** | `/write-docs` | Write structured documentation or knowledge base articles (`cat_32`) |
104
+ | | `/write-blog` | Draft or publish a blog post with clean TipTap HTML (`cat_35`) |
105
+ | | `/write-guide` | Step-by-step how-to guide with prerequisites and FAQs (`cat_36`) |
106
+ | | `/write-newsletter` | Conversational email newsletter issue with sections and CTA (`cat_20`) |
107
+ | | `/list-content` | List published and draft articles across hubs |
108
+ | | `/update-content` | Edit body HTML, metadata, collection, or publish status |
109
+ | | `/seo-audit` | Audit SEO titles, meta descriptions, and keywords |
110
+ | **Pages & Web** | `/create-page` | Assemble a complete landing page using native visual sections |
111
+ | | `/update-page` | Update sections, copy, or settings on an existing page |
112
+ | | `/publish-page` | Toggle page live/published status |
113
+ | | `/list-pages` | List all website pages and publication statuses |
114
+ | | `/create-component` | Generate a bespoke custom component in `user_components` |
115
+ | | `/list-components` | List custom components stored in `user_components` |
116
+ | **Shop & POS** | `/create-new-bill` | Immediate POS billing receipt, natural language or handwritten bill |
117
+ | | `/create-invoice` | Draft a formal itemized B2B customer invoice |
118
+ | | `/send-invoice` | Send customer invoice via email and generate payment link |
119
+ | | `/update-price` | Update retail selling price, cost, or discount floor |
120
+ | **Inventory** | `/add-inventory-from-invoice` | Scan purchase invoice to restock items and post accounting |
121
+ | | `/check-stock` | Query on-hand inventory levels and low-stock alerts |
122
+ | | `/adjust-stock` | Record damage, shrinkage, or audit count variances |
123
+ | **CRM** | `/add-contact` | Register a new client, lead, or supplier in CRM |
124
+ | | `/update-contact` | Update contact information, company, or tags |
125
+ | **System** | `/capabilities` | Discover active modules, profile settings, and tools |
173
126
 
174
127
  ---
175
128
 
176
- ## Works with
129
+ ## Workflow Skills (`skills/`)
177
130
 
178
- | Tool | How |
179
- |---|---|
180
- | Claude Code | Primary runtime — slash commands in `.claude/commands/` |
181
- | Claude Cowork | Plugin at `.claude-plugin/plugin.json` — 18 commands |
182
- | Gemini CLI | Reads `GEMINI.md` automatically |
183
- | Codex | Reads `AGENTS.md` automatically |
184
- | Cursor | Reads `.cursorrules` automatically |
185
- | Any terminal | `npx tsx cli.ts <agent>` |
131
+ - [`skills/docs-cms/SKILL.md`](./skills/docs-cms/SKILL.md) — Technical documentation (`cat_32`), guides, and blog articles (with `references/how-to.md`).
132
+ - [`skills/pages/SKILL.md`](./skills/pages/SKILL.md) — Visual site builder, section schemas, and custom HTML/CSS components (with `references/sections-catalog.json`).
133
+ - [`skills/billing/SKILL.md`](./skills/billing/SKILL.md) — POS bills, B2B invoices, and payment tracking.
134
+ - [`skills/inventory/SKILL.md`](./skills/inventory/SKILL.md) — Stock levels, purchase invoices, and price lists.
135
+ - [`skills/crm/SKILL.md`](./skills/crm/SKILL.md) — Contacts, leads, and customer tags.
136
+ - [`skills/inbox/SKILL.md`](./skills/inbox/SKILL.md) — Triage, 2FA code extraction, and reply drafting.
137
+ - [`skills/brand/SKILL.md`](./skills/brand/SKILL.md) — Brand identity, voice guidelines, and store context.
138
+ - [`skills/humanizer/SKILL.md`](./skills/humanizer/SKILL.md) — De-AI writing patterns and voice polishing.
139
+ - [`skills/copywriting/SKILL.md`](./skills/copywriting/SKILL.md) — High-converting sales page copywriting.
140
+ - [`skills/social/SKILL.md`](./skills/social/SKILL.md) — Multi-platform social copy and threads.
186
141
 
187
142
  ---
188
143
 
189
- ## Requirements
190
-
191
- - Node.js 18+
192
- - A BusinessKit account with Turso connected
193
- - Social platform tokens (optional — for `/social`)
144
+ ## Operating Principles
194
145
 
195
- MIT License
146
+ 1. **Native Engine Execution**: All operations run through verified BusinessKit tools with atomic database transactions.
147
+ 2. **Drafts First**: External communications, customer invoices, and emails are prepared as drafts for human review before transmission.
148
+ 3. **Structured Outputs**: All deliverables, exports, and generated files are organized in `./output/`.
@@ -0,0 +1,3 @@
1
+ <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M14 4.66683C12.3892 4.66683 11.0833 5.97267 11.0833 7.5835C11.0833 9.19433 12.3892 10.5002 14 10.5002C15.6108 10.5002 16.9167 9.19433 16.9167 7.5835C16.9167 5.97267 15.6108 4.66683 14 4.66683ZM14 4.66683V2.3335M24.5 17.4272C21.9347 20.3337 18.1814 22.1668 14 22.1668C9.81858 22.1668 6.06531 20.3337 3.5 17.4272M12.5356 10.1055L3.5 25.6668M15.4644 10.1055L24.5 25.6668" stroke="#D97757" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -1,23 +1,17 @@
1
1
  #!/usr/bin/env node
2
- // bin/businesskit.js — npm global install entry point
3
- // Compiled shim that launches cli.ts via tsx
4
- // Cursor is right: bin entries must be .js for npm to execute them correctly
2
+ // bin/businesskit.js — CLI entrypoint to configure BusinessKit Agent
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
5
+ import { spawn } from 'child_process';
5
6
 
6
- import { createRequire } from 'module'
7
- import { fileURLToPath } from 'url'
8
- import { dirname, join } from 'path'
9
- import { spawn } from 'child_process'
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const root = join(__dirname, '..');
9
+ const setupScript = join(root, 'scripts', 'setup.sh');
10
10
 
11
- const __dirname = dirname(fileURLToPath(import.meta.url))
12
- const root = join(__dirname, '..')
13
- const cli = join(root, 'cli.ts')
14
-
15
- // Find tsx — from local node_modules or global
16
- const tsx = process.execPath.replace('node', 'tsx')
17
- const proc = spawn(tsx, [cli, ...process.argv.slice(2)], {
11
+ const proc = spawn('bash', [setupScript, ...process.argv.slice(2)], {
18
12
  stdio: 'inherit',
19
13
  cwd: root,
20
- env: { ...process.env }
21
- })
14
+ env: { ...process.env },
15
+ });
22
16
 
23
- proc.on('exit', code => process.exit(code ?? 0))
17
+ proc.on('exit', (code) => process.exit(code ?? 0));
@@ -0,0 +1,47 @@
1
+ ---
2
+ id: "cmd_add_contact"
3
+ name: "Add CRM Contact"
4
+ slash: "/add-contact"
5
+ description: "Register a new client, vendor, or lead with email/phone"
6
+ domain_tags: ["crm"]
7
+ required_tools: ["contact_create"]
8
+ ---
9
+
10
+ # Add CRM Contact (`/add-contact`)
11
+
12
+ Register a new client, vendor, supplier, or business lead in the unified CRM.
13
+
14
+ ## Available Tools
15
+ - `contact_create(name: string, email?: string, phone?: string, tags?: array)`: Creates contact and syncs with CRM directory.
16
+
17
+ ## Accepted Arguments
18
+ - Natural language contact creation:
19
+ - `/add-contact John Doe john@example.com +1-555-0199 tags:["client", "vip"]`
20
+ - `/add-contact vendor: "Apex Manufacturing" contact: sales@apex.com`
21
+
22
+ ## Execution Protocol
23
+
24
+ ### Step 1: Parse Contact Details
25
+ 1. Extract full name (split into first and last name automatically).
26
+ 2. Extract email address and validate format.
27
+ 3. Extract phone / mobile number.
28
+ 4. Extract descriptive tags (e.g. `["lead", "wholesale", "partner"]`).
29
+
30
+ ### Step 2: Execute Creation
31
+ Call `contact_create`:
32
+ ```json
33
+ {
34
+ "name": "Sarah Jenkins",
35
+ "email": "sarah.j@example.com",
36
+ "phone": "+1-555-8821",
37
+ "tags": ["client", "q4-lead"]
38
+ }
39
+ ```
40
+
41
+ ### Step 3: Confirmation
42
+ Output contact confirmation card:
43
+ - **Contact ID**: e.g. `ct_8a92b1f4`
44
+ - **Full Name**: Sarah Jenkins
45
+ - **Email & Phone**
46
+ - **Tags**: `client`, `q4-lead`
47
+ - **Next Steps**: Link to invoices (`/create-invoice`) or log communications.
@@ -0,0 +1,80 @@
1
+ ---
2
+ id: "cmd_add_inventory_from_invoice"
3
+ name: "Receive Stock from Invoice"
4
+ slash: "/add-inventory-from-invoice"
5
+ description: "Scan purchase invoice or PDF to auto-restock items"
6
+ domain_tags: ["shop"]
7
+ required_tools: ["inventory_receive_purchase_invoice"]
8
+ ---
9
+
10
+ # Receive Stock from Invoice (`/add-inventory-from-invoice`)
11
+
12
+ Scan purchase bills, supplier invoices, or OCR text to restock warehouse inventory, calculate selling prices, update purchase costs, and post double-entry accounts payable journal entries.
13
+
14
+ ## Available Tools
15
+ - `inventory_receive_purchase_invoice(vendor_name: string, line_items: array, invoice_number?: string, invoice_date?: string, payment_method?: string, payment_status?: string)`: Automatically records inward goods receipt and recalculates weighted average costs.
16
+
17
+ ## Purchase Line Item Schema
18
+ ```json
19
+ {
20
+ "item_name": "Premium Cotton Shirt",
21
+ "sku": "SHIRT-CTN-01",
22
+ "quantity": 100,
23
+ "unit_cost": 25.00,
24
+ "tax_rate": 5.0,
25
+ "discount_pct": 0,
26
+ "selling_price": 55.00,
27
+ "batch_number": "BATCH-2026-A",
28
+ "expiry_date": "2027-12-31"
29
+ }
30
+ ```
31
+
32
+ ## Pricing & Markup Rules
33
+ - `cost_price`: Inward base purchase cost per unit.
34
+ - If user requests markup: `Selling Price = Cost + (Cost * Markup %)`.
35
+ - If new products are being received, prompt or calculate the selling price if omitted.
36
+
37
+ ## Accepted Arguments
38
+ - Raw invoice text or structured items:
39
+ - `/add-inventory-from-invoice vendor:"Apex Supplies" inv:AP-892 items:[{ name: "Widget A", qty: 50, cost: 12.50, selling: 25.00 }]`
40
+ - Or paste purchase bill content after the slash command.
41
+
42
+ ## Execution Protocol
43
+
44
+ ### Step 1: Parse Inward Invoice Data
45
+ 1. Extract Vendor Name (mandatory).
46
+ 2. Extract Invoice Number and Invoice Date.
47
+ 3. Parse all line items: product name, SKU, quantity received, unit cost, taxes, discounts, batches, and selling prices.
48
+
49
+ ### Step 2: Double-Entry & Stock Ledger Integrity
50
+ Calling `inventory_receive_purchase_invoice` performs atomic ledger updates:
51
+ - Restocks warehouse quantity for each item (`track_inventory = 1`).
52
+ - Recalculates moving average unit cost.
53
+ - Posts double-entry journal records: Debits Inventory Asset, Credits Accounts Payable (or Cash/Bank).
54
+
55
+ ### Step 3: Execute Goods Receipt
56
+ Call `inventory_receive_purchase_invoice`:
57
+ ```json
58
+ {
59
+ "vendor_name": "Apex Supplies",
60
+ "invoice_number": "INV-2026-881",
61
+ "invoice_date": "2026-11-22",
62
+ "payment_status": "confirmed",
63
+ "payment_method": "bank_transfer",
64
+ "line_items": [
65
+ {
66
+ "item_name": "Widget A",
67
+ "quantity": 50,
68
+ "unit_cost": 12.50,
69
+ "selling_price": 25.00
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ ### Step 4: Summary Output
76
+ Display a receipt summary:
77
+ - **Vendor & Invoice #**
78
+ - **Restocked Items Table**: SKU, Item Name, Quantity Added, Cost Price, Selling Price
79
+ - **Total Inward Value & Tax**
80
+ - **Status**: Inventory and double-entry accounts updated.
@@ -0,0 +1,46 @@
1
+ ---
2
+ id: "cmd_adjust_stock"
3
+ name: "Adjust Stock Quantity"
4
+ slash: "/adjust-stock"
5
+ description: "Record damage, audit variances or stock corrections"
6
+ domain_tags: ["shop"]
7
+ required_tools: ["inventory_add_stock"]
8
+ ---
9
+
10
+ # Adjust Stock Quantity (`/adjust-stock`)
11
+
12
+ Record manual stock adjustments, breakage, damaged goods, return discrepancies, or cycle count audit variances.
13
+
14
+ ## Available Tools
15
+ - `inventory_add_stock(sku: string, quantity_delta: number, movement_type?: string, unit_cost?: number, reason?: string)`: Adjusts inventory balance and posts inventory shrinkage/variance accounting entries.
16
+
17
+ ## Accepted Arguments
18
+ - Increase stock (found surplus): `/adjust-stock sku:WDG-01 qty:+5 reason:"Audit surplus"`
19
+ - Decrease stock (damage/loss): `/adjust-stock sku:WDG-01 qty:-2 reason:"Broken during transit"`
20
+ - Natural language: `/adjust-stock 3 units of Tellzy 40 damaged`
21
+
22
+ ## Execution Protocol
23
+
24
+ ### Step 1: Parse Item & Delta
25
+ 1. Identify product SKU or item name.
26
+ 2. Determine `quantity_delta` (positive for additions, negative for write-offs).
27
+ 3. Determine movement type (e.g. `adjustment`, `shrinkage`, `damage`, `return`).
28
+ 4. Capture adjustment reason for audit trails.
29
+
30
+ ### Step 2: Execute Adjustment
31
+ Call `inventory_add_stock`:
32
+ ```json
33
+ {
34
+ "sku": "WDG-01",
35
+ "quantity_delta": -2,
36
+ "movement_type": "damage",
37
+ "reason": "Water damage in storage"
38
+ }
39
+ ```
40
+
41
+ ### Step 3: Confirmation
42
+ Output adjustment summary:
43
+ - **Product Name & SKU**
44
+ - **Adjustment**: -2 units (Damage Write-off)
45
+ - **New On Hand Balance**: Updated warehouse total
46
+ - **Accounting Note**: Inventory loss booked to double-entry ledger.
@@ -0,0 +1,33 @@
1
+ ---
2
+ id: "cmd_capabilities"
3
+ name: "Platform Capabilities"
4
+ slash: "/capabilities"
5
+ description: "Discover all available BusinessKit platform capabilities"
6
+ domain_tags: ["system"]
7
+ required_tools: ["system_get_capabilities"]
8
+ ---
9
+
10
+ # Platform Capabilities (`/capabilities`)
11
+
12
+ Inspect active profile settings, enabled modules, store currency, tax configurations, and system toolsets.
13
+
14
+ ## Available Tools
15
+ - `system_get_capabilities()`: Queries the active profile's installed modules and runtime capabilities.
16
+
17
+ ## Accepted Arguments
18
+ - `/capabilities`
19
+
20
+ ## Execution Protocol
21
+
22
+ ### Step 1: Query System Capabilities
23
+ Call `system_get_capabilities()`:
24
+ ```json
25
+ {}
26
+ ```
27
+
28
+ ### Step 2: Present System Summary
29
+ Format a clean markdown report:
30
+ - **Active Profile**: Store Name, Profile ID, Currency, Location
31
+ - **Installed Modules**: Shop & POS, Pages & Landing Pages, Docs / Content, CRM, Domains, Inbox
32
+ - **Available MCP Tools**: Summary of active tool count
33
+ - **Tax & Compliance**: Active tax regime (e.g. GST, Sales Tax, VAT) and inclusive/exclusive pricing mode.
@@ -0,0 +1,43 @@
1
+ ---
2
+ id: "cmd_check_stock"
3
+ name: "Check Stock Levels"
4
+ slash: "/check-stock"
5
+ description: "Inspect inventory levels, reorder points & batches"
6
+ domain_tags: ["shop"]
7
+ required_tools: ["inventory_get_levels"]
8
+ ---
9
+
10
+ # Check Stock Levels (`/check-stock`)
11
+
12
+ Query current stock on hand, warehouse locations, reorder thresholds, and low-stock alerts.
13
+
14
+ ## Available Tools
15
+ - `inventory_get_levels(sku?: string, item_name?: string, low_stock_only?: boolean)`: Retrieves current inventory status across items.
16
+
17
+ ## Accepted Arguments
18
+ - All tracked inventory: `/check-stock`
19
+ - Specific item: `/check-stock Tellzy 40` or `/check-stock sku:SHIRT-01`
20
+ - Low stock items only: `/check-stock --low` or `/check-stock reorder`
21
+
22
+ ## Execution Protocol
23
+
24
+ ### Step 1: Query Inventory
25
+ Call `inventory_get_levels` with user filters:
26
+ ```json
27
+ {
28
+ "item_name": "<optional_filter>",
29
+ "low_stock_only": false
30
+ }
31
+ ```
32
+
33
+ ### Step 2: Format Inventory Overview
34
+ Present findings in a clear markdown table:
35
+
36
+ | Item Name | SKU | On Hand | Reorder Point | Status | Selling Price |
37
+ | :--- | :--- | :--- | :--- | :--- | :--- |
38
+ | Widget Pro | `WDG-PRO` | 142 | 20 | 🟢 In Stock | $49.99 |
39
+ | USB-C Cable | `CBL-USBC` | 4 | 25 | 🔴 Low Stock | $12.50 |
40
+
41
+ ### Step 3: Suggest Restocking or Adjustments
42
+ - If low stock detected, prompt: `/add-inventory-from-invoice` to restock.
43
+ - If physical audit variance found, suggest: `/adjust-stock <sku> <delta>`.