Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .busted
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ return {
},
default = {
ROOT = { 'tests' },
pattern = '_spec',
pattern = 'test_',
verbose = true,
},
}
145 changes: 141 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,138 @@ task(subagent_type="wowhead-researcher", prompt="Look up all ranks of Fireball f

---

## GitHub Project Board
## Code Style

### Formatting
- Indent with **4 spaces**, no tabs
- Max line length **120** unless the addon `.luacheckrc` disables it
- Spaces around operators: `local x = 1 + 2`
- No trailing whitespace
- Use plain hyphens (`-`), **never** em or en dashes

### File Header
Every Lua file starts with:

```lua
-------------------------------------------------------------------------------
-- FileName.lua
-- Brief description
--
-- Supported versions: Retail, MoP Classic, TBC Anniversary, Cata, Classic
-------------------------------------------------------------------------------
```

### Imports and Scoping
- Use the shared namespace: `local ADDON_NAME, ns = ...`
- Cache WoW API and Lua globals used more than once as locals at the top of the file
- Keep addon logic in locals; only SavedVariables and `SLASH_*` are global
- Use `LibStub` for Ace3 or other embedded libs; never global `require`

```lua
local ADDON_NAME, ns = ...
local CreateFrame = CreateFrame
local GetTime = GetTime
local LSM = LibStub("LibSharedMedia-3.0")
```

### Naming

| Element | Convention | Example |
|---------|------------|---------|
| Files | PascalCase | `MyAddon_Core.lua` |
| SavedVariables | PascalCase | `MyAddonDB` |
| Local variables | camelCase | `local currentState` |
| Functions (public or local) | PascalCase | `local function UpdateState()` |
| Constants | UPPER_SNAKE | `local MAX_RETRIES = 5` |
| Slash commands | UPPER_SNAKE | `SLASH_MYADDON1` |
| Color codes | UPPER_SNAKE | `local COLOR_RED = "\|cffff0000"` |
| Unused args | underscore prefix | `local _unused` |

### Types
- Default to plain Lua 5.1 with no annotations
- Only add LuaLS annotations when the file already uses them or for public library APIs
- Keep annotations minimal and accurate; do not introduce new tooling

### Functions and Structure
- Keep functions under 50 lines; extract helpers when longer
- Prefer early returns over deep nesting
- Prefer composition over inheritance
- Keep logic separated by layer when possible: Core (WoW API), Engine (pure Lua),
Data (tables), Presentation (UI)

### Error Handling
- Use defensive nil checks for optional APIs
- For version differences, prefer `or` fallbacks over runtime version checks
- Use `pcall` for user callbacks or APIs that may be missing in some versions
- Use `error(msg, 2)` for public library input validation (reports at caller site)

---

## Versioning and File Loading
- Do not gate features with runtime version checks
- Split version-specific code into separate files
- Load with TOC `## Interface` / `## Interface-*` directives or packager comment
directives (`#@retail@`, `#@non-retail@`)

Packager directives are comments locally, so later files can override earlier ones.

---

## Common Pitfalls
- Missing APIs for a target version -- check `docs/` for the exact client build
- Deprecated globals like `COMBATLOGENABLED` and `COMBATLOGDISABLED` (removed in Cata;
always provide `or` fallbacks)
- Race conditions on `PLAYER_ENTERING_WORLD` -- use a short `C_Timer.After` delay
- Timer leaks -- cancel `C_Timer` or `AceTimer` handles before reusing
- `GetItemInfo` or item data can be nil on first call -- retry with a timer

---

## GitHub Workflow

### Issues
Create issues using the repo's issue templates (`.github/ISSUE_TEMPLATE/`):
- **Bug reports**: Use `bug-report.yml` template. Title prefix: `[Bug]: `
- **Feature requests**: Use `feature-request.yml` template. Title prefix: `[Feature]: `

Create via CLI:
```bash
gh issue create --repo <ORG>/<REPO> --label "bug" --title "[Bug]: <title>" --body "<body matching template fields>"
gh issue create --repo <ORG>/<REPO> --label "enhancement" --title "[Feature]: <title>" --body "<body matching template fields>"
```

### Branches
Use conventional branch prefixes:

| Prefix | Purpose | Example |
|--------|---------|---------|
| `feat/` | New feature | `feat/87-mail-toasts` |
| `fix/` | Bug fix | `fix/99-anchor-zorder` |
| `refactor/` | Code improvement | `refactor/96-listener-utils` |

Include the issue number in the branch name when linked to an issue.

### Commits
Use [Conventional Commits](https://www.conventionalcommits.org/):
- `feat: <description> (#issue)` - new feature
- `fix: <description> (#issue)` - bug fix
- `refactor: <description> (#issue)` - code restructuring
- `docs: <description>` - documentation only

Always use `--no-gpg-sign` (GPG signing not available in CI agent environments).

### Pull Requests
1. Create PRs via CLI using the repo's `.github/PULL_REQUEST_TEMPLATE.md` format
2. Link to the issue with `Closes #N` in the PR body
3. PRs require passing status checks (luacheck, test) before merge
4. Squash merge only: `gh pr merge <number> --squash`
5. Branches are auto-deleted after merge

### Project Boards

PhDamage uses the **DragonAddons** org-level GitHub project board (#2) for issue tracking and sprint planning.

### Board Columns
#### Board Columns

| Column | Purpose |
|--------|---------|
Expand All @@ -181,7 +308,7 @@ PhDamage uses the **DragonAddons** org-level GitHub project board (#2) for issue
| In review | PR submitted, awaiting review |
| Done | Merged / released |

### Custom Fields
#### Custom Fields

| Field | Values / Type |
|-------|---------------|
Expand All @@ -191,7 +318,7 @@ PhDamage uses the **DragonAddons** org-level GitHub project board (#2) for issue
| Start date | Date |
| Target date | Date |

### Workflow
#### Workflow

1. **Triage** - New issues land in *To triage*. Assign Priority and Size.
2. **Plan** - Move to *Backlog* or *Ready* depending on urgency.
Expand All @@ -201,6 +328,16 @@ PhDamage uses the **DragonAddons** org-level GitHub project board (#2) for issue

---

## Working Agreement for Agents
- Addon-level AGENTS.md overrides root rules when present
- Do not add new dependencies without discussing trade-offs
- Run luacheck before and after changes
- If only manual tests exist, document what you verified in-game
- Verify changes in the game client when possible
- Keep changes small and focused; prefer composition over inheritance

---

## Communication Style

When responding to or commenting on issues, always write in **first-person singular** ("I")
Expand Down
4 changes: 2 additions & 2 deletions Data/AuraMap_Warlock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ AuraMap[23761] = {
{ type = MOD.DAMAGE_MULTIPLIER, value = 0 },
},
talentAmplify = {
talentKey = "2:16",
talentKey = "2:11",
perRank = 0.02,
effectType = MOD.DAMAGE_MULTIPLIER,
},
Expand All @@ -142,7 +142,7 @@ AuraMap[35702] = {
{ type = MOD.DAMAGE_MULTIPLIER, value = 0 },
},
talentAmplify = {
talentKey = "2:16",
talentKey = "2:11",
perRank = 0.01,
effectType = MOD.DAMAGE_MULTIPLIER,
},
Expand Down
44 changes: 40 additions & 4 deletions Data/TalentMap_Druid.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
local ADDON_NAME, ns = ...

-------------------------------------------------------------------------------
-- TalentMap_Druid
-- Druid talent modifier definitions for PhDamage
-- TalentMap_Druid.lua
-- Druid talent effects mapped to modifier descriptors for TBC Anniversary
-- Talent positions (tab:index) verified in-game on TBC Anniversary
-- (ordered by internal talentID)
--
-- Supported versions: TBC Anniversary
-------------------------------------------------------------------------------
local ADDON_NAME, ns = ...

ns.TalentMap = ns.TalentMap or {}

local MOD = ns.MOD
Expand All @@ -14,6 +18,17 @@ local TalentMap = {}

-------------------------------------------------------------------------------
-- Balance (Tab 1)
-- 1:1 Nature's Grasp (1) 1:2 Starlight Wrath (5)
-- 1:3 Improved Moonfire (2) 1:4 Nature's Reach (2)
-- 1:5 Brambles (3) 1:6 Moonglow (3)
-- 1:7 Celestial Focus (3) 1:8 Control of Nature (3)
-- 1:9 Insect Swarm (1) 1:10 Nature's Grace (1)
-- 1:11 Moonfury (5) 1:12 Vengeance (5)
-- 1:13 Moonkin Form (1) 1:14 Improved Nature's Grasp (4)
-- 1:15 Lunar Guidance (3) 1:16 Balance of Power (2)
-- 1:17 Dreamstate (3) 1:18 Improved Faerie Fire (3)
-- 1:19 Wrath of Cenarius (5) 1:20 Force of Nature (1)
-- 1:21 Focused Starlight (2)
-------------------------------------------------------------------------------

-- Starlight Wrath: -0.1s cast time on Wrath and Starfire per rank
Expand Down Expand Up @@ -108,7 +123,18 @@ TalentMap["1:21"] = {
}

-------------------------------------------------------------------------------
-- Feral (Tab 2)
-- Feral Combat (Tab 2)
-- 2:1 Thick Hide (3) 2:2 Feral Aggression (5)
-- 2:3 Ferocity (5) 2:4 Brutal Impact (2)
-- 2:5 Sharpened Claws (3) 2:6 Feral Instinct (3)
-- 2:7 Primal Fury (2) 2:8 Shredding Attacks (2)
-- 2:9 Predatory Strikes (3) 2:10 Feral Charge (1)
-- 2:11 Savage Fury (2) 2:12 Feral Swiftness (2)
-- 2:13 Heart of the Wild (5) 2:14 Leader of the Pack (1)
-- 2:15 Faerie Fire (Feral) (1) 2:16 Nurturing Instinct (2)
-- 2:17 Primal Tenacity (3) 2:18 Survival of the Fittest (3)
-- 2:19 Predatory Instincts (5) 2:20 Mangle (1)
-- 2:21 Improved Leader of the Pack (2)
-------------------------------------------------------------------------------

-- Sharpened Claws: +2% melee crit per rank (feral abilities)
Expand Down Expand Up @@ -144,6 +170,16 @@ TalentMap["2:19"] = {

-------------------------------------------------------------------------------
-- Restoration (Tab 3)
-- 3:1 Improved Mark of the Wild (5) 3:2 Furor (5)
-- 3:3 Nature's Focus (5) 3:4 Naturalist (5)
-- 3:5 Improved Regrowth (5) 3:6 Natural Shapeshifter (3)
-- 3:7 Omen of Clarity (1) 3:8 Gift of Nature (5)
-- 3:9 Intensity (3) 3:10 Improved Rejuvenation (3)
-- 3:11 Nature's Swiftness (1) 3:12 Subtlety (5)
-- 3:13 Improved Tranquility (2) 3:14 Tranquil Spirit (5)
-- 3:15 Swiftmend (1) 3:16 Empowered Touch (2)
-- 3:17 Empowered Rejuvenation (5) 3:18 Natural Perfection (3)
-- 3:19 Tree of Life (1) 3:20 Living Spirit (3)
-------------------------------------------------------------------------------

-- Naturalist: -0.1s Healing Touch cast time and +2% physical damage per rank
Expand Down
Loading
Loading