Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
47dd0e1
doc: sub agent parallel work + only use sub agents for simple tasks
JohnDeved Mar 11, 2026
4ff6a3f
Update shared worktree tooling and docs
JohnDeved Mar 11, 2026
ea02c5c
AGENTS: forbid touching comparison inputs
JohnDeved Mar 11, 2026
e7514f1
Merge branch 'tooling-worktree-assets'
JohnDeved Mar 11, 2026
8c384cc
Improve decomp workflow tooling and agent guidance
JohnDeved Mar 12, 2026
635c253
Merge tooling-worktree-assets into main
JohnDeved Mar 12, 2026
85b45a3
Bootstrap fresh worktree setup
JohnDeved Mar 12, 2026
4453407
tools: add style guidance and accuracy audits
JohnDeved Mar 13, 2026
41b71d5
docs: note stub-header ownership cleanup
JohnDeved Mar 13, 2026
b377777
tools: document match-safe null sweeps
JohnDeved Mar 13, 2026
ebaa4a4
Improve DWARF verification workflow
JohnDeved Mar 13, 2026
cc4c690
- again
JohnDeved Mar 13, 2026
718ab67
Add merge rollout helper
JohnDeved Mar 13, 2026
9ff950b
Support dirty merge rollout
JohnDeved Mar 13, 2026
4d42aa9
Merge remote-tracking branch 'origin/dev'
JohnDeved Mar 13, 2026
e7f5382
Tune health checks and line ownership tooling
JohnDeved Mar 13, 2026
6ac3c90
Add ELF address lookup tool
JohnDeved Mar 13, 2026
dfd359e
Add ELF address lookup tool
JohnDeved Mar 13, 2026
2dcd3a0
Fix ProDG dep path rewriting
JohnDeved Mar 13, 2026
8ebbba2
Merge tooling-dev-followups-20260313 into main
JohnDeved Mar 13, 2026
4aafb33
Clarify formatter allowlist semantics
JohnDeved Mar 13, 2026
71946bd
Clarify formatter default scope
JohnDeved Mar 13, 2026
933e54e
Merge remote-tracking branch 'origin/dev' into tooling-dev-followups-…
JohnDeved Mar 13, 2026
635ef0c
Merge remote-tracking branch 'origin/dev' into tooling-dev-followups-…
JohnDeved Mar 13, 2026
effd68f
fix mac build
JohnDeved Mar 13, 2026
8f1ed1b
Merge branch 'tooling-dev-followups-20260313'
JohnDeved Mar 13, 2026
d46f238
tooling: broaden code_style format defaults
JohnDeved Mar 13, 2026
1bb0e62
tooling: globalize clang-format scope
JohnDeved Mar 13, 2026
0c33d68
Merge remote-tracking branch 'origin/main'
JohnDeved Mar 17, 2026
a2663f1
Merge remote-tracking branch 'origin/dev'
JohnDeved Mar 17, 2026
2564a6a
agent %
JohnDeved Mar 17, 2026
a982a7f
4.0%: reconstruct zPlatform source list and match initial helpers
JohnDeved Mar 17, 2026
57405bf
7.4%: match Logitech force and wheel helpers
JohnDeved Mar 17, 2026
73875e2
19.2%: match LGWheels force wrapper batch
JohnDeved Mar 17, 2026
5bb4059
21.4%: add JoyE and movie wrapper functions
JohnDeved Mar 17, 2026
67f98b0
25.4%: add platform memorycard and movie owners
JohnDeved Mar 17, 2026
6210752
28.4%: add ActualReadJoystickData
JohnDeved Mar 17, 2026
5f05447
29.3%: add zPlatform helper owners
JohnDeved Mar 17, 2026
14dcaa9
30.6%: add TextureInfoPlatInfo::SetImage
JohnDeved Mar 17, 2026
42dd3b9
34.9%: add SunE visibility helpers
JohnDeved Mar 17, 2026
ca2e7e6
36.7%: add SunE render path
JohnDeved Mar 17, 2026
ac29e58
41.0%: add GCHW_VD::iDraw
JohnDeved Mar 17, 2026
20b04f8
42.0%: add AcidFX particle setup
JohnDeved Mar 17, 2026
229c141
42.9%: add xSprites sprite owners
JohnDeved Mar 17, 2026
9a9c22c
44.6%: add Xenon effect owners
JohnDeved Mar 17, 2026
e129e44
45.5%: extend Xenon update path
JohnDeved Mar 17, 2026
cafb76e
47.0%: add Xenon constructors
JohnDeved Mar 17, 2026
7b477cb
48.2%: add Xenon particle spawning
JohnDeved Mar 17, 2026
83e7cfe
49.2%: add Xenon particle aging
JohnDeved Mar 17, 2026
9d6ea2d
49.8%: add Xenon poly generation
JohnDeved Mar 17, 2026
80df004
fix: link shared assets and track agent skills symlinks
JohnDeved Mar 17, 2026
8193c87
Merge branch 'main' into zPlatform
JohnDeved Mar 18, 2026
418f610
50.7%: restructure LGWheels Play* functions for correct code layout
JohnDeved Mar 18, 2026
932587c
add stubs and fix matches: PlatGetViewVectors, CGEmitter dtor, RCMP, …
JohnDeved Mar 18, 2026
7013789
fix GCHW_VD::GCHW_VD to 100% match by using Shape::GetWidth/GetHeight
JohnDeved Mar 18, 2026
149e18f
69.8%: implement DVDErrorTask (1904B, 86.5% match)
JohnDeved Mar 18, 2026
108bda3
72.0%: add PlatAddParticle, fix afxEnd return types, improve ClearXen…
JohnDeved Mar 18, 2026
ae1fe91
73.4%: add vector reserve implementation, improve Wheels::IsConnected
JohnDeved Mar 18, 2026
daab130
73.7%: improve GCHW_VD::iDraw VP6 path, fix GXSetTevOp arg
JohnDeved Mar 18, 2026
95e3e6d
74.0%: add VMStatsManager globals, fix gNGEffectList, remove STL temp…
JohnDeved Mar 18, 2026
2e2af0f
74.2%: fix eSetTexture to call GetPlatInfo() each time instead of cac…
JohnDeved Mar 18, 2026
ed210ea
75.9%: improve xenon effect vector flow
JohnDeved Mar 18, 2026
8fa4589
76.2%: improve AddXenonEffect construction order
JohnDeved Mar 18, 2026
8fa418f
76.8%: improve UpdateXenonEmitters staging temps
JohnDeved Mar 18, 2026
0aa9634
77.3%: match GeneratePolys and CGEmitter constructor
JohnDeved Mar 18, 2026
600165b
77.6%: improve eBuildSunPoly and eBuildSunPolyFix register flow
JohnDeved Mar 18, 2026
d76c2f6
fix diff
JohnDeved Mar 18, 2026
c23d422
77.7%: improve DVDErrorTask control flow and indexing
JohnDeved Mar 18, 2026
197ff53
77.8%: add IsPlaying guard to StopForce case 9
JohnDeved Mar 18, 2026
0502060
78.6%: improve AddSpark ScaleAdd argument order and computation flow
JohnDeved Mar 18, 2026
830002c
79.2%: swap push_back condition order and fix AddXenonEffect member s…
JohnDeved Mar 18, 2026
d2b1774
80.3%: restructure SpawnParticles velocity computation and color prec…
JohnDeved Mar 18, 2026
1a17263
80.8%: fix SpawnParticles colour casts to int and reorder computation
JohnDeved Mar 18, 2026
0f5264c
81.0%: fix RenderAll ePoly constructor call and unsigned loop compare
JohnDeved Mar 18, 2026
7981ccc
81.3%: SpawnParticles gravity order, remove initialPos overwrite, pre…
JohnDeved Mar 18, 2026
1e48001
81.6%: fix 2D array access in LGWheels/Periodic force helpers
JohnDeved Mar 18, 2026
3cecdf4
82.5%: rewrite ConvertPadButtons to use bit manipulation and fix Clam…
JohnDeved Mar 19, 2026
e2205dc
Merge remote-tracking branch 'origin/main'
JohnDeved Mar 19, 2026
6ce32b5
82.6%: use OS_BUS_CLOCK macro in DVDErrorTask, fix eInitSunPat store …
JohnDeved Mar 19, 2026
3991375
82.8%: 100% match eRenderSun - fix SunInfo caching, condition order, …
JohnDeved Mar 19, 2026
86df37f
82.9%: 100% match NGEffect constructor, use IsValid() for inline fiel…
JohnDeved Mar 19, 2026
c907e7a
83.0%: 100% match AddSpark and NGEffect, fix int cast for xoris pattern
JohnDeved Mar 19, 2026
1a54bf3
improvements derived from zBWare review changes
JohnDeved Mar 19, 2026
1837507
Merge branch 'main' into zPlatform
JohnDeved Mar 19, 2026
7629e9e
83.3%: fix kFloatScale init order by including UVectorMath.h in Platf…
JohnDeved Mar 19, 2026
fc2f05f
83.4%: improve RenderAll layout and force EffectID 2D array accessors
JohnDeved Mar 19, 2026
1b8ec13
symlink
JohnDeved Mar 19, 2026
b278525
Merge branch 'main' into zPlatform
JohnDeved Mar 19, 2026
c3d7ab9
commit semantics
JohnDeved Mar 19, 2026
e5ef59c
skill
JohnDeved Mar 19, 2026
4611a98
83.7%: improve eUpdateSunPolyFix, Wheels::IsConnected
JohnDeved Mar 19, 2026
db330cd
83.9%: improve LGWheels inline accessors
JohnDeved Mar 19, 2026
9ddb9e0
83.7%: improve Periodic/Constant/Condition EffectID accessors
JohnDeved Mar 19, 2026
097c1a7
84.0%: match MemoryCardImp::BootupCheckDone
JohnDeved Mar 19, 2026
3e69185
84.0%: improve TextureInfoPlatInfo::SetImage power-of-2 check
JohnDeved Mar 19, 2026
0bab6b8
tooling: bootstrap PS2 and Xbox assets
JohnDeved Mar 20, 2026
45403b8
tooling: add cross-platform build matrix checker
JohnDeved Mar 20, 2026
6b35f22
tooling: extend health checks for Xbox and PS2
JohnDeved Mar 20, 2026
c9b94f5
disallow sub agents
JohnDeved Mar 20, 2026
aca2392
Merge branch 'main' into zPlatform
JohnDeved Mar 20, 2026
5434d2a
84.4%: improve LGWheels::InitVars
JohnDeved Mar 20, 2026
1597738
84.6%: improve snProfilerEnable
JohnDeved Mar 20, 2026
3eeb171
84.6%: improve ActualReadJoystickData
JohnDeved Mar 20, 2026
b77c35e
84.6%: match+ MemoryCardImp::DestructSaveInfo
JohnDeved Mar 20, 2026
73d1c19
84.7%: match+ TextureInfoPlatInfo::SetImage(TextureInfo *)
JohnDeved Mar 20, 2026
293c648
84.7%: improve InitPlatform
JohnDeved Mar 20, 2026
09c2a65
84.8%: match MemoryCardImp::ConstructSaveInfo
JohnDeved Mar 20, 2026
6e10cd6
84.9%: improve ActualReadJoystickData
JohnDeved Mar 20, 2026
19a0f83
86.3%: improve UpdateXenonEmitters
JohnDeved Mar 20, 2026
0c8b146
86.4%: improve CGEmitter::SpawnParticles
JohnDeved Mar 20, 2026
5c32776
86.4%: improve CGEmitter::SpawnParticles
JohnDeved Mar 20, 2026
dce867c
87.6%: improve AddXenonEffect
JohnDeved Mar 21, 2026
ff69ca5
87.6%: match AddXenonEffect
JohnDeved Mar 21, 2026
4e77d2f
87.9%: match+ AddXenonEffect
JohnDeved Mar 21, 2026
f283496
87.8%: improve __static_initialization_and_destruction_0
JohnDeved Mar 21, 2026
5a423e0
88.0%: improve UpdateXenonEmitters
JohnDeved Mar 21, 2026
05dce88
88.0%: dwarf improve UpdateXenonEmitters
JohnDeved Mar 21, 2026
aa1ecda
88.3%: improve Periodic::UpdateForce
JohnDeved Mar 21, 2026
1b0e726
87.8%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
e7db202
88.1%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
be48310
88.2%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
f33cc43
88.3%: improve Periodic::UpdateForce
JohnDeved Mar 21, 2026
d81e954
88.5%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
1797bc4
88.6%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
06cba6e
88.4%: improve Periodic::UpdateForce
JohnDeved Mar 21, 2026
30fbea7
88.3%: improve eBuildSunPolyFix
JohnDeved Mar 21, 2026
f3e0d9f
88.2%: improve LGWheels::PlaySpringForce
JohnDeved Mar 21, 2026
2ea73d1
88.3%: improve LGWheels::PlayDamperForce
JohnDeved Mar 21, 2026
547bc07
88.3%: improve LGWheels::PlaySlipperyRoadEffect
JohnDeved Mar 21, 2026
8c4ea74
88.4%: improve LGWheels::PlayAutoCalibAndSpringForce
JohnDeved Mar 21, 2026
404b709
88.5%: improve DVDErrorTask
JohnDeved Mar 21, 2026
4174ce6
88.5%: improve DVDErrorTask
JohnDeved Mar 21, 2026
10886e0
88.5%: improve DVDErrorTask
JohnDeved Mar 21, 2026
cafea00
88.5%: dwarf improve ActualReadJoystickData
JohnDeved Mar 21, 2026
236d2d0
88.6%: improve LGWheels::PlaySurfaceEffect
JohnDeved Mar 21, 2026
3318cfa
88.6%: improve LGWheels::PlaySurfaceEffect
JohnDeved Mar 21, 2026
75c3073
88.8%: improve LGWheels::PlaySurfaceEffect
JohnDeved Mar 21, 2026
d31b357
88.8%: improve LGWheels::PlaySurfaceEffect
JohnDeved Mar 21, 2026
91c4b27
88.8%: dwarf improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
b2f0da6
88.8%: dwarf improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
a10de59
88.8%: improve CGEmitter::SpawnParticles
JohnDeved Mar 21, 2026
06aa8d5
89.0%: improve ActualReadJoystickData
JohnDeved Mar 21, 2026
c609b6f
89.1%: improve ActualReadJoystickData
JohnDeved Mar 21, 2026
d55099e
89.3%: improve ActualReadJoystickData
JohnDeved Mar 21, 2026
d1a7ba7
89.3%: improve ActualReadJoystickData
JohnDeved Mar 21, 2026
f5b816a
89.3%: improve ActualReadJoystickData
JohnDeved Mar 21, 2026
830f07a
89.4%: improve LGWheels::PlayDirtRoadEffect and LGWheels::PlayBumpyRo…
JohnDeved Mar 21, 2026
4048350
89.8%: improve Periodic::UpdateForce
JohnDeved Mar 21, 2026
a20e404
89.9%: improve Periodic::DownloadForce
JohnDeved Mar 21, 2026
888399c
89.9%: improve DVDErrorTask
JohnDeved Mar 21, 2026
c782934
89.9%: improve Wheels helper readers
JohnDeved Mar 21, 2026
a2b2f1b
89.9%: improve LGWheels SameParams helpers
JohnDeved Mar 21, 2026
16fb4fa
90.1%: improve LGWheels multi-field comparators
JohnDeved Mar 21, 2026
70e127c
90.1%: match ReadLGWheelButtonsForProgressiveMenu(int)
JohnDeved Mar 21, 2026
40be219
90.1%: dwarf improve ActualReadJoystickData
JohnDeved Mar 21, 2026
1164aca
90.3%: improve eBuildSunPolyFix
JohnDeved Mar 21, 2026
8334341
90.3%: improve eBuildSunPoly
JohnDeved Mar 21, 2026
d97ddf8
90.3%: improve eBuildSunPoly
JohnDeved Mar 21, 2026
73589af
90.4%: improve eBuildSunPolyFix
JohnDeved Mar 21, 2026
13a4c9e
90.4%: improve eBuildSunPoly
JohnDeved Mar 21, 2026
35b2fa1
90.4%: improve eBuildSunPoly
JohnDeved Mar 21, 2026
23a1e74
90.6%: improve __static_initialization_and_destruction_0
JohnDeved Mar 21, 2026
974aeee
90.6%: improve ParticleList::AgeParticles(float)
JohnDeved Mar 21, 2026
5655a71
90.6%: match PlatformInitJoystick
JohnDeved Mar 21, 2026
3ffb865
90.6%: dwarf improve PlatformInitJoystick
JohnDeved Mar 21, 2026
22315f4
90.6%: match+ LGWheels::LGWheels
JohnDeved Mar 21, 2026
a2dae42
90.6%: match+ PlatformInitJoystick
JohnDeved Mar 21, 2026
700a119
dwarf TU scan tool
JohnDeved Mar 21, 2026
34117cc
90.6%: improve decomp-workflow::dwarf-scan signature filter
JohnDeved Mar 21, 2026
e445c8b
90.6%: match+ LGWheels::ReadAll
JohnDeved Mar 21, 2026
97ff40e
90.6%: match+ DVDValidErrorState
JohnDeved Mar 21, 2026
fcc0cdf
90.6%: match+ GetMemcard
JohnDeved Mar 21, 2026
16d79e4
90.6%: match+ PlatSetFirstMovieFrame
JohnDeved Mar 21, 2026
8825cce
90.6%: match+ MemoryCardImp::ConstructSaveInfo
JohnDeved Mar 21, 2026
2d052d1
fix build
JohnDeved Mar 21, 2026
c91ad03
90.6%: match+ InitDisplaySystem
JohnDeved Mar 21, 2026
8b54f22
90.6%: match+ TextureInfoPlatInterface::SetAnimData
JohnDeved Mar 21, 2026
7e0462b
90.6%: match+ TextureInfoPlatInterface::CreateAnimData
JohnDeved Mar 21, 2026
382e44b
90.6%: match+ ParticleList::GeneratePolys
JohnDeved Mar 21, 2026
0570f41
90.6%: match+ CGEmitter::CGEmitter
JohnDeved Mar 21, 2026
a3eaf08
90.6%: dwarf improve PlatAddParticle
JohnDeved Mar 21, 2026
4b39db8
90.6%: dwarf improve eRenderSun
JohnDeved Mar 21, 2026
cee7e99
90.6%: match+ ClearXenonEmitters
JohnDeved Mar 21, 2026
49f4d0d
90.6%: match+ PlatAddParticle
JohnDeved Mar 21, 2026
fc36af2
90.6%: match+ Wheels::Wheels
JohnDeved Mar 21, 2026
de2f7cf
90.6%: match+ XSpriteManager::AddSpark
JohnDeved Mar 21, 2026
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
1 change: 1 addition & 0 deletions .agents/skills/code_style
1 change: 1 addition & 0 deletions .agents/skills/execute
1 change: 1 addition & 0 deletions .agents/skills/ghidra
1 change: 1 addition & 0 deletions .agents/skills/implement
1 change: 1 addition & 0 deletions .agents/skills/line_lookup
1 change: 1 addition & 0 deletions .agents/skills/lookup
1 change: 1 addition & 0 deletions .agents/skills/refiner
1 change: 1 addition & 0 deletions .agents/skills/scaffold
1 change: 1 addition & 0 deletions .claude
42 changes: 41 additions & 1 deletion .github/skills/code_style/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ In this repo, style cleanup must preserve decomp progress.
- If a style tweak changes codegen or match status, revert it.
- Extend this skill only from patterns you actually verified in the repo.

