Skip to content

Latest commit

Β 

History

History
506 lines (391 loc) Β· 10.6 KB

File metadata and controls

506 lines (391 loc) Β· 10.6 KB

Context7 Documentation Ingestion Plan

Purpose

This document provides a systematic plan for ingesting all core technology documentation via Context7 to prevent iterative debugging issues like we experienced with Cloudflare Stream.


πŸ”΄ IMMEDIATE PRIORITY (Ingest Before Next Feature)

1. Remotion - Video Rendering Engine

Why Critical: Core functionality for video composition and rendering

Context7 Commands:

// Step 1: Resolve library ID
mcp__context7__resolve-library-id({
  libraryName: "remotion"
})

// Step 2: Ingest Player documentation
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "Player API controls configuration",
  tokens: 15000
})

// Step 3: Ingest Lambda rendering
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "Lambda rendering costs deployment",
  tokens: 15000
})

// Step 4: Ingest dynamic compositions
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "dynamic compositions props data-driven",
  tokens: 15000
})

// Step 5: Ingest audio/video sync
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "audio synchronization video timing",
  tokens: 10000
})

Expected Learnings:

  • Player API and event handling
  • Lambda function setup and costs
  • Dynamic composition patterns
  • Audio/video synchronization techniques
  • Bundle optimization strategies

Create After Ingestion:

  • REMOTION_IMPLEMENTATION.md

2. Convex - Real-time Backend

Why Critical: Entire backend infrastructure

Context7 Commands:

// Step 1: Resolve library ID
mcp__context7__resolve-library-id({
  libraryName: "convex real-time database"
})

// Step 2: Ingest query patterns
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "queries mutations actions patterns",
  tokens: 15000
})

// Step 3: Ingest real-time subscriptions
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "real-time subscriptions reactivity",
  tokens: 10000
})

// Step 4: Ingest schema design
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "schema design indexes validation",
  tokens: 10000
})

// Step 5: Ingest authentication
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "authentication authorization users",
  tokens: 10000
})

Expected Learnings:

  • When to use query vs mutation vs action
  • Real-time subscription patterns
  • Index design for performance
  • Schema validation strategies
  • Authentication integration

Create After Ingestion:

  • CONVEX_PATTERNS.md

3. HLS.js - Video Streaming

Why Critical: Cloudflare Stream video playback

Context7 Commands:

// Step 1: Resolve library ID
mcp__context7__resolve-library-id({
  libraryName: "hls.js"
})

// Step 2: Ingest player configuration
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "player configuration initialization",
  tokens: 10000
})

// Step 3: Ingest error handling
mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID from step 1]",
  topic: "error handling recovery retry",
  tokens: 10000
})

Expected Learnings:

  • Player initialization and configuration
  • Error recovery strategies
  • Quality level switching
  • Live streaming support

Create After Ingestion:

  • Add to CLOUDFLARE_STREAM_IMPLEMENTATION.md

🟑 MEDIUM PRIORITY (Before AI Features)

4. Anthropic Claude SDK

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "anthropic claude"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "streaming messages function calling",
  tokens: 15000
})

Expected Learnings:

  • Streaming API patterns
  • Function/tool calling
  • Token counting
  • Error handling

5. Google Generative AI (Gemini)

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "google generative ai gemini"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "gemini flash API streaming",
  tokens: 10000
})

Expected Learnings:

  • Gemini Flash configuration
  • Cost optimization
  • Streaming responses
  • Function calling

6. OpenAI SDK

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "openai"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "chat completions streaming function calling",
  tokens: 15000
})

Expected Learnings:

  • Chat completions API
  • Streaming responses
  • Function calling patterns
  • Cost optimization

Create After Ingestion:

  • DEDALUS_INTEGRATION.md (multi-model routing)

7. React Dropzone

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "react-dropzone"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "drag drop file validation",
  tokens: 8000
})

Expected Learnings:

  • Accept configuration
  • File validation
  • Multiple file handling
  • Custom styling

🟒 LOWER PRIORITY (As Needed)

8. Playwright Testing

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "playwright"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "page object model async testing",
  tokens: 10000
})

Create After Ingestion:

  • TESTING_STRATEGY.md

9. Tailwind CSS

Context7 Commands:

mcp__context7__resolve-library-id({
  libraryName: "tailwind css"
})

mcp__context7__get-library-docs({
  context7CompatibleLibraryID: "[ID]",
  topic: "custom configuration dark mode",
  tokens: 8000
})

πŸ“Š Ingestion Tracking

Completed βœ…

  • Cloudflare Stream (TUS uploads, HLS streaming)
  • Cloudflare R2 (object storage)
  • Next.js (App Router, environment variables)
  • TUS Protocol (resumable uploads)

In Progress πŸ”„

  • None currently

