@compilr-dev/sdk 0.7.1 → 0.7.3

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/dist/index.d.ts CHANGED
@@ -61,7 +61,7 @@ export type { AskUserQuestion, AskUserInput, AskUserResult, AskUserHandler, AskU
61
61
  export { createPlatformTools, createProjectTools, createWorkItemTools, createDocumentTools, createPlanTools, createBacklogTools, createAnchorTools, createArtifactTools, createEpisodeTools, ProjectAnchorStore, } from './platform/index.js';
62
62
  export type { ProjectAnchorStoreConfig } from './platform/index.js';
63
63
  export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getStepCriteria, formatStepDisplay, getStepNumber, } from './platform/index.js';
64
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './skills/index.js';
64
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, } from './skills/index.js';
65
65
  export { ACTION_REGISTRY, getActionsForContext, getActionById, resolveActionPrompt, buildContextSummary, getSuggestedRole, } from './actions/index.js';
66
66
  export type { ActionContext, ActionDefinition } from './actions/index.js';
67
67
  export { PROJECT_TYPES, getProjectTypeConfig, getEnrichedProjectTypeConfig, getProjectTypesByCategory, generalConfig, softwareConfig, researchConfig, businessPlanConfig, contentConfig, techDocsConfig, courseConfig, ACTION_META_REGISTRY, SKILL_META_REGISTRY, resolveActionMeta, getSkillMeta, getAllSkillMeta, } from './project-types/index.js';
package/dist/index.js CHANGED
@@ -139,7 +139,7 @@ export { STEP_ORDER, GUIDED_STEP_CRITERIA, getNextStep, isValidTransition, getSt
139
139
  // =============================================================================
140
140
  // Platform Skills (platform-specific prompt expansions)
141
141
  // =============================================================================
142
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './skills/index.js';
142
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, } from './skills/index.js';
143
143
  // =============================================================================
144
144
  // Contextual Actions (skill invocations with context)
145
145
  // =============================================================================
@@ -118,6 +118,7 @@ export class SQLiteDocumentRepository {
118
118
  plan: 0,
119
119
  'app-model': 0,
120
120
  'research-model': 0,
121
+ 'business-model': 0,
121
122
  };