### Authenticity Over Hacks

A 100% match is the goal, but **how** we get there matters just as much.

- Do not use "any means necessary" to force a match if it results in unreadable or unnatural code.
- Always think about what the original code probably looked like and write it that way.
- Even if a function matches 100% binary-wise, it is not "correct" if the source is unreadable or contains logic that no human developer would have written.
- If you find a stubborn mismatch, look for a more natural C++ expression or a different architectural pattern instead of resorting to opaque hacks.

## Quick Tooling

Use the repo-local helper before doing a style pass:
Expand All @@ -31,7 +40,7 @@ python tools/code_style.py audit --base origin/main
- `audit` also checks touched `class` / `struct` declarations against known header declarations and, when no header exists, against the PS2 visibility rule.
- `audit` warns on touched local forward declarations when the repo already has a header for that type.
- `audit` warns on touched type members that look like invented padding or placeholder names such as `pad`, `unk`, or `field_1234`.
- `audit` also checks touched style-guide rules that clang-format cannot enforce for you, such as cast spacing, `using namespace`, `NULL`, and missing `EA_PRAGMA_ONCE_SUPPORTED` guard blocks when a header's guard region is touched.
- `audit` also checks touched style-guide rules that clang-format cannot enforce for you, such as cast spacing, `using namespace`, `NULL`, bare `#if MACRO` presence checks, recovered layout members that still use raw `unsigned char` / `unsigned short`, and missing or misordered `EA_PRAGMA_ONCE_SUPPORTED` guard blocks when a header's prologue is touched.
- `audit` groups repeated findings by file so branch-wide output stays readable.
- Use `audit --category safe-cpp` when you want a smaller Frontend/FEng-focused subset and `audit --category match-sensitive-cpp` when you want a conservative review queue for decomp code.
- `format --check` is an opt-in wrapper around the repo's `.clang-format`, and by default it targets eligible changed C/C++ files, including match-sensitive code.
Expand Down Expand Up @@ -95,14 +104,22 @@ Foo::Foo()
- Use `nullptr` exclusively for null pointers.
- Prefer `if (ptr)` / `if (!ptr)` over explicit null comparisons when the change is local and verified safe.
- When a match-sensitive TU has many explicit `nullptr` checks and you decide to normalize them, prefer one mechanical full-TU pass over piecemeal cleanup. Rebuild the unit and re-check its status before keeping the rewrite.
- When a helper is doing address arithmetic, prefer `intptr_t` / `uintptr_t` or byte-pointer (`reinterpret_cast<char *>`) math over plain `int` parameters or integerized pointer subtraction.
- Inline assembly is acceptable when it is needed to preserve dead-code compares, ordering, or other compiler behavior that source alone cannot reproduce.
- In low-level list / node / allocator code, prefer existing helper methods such as `AddBefore`, `AddAfter`, `Remove`, `GetPrev`, `GetNext`, or typed accessors over open-coding link rewiring once the helper exists.

