@businesskit/agent 1.0.2 → 1.0.4
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/.claude/settings.json +16 -0
- package/.claude/settings.local.json +11 -0
- package/.claude-plugin/marketplace.json +36 -0
- package/.claude-plugin/plugin.json +7 -28
- package/.env.example +10 -0
- package/CLAUDE.md +56 -195
- package/HEARTBEAT.md +81 -57
- package/PLAN.md +211 -119
- package/PRD-Agent-Composition.md +149 -0
- package/README.md +25 -11
- package/REFERENCE.md +160 -0
- package/SOUL.md +31 -0
- package/SYSTEM.md +22 -0
- package/agents/_base.ts +352 -44
- package/agents/analytics/SOUL.md +11 -0
- package/agents/analytics/analytics.ts +405 -0
- package/agents/business/SOUL.md +11 -0
- package/agents/{csuite/cbo.ts → business/business.ts} +2 -2
- package/agents/ceo/SOUL.md +15 -0
- package/agents/{csuite → ceo}/ceo.ts +33 -8
- package/agents/content/SOUL.md +11 -0
- package/agents/content/content.ts +379 -0
- package/agents/copywriting/SOUL.md +11 -0
- package/agents/courses/SOUL.md +11 -0
- package/agents/courses/courses.ts +451 -0
- package/agents/docs/SOUL.md +11 -0
- package/agents/forms/SOUL.md +11 -0
- package/agents/forms/forms.ts +364 -0
- package/agents/hiring/SOUL.md +11 -0
- package/agents/hiring/hiring.ts +314 -0
- package/agents/marketing/SOUL.md +15 -0
- package/agents/{csuite/cmo.ts → marketing/marketing.ts} +3 -3
- package/agents/newsletter/SOUL.md +11 -0
- package/agents/operations/SOUL.md +11 -0
- package/agents/operations/operations.ts +157 -0
- package/agents/sales/SOUL.md +44 -0
- package/agents/sales/sales.ts +883 -0
- package/agents/scheduler/SOUL.md +11 -0
- package/agents/{growth → scheduler}/scheduler.ts +2 -2
- package/agents/seo/SOUL.md +11 -0
- package/agents/{growth/seo-agent.ts → seo/seo.ts} +60 -54
- package/agents/social/SOUL.md +11 -0
- package/agents/social/social.ts +744 -0
- package/agents/store/SOUL.md +11 -0
- package/agents/store/store.ts +514 -0
- package/cli.ts +44 -25
- package/lib/cms.ts +88 -0
- package/lib/db.ts +58 -11
- package/lib/enums.ts +25 -0
- package/lib/groups.ts +122 -0
- package/lib/id.ts +38 -10
- package/lib/profile.ts +44 -8
- package/lib/schema.ts +2015 -0
- package/lib/validate.ts +33 -0
- package/package.json +1 -1
- package/scripts/generate-schema.ts +244 -0
- package/setup.ts +16 -2
- package/{.agents/skills/analytics.md → skills/analytics/SKILL.md} +6 -1
- package/{.agents/skills/brand.md → skills/brand/SKILL.md} +14 -1
- package/skills/ceo/SKILL.md +25 -0
- package/skills/cmo/SKILL.md +8 -0
- package/skills/humanizer/SKILL.md +270 -0
- package/skills/schema/SKILL.md +86 -0
- package/tsconfig.json +2 -1
- package/.agents/skills/schema.md +0 -45
- package/.agents/skills/store.md +0 -46
- package/.claude/skills/agents.md +0 -56
- package/.claude/skills/analytics.md +0 -7
- package/.claude/skills/brand.md +0 -44
- package/.claude/skills/humanizer.md +0 -474
- package/.claude/skills/schema.md +0 -45
- package/agents/creators/blog-writer.ts +0 -347
- package/agents/creators/course-creator.ts +0 -106
- package/agents/creators/crm-agent.ts +0 -479
- package/agents/creators/forms-builder.ts +0 -90
- package/agents/creators/jobs-manager.ts +0 -82
- package/agents/creators/store-manager.ts +0 -138
- package/agents/csuite/coo.ts +0 -115
- package/agents/growth/analytics-agent.ts +0 -52
- package/agents/growth/social-agent.ts +0 -346
- /package/{ingest.md → .claude/commands/ingest.md} +0 -0
- /package/agents/{creators/copywriter.ts → copywriting/copywriting.ts} +0 -0
- /package/agents/{creators/docs-writer.ts → docs/docs.ts} +0 -0
- /package/agents/{creators/newsletter-writer.ts → newsletter/newsletter.ts} +0 -0
- /package/{ABOUT-ME.md → context/about-me.md} +0 -0
- /package/{brand-voice.md → context/brand-voice.md} +0 -0
- /package/{working-style.md → context/working-style.md} +0 -0
- /package/{.claude/skills → skills}/README.md +0 -0
- /package/{.agents/skills/agents.md → skills/agents/SKILL.md} +0 -0
- /package/{.claude/skills/blog-writing.md → skills/blog-writer/SKILL.md} +0 -0
- /package/{.claude/skills/store-copywriting.md → skills/copywriting/SKILL.md} +0 -0
- /package/{.claude/skills/social-content.md → skills/social/SKILL.md} +0 -0
- /package/{.claude/skills → skills/social}/content-seo.md +0 -0
- /package/{.claude/skills/store.md → skills/store/SKILL.md} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# scheduler
|
|
2
|
+
|
|
3
|
+
Placeholder SOUL. See CLAUDE.md routing table and skills/scheduler/SKILL.md (if present) for scope.
|
|
4
|
+
|
|
5
|
+
## Rules
|
|
6
|
+
|
|
7
|
+
- Load skills on demand
|
|
8
|
+
- Draft before publish
|
|
9
|
+
- Archive not delete (hidden=1)
|
|
10
|
+
- Log every action to agent_memory
|
|
11
|
+
- Push reports to agent_reports mid-session
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* ARIA (weekly briefing), NOVA (content calendar drafts), PEARL (newsletter).
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { coo } from '../
|
|
13
|
-
import { ceo } from '../
|
|
12
|
+
import { coo } from '../operations/operations.ts'
|
|
13
|
+
import { ceo } from '../ceo/ceo.ts'
|
|
14
14
|
|
|
15
15
|
export class Scheduler {
|
|
16
16
|
readonly name = 'CRON'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# seo
|
|
2
|
+
|
|
3
|
+
Placeholder SOUL. See CLAUDE.md routing table and skills/seo/SKILL.md (if present) for scope.
|
|
4
|
+
|
|
5
|
+
## Rules
|
|
6
|
+
|
|
7
|
+
- Load skills on demand
|
|
8
|
+
- Draft before publish
|
|
9
|
+
- Archive not delete (hidden=1)
|
|
10
|
+
- Log every action to agent_memory
|
|
11
|
+
- Push reports to agent_reports mid-session
|
|
@@ -39,39 +39,49 @@ export class SEOAgent extends BaseAgent {
|
|
|
39
39
|
async audit(): Promise<{ issues: SEOIssue[]; score: number; summary: string }> {
|
|
40
40
|
await this.init()
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
// All content lives in the unified `content` table; filter by the cms
|
|
43
|
+
// kinds we care about. See businesskit-files/content.ts for the schema.
|
|
44
|
+
const kinds = ['blog', 'compare', 'alternative', 'guides'] as const
|
|
43
45
|
const allIssues: SEOIssue[] = []
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
47
|
+
try {
|
|
48
|
+
const { rows } = await db.execute({
|
|
49
|
+
sql: `SELECT c.id, c.title, c.slug, c.excerpt, c.seo_title,
|
|
50
|
+
c.seo_description, c.word_count, cms.slug AS kind
|
|
51
|
+
FROM content c
|
|
52
|
+
JOIN cms ON cms.id = c.cms_id
|
|
53
|
+
WHERE c.profile_id=? AND c.published=1 AND c.hidden=0
|
|
54
|
+
AND cms.slug IN ('blog','compare','alternative','guides')`,
|
|
55
|
+
args: [this.profileId],
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
for (const r of rows) {
|
|
59
|
+
const problems: string[] = []
|
|
60
|
+
if (!r.excerpt) problems.push('missing excerpt')
|
|
61
|
+
if (!r.seo_title) problems.push('missing seo_title')
|
|
62
|
+
if (!r.seo_description) problems.push('missing seo_description')
|
|
63
|
+
if (r.seo_title && String(r.seo_title).length > 60) problems.push('seo_title >60 chars')
|
|
64
|
+
if (r.seo_description && String(r.seo_description).length > 160) problems.push('seo_description >160 chars')
|
|
65
|
+
if (Number(r.word_count ?? 0) < 300) problems.push('thin content <300 words')
|
|
66
|
+
if (!r.slug || String(r.slug).includes(' ')) problems.push('slug has spaces')
|
|
67
|
+
if (String(r.slug ?? '').length > 80) problems.push('slug too long >80 chars')
|
|
68
|
+
|
|
69
|
+
if (problems.length) {
|
|
70
|
+
allIssues.push({
|
|
71
|
+
table: String(r.kind ?? 'content'),
|
|
72
|
+
id: r.id as string,
|
|
73
|
+
title: r.title as string,
|
|
74
|
+
slug: r.slug as string,
|
|
75
|
+
problems,
|
|
76
|
+
})
|
|
67
77
|
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
78
|
+
}
|
|
79
|
+
} catch { /* content table may not exist on pre-migration DBs */ }
|
|
70
80
|
|
|
71
81
|
const score = allIssues.length === 0 ? 100 : Math.max(0, 100 - allIssues.length * 5)
|
|
72
82
|
const summary = allIssues.length === 0
|
|
73
83
|
? 'All content passes SEO checks.'
|
|
74
|
-
: `${allIssues.length} issues found across ${
|
|
84
|
+
: `${allIssues.length} issues found across ${kinds.join(', ')}.`
|
|
75
85
|
|
|
76
86
|
await logMemory('seo', `SEO audit: score ${score}/100, ${allIssues.length} issues`, { issues: allIssues.length, score })
|
|
77
87
|
|
|
@@ -80,13 +90,15 @@ export class SEOAgent extends BaseAgent {
|
|
|
80
90
|
|
|
81
91
|
// ── Fix a specific post's SEO fields ─────────────────────────────────────
|
|
82
92
|
|
|
93
|
+
/** Fix SEO fields on any content row (blog, guides, compare, …). */
|
|
83
94
|
async fixPost(id: string, fixes: {
|
|
84
95
|
seo_title?: string
|
|
85
96
|
seo_description?: string
|
|
86
97
|
seo_keywords?: string[]
|
|
87
98
|
excerpt?: string
|
|
88
99
|
slug?: string
|
|
89
|
-
}
|
|
100
|
+
}) {
|
|
101
|
+
await this.init()
|
|
90
102
|
const sets: string[] = ['updated_at=?']
|
|
91
103
|
const args: unknown[] = [iso()]
|
|
92
104
|
|
|
@@ -96,10 +108,9 @@ export class SEOAgent extends BaseAgent {
|
|
|
96
108
|
if (fixes.excerpt) { sets.push('excerpt=?'); args.push(fixes.excerpt) }
|
|
97
109
|
if (fixes.slug) { sets.push('slug=?'); args.push(this.toSlug(fixes.slug)) }
|
|
98
110
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
args: [...args, this.profileId],
|
|
111
|
+
await db.write({
|
|
112
|
+
sql: `UPDATE content SET ${sets.join(',')} WHERE id=? AND profile_id=?`,
|
|
113
|
+
args: [...args, id, this.profileId],
|
|
103
114
|
})
|
|
104
115
|
}
|
|
105
116
|
|
|
@@ -168,7 +179,7 @@ export class SEOAgent extends BaseAgent {
|
|
|
168
179
|
sql: `UPDATE profiles SET llm_visibility=? WHERE id=?`,
|
|
169
180
|
args: [JSON.stringify(updated), this.profileId],
|
|
170
181
|
})
|
|
171
|
-
await logMemory('seo', 'Updated LLM visibility', updated)
|
|
182
|
+
await logMemory('seo', 'Updated LLM visibility', updated as unknown as Record<string, unknown>)
|
|
172
183
|
return updated
|
|
173
184
|
}
|
|
174
185
|
|
|
@@ -200,38 +211,33 @@ export class SEOAgent extends BaseAgent {
|
|
|
200
211
|
advice: string[]
|
|
201
212
|
}> {
|
|
202
213
|
await this.init()
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
] = await Promise.all([
|
|
214
|
+
// content_type is no longer a column on the new `content` schema —
|
|
215
|
+
// without it we can only detect missing kinds, not missing styles.
|
|
216
|
+
// We infer style presence from titles as a heuristic.
|
|
217
|
+
const [{ rows: kindCounts }, { rows: [thin] }] = await Promise.all([
|
|
208
218
|
db.execute({
|
|
209
|
-
sql: `SELECT
|
|
210
|
-
|
|
211
|
-
|
|
219
|
+
sql: `SELECT cms.slug AS kind, COUNT(*) cnt, MAX(c.title) title_sample
|
|
220
|
+
FROM content c
|
|
221
|
+
JOIN cms ON cms.id = c.cms_id
|
|
222
|
+
WHERE c.profile_id=? AND c.published=1 AND c.hidden=0
|
|
223
|
+
GROUP BY cms.slug`,
|
|
212
224
|
args: [this.profileId],
|
|
213
225
|
}),
|
|
214
226
|
db.execute({
|
|
215
|
-
sql: `SELECT COUNT(*) cnt FROM
|
|
216
|
-
|
|
217
|
-
}),
|
|
218
|
-
db.execute({
|
|
219
|
-
sql: `SELECT COUNT(*) cnt FROM alternative WHERE profile_id=? AND published=1`,
|
|
227
|
+
sql: `SELECT COUNT(*) cnt FROM content
|
|
228
|
+
WHERE profile_id=? AND published=1 AND word_count < 500`,
|
|
220
229
|
args: [this.profileId],
|
|
221
230
|
}),
|
|
222
231
|
])
|
|
223
232
|
|
|
224
|
-
const
|
|
233
|
+
const byKind = new Map(kindCounts.map(r => [String(r.kind), Number(r.cnt ?? 0)]))
|
|
225
234
|
const highValueTypes = ['listicle', 'how-to', 'ultimate-guide', 'qa']
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
sql: `SELECT COUNT(*) cnt FROM posts WHERE profile_id=? AND published=1 AND word_count < 500`,
|
|
230
|
-
args: [this.profileId],
|
|
231
|
-
})
|
|
235
|
+
// Best-effort: if there's no blog content at all, assume nothing of that
|
|
236
|
+
// style exists yet. Otherwise leave format-specific gaps to the content agent.
|
|
237
|
+
const missingTypes = (byKind.get('blog') ?? 0) === 0 ? highValueTypes : []
|
|
232
238
|
|
|
233
|
-
const noCompare =
|
|
234
|
-
const noAlternative =
|
|
239
|
+
const noCompare = (byKind.get('compare') ?? 0) === 0
|
|
240
|
+
const noAlternative = (byKind.get('alternative') ?? 0) === 0
|
|
235
241
|
const thinPosts = Number(thin?.cnt ?? 0)
|
|
236
242
|
|
|
237
243
|
const advice: string[] = []
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# social
|
|
2
|
+
|
|
3
|
+
Placeholder SOUL. See CLAUDE.md routing table and skills/social/SKILL.md (if present) for scope.
|
|
4
|
+
|
|
5
|
+
## Rules
|
|
6
|
+
|
|
7
|
+
- Load skills on demand
|
|
8
|
+
- Draft before publish
|
|
9
|
+
- Archive not delete (hidden=1)
|
|
10
|
+
- Log every action to agent_memory
|
|
11
|
+
- Push reports to agent_reports mid-session
|