@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.
- package/.agents/skills/agents.md +56 -0
- package/.agents/skills/analytics.md +47 -0
- package/.agents/skills/brand.md +87 -0
- package/.agents/skills/schema.md +45 -0
- package/.agents/skills/store.md +46 -0
- package/.claude/commands/analytics.md +7 -0
- package/.claude/commands/blog-writer.md +9 -0
- package/.claude/commands/cbo.md +7 -0
- package/.claude/commands/ceo.md +10 -0
- package/.claude/commands/cmo.md +7 -0
- package/.claude/commands/compress.md +73 -0
- package/.claude/commands/coo.md +11 -0
- package/.claude/commands/copywriter.md +15 -0
- package/.claude/commands/course-creator.md +9 -0
- package/.claude/commands/crm.md +82 -0
- package/.claude/commands/deep.md +50 -0
- package/.claude/commands/docs-writer.md +8 -0
- package/.claude/commands/forms-builder.md +10 -0
- package/.claude/commands/jobs-manager.md +8 -0
- package/.claude/commands/kb.md +107 -0
- package/.claude/commands/newsletter-writer.md +9 -0
- package/.claude/commands/preserve.md +64 -0
- package/.claude/commands/resume.md +67 -0
- package/.claude/commands/scheduler.md +8 -0
- package/.claude/commands/seo.md +60 -0
- package/.claude/commands/social.md +51 -0
- package/.claude/commands/store-manager.md +11 -0
- package/.claude/skills/README.md +33 -0
- package/.claude/skills/agents.md +56 -0
- package/.claude/skills/analytics.md +7 -0
- package/.claude/skills/blog-writing.md +452 -0
- package/.claude/skills/brand.md +44 -0
- package/.claude/skills/content-seo.md +0 -0
- package/.claude/skills/humanizer.md +474 -0
- package/.claude/skills/schema.md +45 -0
- package/.claude/skills/social-content.md +278 -0
- package/.claude/skills/store-copywriting.md +519 -0
- package/.claude/skills/store.md +62 -0
- package/.claude-plugin/plugin.json +33 -0
- package/.cursorrules +0 -0
- package/.env.example +2 -0
- package/.mcp.json +3 -0
- package/AGENTS.md +63 -0
- package/CLAUDE.md +221 -0
- package/GEMINI.md +37 -0
- package/LICENSE +21 -0
- package/PLAN.md +253 -0
- package/PRD-Agent-Harness.md +316 -0
- package/README.md +237 -0
- package/SYSTEM.md +49 -0
- package/agents/_base.ts +63 -0
- package/agents/creators/blog-writer.ts +347 -0
- package/agents/creators/copywriter.ts +89 -0
- package/agents/creators/course-creator.ts +106 -0
- package/agents/creators/crm-agent.ts +479 -0
- package/agents/creators/docs-writer.ts +77 -0
- package/agents/creators/forms-builder.ts +90 -0
- package/agents/creators/jobs-manager.ts +82 -0
- package/agents/creators/newsletter-writer.ts +91 -0
- package/agents/creators/store-manager.ts +138 -0
- package/agents/csuite/cbo.ts +109 -0
- package/agents/csuite/ceo.ts +121 -0
- package/agents/csuite/cmo.ts +109 -0
- package/agents/csuite/coo.ts +115 -0
- package/agents/growth/analytics-agent.ts +52 -0
- package/agents/growth/scheduler.ts +68 -0
- package/agents/growth/seo-agent.ts +282 -0
- package/agents/growth/social-agent.ts +346 -0
- package/bin/businesskit.js +17 -0
- package/cli.ts +125 -0
- package/context/brand.md +80 -0
- package/context/business.md +66 -0
- package/lib/analytics.ts +81 -0
- package/lib/db.adapter.ts +30 -0
- package/lib/db.ts +16 -0
- package/lib/id.ts +15 -0
- package/lib/kb.ts +337 -0
- package/lib/memory.ts +219 -0
- package/lib/pattern-detector.ts +169 -0
- package/lib/profile.ts +119 -0
- package/lib/slug.ts +30 -0
- package/package.json +50 -0
- package/setup.ts +127 -0
- package/tsconfig.json +13 -0
package/setup.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
try {
|
|
75
|
+
const { rows } = await db.execute('SELECT id, slug, title FROM profiles LIMIT 1')
|
|
76
|
+
if (!rows.length) {
|
|
77
|
+
err('No profile found in your database')
|
|
78
|
+
dim('Complete BusinessKit onboarding at businesskit.io first')
|
|
79
|
+
dim('Then come back and run: npm run setup')
|
|
80
|
+
process.exit(1)
|
|
81
|
+
}
|
|
82
|
+
const p = rows[0]
|
|
83
|
+
ok(`Profile: ${p.title} (@${p.slug})`)
|
|
84
|
+
dim(`Profile ID: ${p.id}`)
|
|
85
|
+
} catch (e: any) {
|
|
86
|
+
err(`Could not read profiles table: ${e.message}`)
|
|
87
|
+
dim('Your database may not be provisioned yet')
|
|
88
|
+
dim('Complete BusinessKit onboarding first')
|
|
89
|
+
process.exit(1)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ── Step 4: Key agent tables exist ───────────────────────────────────────────
|
|
93
|
+
console.log('\n4. Checking database tables...')
|
|
94
|
+
const requiredTables = ['profiles', 'posts', 'products', 'subscribers', 'crm_contacts', 'social_posts']
|
|
95
|
+
const missing: string[] = []
|
|
96
|
+
|
|
97
|
+
for (const table of requiredTables) {
|
|
98
|
+
try {
|
|
99
|
+
await db.execute(`SELECT 1 FROM ${table} LIMIT 0`)
|
|
100
|
+
} catch {
|
|
101
|
+
missing.push(table)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (missing.length) {
|
|
106
|
+
err(`Missing tables: ${missing.join(', ')}`)
|
|
107
|
+
dim('Your DB may not be fully provisioned')
|
|
108
|
+
dim('Go to BusinessKit → Dashboard → Status and click "Provision"')
|
|
109
|
+
process.exit(1)
|
|
110
|
+
}
|
|
111
|
+
ok(`All required tables found`)
|
|
112
|
+
|
|
113
|
+
// ── Step 5: Node version ──────────────────────────────────────────────────────
|
|
114
|
+
console.log('\n5. Checking Node.js version...')
|
|
115
|
+
const [major] = process.versions.node.split('.').map(Number)
|
|
116
|
+
if (major < 18) {
|
|
117
|
+
err(`Node.js ${process.versions.node} is too old (need 18+)`)
|
|
118
|
+
dim('Install Node.js 18+ from nodejs.org')
|
|
119
|
+
process.exit(1)
|
|
120
|
+
}
|
|
121
|
+
ok(`Node.js ${process.versions.node}`)
|
|
122
|
+
|
|
123
|
+
// ── Done ──────────────────────────────────────────────────────────────────────
|
|
124
|
+
console.log(`\n${GREEN}${BOLD}✅ All checks passed.${RESET}\n`)
|
|
125
|
+
console.log(`Open this folder in Claude Code and type ${BOLD}/ceo${RESET} to start.\n`)
|
|
126
|
+
console.log(`Or run from terminal:`)
|
|
127
|
+
console.log(` ${DIM}npx tsx cli.ts ceo${RESET}\n`)
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"resolveJsonModule": true,
|
|
9
|
+
"outDir": "dist"
|
|
10
|
+
},
|
|
11
|
+
"include": ["**/*.ts"],
|
|
12
|
+
"exclude": ["node_modules", "dist"]
|
|
13
|
+
}
|