## 2026-10-04T13:23:58Z
You are worker_rem_1, an implementation Worker subagent for FreeExile.
Your working directory is: c:\Projects\FreeExile\.agents\teamwork\worker_rem_1
Your parent orchestrator is orchestrator_22 (conversation ID: 34037784-62e1-41f8-bfe6-912696fdec14).

MANDATORY: You MUST read c:\Projects\FreeExile\.agents\teamwork\ORIGINAL_REQUEST.md under header ## 2026-10-04T12:05:22Z before starting work.
Also read:
- c:\Projects\FreeExile\.agents\teamwork\orchestrator_22\PROJECT.md
- c:\Projects\FreeExile\.agents\teamwork\reviewer_m1_2\handoff.md
- c:\Projects\FreeExile\.agents\teamwork\explorer_rem_1\analysis.md
- c:\Projects\FreeExile\.agents\teamwork\explorer_rem_2\analysis.md
- c:\Projects\FreeExile\.agents\teamwork\explorer_rem_3\analysis.md

MANDATORY INTEGRITY WARNING:
DO NOT CHEAT. All implementations must be genuine. DO NOT hardcode test results, create dummy/facade implementations, or circumvent the intended task. A teamwork_preview_auditor will independently verify your work. Integrity violations WILL be detected and your work WILL be rejected.

Your Exclusive Write Ownership:
- tools/asset_pipeline/monster_character_pipeline_scaffold.py
- client/cocos/assets/resources/monsters/
- client/cocos/assets/resources/characters/
- tests/e2e_cocos/vfx_test_helpers.py
- tests/e2e_cocos/test_vfx_texture_atlas_pipeline_e2e.py
- tests/e2e_cocos/test_vfx_scaffolding_and_parity_e2e.py
- client/cocos/assets/scripts/animation/SpriteAtlasRenderer.ts
- client/cocos/assets/scripts/combat/SkillVfxPlayer.ts

Your Tasks:
PART 1: Fix Scaffolding UV Math Defect
1. In tools/asset_pipeline/monster_character_pipeline_scaffold.py:
   - Dynamically compute Power-of-Two height `textureHeight = next_power_of_two(total_rows * frame_height)`:
     For monsters: total_rows=48, frame_height=160 -> 7,680 px -> textureHeight = 8,192.
     For characters: total_rows=80, frame_height=192 -> 15,360 px -> textureHeight = 16,384.
   - Calculate normalized UVs using the actual declared texture width and height:
     `u0 = x / textureWidth`, `v0 = y / textureHeight`, `u1 = (x + w) / textureWidth`, `v1 = (y + h) / textureHeight`.
   - Ensure all frames have 0.0 <= u0, v0, u1, v1 <= 1.0 and keep the file strictly under 500 lines.
2. Run `python tools/asset_pipeline/monster_character_pipeline_scaffold.py` to regenerate all 16 manifests in `client/cocos/assets/resources/monsters/` and `client/cocos/assets/resources/characters/`.

PART 2: Modularize E2E Tests & Harden Assertions (< 500 lines Hard Cap)
1. Restructure the E2E tests into the 3-component architecture specified by explorer_rem_2:
   - `tests/e2e_cocos/vfx_test_helpers.py` (~110 lines): Extract canonical skill/sigil/monster/character tables, fixtures, and reusable `validate_manifest_uv_bounds()`.
   - `tests/e2e_cocos/test_vfx_texture_atlas_pipeline_e2e.py` (~340 lines, strictly < 500 lines): Retain primary VFX tests and harden `test_t1_monster_and_character_scaffolding_structure` to assert that all 10 monsters and 6 characters directories exist and all frames satisfy 0.0 <= UV <= 1.0.
   - `tests/e2e_cocos/test_vfx_scaffolding_and_parity_e2e.py` (~190 lines, strictly < 350 lines): Deep scaffolding, Metal configs, Song Binh pairs, parameterized UV checks, and WebApp parity.
2. Verify with `python tools/lint/check_code_and_doc_hygiene.py --strict` to ensure 0 hygiene errors.

PART 3: Milestone 2 Cocos Client Integration
1. Upgrade `client/cocos/assets/scripts/animation/SpriteAtlasRenderer.ts`:
   - Eliminate heap allocations during frame updates (reusable `_scratchRect = new Rect()`, pre-baked UV lookup cache).
   - Update manifest parser to support flexible manifest lookup (both explicit frame definitions and sequential grids).
   - Retain anchor pivot [0.5, 0.90].
   - Keep file strictly under 500 lines.
2. Implement `client/cocos/assets/scripts/combat/SkillVfxPlayer.ts`:
   - Listens to `EventBus.emit('skillCasted', ...)` from `CombatController.ts`.
   - Uses a pre-warmed object pool of VFX sprite quad nodes with `SpriteAtlasRenderer`.
   - Plays the corresponding skill/sigil animation with anchor pivot [0.5, 0.90] and releases back to pool when animation completes.
   - Strict TypeScript types, zero allocation hot path, under 350 lines.

PART 4: Full Verification
1. Run `python tools/asset_pipeline/monster_character_pipeline_scaffold.py`
2. Run `pytest tests/unit/test_asset_pipeline_tools.py -v`
3. Run `pytest tests/e2e/test_asset_campaign_and_pipeline_e2e.py -v`
4. Run `pytest tests/e2e_cocos/test_vfx_texture_atlas_pipeline_e2e.py -v`
5. Run `pytest tests/e2e_cocos/test_vfx_scaffolding_and_parity_e2e.py -v`
6. Run `python tools/lint/check_code_and_doc_hygiene.py --strict`
7. Run `cd client/cocos && npm run build:web` (ensure 0 TypeScript compiler errors)
8. Document all commands and results in your handoff report.
Deliver handoff.md in your working directory and notify parent orchestrator.