### Header prologues and preprocessor checks

- In headers, keep the guard / `EA_PRAGMA_ONCE_SUPPORTED` block before any project `#include`; do not place includes ahead of `#pragma once`.
- Use `#ifdef MACRO` / `#ifndef MACRO` for presence checks. Reserve bare `#if MACRO` for cases where you really need the macro's numeric value.

### Forward declarations and local prototypes

- Prefer including the owning repo header over adding a local forward declaration for a project type.
- If the repo already has a header declaration/definition for a type, include that header instead of redeclaring the type locally.
- If the repo only has an empty or stub owner header, and line info / surrounding source clearly points at that header's subsystem, prefer populating that owner header over leaving a recovered project type declaration inside a `.cpp`.
- Only keep a local forward declaration when no canonical repo header exists yet and you have verified that the ownership is still unresolved.
- Likewise for project free functions: if a declaration is shared across translation units, move it into the owning header instead of leaving ad-hoc local prototypes in `.cpp` files.
- Prefer moving helper template declarations next to their real use site instead of leaving them in an unrelated file.

### Pointer style
Expand All @@ -117,10 +134,13 @@ Foo::Foo()
- Preserve the original `class` / `struct` kind from existing headers or Dwarf / PS2 evidence; do not treat it as a cosmetic style choice.
- Treat header declarations as the repo source of truth. If the repo only has local `.cpp` partial declarations, verify the kind with the PS2 dump instead of copying them blindly.
- Even forward declarations and local partial declarations should use the accurate keyword when known.
- Keep the `// total size: 0x...` comment above the recovered type declaration instead of burying it inside the body.
- When a recovered type is a `class`, keep explicit access sections and put the method/accessor block before the member layout block unless existing repo evidence shows otherwise.
- Preserve the member naming style that DWARF shows. Some types use `mMember`, others use `m_member`; do not normalize them.
- Preserve recovered member names, types, order, and offset comments. Do not invent placeholder members named `pad`, `unk`, `unknown`, or `field_XXXX` for game code just to make a layout compile.
- If a member is genuinely unknown, stop and verify it with `find-symbol.py`, GC Dwarf, and PS2 data. If the layout is still incomplete, add a short TODO above the type instead of burying uncertainty in fake member names.
- Add offset / size comments when you are writing recovered type layouts from DWARF.
- In recovered layouts, prefer explicit-width aliases such as `uint8` / `uint16` when the field width is known. Use plain `char` for text / byte buffers and `signed char` when the field is a signed 8-bit counter.
- Define inline member functions in headers only when DWARF shows that they are genuinely inlined in the binary.
- Use `struct` for POD-like data carriers with public fields; use `class` for behavior-heavy types only when that matches the recovered type information.
- Keep tiny placeholder methods as concise inline bodies when that is already the local pattern.
Expand All @@ -134,13 +154,27 @@ Foo::Foo()
### Dense local code