Planned πŸ“‹

  • Remotion (video rendering)
  • Convex (backend patterns)
  • HLS.js (video playback)
  • Anthropic Claude SDK
  • Google Generative AI
  • OpenAI SDK
  • React Dropzone
  • Playwright
  • Tailwind CSS

🎯 Ingestion Workflow Template

For each technology:

1. Pre-Ingestion

## Technology: [Name]

### Why We Need This
- [Use case 1]
- [Use case 2]
- [Use case 3]

### Current Knowledge Gaps
- [ ] Gap 1
- [ ] Gap 2
- [ ] Gap 3

### Features We'll Implement
- [ ] Feature 1
- [ ] Feature 2
- [ ] Feature 3

2. Ingestion

// Resolve library ID
const result = await mcp__context7__resolve-library-id({
  libraryName: "technology name"
});

// Ingest documentation with specific topics
const docs = await mcp__context7__get-library-docs({
  context7CompatibleLibraryID: result.id,
  topic: "specific feature or API",
  tokens: 10000-15000
});

3. Analysis

## Key Learnings

### API Patterns
- [Pattern 1 with code example]
- [Pattern 2 with code example]

### Configuration Requirements
- [Requirement 1]
- [Requirement 2]

### Common Pitfalls
- [Pitfall 1 and how to avoid]
- [Pitfall 2 and how to avoid]

### Best Practices
- [Practice 1]
- [Practice 2]

4. Implementation Plan

## Implementation Checklist

### Prerequisites
- [ ] Environment variables needed
- [ ] Dependencies installed
- [ ] Configuration files updated

### Implementation Steps
- [ ] Step 1 based on docs
- [ ] Step 2 based on docs
- [ ] Step 3 based on docs

### Testing Plan
- [ ] Happy path test
- [ ] Error case tests
- [ ] Edge case tests

5. Documentation

## [TECHNOLOGY]_IMPLEMENTATION.md

Created with:
- Architecture explanation
- Configuration guide
- Code examples from official docs
- Troubleshooting section
- Testing checklist
- References to Context7 docs

🚨 Critical Reminder

BEFORE implementing ANY feature that uses one of these technologies:

  1. Check if we've ingested docs (see tracking above)
  2. If not ingested, DO IT FIRST
  3. Read the ingested docs completely
  4. Base implementation on official examples
  5. Document the implementation

Example: Before implementing Remotion Player:

// ❌ DON'T start coding immediately
// βœ… DO ingest Remotion docs first

// Step 1: Resolve library ID
const remotionLibs = await mcp__context7__resolve-library-id({
  libraryName: "remotion"
});

// Step 2: Get Player documentation
const playerDocs = await mcp__context7__get-library-docs({
  context7CompatibleLibraryID: remotionLibs.id,
  topic: "Player API controls events",
  tokens: 15000
});

// Step 3: Read and understand
// Step 4: Implement based on examples
// Step 5: Document in REMOTION_IMPLEMENTATION.md

πŸ“ˆ Success Metrics

For Each Ingestion

  • Library ID resolved successfully
  • Documentation fetched (10k-15k tokens)
  • Key patterns identified
  • Configuration requirements documented
  • Code examples extracted
  • Implementation markdown created
  • Added to DOCUMENTATION_LIBRARY.md

Overall Progress

  • Target: 15 technologies documented
  • Completed: 4 (Cloudflare Stream, R2, Next.js, TUS)
  • Remaining: 11
  • Completion: 27%

πŸŽ“ Lessons Applied

Based on Cloudflare Stream experience:

  1. Don't assume - Official docs show exact patterns
  2. Don't guess - Configuration structure is documented
  3. Don't iterate - Complete understanding prevents bugs
  4. Don't skip - Every technology deserves Context7 ingestion

πŸ“… Suggested Timeline

Week 1: Video Core (Critical Path)

  • Day 1: Remotion (Player)
  • Day 2: Remotion (Lambda + Dynamic)
  • Day 3: HLS.js
  • Day 4: Convex (Queries/Mutations/Actions)
  • Day 5: Convex (Real-time + Auth)

Week 2: AI Integration

  • Day 1: Anthropic Claude SDK
  • Day 2: Google Generative AI
  • Day 3: OpenAI SDK
  • Day 4: Create DEDALUS_INTEGRATION.md
  • Day 5: Buffer/catch-up

Week 3: Polish & Testing

  • Day 1: React Dropzone
  • Day 2: Playwright
  • Day 3: Tailwind CSS
  • Day 4: Create TESTING_STRATEGY.md
  • Day 5: Final documentation review

πŸ”— Related Documents

  • DOCUMENTATION_LIBRARY.md - List of all available documentation
  • DEVELOPMENT_WORKFLOW.md - How to use documentation in development
  • CLAUDE.md - Standing orders including documentation-first approach
  • CLOUDFLARE_STREAM_IMPLEMENTATION.md - Example of post-ingestion documentation

Remember: Every hour spent reading documentation saves 10 hours of debugging.