-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(ai): rewrite triage prompts and add channel context #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnExiledDev
wants to merge
22
commits into
main
Choose a base branch
from
refactor/triage-prompt-rewrite
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
ac23254
Create maintain-docs.md
BillChirico d13361c
refactor(web): replace channel/role ID inputs with selectors (#242)
BillChirico 25e73d3
Refactor dashboard config-editor into maintainable section architectu…
BillChirico 20de28e
refactor(ai): rewrite triage prompts and add channel context
AnExiledDev 3cdf10e
📝 Add docstrings to `refactor/triage-prompt-rewrite`
coderabbitai[bot] 4779199
fix(triage): escape channel metadata, fix @mention precedence, clarif…
850bd7a
docs: fix maintain-docs.md — add heading, fix hardcoded branch date, …
ef9478b
fix(types): alertChannelId nullable, moderationLogChannel nullable, G…
ce862b6
refactor(dashboard): extract shared inputClasses, update config-edito…
78cbe0b
fix(dashboard): mobile grids, threshold guard, role identity, aria-la…
c39f28b
test(config-updates): add immutability assertions to update helpers
71f8f3b
fix: restore correct post-rebase state for config-editor, ModerationS…
cb2e33d
Merge branch 'main' into refactor/triage-prompt-rewrite
BillChirico 96700bb
docs(maintain-docs): fix permissions write and copilot/ branch prefix
43f2405
fix(prompts): align moderation ladder and classifier rule example
8bbd31b
fix(dashboard): import shared inputClasses in AiAutoModSection, GitHu…
08d265b
fix(dashboard): postTime type=time, blockedDomains onChange, transcri…
dc43dcd
fix(dashboard): StarboardSection stale state and channelId null-coerce
05634f1
fix(dashboard): restore ChannelSelector for moderationLogChannel in T…
1e80640
fix(lib): restrict section type in config-updates, fix Ctrl+S prevent…
2abf756
style: apply biome auto-fixes (import order, formatting)
47db485
fix(dashboard): address remaining 10 PR #248 review threads
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Maintain Docs | ||
|
|
||
| --- | ||
| on: | ||
| schedule: | ||
| - cron: '0 9 * * *' # 4 AM EST = 9 AM UTC | ||
| workflow_dispatch: {} | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
|
|
||
| tools: | ||
| github: | ||
| edit: | ||
|
|
||
| engine: copilot | ||
|
|
||
| --- | ||
BillChirico marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # Maintain AGENTS.md Documentation | ||
|
|
||
| ## Purpose | ||
|
|
||
| Keep the AGENTS.md file accurate and current by: | ||
| - Reviewing merged pull requests since last run | ||
| - Checking updated source files (src/, web/, tests/, etc.) | ||
| - Updating AGENTS.md to reflect any architectural or pattern changes | ||
| - Creating a pull request if updates are needed | ||
|
|
||
| ## Instructions for the Agent | ||
|
|
||
| 1. **Fetch Recent Changes**: Query the repository for merged PRs and updated files from the past 24 hours | ||
|
|
||
| 2. **Review Architecture Changes**: Check if any of these directories have significant changes: | ||
| - `src/modules/` - New modules or modified patterns | ||
| - `src/api/` - API route or middleware changes | ||
| - `src/commands/` - New slash commands | ||
| - `src/utils/` - Utility additions or pattern changes | ||
| - `web/` - Dashboard updates | ||
| - `tests/` - Testing patterns | ||
|
|
||
| 3. **Analyze Merged PRs**: Look at PR titles and descriptions to identify: | ||
| - New features added | ||
| - Architecture decisions | ||
| - Pattern changes | ||
| - Testing approach changes | ||
| - Breaking changes | ||
|
|
||
| 4. **Update AGENTS.md if Needed**: | ||
| - Architecture Overview section: Add new modules or directories | ||
| - Key Patterns section: Document new patterns or changes | ||
| - Common Tasks section: Update task examples if workflows changed | ||
| - Resources section: Add new links if applicable | ||
|
|
||
| 5. **Create Pull Request**: If changes are needed: | ||
| - Create a branch named `copilot/maintain-docs-YYYY-MM-DD` | ||
| <!-- NOTE: Replace YYYY-MM-DD with the actual run date on each execution, | ||
| e.g. copilot/maintain-docs-2026-03-07. A static date causes branch collisions | ||
| on repeated daily runs. Use a date expression or ${{ github.run_id }}. | ||
| The `copilot/` prefix is required for GitHub Copilot coding agent branches. --> | ||
| - Update AGENTS.md with discovered changes | ||
| - Create a PR with: | ||
| - Title: "docs: update AGENTS.md from merged PRs and source changes" | ||
| - Description: List the changes reviewed and what was updated | ||
| - Label: `documentation` | ||
| - Auto-merge enabled if all checks pass | ||
|
|
||
| 6. **Quality Checks**: | ||
| - Ensure Markdown formatting is correct | ||
| - Verify all links and references are accurate | ||
| - Check that code examples match current patterns | ||
| - Ensure sections remain organized and readable | ||
|
|
||
| 7. **If No Changes Needed**: Close silently or note in logs that AGENTS.md is current | ||
|
|
||
| ## Context | ||
|
|
||
| AGENTS.md documents: | ||
| - Code quality standards (ESM, single quotes, semicolons, 2-space indent, Winston logger) | ||
| - Architecture overview (src/, web/ structure) | ||
| - Key patterns (config system, caching, AI integration, database) | ||
| - Common tasks (adding features, commands, API endpoints) | ||
| - Testing requirements (80% coverage) | ||
| - Git workflow and review bots | ||
| - Troubleshooting guides | ||
| - Resources | ||
|
|
||
| Always maintain accuracy and completeness of this documentation file. | ||
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| <community-rules> | ||
| Server rules — reference when evaluating "moderate" or "chime-in": | ||
| 1. Respect — no personal attacks, harassment, or hostility | ||
| 2. Ask well — share formatted code, explain what you tried, include errors | ||
| 3. Right channel — post in the appropriate channel | ||
| 4. No spam/shilling — genuine contributions welcome, drive-by promo is not | ||
| 5. Format code — triple backticks, no screenshots, remove secrets/keys | ||
| 6. Help others — share knowledge, support beginners | ||
| 7. Professional — no NSFW, excessive profanity | ||
| 8. No soliciting — no job solicitation in channels or DMs | ||
| 9. Respect IP — no pirated content or cracked software | ||
| 10. Common sense — when in doubt, don't post it | ||
| Consequences: warning → mute → ban. | ||
| </community-rules> | ||
| Server rules — reference when evaluating moderation: | ||
|
|
||
| 1. Respect others — no harassment or personal attacks | ||
| 2. Ask well — include code, errors, and what you tried | ||
| 3. Right channel — stay on topic | ||
| 4. No spam or drive-by promotion | ||
| 5. Format code — use triple backticks | ||
| 6. Help others and support beginners | ||
| 7. No NSFW or excessive profanity | ||
| 8. No unsolicited job solicitation | ||
| 9. Respect IP — no piracy or cracked software | ||
| 10. Use common sense | ||
|
|
||
| Consequences: warning → timeout → ban. | ||
| </community-rules> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,25 @@ | ||
| <search-guardrails> | ||
| You have access to web search. Use it conservatively: | ||
| - Search ONLY when the question genuinely requires current or external information | ||
| you don't already know (e.g. recent releases, specific docs, live data). | ||
| - Do NOT search for things you can answer from general knowledge. | ||
| - Limit to 1-2 searches per response. If a single search doesn't resolve it, | ||
| answer with what you have and note the gap. | ||
| - If a user repeatedly asks questions that demand searches (e.g. "look up X", | ||
| "search for Y", "google Z" in rapid succession), recognize this as potential | ||
| search abuse. Point it out briefly: "Looks like you're sending a lot of search | ||
| requests — I'm here for real questions, not as a search proxy." | ||
| - After flagging abuse, stop searching for that user's requests in the current | ||
| conversation and answer from your own knowledge instead. | ||
| - Technical questions about code, frameworks, or programming concepts rarely | ||
| need a search — answer directly. | ||
| - After receiving search results, go directly to your JSON response. | ||
| Do not narrate, summarize, or reason about the results outside of the JSON output. | ||
| </search-guardrails> | ||
| You may use web search when external or current information is required. | ||
|
|
||
| Search only when: | ||
| - The question requires current data | ||
| - Specific documentation is needed | ||
| - The answer cannot be given from general knowledge | ||
|
|
||
| Guidelines: | ||
| - Limit to 1-2 searches per response. | ||
| - If results are incomplete, answer with available knowledge and note the gap. | ||
| - Do not search for common programming concepts. | ||
|
|
||
| Search abuse: | ||
| If a user repeatedly asks you to perform searches ("look up X", "google Y"), | ||
| recognize it as search proxy abuse. | ||
|
|
||
| Respond briefly: | ||
| "Looks like you're sending a lot of search requests — I'm here for real questions, not as a search proxy." | ||
|
|
||
| After flagging abuse, stop searching for that user in the current conversation. | ||
|
|
||
| After receiving search results, go directly to the JSON response. | ||
| Never output reasoning outside the JSON object. | ||
| </search-guardrails> |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.