- Expand dense one-line helper structs, declaration blocks, and function bodies in non-match-sensitive files into normal multiline formatting.
- In low-level headers, prefer normal multi-line bodies for touched inline operators and accessors instead of stacking `{ return ...; }` on one line, unless the surrounding file clearly uses intentional placeholder one-liners.
- Prefer readable blocks over stacked one-line statements when behavior does not depend on exact source shape.
- In touched validation/parsing code, prefer explicit min/max or boundary checks over equivalent magic-constant arithmetic when the clearer form still compiles to the verified result.
- In parser/state-table code, prefer named enums and enum-typed state variables over anonymous integer state codes when that rewrite is verified safe.

### Recovery markers

- Remove stale recovery markers such as `// TODO`, `// UNSOLVED`, or `// STRIPPED` when the touched code is now implemented or understood.
- If a marker still needs to stay, give it short context such as ownership uncertainty, a Dwarf caveat, a platform/config note, or a scratch/link reference. Avoid bare marker-only comments.
- Do not leave `// TODO` hanging off a declaration or helper you just implemented; either finish the thought or remove the marker.

### Uncertain ownership

- If a declaration or global clearly compiles but its original home is uncertain, add a short TODO comment instead of inventing structure you cannot justify yet.
- When ownership matters, verify it with `decomp-workflow.py`, `decomp-context.py`, and `line-lookup` before moving code.

