Claude-skill-registry build-evaluation-developer
Guidelines for safely understanding, modifying, and extending the weapon build optimization evaluator
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/build-evaluation-developer" ~/.claude/skills/majiayu000-claude-skill-registry-build-evaluation-developer && rm -rf "$T"
manifest:
skills/data/build-evaluation-developer/SKILL.mdsource content
Build Evaluation Developer Skill
Use this skill when modifying the weapon build evaluation logic in
internal/evaluator/.
The evaluator is a high-performance DFS engine. Incorrect modifications can lead to exponential search times or suboptimal builds.
Scope & Intent
Use this skill when:
- Modifying the DFS algorithm in
processSlots - Adding new optimization metrics (e.g. Weight, Price)
- Adjusting pruning or bounding logic
- Debugging why a "best build" isn't actually optimal
Safety & Performance Invariants
- Limited Run Scope:
- Full Runs: Do NOT trigger a full evaluator run (
) unless explicitly requested.task evaluator:start - Test Mode: You MAY use
for smoke tests. It uses a restricted subset of weapons and trader levels.task evaluator:start:test-mode - Focused Testing: Prefer unit tests, benchmarks, or integration tests targeting specific weapons.
- Full Runs: Do NOT trigger a full evaluator run (
- Thread Safety:
runs in parallel worker pools. NEVER use global variables or mutate shared structures (like theprocessSlots
items) during the search.CandidateTree - Pre-Evaluation Setup: Before calling
, you MUST ensure the tree is initialized:FindBestBuildweapon.UpdateAllowedItems() weapon.UpdateAllowedItemSlots() - Branch-Local Exclusions:
must be cloned (excludedItems
) when descending into a branch where a new conflict is introduced.helpers.CloneMap
Algorithm Logic: processSlots
processSlotsConflict Enforcement
Conflicts are enforced by the
excludedItems map.
- Rule: If an item is in
, it cannot be chosen for the current slot.excludedItems - Rule: If an item is chosen, all its
must be added to the exclusion map for all subsequent descendants and siblings in that branch.ConflictingItems
Tie-Breaking (doesImproveStats
)
doesImproveStatsWhen comparing builds, we use primary and secondary stats:
- Recoil Focus: Primary is
(lower is better). Tie-breaker isRecoilSum
(higher is better).ErgonomicsSum - Ergo Focus: Primary is
(higher is better). Tie-breaker isErgonomicsSum
(lower is better).RecoilSum
Pruning & Bounding
Pruning skips branches that cannot mathematically beat the current
best build.
Bounding Functions
: Sum of current recoil + minimum possible recoil from all remaining slots.computeRecoilLowerBound
: Sum of current ergonomics + maximum possible ergonomics from all remaining slots.computeErgoUpperBound
Pruning Locations
- Item Selection: Before evaluating an item in a slot.
- Empty Slot: Before evaluating the outcome of leaving a slot empty.
Caching Logic (Cache
interface)
CacheCaching uses memoization of "conflict-free" subtrees to avoid redundant DFS traversals.
The "Conflict-Free" Invariant
- An item is only cacheable if it has zero
.ConflictingItems - If an item has conflicts, its optimal subtree depends on which exclusions are active, making simple ID-based caching unsafe.
Clean Contribution
The cache stores the relative contribution of a subtree, not the absolute total. This allows the same cached result to be added to different parent builds.
How to Modify: Developer Checklist
When adding a new stat (e.g.,
Weight):
- Update Models: Add the stat to
,Build
, andItemEvaluation
inOptimalItem
.evaluator.go - Implement Bounding: Create
orcompute[Stat]LowerBound
.compute[Stat]UpperBound - Update Comparison: Modify
to include the new stat in the priority chain.doesImproveStats - Integrate Pruning: Call your new bounding function in
.processSlots - Update Caching: Ensure the new stat is captured in
and theCacheEntry
implementation.Cache - Verify:
- Run
to check cache correctness.go test ./internal/evaluator/ -run TestCache - Run
to check for performance regressions.go test ./internal/evaluator/ -bench=. -benchmem
- Run