Services SDK
Design Service

Design Service

Framework generation, playbooks, and benchmark creation.

Installation

pnpm add @aicr/design-core

Quick Start

import { generateFramework, createPlaybook } from '@aicr/design-core';
 
// Generate a compensation framework
const framework = await generateFramework({
  domain: 'sales-compensation',
  inputs: analysisResults,
  templateId: 'standard-framework'
});
 
// Create implementation playbook
const playbook = await createPlaybook({
  frameworkId: framework.id,
  phases: ['discovery', 'design', 'implement', 'validate']
});

API Reference

generateFramework(input)

Generate a domain-specific framework.

interface FrameworkInput {
  domain: string;          // e.g., 'sales-compensation', 'territory-design'
  inputs: AnalysisResult;  // From DA analysis
  templateId: string;
  options?: {
    includeMetrics?: boolean;
    includeBenchmarks?: boolean;
  };
}
 
interface Framework {
  id: string;
  domain: string;
  components: FrameworkComponent[];
  metrics: Metric[];
  benchmarks: Benchmark[];
  createdAt: Date;
}

createPlaybook(input)

Create an implementation playbook.

interface PlaybookInput {
  frameworkId: string;
  phases: string[];
  stakeholders?: string[];
  timeline?: { phase: string; duration: string }[];
}
 
interface Playbook {
  id: string;
  frameworkId: string;
  phases: PlaybookPhase[];
  tasks: PlaybookTask[];
  milestones: Milestone[];
}

generateBenchmark(input)

Generate industry benchmarks.

const benchmark = await generateBenchmark({
  domain: 'sales-compensation',
  metrics: ['quota-attainment', 'pay-mix', 'accelerators'],
  industry: 'technology',
  companySize: 'enterprise'
});

HTTP API

POST /api/design/frameworks

curl -X POST /api/design/frameworks \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "sales-compensation",
    "templateId": "standard-framework",
    "inputs": { ... }
  }'

POST /api/design/playbooks

curl -X POST /api/design/playbooks \
  -H "Content-Type: application/json" \
  -d '{
    "frameworkId": "fw-123",
    "phases": ["discovery", "design", "implement"]
  }'