### Readable helper extraction

- When touched recovered code repeats the same pointer/boundary arithmetic, prefer a short named helper or accessor such as `GetTop`, `GetBot`, `GetNext`, `GetPrev`, `GetStringTableStart`, or `GetStringTableEnd` if that shape is already supported by Dwarf/inlining evidence.
- Prefer call sites that use those helpers or existing container APIs over re-encoding the same arithmetic or link manipulation inline.

## Phase 3: Things Not To "Clean Up" Blindly

- Do not move an inline method out of a header just because it looks cleaner.
Expand Down Expand Up @@ -172,3 +206,9 @@ Keep the cleanup only if the build succeeds and the relevant match status is unc
- The trailing `//` initializer-list markers are an intentional repo convention, not noise to remove.
- Small `if (ptr)` cleanup batches can be kept in match-sensitive code, but only after rebuilding the affected unit.
- Dense frontend shim files benefit from multiline struct/prototype/function formatting.
- Header prologues should keep the `EA_PRAGMA_ONCE_SUPPORTED` block ahead of includes, not after them.
- Bare `#if MACRO` presence checks are review bait; use `#ifdef` / `#ifndef` unless you are intentionally testing a numeric config value.
- Reviewed recovered headers tend to keep total-size comments above the type, methods before fields, explicit access sections, and fixed-width aliases for width-known narrow integer members.
- Reviewed fixups also remove stale bare recovery markers or replace them with context, and prefer existing list/node helpers over hand-written pointer/link rewiring.
- Some reviewed fixups improved readability without losing match by replacing opaque range-check arithmetic with explicit bounds and by moving repeated pointer/boundary math behind short named helpers.
- Other recurring review churn came from plain-`int` address helpers, stray local `.cpp` prototypes for shared functions, and integer-coded parser states where named enums were clearer but still matched.
9 changes: 9 additions & 0 deletions .github/skills/execute/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ the produced C++ compiles to byte-identical object code against the original ret

