Skip to content

wandb/weave-integration-skills

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Weave Integration Skill

AI coding agent skill for integrating W&B Weave into existing applications — trace-first instrumentation with minimal code changes.

What It Does

Analyzes an existing codebase, creates a collaborative integration plan, and applies Weave tracing with user approval at every step.

  • Scan for all functions, LLM calls, model classes, and frameworks
  • Create weave_instrumentation.md with checkbox-based trace map
  • AI pre-checks recommended targets, user opts out of what they don't need
  • Two explicit approval gates before any code is modified

How It Works

Phase 0: Project Setup

  • Confirm project name, environment, API key
image

Phase 1: Codebase Analysis

  • codebase-analysis.md
  1. Scan for ALL functions, classes, API calls
  2. Detect frameworks (FastAPI, LangChain, CrewAI, etc.)
  3. Check if Weave is already partially integrated
image

Phase 2: Plan File ⏸ APPROVAL GATE 1

  • weave-instrumentation-template.md
  1. Ask: "Create weave_instrumentation.md?"
  2. List ALL traceable targets with checkboxes
  3. AI pre-checks [x] recommended, leaves [ ] others
  4. User reviews and unchecks what they don't want
image

Phase 3: Review ⏸ APPROVAL GATE 2

  • Ask: "Approve this plan for implementation?"
  • Do NOT proceed without explicit approval
image

Phase 4: Apply Changes

  • official docs + transformation-patterns.md
  1. Add weave.init() at the app entrypoint
  2. Decorate checked functions with @weave.op()
  3. Convert checked classes to weave.Model
image

Phase 5: Validation

  • integration-checklist.md
  1. Run integration checklist (setup, tracing, models, eval)
  2. Guide user through test run + Weave UI verification
  3. Ask if weave_instrumentation.md should be kept or deleted
image

Result

image

Key principles

  • Trace first — list everything, user opts out
  • Two approval gates — plan creation and implementation are separate approvals
  • No code changes without explicit approval

Skill Structure

skills/weave-integration/
├── SKILL.md                                # Integration workflow, docs lookup, rules
├── evals/
│   └── evals.json                          # Test cases for skill trigger evaluation
└── references/
    ├── codebase-analysis.md                # Scan guide, evolve vs fresh logic, checkbox criteria
    ├── weave-instrumentation-template.md   # Template for weave_instrumentation.md plan file
    ├── transformation-patterns.md          # Model conversion patterns (class → weave.Model)
    └── integration-checklist.md            # Post-integration validation checklist

Prerequisites

  • Python 3.8+
  • pip install weave
  • wandb login or set WANDB_API_KEY environment variable

Installation

# Clone the repo
git clone https://github.com/wandb/weave-integration-skills.git
cd weave-integration-skills

# Claude Code
cp -r skills/weave-integration/ ~/.claude/skills/weave-integration/

# Cursor
cp -r skills/weave-integration/ ~/.cursor/skills/weave-integration/

# Project-level (any agent)
cp -r skills/ .claude/skills/

Example Prompts

  • "Add Weave to my existing app"
  • "Instrument my FastAPI app with Weave"
  • "Integrate Weave into my LangChain project"
  • "Add Weave to my OpenAI Agents SDK project"
  • "Retrofit Weave tracing into my production chatbot"

Documentation

License

MIT

About

AI coding agent skills for integration Weave to exist project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors