|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Scope |
| 4 | +- Applies to the entire repository. |
| 5 | +- Goal: deliver safe, minimal, testable changes to `KNSoft.SlimDetours`. |
| 6 | + |
| 7 | +## Quick Start (Read First) |
| 8 | +- `README.md` |
| 9 | +- `Source/KNSoft.SlimDetours/SlimDetours.h` |
| 10 | +- `Source/KNSoft.SlimDetours/InlineHook.c` |
| 11 | +- `Source/KNSoft.SlimDetours/Transaction.c` |
| 12 | +- `Source/KNSoft.SlimDetours/Thread.c` |
| 13 | +- `Source/KNSoft.SlimDetours/Memory.c` |
| 14 | +- `Source/KNSoft.SlimDetours/Trampoline.c` |
| 15 | +- `Source/Demo/Main.c` |
| 16 | +- `.github/workflows/Build_Publish.yml` |
| 17 | + |
| 18 | +## Hard Rules |
| 19 | +- Follow `.editorconfig`. |
| 20 | +- Preserve original file encoding and line-ending style when editing files. |
| 21 | +- Keep diffs minimal; do not refactor unrelated code. |
| 22 | +- `Source/Microsoft.Detours/` is bundled for NuGet packaging only; never modify it. |
| 23 | +- Use concise, technical comments only when needed. |
| 24 | + |
| 25 | +## Build and Validate |
| 26 | +- Build: |
| 27 | + - `msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Debug /p:Platform=x64 /p:RestorePackagesConfig=true` |
| 28 | +- Run demo tests: |
| 29 | + - `.\Source\OutDir\x64\Debug\Demo.exe -Run` |
| 30 | + - `.\Source\OutDir\x64\Debug\Demo.exe -Run DeadLock -Engine=SlimDetours` |
| 31 | + |
| 32 | +## Change Routing |
| 33 | +- Hook transaction semantics: `Transaction.c`, `InlineHook.c`, `SlimDetours.h` |
| 34 | +- Thread suspend/resume/context update: `Thread.c` |
| 35 | +- Trampoline allocation/address-range logic: `Trampoline.c`, `Memory.c` |
| 36 | +- Public API/signature changes: `SlimDetours.h` |
| 37 | +- Packaging/consumption: `KNSoft.SlimDetours.nuspec`, `KNSoft.SlimDetours.targets` |
| 38 | + |
| 39 | +## Before Finishing |
| 40 | +- Verify both hook and unhook paths still work. |
| 41 | +- Check platform/config impact (`x86`, `x64`, `ARM64`, `ARM64EC`) for touched logic. |
| 42 | +- If tests were not run, state that explicitly. |
0 commit comments