Claude Templates / A-tier · High leverage
Growth & SEO
The Pre-Sale Chatbot Playbook
A grounded pre-sale assistant that builds its own knowledge base on install.
PRE-SALE-CHATBOT-PLAYBOOK.md · 13 sections · 2,787 words · 20 KB · markdown
A floating chat widget that answers pre-sale questions from your actual site and codebase — not hallucinated feature claims. The install step crawls your marketing site and reads your code to build the corpus, so it ships ready to answer. No lead capture, no gate.
What's inside
- //A floating widget + streaming corpus-grounded chat endpoint
- //Self-building knowledge base: crawl the site, read the code, reconcile
- //The drift rule — when site copy and code disagree, flag it, don't average it
- //Provider key handling on admin keys, never the visitor's
- //A global rate-limit circuit breaker so a botnet can't drain your quota
When to use it
Once a marketing site exists and signup is self-serve.
Build these first
Straight from the file
Owned (copied + adapted per app): 1. src/lib/help/public-corpus.ts — the knowledge base (auto-generated, §3). This is the part that "understands the app." 2. src/app/api/public-chat/route.ts — streaming, corpus-grounded, provider-fallback endpoint. 3. src/components/landing/LandingChat.tsx — the floating widget (thread persistence, SSE render, link-rewriting). 4. src/components/landing/LandingChatLazy.tsx + LandingChatGate — dynamic-import wrapper + route gate that self-hides the widget on app routes.
Table of contents
- 0. When to use this — and the tier rationale
- 1. What you get (the install surface)
- 2. Architecture
- 3. The knowledge-base autobuild ← the heart of "one action"
- 4. Provider + key config (OpenAI-primary, admin-console keys)
- 5. System prompt contract
- 6. The widget
- 7. Anonymous rate limiting (required)
- 8. The one-action install sequence
- 9. Verification / smoke test
- 10. Keeping the corpus fresh (it does NOT self-update)
- 11. Common pitfalls
- 12. Kickoff prompt
How to run it
Drop PRE-SALE-CHATBOT-PLAYBOOK.md into your repo, then tell Claude Code: “Read PRE-SALE-CHATBOT-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.
More growth & seo playbooks
Topical Authority
The 5-layer model that turns a marketing site into 250-350 pages that actually rank.
Read + download →A-tierCustomer Analytics
First-party event tracking that outlives cookie blockers — and costs nothing per event.
Read + download →A-tierSEO/GEO Engine
The autonomous layer — trend discovery, LLM classification, auto-authored pages, tracking.
Read + download →