A machine-optimized knowledge base for AI agents building Cloudstream extensions. Born from real production errors, real fixes, real attempts that failed.
This repo is a database of everything an AI agent needs to build working Cloudstream extensions from scratch. Every error, every fix, every site pattern, every gotcha — structured for instant machine consumption, not casual human reading.
For AI agents: Read agent-index.json first, then drill into specific files as needed.
For humans: You don't read this. You give this to your AI agent along with a target website, and the agent builds the extension.
- Give your AI agent this prompt + the knowledge base URL
- Tell it which website to build an extension for
That's it. Your AI agent will:
- Read the knowledge base
- Analyze the target website
- Build the extension
- Handle all the common errors automatically
- Update the knowledge base with any new errors it discovers
Open AI_AGENT_PROMPT.md, copy the entire content, and paste it to your AI agent. Then just say the website you want.
Example:
[paste the entire AI_AGENT_PROMPT.md content here]
Target website: https://example.com
| File | Purpose | Read By |
|---|---|---|
agent-index.json |
Machine-readable quick reference — versions, error lookups, mappings | AI agents (read FIRST) |
KNOWLEDGE_BASE.md |
Complete code templates — root build, provider build, Plugin.kt, Provider.kt, CI/CD | AI agents (when writing code) |
ERRORS_DB.md |
Every error encountered with symptom/cause/fix/failed attempts | AI agents (on build errors) |
SITE_PATTERNS.md |
Site scraping patterns — selectors, URL patterns, extraction methods | AI agents (when analyzing new sites) |
AGENT_GUIDE.md |
Workflow guide — step-by-step process for building extensions | AI agents (quick reference) |
AI_AGENT_PROMPT.md |
Universal prompt template — copy this to activate any AI agent | Humans (copy and give to agent) |
update.sh |
Auto-update script — increments version, commits, pushes | AI agents (after adding new knowledge) |
Human: "Build extension for site X"
|
v
AI Agent reads agent-index.json ---------> Gets critical versions & known gotchas
|
v
AI Agent checks site X for Cloudflare ----> Blocked? Tell user. Not blocked? Continue.
|
v
AI Agent scrapes site X ------------------> Uses SITE_PATTERNS.md to analyze structure
|
v
AI Agent builds extension ----------------> Uses KNOWLEDGE_BASE.md templates
|
v
Build error? -----------------------------> Looks up in ERRORS_DB.md, applies fix
|
v
Push to GitHub ---------------------------> CI builds .cs3, user installs
|
v
New error found? -------------------------> Agent updates this knowledge base
When you encounter a new error or discover a new site pattern:
- Add the error to
ERRORS_DB.mdfollowing the existing format - Add site patterns to
SITE_PATTERNS.mdif it's a new site - Update
agent-index.jsonwith the new quick-lookup entry - Run
./update.sh "description of change"
- Fork this repo
- Add your error/pattern following the existing format
- Open a Pull Request
- Or open a GitHub Issue with label
error-reportorsite-pattern
- Build errors (Kotlin version, JVM target, unresolved references)
- Gradle configuration (plugin application, dependency resolution)
- GitHub Actions CI/CD (permissions, branch pushing)
- Search functionality (URL encoding, multi-word queries)
- App behavior (tvTypes, caching, tag limitations)
- Site scraping (Cloudflare, CSS selectors, lazy images)
- Code generation (bracket corruption in shell, regex escaping)
- API limitations (stubs missing methods, display-only features)
- Errors documented: 12
- Site patterns: 3 (1 specific + 2 generic)
- Knowledge base version: 2.0
- Last updated: 2026-05-20
MIT — Use it, share it, improve it.