agentleFS
christiankoertel-sketchchristiankoertel-sketch/adam-skills/community-chatbot-builder/SKILL.md

community-chatbot-builder

Skill0 starsChanged 8 months agoMITView on GitHub

Build RAG-powered AI chatbots for online communities (Skool, Circle, Discord, Mighty Networks). Handles the full pipeline: content scraping, voice analysis, ChromaDB ingestion, system prompt configuration, model routing, sync automation, and deployment. Use this skill whenever someone wants to build a chatbot for a community, membership site, course platform, or knowledge base. Also trigger when the user mentions Skool bots, community AI assistants, course chatbots, membership chatbots, RAG chatbots for communities, or wants to turn community content into an AI assistant — even if they don't say "chatbot" explicitly.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Document topic-specific language (e.g., a trading educator explaining candlesticks vs a mindset coach talking about discipline)

    line 122
  2. Very specific:

    Use chromadb.PersistentClient for persistence across restarts

    line 157
  3. Distinctive:

    Never hallucinate sources — only reference content that appears in retrieved context chunks.

    line 179

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Community Chatbot Builder

Build production-ready AI chatbots that know a community's content and speak in its voice. This skill encodes a proven 7-phase framework battle-tested on real communities.

Why This Approach Works

Generic AI assistants fail communities because they don't know the community's actual content, terminology, or teaching style. A community-specific RAG chatbot retrieves real lessons, references real videos by name, and speaks the way the educators speak. Members get answers that feel like they came from the community itself — with citations linking back to the source material.

The economics are compelling: ~$5-15/month in API costs per client, deliverable in under 48 hours, with 90%+ margins at $500-1000 setup + $100-200/month.

The 7-Phase Build Process

Work through these phases sequentially. Each phase builds on the previous one. Skip phases only if the user explicitly says they don't need that component.

Phase 1: Content Audit (2-4 hours)

Map every content source the community has. The more content you ingest, the smarter the chatbot.

Content source checklist — go through each with the user:

Source TypeWhere to FindExtraction MethodPriority
Courses/ClassroomSkool classroom, Teachable, KajabiBrowser automation + JS extractionP0
Community PostsSkool community, Circle, DiscordAPI or browser scrapingP0
Video TranscriptsPlatform-hosted or YouTubeVTT extraction or Whisper APIP1
Website PagesMain site, landing pagesWeb scraping to markdownP1
Google DriveShared drives, foldersDrive API via service accountP2
Email NewslettersMailchimp, ConvertKit archivesAPI extractionP3

Key questions to answer during audit:

  • What platforms host the content? (Skool, Circle, Teachable, etc.)
  • How much content exists? (rough page/post/video count)
  • Who are the key educators/voices? (their names, teaching styles)
  • What's the community's unique terminology? (jargon, acronyms, catchphrases)
  • Is the audience members-only, prospects, or mixed?

Phase 2: Content Scraping (4-8 hours)

Extract all content into structured JSON files. Platform-specific patterns matter here.

Skool-specific extraction patterns (reusable across any Skool community):

# Community posts live in window globals:
window._compactPosts  → pipe-delimited: id|title|likes|comments|author|date|category|pinned
window._sortedPosts   → array of post objects with full content

# Classroom/course data:
window.__NEXT_DATA__  → course structure (modules, sections, lessons)
React fiber nodes     → module titles, sections, IDs

# Pagination for large communities:
Infinite scroll loads ~30 posts per batch
Use: scrollTo(0, document.body.scrollHeight) + wait(2000) pattern
Repeat until no new posts load

Standard output structure — use this for every client:

data/
  scraped/          # Website markdown pages
  transcripts/      # Video transcripts + module_lookup.json
  community/        # posts.json, top_posts.json, community_stats.json
  drive/            # drive_structure.json (if applicable)
  voice/            # Voice style guide
  chromadb/         # Vector database
  logs/             # Sync logs
  sync_state.json   # Sync tracking

