Contributing
Contributing
This guide describes how to contribute to firelands-next, including development workflow, coding standards, and best practices.
Prerequisites
Before contributing, understand:
- Hexagonal architecture — Architecture and module guides
- TDD workflow — Testing
- Build system — CMake + Ninja (Developer Setup)
- Language — All code, comments, and git commits in English
Development workflow
1. Finding work
- Check the Roadmap for planned features
- Look at GitHub issues labeled
good first issue - Review documentation gaps in this wiki
2. Starting work
git checkout -b feature/my-new-feature
# or
git checkout -b fix/description-of-bug
Branch naming:
| Prefix | Use |
|---|---|
feature/ | New features |
fix/ | Bug fixes |
refactor/ | Code refactoring |
docs/ | Documentation only |
3. Development process
- Write tests first (TDD)
- Implement the feature
- Verify tests pass:
ctest --test-dir build - Commit with clear messages
- Open a pull request
4. Commit messages
<type>(<scope>): <description>
[optional body]
Types: feat, fix, refactor, docs, test, chore, perf
Examples:
feat(auth): add SRP6a password reset flow
fix(world): correct spell damage for area spells
docs(database): document new migration schema
Code standards
C++ style
| Rule | Convention |
|---|---|
| Standard | C++20 |
| Variables / functions | snake_case |
| Types / classes | PascalCase |
| Constants / enums | UPPER_SNAKE_CASE |
| File names | kebab-case |
Architecture rules
Dependency direction:
Infrastructure → Application → Domain → Shared
domain/must not import fromapplication/orinfrastructure/- Use ports (interfaces) in domain/application; implement adapters in infrastructure
- Application depends on domain + shared only — no concrete MySQL or Boost.Asio headers
Logging
Always include spdlog via <shared/Logger.h>:
#include <shared/Logger.h>
LOG_INFO("Player {} logged in from {}", player.GetName(), ip_address);
Error handling
- Exceptions for exceptional situations
std::optional<T>when an operation may legitimately find nothing- Never concatenate SQL strings — use parameterized queries in infrastructure
SQL standards
- Place migrations in
sql/migrations/with numeric prefixes (001_,002_, …) - Use idempotent operations (
IF NOT EXISTS,ADD COLUMN IF NOT EXISTS) - Never
DROP TABLEin migrations - Regenerate bundled SQL after schema changes:
cmake --build build --target merge-migrations
Lua standards
- Scripts in
scripts/lua/ - Descriptive file names:
npc_9001_boss_karax.lua - Wrap risky code in
pcall; namespace handlers in tables - See Lua Scripting
Testing standards
- GoogleTest + GMock
- One behavior per test; AAA pattern (Arrange, Act, Assert)
- Mock repository ports when testing application services
- See Testing
Common contribution types
Adding a feature
- Domain model (if needed)
- Repository port + infrastructure adapter
- Application service
- Wire handlers (infrastructure)
- Unit tests
- Wiki documentation
Adding a GM command
Permissioninshared/game/Permissions.h- Register in
CommandService.cpp - Implement on
WorldSessionviaICommandSession - Document in GM Commands
Adding a database migration
sql/migrations/NNN_description.sql- Update C++ models/repositories if needed
- Run
merge-migrationsand test on Docker MySQL - Update Database
Code review
Reviewers: focus on logic, architecture, and style; be constructive.
Authors: respond to comments; keep PRs focused and reasonably sized.
Getting help
- This wiki and
docs/in the firelands-next repository - GitHub issues and discussions
- WowPacketParser structs and packet captures for build 15595 when validating wire formats