For each function, "done" means both objdiff and normalized DWARF are exact.

Human review is not a substitute for running `dwarf compare`. Each function should hit
its own `verify` gate before you treat it as ready to hand off, commit, or move past.

## Overview

This workflow combines several smaller workflows:
Expand Down Expand Up @@ -152,6 +155,10 @@ python tools/decomp-workflow.py verify -u main/Path/To/TU -f FunctionName
If it fails, follow up with `decomp-workflow.py diff` and `decomp-workflow.py dwarf`
until both checks pass.

Do not queue up several "probably done" functions and leave the DWARF check for later.
Close the `verify` gate per function before moving on whenever feasible; otherwise the
reviewer ends up doing avoidable DWARF triage.

### 3g. Periodic reassessment

After every few functions, re-run the full status check:
Expand Down Expand Up @@ -189,6 +196,8 @@ For any remaining nonmatching functions, make one final pass using the implement
or refiner workflow with all context accumulated during the session.

Do not report a function as complete unless its per-function `verify` check also passes.
Do not hand a function to review as "done except maybe DWARF" — either resolve the DWARF
failure yourself or explicitly call out the blocker and why it remains.

## Phase 5: Report

Expand Down
29 changes: 29 additions & 0 deletions .github/skills/implement/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Your goal is to decompile a specific function: writing C++ source that compiles

