Complete Claude Code setup with iterative learning, real industry data, and production-grade patterns
Core promise: Turn creator partnerships into forecastable growth.
Experience model: Brand-first, progressive-trust onboarding (explore planner β compare scenarios β request pilot outline).
Proof model: Strict separation between synthetic_modeled planning views and verified_real partner outcomes.
Overview: narrative entry, trust framing, and soft conversion pathDemo: guided synthetic scenario planner with provenance/source visibilityCase Studies: consent-gated proof narrativesResults: verified KPI/testimonial surfacesFor Brands: pilot planning pathFor Creators: benchmark and sponsor-readiness path
sponsorgraph_project/
βββ .claude/ # Claude Code configuration
β βββ CLAUDE.md # Main project context
β βββ business_logic.md # Real industry benchmarks (12K+ campaigns)
β βββ settings.json # Hooks, MCPs, permissions
β β
β βββ skills/ # Reusable patterns
β β βββ bigquery/SKILL.md # BigQuery optimization patterns
β β βββ dbt/SKILL.md # dbt transformation patterns
β β βββ ml-pipeline/SKILL.md # ML model training patterns
β β βββ api-design/SKILL.md # FastAPI endpoint patterns
β β
β βββ agents/ # Specialized sub-agents
β β βββ data-engineer/AGENT.md # dbt + BigQuery specialist
β β βββ ml-engineer/AGENT.md # Vertex AI + model training
β β βββ frontend-engineer/AGENT.md # React + dashboard specialist
β β
β βββ workflows/ # Step-by-step guides
β β βββ add-platform.md # Add new social platform
β β βββ new-attribution-model.md # Implement attribution logic
β β βββ deploy-model.md # Deploy ML model to Vertex AI
β β βββ synthetic-case-study.md # Build synthetic demo case studies
β β
β βββ context/ # Additional docs
β β βββ api-design.md # REST API conventions
β β βββ data-quality.md # Data validation rules
β β βββ testing-strategy.md # Test coverage requirements
β β
β βββ hooks/ # Iterative learning system
β β βββ on_error.py # Auto-log errors
β β βββ on_success.py # Auto-log solutions
β β βββ pre_tool_use.py # Validate before tool use
β β βββ post_tool_use.py # Update docs after success
β β
β βββ docs/ # Learning logs
β βββ errors.md # Error catalog (auto-updated)
β βββ solutions.md # Solutions catalog (auto-updated)
β βββ improvements.md # Continuous improvement log
β
βββ src/
β βββ ingestion/ # Platform API clients
β βββ dbt/ # Data transformations
β βββ ml/ # Model training
β βββ api/ # FastAPI backend
β βββ frontend/ # React dashboard
β
βββ README.md # This file
# macOS/Linux
curl -fsSL https://claude.ai/install.sh | bash
# Or via Homebrew
brew install claude-codecd sponsorgraph_project
claude
# Claude will automatically load .claude/CLAUDE.md on startup# Inside Claude Code session
> /permissions # Check tool permissions
> /skills # View available skills
> /agents # List specialized agentsClaude learns from mistakes and successes:
- Error Logging: Errors automatically logged to
.claude/docs/errors.md - Solution Catalog: Successful patterns saved to
.claude/docs/solutions.md - Continuous Improvement: After each task, Claude reviews if pattern is reusable
How it works:
1. Claude encounters error β OnError hook logs to errors.md
2. Claude solves problem β OnSuccess hook prompts to document
3. Next session β Claude reads errors.md and solutions.md
4. Result: Claude remembers and improves over time
No arbitrary numbers. All metrics based on actual 2024-2025 data:
- 12,000+ real creator campaigns (CreatorsJet 2025)
- Platform CPMs: YouTube ($5.70), TikTok ($6.50), Instagram ($6.59)
- Conversion rates: 2% CTR, 2% CVR (vs 0.8% for ads)
- Pricing tiers: Nano ($20-200) to Mega ($15K-200K)
See .claude/business_logic.md for complete benchmarks.
Invoke expert agents for specific tasks:
# Data engineering tasks
> /agent data-engineer "optimize this slow query"
# ML model training
> /agent ml-engineer "train pricing model with new features"
# Frontend work
> /agent frontend-engineer "add TikTok platform to dashboard"Skills are automatically activated based on context:
- BigQuery Skill: Triggers when writing SQL, designing schemas
- dbt Skill: Triggers when working with transformations
- ML Pipeline Skill: Triggers when training models
- API Design Skill: Triggers when building endpoints
Comprehensive guides for common tasks:
# Add new platform (Instagram, TikTok, etc.)
> View .claude/workflows/add-platform.md
# Implement new attribution model
> View .claude/workflows/new-attribution-model.md
# Deploy ML model
> View .claude/workflows/deploy-model.md
# Build synthetic case-study pipeline
> View .claude/workflows/synthetic-case-study.md1. β Error occurs
ββ> Auto-logged to errors.md with context
2. π Claude debugs
ββ> Finds root cause
ββ> Implements fix
3. β
Solution works
ββ> Logged to solutions.md
ββ> Reviewed for reusability
4. π Pattern emerges
ββ> Extracted to skill or workflow
ββ> Available in future sessions
5. π Continuous improvement
ββ> Claude gets better over time
ββ> Team shares accumulated knowledge
Session 1: Claude encounters BigQuery query timeout
- Error logged: "Query exceeded resource limits"
- Root cause: Missing partition filter
- Solution: Added
WHERE date >= '2024-01-01'
Session 2: Similar query needed
- Claude reads solutions.md
- Automatically adds partition filter
- No error, faster query
Session 3: Pattern crystallizes
- Added to BigQuery skill
- Now applies to all partitioned queries
- Team benefits from lesson learned
All pricing, CPMs, conversion rates sourced from:
- CreatorsJet - 12,000 real campaign analysis
- Aspire - State of Influencer Marketing 2025
- Gupta Media - Real-time CPM tracker
- eMarketer - YouTube CPM data
- Quimby Digital - Platform comparisons
# β BAD: Arbitrary numbers
creator_rate = 5000 # Where did this come from?
# β
GOOD: Use real benchmarks
from business_logic import MICRO_RATES
creator_rate = MICRO_RATES["instagram_post"]["median"] # $500All benchmarks in .claude/business_logic.md with sources and dates.
# Python: Black, isort, pylint
# Type hints required
def calculate_attribution(
touchpoints: List[Touchpoint],
model: AttributionModel = AttributionModel.DATA_DRIVEN
) -> Dict[str, float]:
"""Calculate attribution weights for touchpoints"""
...# Unit tests: β₯80% coverage
pytest tests/ --cov=src --cov-report=term
# dbt tests: Required on all models
cd src/dbt && dbt test
# API + synthetic + ingestion test suites
pytest -q# Branch naming
feature/add-tiktok-integration
fix/attribution-query-timeout
refactor/optimize-bigquery-costs
# Commit messages (Conventional Commits)
feat: add Instagram Graph API client
fix: handle rate limits in YouTube ingestion
refactor: optimize attribution query performance# NEVER commit keys
echo ".env" >> .gitignore
echo "*.key" >> .gitignore
# Use environment variables
export YOUTUBE_API_KEY="your_key"
# Or GCP Secret Manager
gcloud secrets create youtube-api-key --data-file=key.txt# Always dry-run expensive queries
from claude.skills.bigquery import safe_query
df = safe_query(sql, max_gb=1.0) # Blocks if >1GB scan# One-shot pre-production checks (recommended)
./scripts/preprod_checks.sh
# Development
uvicorn src.api.main:app --reload # Start API server
npm run dev --prefix src/frontend # Start frontend
python3 src/synthetic/generate_cases.py # Regenerate synthetic snapshot + seeds
# Data operations
cd src/dbt && dbt deps # Install dbt packages
cd src/dbt && dbt seed --select synthetic_creator_profiles synthetic_content_events synthetic_touchpoints synthetic_campaign_costs synthetic_conversions
cd src/dbt && dbt run --select stg_synthetic__creator_profiles stg_synthetic__content_events stg_synthetic__touchpoints stg_synthetic__campaign_costs stg_synthetic__conversions dim_creator fact_content_performance fact_touchpoints fact_conversions fact_campaign_forecast
cd src/dbt && dbt test --select stg_synthetic__creator_profiles stg_synthetic__content_events stg_synthetic__touchpoints stg_synthetic__campaign_costs stg_synthetic__conversions fact_touchpoints fact_conversions fact_campaign_forecast
# Frontend quality checks
npm run -s type-check --prefix src/frontend
npm run -s build --prefix src/frontend
# Python test suites
pytest -q
# Claude Code
/skills # List available skills
/agents # List specialized agents
/memory # View/edit persistent memory
/permissions # Manage tool permissions- Read CLAUDE.md: Understand project context
- Review business_logic.md: Learn industry benchmarks
- Install deps:
pip install -r requirements.txt -r requirements-dev.txtandnpm ci --prefix src/frontend - Run quality gates:
./scripts/preprod_checks.sh - Start coding: Claude will guide you with skills + workflows
# On first startup in project
> /init # Generate project orientation (already done)
# During development
> "Help me add LinkedIn as a new platform"
# Claude will:
# 1. Read workflow: .claude/workflows/add-platform.md
# 2. Activate skills: bigquery, dbt, api-design
# 3. Follow step-by-step guide
# 4. Log any errors/solutions- Check
.claude/docs/errors.mdfor known issues - Search
.claude/docs/solutions.mdfor patterns - Follow workflows in
.claude/workflows/ - Update docs after solving problems
- Share learnings with team
MIT License - See LICENSE file
Built with:
- Claude Code by Anthropic
- Real industry data from 12,000+ creator campaigns
- Iterative learning patterns for continuous improvement
- Production-grade data engineering practices
Version: 1.0.0
Last Updated: 2026-02-07
Model: Claude Opus 4.5
SponsorGraph now includes a deterministic synthetic demo system for brand-first planning across three creator tiers.
- Synthetic generator config:
configs/synthetic_cases.yaml - Generated snapshot for API:
configs/synthetic_cases_snapshot.json - Generated raw seed tables:
src/dbt/seed/synthetic/*.csv - API endpoints:
GET /api/v1/synthetic/casesGET /api/v1/synthetic/cases/{case_id}GET /api/v1/synthetic/assumptionsPOST /api/v1/synthetic/forecast
- Frontend Demo tab now calls synthetic APIs with:
- tier selection
- objective selector
- package mode toggle (platform-specific vs cross-platform bundle)
- budget input
- provenance and source references on KPI surfaces
python3 src/synthetic/generate_cases.pypytest tests/synthetic tests/api -q
cd src/frontend && npm run type-checkSynthetic demo outputs must include:
provenance:public_real|synthetic_modeled|verified_realsource_ref: source URL + retrieval date for surfaced benchmark metrics
Use synthetic metrics for planning only until partner-verified data is connected.
Landing pages now submit inquiries through POST /api/v1/leads with validated payloads and source attribution (for-brands, for-creators, etc.).
Captured leads are persisted locally to:
.claude/runtime/leads.ndjson
Set a custom storage path with:
export LEAD_STORAGE_PATH=/path/to/leads.ndjson