Skip to content

A framework for giving AI agents domain expertise through structured knowledge and skills

Notifications You must be signed in to change notification settings

danmcdevitt/composable-knowledge-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composable Knowledge Framework

A pattern for giving AI agents domain expertise through structured knowledge and skills.

What Is This?

A framework for building AI agents that have real expertise in specific domains. Instead of relying solely on an LLM's general knowledge, agents access structured domain knowledge:

  • Principles - Core truths that guide judgment
  • Rubrics - Evaluation frameworks with scoring criteria
  • Examples - Contrast pairs (WEAK vs STRONG) that teach taste
  • Frameworks - Decision trees and mental models

The Core Pattern

┌─────────────────────────────────────────────────────────────────┐
│                                                                  │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │               DOMAIN EXPERTISE ENGINE                    │   │
│   │                                                          │   │
│   │   domains/                                               │   │
│   │   ├── copywriting/                                       │   │
│   │   │   ├── principles.md    ← Core truths                │   │
│   │   │   ├── rubrics/         ← Evaluation criteria        │   │
│   │   │   └── examples/        ← WEAK vs STRONG pairs       │   │
│   │   ├── landing_pages/                                     │   │
│   │   └── [your-domain]/                                     │   │
│   │                                                          │   │
│   │   CLI: expertise query <domain> "<question>"            │   │
│   │                                                          │   │
│   └─────────────────────────────────────────────────────────┘   │
│                              │                                   │
│                              ▼                                   │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │                    SKILLS                                │   │
│   │                                                          │   │
│   │   .claude/skills/                                        │   │
│   │   ├── audit-landing-page/  ← Orchestrates expertise     │   │
│   │   ├── grade-headline/      ← Single-purpose skill       │   │
│   │   └── [your-skill]/                                      │   │
│   │                                                          │   │
│   │   Skills tell Claude HOW to use domain expertise        │   │
│   │                                                          │   │
│   └─────────────────────────────────────────────────────────┘   │
│                              │                                   │
│                              ▼                                   │
│   ┌─────────────────────────────────────────────────────────┐   │
│   │              EXECUTION ENVIRONMENT                       │   │
│   │                                                          │   │
│   │   Local: Claude Code CLI                                 │   │
│   │   Production: Vercel Sandbox / Cloud Run                 │   │
│   │                                                          │   │
│   └─────────────────────────────────────────────────────────┘   │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Why This Works

  1. Expertise is explicit - Not hoping the LLM "knows" copywriting; teaching it our specific standards
  2. Contrast examples teach taste - WEAK vs STRONG pairs with WHY annotations develop judgment
  3. Rubrics ensure consistency - Same evaluation criteria applied every time
  4. Skills orchestrate - Claude knows which expertise to pull for each task
  5. Portable across projects - Same domains work in any project

Components

1. Domain Expertise Engine

A standalone Python package with CLI. Contains structured knowledge in markdown files.

# Query domain expertise
expertise query copywriting "B2B SaaS headline for cold traffic"

# Get analysis context (token-budgeted)
expertise context landing_pages hero_evaluation "problem-aware visitor"

See: Domain Authoring Guide

2. Skills

Markdown files that tell Claude Code how to perform specific tasks using domain expertise.

# audit-landing-page/skill.md

You are performing a landing page audit.

## Step 1: Scrape the page
Use dev-browser to get page content...

## Step 2: Load domain expertise
expertise query landing_pages "hero section evaluation"

## Step 3: Evaluate and score
Apply rubric criteria to page content...

See: Skill Authoring Guide

3. Execution Environment

  • Development: Claude Code CLI running locally
  • Production: Vercel Sandbox or similar (Claude + tools in VM)

Use Cases

Use Case Domains Skills
Landing Page Analyzer landing_pages, copywriting, trust_building audit-landing-page
Headline Grader copywriting grade-headline
Email Sequence Reviewer email_copy, copywriting review-email-sequence
Ad Copy Auditor copywriting, advertising audit-ad-copy
Sales Page Scorer landing_pages, copywriting, trust_building score-sales-page

Quick Start

See Quick Start Guide to add this to your project in 15 minutes.

Documentation

Doc Purpose
Quick Start Get running in 15 minutes
Skill Authoring How to create skills
Domain Authoring How to create domain expertise
Sandbox Deployment Deploy to production

Key Principles

  1. Analysis, not generation - Agents evaluate and recommend; humans create
  2. Grounded in examples - Contrast pairs teach judgment better than rules
  3. Explicit over implicit - Document expertise, don't hope the LLM knows it
  4. Composable - Mix domains and skills for different use cases
  5. Portable - Same framework works across any project

About

A framework for giving AI agents domain expertise through structured knowledge and skills

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •