From f7195368e48b8696c342270e43be5f3fb99d11bf Mon Sep 17 00:00:00 2001 From: NickTheDevOpsGuy Date: Mon, 22 Dec 2025 16:45:54 -0500 Subject: [PATCH 1/3] Adding in files --- README.md | 23 +++++++++++++++++++++-- docs/faq.md | 3 +++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 docs/faq.md diff --git a/README.md b/README.md index b085c70e..a3f3a2f5 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ OmegaBot is online ``` . ├── .env-example +. ├── .github │ ├── ISSUE_TEMPLATE │ │ ├── bug.yml @@ -132,17 +133,37 @@ OmegaBot is online │ │ └── OmegaBot.yml │ └── pull_request_template.md ├── .husky +│ ├── _ +│ │ ├── .gitignore +│ │ ├── applypatch-msg +│ │ ├── commit-msg +│ │ ├── h +│ │ ├── husky.sh +│ │ ├── post-applypatch +│ │ ├── post-checkout +│ │ ├── post-commit +│ │ ├── post-merge +│ │ ├── post-rewrite +│ │ ├── pre-applypatch +│ │ ├── pre-auto-gc +│ │ ├── pre-commit +│ │ ├── pre-merge-commit +│ │ ├── pre-push +│ │ ├── pre-rebase +│ │ └── prepare-commit-msg │ ├── pre-commit │ └── pre-push ├── assets │ ├── banner.png │ └── omegabot.png ├── data +│ ├── faqs.json │ ├── last-seen.json │ └── timezones.json ├── docs │ ├── commands.md │ ├── dev-notes.md +│ ├── faq.md │ ├── setup-discord.md │ ├── setup-env.md │ └── transcripts.md @@ -209,7 +230,6 @@ OmegaBot is online │ ├── bot.ts │ └── registerCommands.ts ├── .env.example -├── .eslintcache ├── .gitignore ├── .prettierignore ├── .prettierrc.yml @@ -220,7 +240,6 @@ OmegaBot is online ├── package-lock.json ├── package.json ├── README.md -└── tsconfig.json ``` diff --git a/docs/faq.md b/docs/faq.md new file mode 100644 index 00000000..1288f66f --- /dev/null +++ b/docs/faq.md @@ -0,0 +1,3 @@ +## FAQ entry schema + +## Key format and limits \ No newline at end of file From 7a03c47c4b98a4360cfb169f61a5eadf2c012388 Mon Sep 17 00:00:00 2001 From: NickTheDevOpsGuy Date: Mon, 22 Dec 2025 16:51:18 -0500 Subject: [PATCH 2/3] Adding this files in --- README.md | 23 ++--------- docs/faq.md | 88 +++++++++++++++++++++++++++++++++++++++- src/services/faq/type.ts | 16 ++++++++ 3 files changed, 105 insertions(+), 22 deletions(-) create mode 100644 src/services/faq/type.ts diff --git a/README.md b/README.md index a3f3a2f5..857d7291 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,6 @@ OmegaBot is online ``` . ├── .env-example -. ├── .github │ ├── ISSUE_TEMPLATE │ │ ├── bug.yml @@ -133,31 +132,12 @@ OmegaBot is online │ │ └── OmegaBot.yml │ └── pull_request_template.md ├── .husky -│ ├── _ -│ │ ├── .gitignore -│ │ ├── applypatch-msg -│ │ ├── commit-msg -│ │ ├── h -│ │ ├── husky.sh -│ │ ├── post-applypatch -│ │ ├── post-checkout -│ │ ├── post-commit -│ │ ├── post-merge -│ │ ├── post-rewrite -│ │ ├── pre-applypatch -│ │ ├── pre-auto-gc -│ │ ├── pre-commit -│ │ ├── pre-merge-commit -│ │ ├── pre-push -│ │ ├── pre-rebase -│ │ └── prepare-commit-msg │ ├── pre-commit │ └── pre-push ├── assets │ ├── banner.png │ └── omegabot.png ├── data -│ ├── faqs.json │ ├── last-seen.json │ └── timezones.json ├── docs @@ -201,6 +181,8 @@ OmegaBot is online │ │ │ ├── commandLoader.ts │ │ │ ├── fetchChannelMessages.ts │ │ │ └── interactionHandler.ts +│ │ ├── faq +│ │ │ └── type.ts │ │ ├── github │ │ │ ├── githubApi.ts │ │ │ ├── githubClient.ts @@ -240,6 +222,7 @@ OmegaBot is online ├── package-lock.json ├── package.json ├── README.md +└── tsconfig.json ``` diff --git a/docs/faq.md b/docs/faq.md index 1288f66f..e8672427 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -1,3 +1,87 @@ -## FAQ entry schema +# FAQ System Design -## Key format and limits \ No newline at end of file +This document defines how FAQs are stored, identified, and managed inside **OmegaBot**. + +The goal is to keep FAQs: + +- Easy to manage +- Safe for Discord limits +- Auditable +- Simple to migrate to a database later + +--- + +## Storage Model + +FAQs are stored in a file-based JSON store: + +``` +data/faqs.json +``` + +This file is the single source of truth for all FAQ entries. + +--- + +## FAQ Entry Schema + +Each FAQ entry follows this schema: + +```ts +type FaqEntry = { + key: string; + title: string; + body: string; + tags: string[]; + createdAt: string; + updatedAt: string; + createdBy: string; + updatedBy: string; + usageCount: number; +}; + +type FaqStore = { + version: 1; + entries: Record; +}; +``` + +--- + +## Key Format and Limits + +- Lowercase only +- Letters, numbers, and dashes only +- No spaces +- Immutable once created +- Max length: 48 characters + +--- + +## Size Limits + +| Field | Limit | +| ----- | ---------- | +| title | 80 chars | +| body | 4000 chars | +| tags | 10 max | + +--- + +## Command Expectations + +- `/faq add` validates input and initializes metadata +- `/faq get` increments usage count +- `/faq list` shows keys + titles +- `/faq remove` deletes entry (permission-gated) + +--- + +## Future Plans + +- Database storage +- Search +- Role-based visibility +- Audit history + +FAQs are treated as shared operational knowledge. diff --git a/src/services/faq/type.ts b/src/services/faq/type.ts new file mode 100644 index 00000000..aca58227 --- /dev/null +++ b/src/services/faq/type.ts @@ -0,0 +1,16 @@ +export type FaqEntry = { + key: string; + title: string; + body: string; + tags: string[]; + createdAt: string; + updatedAt: string; + createdBy: string; + updatedBy: string; + usageCount: number; +}; + +export type FaqStoreV1 = { + version: 1; + entries: Record; +}; \ No newline at end of file From 4c5cfa33b85db80e163f3773993a26c89138f873 Mon Sep 17 00:00:00 2001 From: NickTheDevOpsGuy Date: Mon, 22 Dec 2025 16:52:56 -0500 Subject: [PATCH 3/3] Adding in more files --- README.md | 1 + src/services/faq/type.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 857d7291..2757fdc8 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Planned features - 🤖 [Discord Bot Setup Guide](docs/discord-bot-setup.md) - 📘 [Command Reference](docs/commands.md) +- ❓ [FAQ Storage Design](docs/faq.md) - 🧠 [Transcript & Summary Design](docs/transcripts.md) - 🛠️ [Development Notes](docs/dev-notes.md) diff --git a/src/services/faq/type.ts b/src/services/faq/type.ts index aca58227..6fbc3131 100644 --- a/src/services/faq/type.ts +++ b/src/services/faq/type.ts @@ -13,4 +13,4 @@ export type FaqEntry = { export type FaqStoreV1 = { version: 1; entries: Record; -}; \ No newline at end of file +};