Discord /help: searchable, self-growing knowledge base#167
Merged
Conversation
Replace the flat faq.md behind the /help slash command with a searchable, self-growing knowledge base shared with the in-app help center. - Migration: help_articles table (generated tsvector, GIN FTS + pg_trgm fuzzy indexes, RLS + published-read policy) and a hybrid search_help_articles() RPC. - Seed: scripts/seed-help-articles.ts (npm run seed:help) imports the shared corpus from lib/help-content.ts (articles + glossary), upsert-on-slug. - Content audit: 16 new high-value articles added to lib/help-content.ts (item classifications, submission statuses, attendance window, raid teams, reserves, roles, invites, transfer/delete, Discord, Gargul, addon, WCL, Bnet). - Bot: help.js rewritten to search the RPC + known GitHub issues, answer via a structured Claude reply with a confidence gate, and — for novel answers — draft an article, store it pending_review, and post it to the ops channel. - help-review.js: officers approve/reject drafts with reactions (reuses the isAllowedReactor permission model); wired as a second MessageReactionAdd listener in bot.js. - Web loop: /api/help/articles + help-center merge so approved community articles appear on the website too. - faq.md removed; HELP_FAQ_PATH dropped; .env.example updated; parser unit test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Load Test Results
|
Vitest can't be loaded via require() in a CommonJS module. Convert the co-located help parser test from .js (require) to .mjs (import). .mjs is unambiguously ESM for Vitest and stays out of the tsconfig include globs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Load Test Results
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Upgrades the
/helpslash command from a flatfaq.md(whole-file dumped into a prompt, 5 entries) to a searchable, self-growing knowledge base shared with the in-app help center. Delivers the three asks: better search/indexing, a content audit, and retroactive article growth — all driven through the Discord bot.How it works
tsvector/GIN) +pg_trgmfuzzy, hybrid-ranked insearch_help_articles(). No new vendor — Anthropic-only, as before.pending_review) and posted to the ops channel; an officer approves with ✅ (→ published, searchable) or discards with 🗑️. Reuses the existing 🐛/💡 reaction-permission model.lib/help-content.ts(which also powers the in-app help center); approved community articles are merged back into the website via/api/help/articles.Contents
supabase/migrations/20260704000001_create_help_articles.sql— table + indexes + RLS + RPC (auto-deploys on merge).scripts/seed-help-articles.ts+npm run seed:help.lib/help-content.ts— 16 new audit articles.discord-bot/help.js(rewrite),help-review.js(new),bot.js/feedback.js/commands.js/interactions.jswiring,help.test.js(parser tests).app/api/help/articles/route.ts+ help-center merge.After merge
deploy-migrationsworkflow.npm run seed:help(needsSUPABASE_URL+SUPABASE_SERVICE_ROLE_KEY)./help, loads the review handler). EnsureANTHROPIC_API_KEY,FEEDBACK_OPS_CHANNEL_ID,FEEDBACK_REACTION_ROLE_IDS/NAMESare set.Verification note
Authored without a local Node runtime, so lint/typecheck/test were not run locally — relying on this PR's CI. Manual review done; one template-literal escaping bug in the new articles was caught and fixed.
🤖 Generated with Claude Code