A function is not done until it is exact in both objdiff and normalized DWARF.

Reviewers should not be spending their time rediscovering DWARF mismatches. Before you
report progress, ask for review, hand the function off, or switch to another target, you
must run the per-function verification gate yourself and treat any DWARF failure as your
next task, not as review debt.

## Phase 1: Gather Context

Collect data from **all** of these sources in parallel where possible.
Expand Down Expand Up @@ -156,6 +161,16 @@ python tools/decomp-workflow.py verify -u main/Path/To/TU -f FunctionName

If the build fails, fix compilation errors first.

As soon as you have a compiling draft, run the combined verification gate immediately:

```sh
python tools/decomp-workflow.py verify -u main/Path/To/TU -f FunctionName
```

Do this before you spend a long time polishing late instruction mismatches. If `verify`
already shows a DWARF failure, fix that first so you are not polishing code the reviewer
will bounce anyway.

### Check the diff

```sh
Expand Down Expand Up @@ -203,6 +218,17 @@ debug-line owner files for each DWARF `// Range:` block, which makes it much eas
spot inlines that are coming from the wrong header or owner file. Exact line-number
agreement is a useful secondary hint, but file ownership is the first thing to check.

Use this as the default loop when the function compiles but `verify` is still failing:

1. Run `verify`.
2. If DWARF fails, run `dwarf`.
3. Fix the structural issue the DWARF diff is pointing at first: missing/extra locals,
wrong qualifiers or parameter types, wrong inline ownership, wrong helper/header owner,
or a source shape that outlined something that should be inlined.
4. Rebuild and rerun `verify`.
5. Only return to instruction-by-instruction cleanup once the remaining failures are no
longer obvious DWARF-compare issues.

