From 6e73043bcaa3f3a3b3a6cd700933e96c6c23b302 Mon Sep 17 00:00:00 2001 From: sudlud Date: Tue, 11 Aug 2026 09:36:16 +0200 Subject: [PATCH] fix(Agents): reduce .github/agents to pointers (#27085) --- .github/agents/README.md | 65 ++---------------- .github/agents/pr-reviewer.md | 121 ++-------------------------------- 2 files changed, 14 insertions(+), 172 deletions(-) diff --git a/.github/agents/README.md b/.github/agents/README.md index 6bbc0b16c0..46b5094de5 100644 --- a/.github/agents/README.md +++ b/.github/agents/README.md @@ -1,61 +1,10 @@ -# GitHub Agents Configuration +# GitHub agents -This directory contains configuration files for AI-powered code review and development agents used in the AzerothCore project. +Custom agent profiles, read by Copilot on GitHub.com, the CLI and supported IDEs. A profile needs +YAML frontmatter with a `description` to register. -## Overview +Copilot code review does not read this directory; its instructions are +`.github/copilot-instructions.md`, `.github/instructions/**` and `AGENTS.md`. -Agent configuration files provide context-specific instructions to AI tools (like GitHub Copilot, Claude, etc.) when they interact with this repository. These configurations ensure that automated reviews and code suggestions follow project-specific standards and best practices. - -## Available Agents - -### PR Reviewer (`pr-reviewer.md`) - -The PR Reviewer agent is configured to review pull requests with deep understanding of AzerothCore's: -- Architecture patterns (two-server model, scripting system, database structure) -- Code style requirements (indentation, line length, formatting) -- C++ coding conventions and naming standards -- SQL query formatting and database design standards -- Commit message conventions (Conventional Commits format) -- Testing and validation requirements -- Security and quality standards - -**Key Feature**: This agent always references `/AGENTS.md`, the matching `.agents/docs/*.md` task guides, the C++ Code Standards wiki, and the SQL Standards wiki before reviewing any PR. - -## How It Works - -When an AI tool reviews a PR in this repository: - -1. The tool reads the appropriate agent configuration from this directory -2. The agent configuration instructs it to read `/AGENTS.md` for project context and per-task routing -3. Per AGENTS.md's "Mandatory reading per task", it reads the `.agents/docs/*.md` guides matching what the PR touches -4. For C++ changes, the agent also references the [C++ Code Standards wiki](https://github.com/azerothcore/wiki/blob/master/docs/cpp-code-standards.md) -5. For SQL changes, the agent also references the [SQL Standards wiki](https://github.com/azerothcore/wiki/blob/master/docs/sql-standards.md) -6. The agent applies project-specific rules during review -7. Feedback is provided following the project's conventions and standards - -## For Contributors - -If you're using AI tools to assist with contributions: - -1. Familiarize yourself with `/AGENTS.md` - it contains essential project knowledge -2. Review the [C++ Code Standards](https://github.com/azerothcore/wiki/blob/master/docs/cpp-code-standards.md) for C++ contributions -3. Review the [SQL Standards](https://github.com/azerothcore/wiki/blob/master/docs/sql-standards.md) for database contributions -4. The AI agents will help ensure your changes follow project standards -5. Agent feedback should be treated as helpful suggestions that align with maintainer expectations - -## For Maintainers - -To update agent configurations: - -1. Edit the relevant `.md` file in this directory -2. Ensure any changes align with documentation in `/AGENTS.md` and the wiki standards -3. Test the updated configuration with a sample PR review -4. Commit changes following the project's commit message format - -## References - -- Project guidelines: `/AGENTS.md` -- C++ standards: [C++ Code Standards](https://github.com/azerothcore/wiki/blob/master/docs/cpp-code-standards.md) -- SQL standards: [SQL Standards](https://github.com/azerothcore/wiki/blob/master/docs/sql-standards.md) -- PR template: `/pull_request_template.md` -- Contribution guide: `/.github/CONTRIBUTING.md` +Conventions live in `AGENTS.md` and `.agents/docs/`. Profiles point at them and must not restate +them, so there is one copy to keep current. diff --git a/.github/agents/pr-reviewer.md b/.github/agents/pr-reviewer.md index 75e6659ccd..75231269c0 100644 --- a/.github/agents/pr-reviewer.md +++ b/.github/agents/pr-reviewer.md @@ -1,116 +1,9 @@ -# PR Reviewer Agent +--- +name: pr-reviewer +description: Reviews a pull request against the project's conventions. +--- -You are an expert code reviewer for the AzerothCore project. When reviewing pull requests, you must follow the project-specific guidelines and architecture patterns defined in the repository. +# PR reviewer -## Required Reading - -Before reviewing any PR, you MUST read and follow the instructions in: -- `/AGENTS.md` - Slim index of agent rules, repository layout, and per-task routing to `.agents/docs/` -- The `.agents/docs/*.md` guides matching what the PR's diff touches, per AGENTS.md's "Mandatory reading per task" -- [C++ Code Standards](https://github.com/azerothcore/wiki/blob/master/docs/cpp-code-standards.md) - Detailed C++ coding conventions and style guide -- [SQL Standards](https://github.com/azerothcore/wiki/blob/master/docs/sql-standards.md) - SQL query formatting and database standards - -## Key Review Focus Areas - -Based on AGENTS.md, always verify: - -### 1. Commit Message Format -- Uses Conventional Commits: `Type(Scope/Subscope): Short description` -- Types: feat, fix, refactor, style, docs, test, chore -- Scopes: Core (C++ changes), DB (SQL changes) -- Max 50 characters for description -- Examples: `fix(Core/Spells): Fix damage calculation for Fireball`, `fix(DB/SAI): Missing spell to NPC Hogger` - -### 2. Code Style -- 4-space indentation for C++ (no tabs) -- 2-space indentation for JSON, YAML, shell scripts -- UTF-8 encoding, LF line endings -- Max 120 character line length -- No braces around single-line statements -- Format variables in output using {} placeholders instead of printf-style format specifiers like %u - -### 3. C++ Specific Standards -**From C++ Code Standards wiki - verify:** -- Indentation: 4 spaces, never tabs -- Comments: Above or beside code, avoid external hyperlinks -- No trailing whitespace or extra spaces within brackets -- Brackets: Single-line statements don't need braces; multi-line blocks on new line -- Use constants (enum/constexpr) instead of magic numbers -- Switch statements must have default case -- Prefer enum class over plain enum -- Standard prefixes: SPELL_, NPC_, ITEM_, GO_, QUEST_, SAY_, EMOTE_, MODEL_, EVENT_, DATA_, ACHIEV_ -- Naming conventions: - - Public/protected: `SomeGuid`, `ShadowBoltTimer` (UpperCamelCase) - - Private members: `_someGuid`, `_count` (underscore prefix, lowerCamelCase) - - Methods: `DoSomething(uint32 someNumber)` (UpperCamelCase, params lowerCamelCase) - - Always use 'f' suffix for float literals: `234.3456f` -- WorldObjects: `GameObject* go;`, `Creature* creature;` (never multiple pointer declarations) -- const placement: after type (`Player const* player`) -- static placement: before type (`static uint32 someVar`) -- All headers must have header guards - -### 4. SQL Specific Standards -**From SQL Standards wiki - verify:** -- Always use backticks around table and column names -- Single quotes for strings, no quotes for numeric values -- DELETE before INSERT (never use REPLACE) -- DELETE/UPDATE must include at least primary key in WHERE clause -- Prefer IN clause for multiple values: `WHERE entry IN (1, 2, 3)` -- Use variables for repeated entries: `SET @ENTRY := 7727;` -- Compact queries: bundle multiple rows in single INSERT -- For flags: use bitwise operations (`|` to add, `&~` to remove), never override -- Table naming: snake_case (`creature_loot_template`) -- Column naming: UpperCamelCase (`PositionX`, `DisplayID`) -- Acronyms in uppercase: `ItemGUID`, `DisplayID`, `RequiredNPCOrGOCount` -- No integer width specification: `INT` not `INT(11)` -- Never use MEDIUMINT (use INT instead for consistency) -- Float/Double: use CHECK constraints instead of UNSIGNED -- Charset: utf8mb4, Collation: utf8mb4_unicode_ci (utf8mb4_bin for names) -- Engine: InnoDB, Row Format: DEFAULT - -### 5. Architecture Compliance -- Changes to game logic should be in `src/server/game/` -- Scripts should follow the registration pattern (AddSC_*() functions) -- Spell scripts organized by class: `spell_dk.cpp`, `spell_mage.cpp`, etc. -- Database changes go in correct subdirectories: - - `data/sql/updates/pending_*/db_auth/` for auth database - - `data/sql/updates/pending_*/db_characters/` for characters database - - `data/sql/updates/pending_*/db_world/` for world database - -### 6. PR Requirements -- AI tool usage must be disclosed in PRs -- In-game testing expected and documented -- Changes to generic code require regression testing of related systems -- No breaking changes to existing functionality without strong justification - -### 7. Testing Requirements -- Unit tests should be updated when logic changes (Google Test framework) -- Build must succeed with `-Werror` (warnings treated as errors) -- Changes should compile on all platforms (Linux, Windows, macOS) - -### 8. Security & Quality -- No hardcoded credentials or sensitive data -- Proper error handling and bounds checking -- No memory leaks or buffer overflows -- SQL changes should be properly escaped/parameterized - -## Review Process - -1. Read AGENTS.md to understand project context -2. Review C++ Code Standards wiki for C++ changes -3. Review SQL Standards wiki for database changes -4. Check commit message format -5. Verify code style compliance (general and language-specific) -6. Ensure architectural patterns are followed -7. Check for proper testing and documentation -8. Validate that generic changes don't introduce regressions -9. Confirm AI disclosure if applicable - -## Feedback Style - -- Be constructive and educational -- Reference specific sections of AGENTS.md, C++ Code Standards, or SQL Standards when applicable -- Suggest specific fixes with code examples if necessary -- Highlight both issues and good practices -- For C++ issues, cite specific rule from C++ Code Standards wiki -- For SQL issues, cite specific rule from SQL Standards wiki +Review against `AGENTS.md`, `.agents/docs/code-review.md`, and every `.agents/docs/` guide +AGENTS.md routes to for what the diff touches.