Scraping best practices:

  • Batch extract using browser console JS — don't scrape page by page
  • Filter community posts by engagement (5+ likes threshold keeps the KB high-signal)
  • Cross-reference transcript IDs with module titles/sections/URLs for rich metadata
  • For Google Cloud forms, use form_input with element refs (not type action)

Phase 3: Voice Analysis (1-2 hours)

This is what separates a good community chatbot from a generic one. The bot must sound like the community, not like corporate AI.

Create a voice style guide using this template:

# [Community Name] Voice Style Guide

## Key Educators
- [Name]: [Teaching style, catchphrases, tone]
  Example: "So the first thing we're gonna look for is..."

## Topic-Specific Voices
- [Technical topic]: [Who teaches it, how they explain things]
- [Mindset/motivation topic]: [Who teaches it, their speaking style]

## Language Patterns
- Pronouns: "our system", "we", "together" (inclusive)
- Comprehension checks: "okay?", "make sense?", "right?"
- Encouragement style: [How they motivate members]
- What they NEVER say: [Anti-patterns to avoid]

## Guardrails
- [Domain-specific restrictions]
  e.g., trading community: never give specific financial advice
  e.g., health community: always recommend consulting a professional
- [Audience assumptions — member vs prospect behavior]

How to build the voice guide:

  1. Listen to or read 3-5 pieces of content from each key educator
  2. Note their verbal tics, catchphrases, and sentence structures
  3. Note what they explicitly avoid saying
  4. Document topic-specific language (e.g., a trading educator explaining candlesticks vs a mindset coach talking about discipline)

Phase 4: Ingestion Pipeline (2-4 hours)

Chunk the scraped content and load it into ChromaDB for RAG retrieval.

Chunk sizes by content type:

Content TypeChunk Size (words)Overlap (words)Why
Website pages50050Short, focused context windows
Video transcripts500-80050-100Longer to preserve conversational flow
Community postsFull post0Posts are natural semantic units
Voice guide60050Style context needs coherence

Standard metadata schema — attach to every chunk:

{
  "source": "unique_id",
  "source_type": "transcript|community|scraped_page|voice_guide",
  "content_type": "video_transcript|community_post|scraped_page|voice_guide",
  "course": "Course Name",
  "section": "Section Name",
  "module_title": "Module Title",
  "author": "Author Name",
  "url": "https://...",
  "engagement_tier": "viral|high|medium|low",
  "ingested_at": "ISO timestamp"
}

Technical notes:

  • Batch upserts at 200 items — individual upserts on 4K+ items will time out
  • SQLite (ChromaDB backend) can fail on some mounted filesystems — use /tmp fallback
  • all-MiniLM-L6-v2 embedding runs locally, is free, and is good enough for v1
  • Use chromadb.PersistentClient for persistence across restarts

Phase 5: Chatbot Configuration (2-4 hours)

Configure the system prompt, model routing, and safety guardrails.

System prompt structure (follow this order):

  1. Identity — who the bot is, what community it serves
  2. Member context — are users members, prospects, or mixed?
  3. Voice instructions — reference the voice guide, include specific phrases and tone
  4. Citation rules — every teaching response MUST reference a specific video/module with a link. This is the #1 differentiator from generic AI.
  5. Guardrails — domain-specific restrictions (no financial advice, no medical diagnosis, etc.)
  6. Response format — length, style, how to end responses

Model routing for cost optimization:

  • Simple questions (greetings, FAQs, definitions) → Haiku (~$0.001/query)
  • Complex teaching (multi-step explanations, concept connections) → Sonnet (~$0.01/query)
  • Classify by keyword lists, customizable per client

Non-negotiable design rules:

  1. Citations are mandatory — every teaching response must link to a source. This is what makes community chatbots valuable vs generic AI.
  2. Voice styling must be active — "So the first thing we're gonna look for is..." beats "The initial step in the process is to..."
  3. Never hallucinate sources — only reference content that appears in retrieved context chunks.

