From f806ca71efd12bd984d6a7bb0d133bc718c5c768 Mon Sep 17 00:00:00 2001 From: sudlud Date: Sun, 9 Aug 2026 17:00:20 +0200 Subject: [PATCH] docs(Agents): add code review guidance (#27053) --- .agents/docs/code-review.md | 27 +++++++++++++++++++++++++++ .agents/docs/self-review-rules.md | 3 ++- AGENTS.md | 3 ++- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 .agents/docs/code-review.md diff --git a/.agents/docs/code-review.md b/.agents/docs/code-review.md new file mode 100644 index 000000000..2f8747bd3 --- /dev/null +++ b/.agents/docs/code-review.md @@ -0,0 +1,27 @@ +# Code review + +Reviewing a changeset or PR, your own before submission or a contributor's. The task-scoped docs +(`cpp-guidelines.md`, `sql-guidelines.md`, `cpp-scripts.md`) apply as a checklist to every changed +line, not as background reading. + +- Review codestyle on every changed line, even when style is not the change's subject. Run both + linters and report violations as findings: `python apps/codestyle/codestyle-cpp.py` and + `python apps/codestyle/codestyle-sql.py`. +- Title and description follow the [commit message guidelines](https://www.azerothcore.org/wiki/commit-message-guidelines). +- Prefer data over code: when a C++ or script change is also achievable through world DB data + (SmartAI, conditions, templates), flag the DB-only alternative (see `cpp-scripts.md`). +- Never take a claim as fact, neither the PR description's nor a comment's. Verify game-data + claims (spell/creature/quest ids, mechanics) against the world DB, DBC data, or cited sources; + verify "fixed in the latest push" against the current diff. +- Check the change is still needed against current `master`: the surrounding code may have moved, + or another change may have landed the same fix. +- On an existing PR, walk every discussion item one by one: what was raised, whether it was + answered, and whether it still applies to the current head. Never skip one because it looks + resolved, old, or minor; this walk overrides any read-comments-lightly default of the reviewing + skill. `gh pr view` misses review bodies and inline threads; pull all three: + + ``` + gh api repos/azerothcore/azerothcore-wotlk/issues//comments --paginate # conversation comments + gh api repos/azerothcore/azerothcore-wotlk/pulls//reviews --paginate # review verdicts + bodies + gh api repos/azerothcore/azerothcore-wotlk/pulls//comments --paginate # inline comments + ``` diff --git a/.agents/docs/self-review-rules.md b/.agents/docs/self-review-rules.md index 879880861..e52bb98c5 100644 --- a/.agents/docs/self-review-rules.md +++ b/.agents/docs/self-review-rules.md @@ -3,7 +3,8 @@ Project-specific rules for [/self-review](https://github.com/eai-org/agent-toolkit/blob/main/skills/self-review/SKILL.md). Add here rules about reviewing AzerothCore PRs before they are submitted. Generic improvements -to the review process itself belong to the skill, not here. +to the review process itself belong to the skill, not here. The [code-review.md](code-review.md) +rules apply on top. ## Regression risk diff --git a/AGENTS.md b/AGENTS.md index fb05e273b..377a814f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,7 +17,8 @@ Read the matching doc(s) BEFORE starting the task: - Script work (under `src/server/scripts/`) → also `.agents/docs/cpp-scripts.md` - Creating or modifying SQL → `.agents/docs/sql-guidelines.md` - SmartAI work (`smart_scripts` data) → also `.agents/docs/cpp-scripts.md` -- Self-reviewing a changeset before submission → `.agents/docs/self-review-rules.md` +- Reviewing a changeset or PR → `.agents/docs/code-review.md` +- Self-reviewing a changeset before submission → also `.agents/docs/self-review-rules.md` - Touching a subsystem that has a doc in `.agents/docs/systems/` → read that doc too - Capturing a lesson or adding/updating agent docs → `.agents/docs/README.md`