Manual fallback:

After writing your code, you can also run the dwarf dump on the compiled output and then query your output dump with lookup.py to compare your decompiled functions against the originals. Since the address of the function you're working on can keep changing
Expand Down Expand Up @@ -233,6 +259,9 @@ Every mismatched instruction is a signal — don't settle for "close enough".
Reaching 100% instruction matching status is not enough. Stay in the loop until `verify`
passes, which means the DWARF of the function also matches after normalization.

Do not leave a function in a "review-ready" or "good enough for now" state with a known
DWARF failure unless you are explicitly blocked and you document that blocker clearly.

## Phase 5: Report

Summarize:
Expand Down
19 changes: 19 additions & 0 deletions .github/skills/refiner/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ approaches that were tried before — instead, apply systematic lateral analysis
- A diff is available (`decomp-diff.py -u <TU> -d <func>`).
- The "obvious" translation from Ghidra has been attempted.
- You have been given the current source code and the diff.
- You have already run the per-function `verify` gate and know whether the remaining work
is still structural DWARF cleanup or true late-stage instruction cleanup.

Refiner is not the place to dump unresolved DWARF debt on a reviewer. If `verify` or
`dwarf` is still showing obvious structural mismatches (missing locals, wrong types,
wrong inline ownership, wrong helper/header owner), fix those first or drop back to the
implementer workflow before doing late instruction polish.

## Phase 1: Read the full diff without collapsing

Before you start a refiner pass, confirm the gate status:

```sh
python tools/decomp-workflow.py verify -u main/Path/To/TU -f FunctionName
```

If the combined gate is failing for reasons that are still clearly visible in the DWARF
diff, address those first instead of treating them as reviewer follow-up.

Preferred shortcut:

```sh
Expand Down Expand Up @@ -151,6 +167,9 @@ DWARF mismatches to watch for:
- Wrong return type
- Missing inlined function records (means an inline call was outlined)

If these mismatches are still present, you are not in pure refiner territory yet. Resolve
them before you ask a reviewer to spend time on the function.

## Phase 4: Report

Summarize:
Expand Down
20 changes: 19 additions & 1 deletion .github/skills/scaffold/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Preserve the real `class` / `struct` kind while scaffolding. Check existing head
then use Dwarf plus PS2 visibility / vtable info to decide the type kind. Even temporary
forward declarations should match the known original kind.

Keep the header prologue in repo order: header guard, `EA_PRAGMA_ONCE_SUPPORTED` block,
then includes. Do not drop project includes ahead of `#pragma once`.

If the repo already has a header for a type you need, include that header instead of
adding a new local forward declaration. Only forward-declare when no canonical repo header
exists yet and you have verified that the ownership is still unresolved.
Expand All @@ -47,11 +50,26 @@ Preserve real member names, types, order, and offset comments while scaffolding.
fill gaps with invented `pad`, `unk`, or `field_XXXX` members for game types; verify the
layout from Dwarf / PS2 data and leave a TODO over the type if a field is still uncertain.

Keep the `// total size: 0x...` comment above the recovered type declaration. When the
recovered type is a `class`, keep explicit access sections and prefer putting methods /
accessors before the member layout block unless existing repo evidence says otherwise.

When a recovered field width is known, prefer explicit-width aliases such as `uint8` /
`uint16` over raw `unsigned char` / `unsigned short`. Use plain `char` for string or byte
buffers and `signed char` when the field is a signed 8-bit counter.

If a recovered type repeatedly walks neighbors, boundaries, or in-object offsets, prefer
small named helpers such as `GetTop`, `GetBot`, `GetNext`, `GetPrev`, or boundary getters
instead of repeating raw pointer arithmetic at each call site.

When those helpers operate on addresses or byte offsets, prefer `intptr_t` / `uintptr_t`
or explicit byte-pointer arithmetic instead of plain `int` address parameters.

Only create headers if it's really necessary (the struct doesn't have inlines so you can't determine in which header file it goes and it's thematically very different from the other structs that use it), otherwise put it into the one you determined to be correct.

The dwarf often has duplicated inlines, clean those up according to the order in the PS2 info.

Write a TODO comment over the struct/class if you aren't 100% sure that it belongs to the correct header.
Write a TODO comment over the struct/class if you aren't 100% sure that it belongs to the correct header, and say why (ownership uncertainty, circular dependency, dwarf caveat, etc.) instead of leaving a bare marker.

## Phase 3: Add needed files to jumbo file and compile

Expand Down
Loading
Loading