122
123
  for (const row of results) {
123
124
  counts[row.doc_type] = row.count;
@@ -16,6 +16,7 @@ const DOC_TYPE_ENUM = [
16
16
  'plan',
17
17
  'app-model',
18
18
  'research-model',
19
+ 'business-model',
19
20
  ];
20
21
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
21
22
  export function createDocumentTools(config) {
@@ -19,7 +19,7 @@ export type WorkItemType = 'feature' | 'bug' | 'tech-debt' | 'chore';
19
19
  export type WorkItemStatus = 'backlog' | 'in_progress' | 'completed' | 'skipped';
20
20
  export type WorkItemPriority = 'critical' | 'high' | 'medium' | 'low';
21
21
  export type GuidedStep = 'plan' | 'implement' | 'test' | 'commit' | 'review';
22
- export type DocumentType = 'prd' | 'architecture' | 'design' | 'notes' | 'plan' | 'app-model' | 'research-model';
22
+ export type DocumentType = 'prd' | 'architecture' | 'design' | 'notes' | 'plan' | 'app-model' | 'research-model' | 'business-model';
23
23
  export type PlanStatus = 'draft' | 'approved' | 'in_progress' | 'completed' | 'abandoned';
24
24
  export interface Project {
25
25
  id: number;
@@ -54,6 +54,10 @@ export const ACTION_META_REGISTRY = {
54
54
  icon: 'ShieldCheck',
55
55
  description: 'Review the paper',
56
56
  },
57
+ // ── Business Plan project actions ──────────────────────────────────────────
58
+ 'business-vision': { id: 'business-vision', label: 'Vision', icon: 'Target', description: 'Define your business' },
59
+ 'market-analysis': { id: 'market-analysis', label: 'Market', icon: 'TrendingUp', description: 'Analyze the market' },
60
+ 'competitor-analysis': { id: 'competitor-analysis', label: 'Competitors', icon: 'Swords', description: 'Map competition' },
57
61
  // ── Work item actions ────────────────────────────────────────────────────
58
62
  build: {
59
63
  id: 'build',
@@ -340,19 +340,19 @@ export const businessPlanConfig = {
340
340
  { role: 'writer', label: 'Writer', description: 'Clear, persuasive business writing' },
341
341
  ],
342
342
  documentTemplates: [
343
+ { type: 'business-model', label: 'Business Model', description: 'Structured business model (identity, market, competitors, financials)' },
343
344
  { type: 'executive-summary', label: 'Executive Summary', description: 'Business overview' },
344
345
  {
345
346
  type: 'market-analysis',
346
347
  label: 'Market Analysis',
347
348
  description: 'Market size, trends, competition',
348
349
  },
349
- { type: 'business-model', label: 'Business Model', description: 'Revenue, costs, operations' },
350
350
  { type: 'financial-model', label: 'Financial Model', description: 'Projections and forecasts' },
351
351
  { type: 'pitch', label: 'Pitch Narrative', description: 'Investor pitch content' },
352
352
  { type: 'session-notes', label: 'Session Notes', description: 'Summary of work done' },
353
353
  ],
354
- projectActions: ['session-notes'],
355
- workItemActions: ['explain'],
354
+ projectActions: ['business-vision', 'market-analysis', 'competitor-analysis', 'session-notes'],
355
+ workItemActions: ['refine-item', 'explain'],
356
356
  workItemLabels: {
357
357
  feature: { short: 'ML', full: 'Milestone' },
358
358
  bug: { short: 'IS', full: 'Issue' },
@@ -106,6 +106,10 @@ export const SKILL_META_REGISTRY = {
106
106
  icon: 'Layers',
107
107
  category: 'research',
108
108
  },
109
+ // ── Business Plan Skills ──────────────────────────────────────────────────
110
+ 'business-vision': { id: 'business-vision', label: 'Business Vision', description: 'Define business identity and value proposition', icon: 'Target', category: 'planning' },
111
+ 'market-analysis': { id: 'market-analysis', label: 'Market Analysis', description: 'Analyze market size, trends, and segments', icon: 'TrendingUp', category: 'analysis' },
112
+ 'competitor-analysis': { id: 'competitor-analysis', label: 'Competitor Analysis', description: 'Map competitive landscape', icon: 'Swords', category: 'analysis' },
109
113
  // ── Builtin Skills (agents library) ──────────────────────────────────────
110
114
  'code-review': {
111
115
  id: 'code-review',
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Platform Skills — barrel export
3
3
  */
4
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, } from './platform-skills.js';
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Platform Skills — barrel export
3
3
  */
4
- export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, } from './platform-skills.js';
4
+ export { platformSkills, designSkill, sketchSkill, prdSkill, refineSkill, refineItemSkill, architectureSkill, sessionNotesSkill, buildSkill, scaffoldSkill, outlineSkill, literatureReviewSkill, draftSectionSkill, peerReviewSkill, researchScaffoldSkill, businessVisionSkill, marketAnalysisSkill, competitorAnalysisSkill, } from './platform-skills.js';
@@ -22,8 +22,11 @@ export declare const literatureReviewSkill: Skill;
22
22
  export declare const draftSectionSkill: Skill;
23
23
  export declare const peerReviewSkill: Skill;
24
24
  export declare const researchScaffoldSkill: Skill;
25
+ export declare const businessVisionSkill: Skill;
26
+ export declare const marketAnalysisSkill: Skill;
27
+ export declare const competitorAnalysisSkill: Skill;
25
28
  /**
26
- * All platform-specific skills (14 total).
29
+ * All platform-specific skills (17 total).
27
30
  * These skills reference platform tools (backlog, workitems, documents, projects)
28
31
  * and belong in the SDK rather than in generic agent/coding libraries.
29
32
  */
@@ -1410,10 +1410,151 @@ After scaffolding, tell the user:
1410
1410
  tags: ['research', 'scaffold', 'setup'],
1411
1411
  });
1412
1412
  // =============================================================================
1413
+ // Business Plan Skills
1414
+ // =============================================================================
1415
+ export const businessVisionSkill = defineSkill({
1416
+ name: 'business-vision',
1417
+ description: 'Define the business identity, problem, solution, and value proposition',
1418
+ prompt: `You are in BUSINESS VISION MODE. Help the user define and articulate their business idea.
1419
+
1420
+ ## Step 1: Assess Current State
1421
+ 1. Use \`business_model_get\` with scope: "identity" to check if a model exists
1422
+ 2. Report what's already defined
1423
+
1424
+ ## Step 2: Gather Core Information
1425
+ Ask in batches (only what's not already defined):
1426
+ - **Business name** and tagline
1427
+ - **Problem**: What specific pain point do your target customers experience?
1428
+ - **Solution**: How does your product/service solve this?
1429
+ - **Unique value**: Why you instead of alternatives? What's the unfair advantage?
1430
+ - **Target customer**: Who specifically are you building for?
1431
+ - **Stage**: idea, pre-seed, seed, series-a, growth, or established?
1432
+ - **Industry/sector**
1433
+
1434
+ ## Step 3: Craft the Value Proposition
1435
+ Help refine the problem-solution-uniqueValue into a compelling narrative:
1436
+ - Problem should be specific and relatable
1437
+ - Solution should directly address the problem
1438
+ - Unique value should differentiate from ALL alternatives (including doing nothing)
1439
+
1440
+ ## Step 4: Save to Model
1441
+ - \`business_model_update\` with op: "set_identity" for name, tagline, mission, stage, industry, sector
1442
+ - \`business_model_update\` with op: "set_value_proposition" for problem, solution, uniqueValue, targetCustomer
1443
+
1444
+ ## Step 5: Suggest Next Steps
1445
+ After saving, suggest:
1446
+ - "Run /market-analysis to size your market and define customer segments"
1447
+ - "Run /competitor-analysis to map the competitive landscape"
1448
+
1449
+ ## Rules
1450
+ - Interactive — ask questions, don't assume
1451
+ - Push back on vague answers ("everyone" is not a target customer)
1452
+ - A good value proposition is specific, measurable, and defensible`,
1453
+ tags: ['business', 'planning', 'vision'],
1454
+ });
1455
+ export const marketAnalysisSkill = defineSkill({
1456
+ name: 'market-analysis',
1457
+ description: 'Analyze market size, trends, and customer segments',
1458
+ prompt: `You are in MARKET ANALYSIS MODE. Help the user understand their market.
1459
+
1460
+ ## Step 1: Assess Current State
1461
+ 1. Use \`business_model_get\` with scope: "overview" for context
1462
+ 2. Use \`business_model_get\` with scope: "market" for existing market data
1463
+ 3. Check Knowledge Base for market research sources
1464
+
1465
+ ## Step 2: Define Customer Segments
1466
+ For each segment:
1467
+ - Name and description
1468
+ - Estimated size (number of potential customers or revenue opportunity)
1469
+ - Key pain points (what problems they face)
1470
+ - Willingness to pay
1471
+
1472
+ Save each: \`business_model_update\` with op: "segment_add", segment: { name, description, size, painPoints, willingness }
1473
+
1474
+ ## Step 3: Market Sizing
1475
+ Guide through TAM/SAM/SOM:
1476
+ - **TAM** (Total Addressable Market): If everyone who could use your product did, how big is the market?
1477
+ - **SAM** (Serviceable Addressable Market): Realistically, which portion can you reach?
1478
+ - **SOM** (Serviceable Obtainable Market): In the first 1-3 years, what share can you capture?
1479
+
1480
+ Each should have a value (e.g., "$4.2B"), description, and source.
1481
+ Save: \`business_model_update\` with op: "set_market_size", market_size: { tam: {...}, sam: {...}, som: {...} }
1482
+
1483
+ ## Step 4: Trends and Growth
1484
+ - Identify 3-5 market trends relevant to the business
1485
+ - Estimate market growth rate
1486
+ Save: \`business_model_update\` with op: "set_market_size", market_size: { trends: [...], growthRate: "..." }
1487
+
1488
+ ## Step 5: Generate Work Items
1489
+ Create Milestone work items for:
1490
+ - "Validate segment: [name]" for each segment (priority: high)
1491
+ - "Source market data" if TAM/SAM/SOM need better sources (priority: medium)
1492
+
1493
+ ## Rules
1494
+ - Always ask for sources — investors will ask "where did you get that number?"
1495
+ - Challenge unrealistic sizing (a $100B TAM for a niche SaaS is suspicious)
1496
+ - Bottom-up sizing is more credible than top-down
1497
+ - Distinguish between potential customers and paying customers`,
1498
+ tags: ['business', 'analysis', 'market'],
1499
+ });
1500
+ export const competitorAnalysisSkill = defineSkill({
1501
+ name: 'competitor-analysis',
1502
+ description: 'Map the competitive landscape — identify competitors, strengths, weaknesses, positioning',
1503
+ prompt: `You are in COMPETITOR ANALYSIS MODE. Help the user understand their competition.
1504
+
1505
+ ## Step 1: Assess Current State
1506
+ 1. Use \`business_model_get\` with scope: "competitors" for existing data
1507
+ 2. Read Knowledge Base for competitor research, reports, articles
1508
+ 3. Use \`business_model_get\` with scope: "identity" for context on the business
1509
+
1510
+ ## Step 2: Identify Competitors
1511
+ For each competitor (guide user to list 3-8):
1512
+ - Direct competitors (same product, same market)
1513
+ - Indirect competitors (different product, same problem)
1514
+ - Potential competitors (could enter the market)
1515
+
1516
+ ## Step 3: Analyze Each Competitor
1517
+ For each, gather:
1518
+ - **Name** and brief description
1519
+ - **Strengths** (2-4): what they do well
1520
+ - **Weaknesses** (2-4): where they fall short
1521
+ - **Market position**: leader, challenger, niche, or emerging
1522
+ - **Pricing** model/range
1523
+ - **URL** (if applicable)
1524
+
1525
+ Save each: \`business_model_update\` with op: "competitor_add", competitor: { name, description, strengths, weaknesses, marketPosition, pricing, url }
1526
+
1527
+ ## Step 4: Define Competitive Advantages
1528
+ Based on the competitor analysis, what are YOUR advantages?
1529
+ - What do you do that no competitor does?
1530
+ - Where are the gaps in the market?
1531
+ - What would be hard for competitors to replicate?
1532
+
1533
+ Save: \`business_model_update\` with op: "set_competitive_advantages", advantages: [...]
1534
+
1535
+ ## Step 5: Positioning
1536
+ Help the user think about positioning:
1537
+ - On what axes do competitors differentiate? (price vs. features, simplicity vs. power, etc.)
1538
+ - Where does your business sit on those axes?
1539
+ - Is there an unoccupied position?
1540
+
1541
+ ## Step 6: Generate Work Items
1542
+ Create work items for:
1543
+ - "Deep-dive: [competitor name]" for competitors needing more research (type: Research)
1544
+ - "Validate advantage: [advantage]" for unproven competitive claims (type: Research)
1545
+
1546
+ ## Rules
1547
+ - "We have no competitors" is always wrong — there's always an alternative (even doing nothing)
1548
+ - Be honest about competitor strengths — investors will know
1549
+ - Focus on defensible advantages, not features that can be copied
1550
+ - Include both current competitors and potential future entrants`,
1551
+ tags: ['business', 'analysis', 'competition'],
1552
+ });
1553
+ // =============================================================================
1413
1554
  // Aggregate export
1414
1555
  // =============================================================================
1415
1556
  /**
1416
- * All platform-specific skills (14 total).
1557
+ * All platform-specific skills (17 total).
1417
1558
  * These skills reference platform tools (backlog, workitems, documents, projects)
1418
1559
  * and belong in the SDK rather than in generic agent/coding libraries.
1419
1560
  */
@@ -1432,4 +1573,7 @@ export const platformSkills = [
1432
1573
  draftSectionSkill,
1433
1574
  peerReviewSkill,
1434
1575
  researchScaffoldSkill,
1576
+ businessVisionSkill,
1577
+ marketAnalysisSkill,
1578
+ competitorAnalysisSkill,
1435
1579
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compilr-dev/sdk",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Universal agent runtime for building AI-powered applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",