Phase 6: Sync Pipeline (2-4 hours)

Set up automated daily sync to keep the knowledge base fresh as new content is posted.

Architecture:

Scheduled Task (daily, e.g., 7am)
    |
    v
Browser automation → data/sync_inbox/new_*.json
    |
    v
sync_helpers.py → merge, deduplicate, update metrics
    |
    v
ingest.py → upsert into ChromaDB
    |
    v
Sync report → data/logs/sync_YYYYMMDD.txt

Deduplication strategy:

  • Community posts: by post ID
  • Classroom modules: by module ID
  • Drive files: by file ID or filename
  • Cross-source: title matching (exact + partial fuzzy)

Phase 7: Deployment (1-2 hours)

Make the chatbot accessible. Options ranked by simplicity:

  1. Streamlit + Cloudflare Tunnel — free, instant, great for demos and small communities
  2. Streamlit Community Cloud — free persistent hosting via GitHub repo
  3. Railway/Render — paid ($5-10/month) but reliable for production
  4. Client's own infrastructure — hand off the codebase

Crash-proof demo pattern:

nohup bash -c 'while true; do
    # Check if streamlit is running, restart if dead
    pgrep -f "streamlit run" || streamlit run app.py --server.port 8501 &
    # Check if tunnel is running, restart if dead
    sleep 15
done' &
disown

Replication Checklist

Copy this for each new client build:

Pre-Build:

  • Community URL and access credentials obtained
  • Claude API key configured
  • All content sources identified (courses, community, drive, etc.)
  • Voice analysis done — listened to 2-3 recordings, noted speech patterns
  • Voice style guide created
  • Member vs. prospect audience determined

Build:

  • Classroom/course structure scraped
  • Community posts scraped (filtered by engagement)
  • Video transcripts extracted
  • Website pages scraped
  • Ingestion pipeline run — all content in ChromaDB
  • System prompt customized (voice, identity, guardrails, citations)
  • Topic classifier keywords customized
  • RAG retrieval tested (3 query types: technical, mindset, community)

Deploy:

  • Hosting method chosen and configured
  • Daily sync scheduled task set up
  • Demo link created and shared with client
  • End-to-end test with real queries passed

Handoff:

  • Client can access the chatbot URL
  • Sync pipeline runs daily unattended
  • Client knows how to stop/restart if needed
  • Monitoring configured for sync health

Cost Model

ComponentMonthly CostNotes
ChromaDBFreeLocal, open-source
EmbeddingsFreeall-MiniLM-L6-v2 runs locally
Claude Haiku queries~$3-5At 50-100 queries/day
Claude Sonnet queries~$5-10Complex questions only
HostingFree-$10Streamlit Cloud free, Railway $5-10
Automated sync~$0Scheduled task, minimal compute
Total$5-15/mo

Pricing suggestion: $500-1000 setup fee + $100-200/month management. 90%+ profit margin.

Adapting to Different Platforms

The framework is built on Skool patterns but adapts to any community platform:

  • Circle: Uses API for posts/spaces, similar content structure to Skool
  • Discord: Bot API for channel history, thread extraction, role-based content filtering
  • Mighty Networks: Browser automation for courses, API for community posts
  • Teachable/Kajabi: Course structure via API or scraping, no native community (pair with Skool/Discord)
  • Custom platforms: Adapt scraping to the platform's DOM structure; the ingestion pipeline and chatbot layer stay identical

Future Improvements

Once the v1 is running, these upgrades increase value:

  1. Usage analytics — track what members ask, surface content gaps
  2. Auto-escalation — route unanswerable questions to human educators
  3. Webhook sync — real-time content updates vs daily batch
  4. Platform embed — iframe or widget for native-feeling integration
  5. Multi-language support — translate content for international communities

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.