copilot-instructions rework, new C++ coding guide for AI reviews#5480
copilot-instructions rework, new C++ coding guide for AI reviews#5480softhack007 wants to merge 9 commits intomainfrom
Conversation
Initial commit based on WLED-MM version * shorten previous instructions, by removing duplicated information and shortening wording * move agent instructions into a separate file * added coding conventions for C++, webUI, CI/CD (based on WLED-MM, needs adjustment for WLED) * added .coderabbit.yaml so the rabbits picks the same instructions for reviews. more information: * MoonModules#353 * MoonModules#354 * MoonModules#356
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdded a repository-level CodeRabbit configuration and five new or updated documentation files providing path-scoped review instructions, C++ and Web UI coding standards, CI/CD workflow conventions, and agent-mode build/test procedures; Copilot instructions were revised to reference these new guides. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Clarify float-to-unsigned conversion behavior and update semaphore return note.
Reworks AI instructions, to separate "coding agent" from "code review" instructions.
Adds C++ coding guidelines that were extracted from the WLED source code (mainly by AI). The new guides can be used both for contributor information, and as a "best practice" database in automated code reviews by the rabbit.
HUMAN_ONLYmechanism that hides generic information from the AI, to increase "attention layer excitement"Example for a coderabbit review with the new instructions: MoonModules#324 (comment)
(notice that recommendations refer to the new guidelines, and there is a "things done well" section, too)
This is a request for discussions
The new instructions already work well in WLED-MM, but we need to adjust them for WLED. Most importantly, optimization guides for ESP8266 still need to be added.
more information:
Revising AI review instructions:
Guiding Principles for Efficient AI Instruction Files
Only document what can't be inferred from the code or from general training.
If the AI would get it right without instruction 95% of the time, the instruction probably isn't worth the extra space in context memory.
Prefer short, actionable rules over explanations.
"Do not flag
uint8_t x = int(f)as a bug when the comment says// float→int wrapping" is more useful than a paragraph explaining why. The paragraph is for humans; the rule is for AI.Keep the total injected instruction size per file type low (<1000 lines, best under ~500 words).
With lots of instructions, the value of additional instructions drops rapidly and the distraction cost rises.
Encode "false positive suppressors" first, feature guidance second.
"Don't flag pattern X as a bug" is more impactful than "always do Y" because it directly prevents noise.
Treat instruction files like tests — they need maintenance when the code changes.
If you wouldn't update the instruction file when refactoring the relevant code, don't write the instruction.
Large language models already have extensive general knowledge about C++, ESP-IDF, GitHub Actions, etc. The genuine value of instruction files is narrow but real:
delay()works in FreeRTOSWLED_DISABLE_2D,d_malloc)The key insight: instruction files are most valuable when they prevent false positives (AI flagging intentional patterns as bugs) and encode decisions that can't be inferred from the code alone.
Summary by CodeRabbit