From a2f783a296ce24fddf0b6c5e50a3b0781cd47013 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Sun, 27 Sep 2026 13:06:59 -0700 Subject: [PATCH 1/2] docs: add contributing.md and agents.md --- AGENTS.md | 33 ++++++++++++++++++++++++++++++ CONTRIBUTING.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 14 +++---------- 3 files changed, 90 insertions(+), 11 deletions(-) create mode 100644 AGENTS.md create mode 100644 CONTRIBUTING.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..923f49b2 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,33 @@ +It is strongly recommended to disclose your vendor and model (e.g. `GitHub Copilot on GPT 5.6 Sol`) +in your commit messages and PR description. + +Please read @CONTRIBUTING.md in addition to the rules below. + +# RE/Decompile Rules + +- The contributions must be based on publicly available sources. + +# Code Style Rules + +- Do not include any assembly or disassembly as code or comment +- Do not use inline assembly for matching. Any PR with a substantial amount of + inline assembly will be automatically rejected. Even for a small amount, it is + preferred to keep the function as non-matching when it's trivially provable + that it is equivalent to the original (e.g. register renaming, reordering). + - The only exception is `asm("")` which can serve as a barrier for optimization. +- Do not use `goto` for matching unless it is **absolutely** necessary and plausible + that the original source code contained `goto`. + +# PR Rules + +- English only +- Do not publish a PR without human review. If the human doesn't know what + they are doing, do not create a PR. +- Do not commit one-off scripts. +- Do not include any assembly or disassembly as code, comment, commit message or PR description +- Make the PRs small and focused, which helps review: + - One thing per PR + - If the change spans across a lot of components, batch them into smaller PRs +- Squash your branch into one commit. +- Include an explanation or source for member names or why functions must exist, + if it isn't straightforward from the binary or their usages. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d1da08ce --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# Contribution Guidelines + +## Development + +To build and run checks, please install: +- [task](https://taskfile.dev) for running commands. +- CMake (check the version requirement in CMakeLists.txt) and Ninja. +- Clang/LLVM toolchain for your host system. This is only used for `clang-format` and `clang-tidy`. + The version should match [the image used in the PR checks](https://github.com/open-ead/containers/blob/main/ubuntu-builder/Dockerfile). + +Workflows: +- Run `task configure` to configure the CMake projects. +- Run `task build` to build and run tests. +- Run `task check` to check formatting and clang-tidy issues. `task fix` formats the files. +- Run `task pr` to run the same checks that the PR runs. + It's a good idea to always run this one before you open or update a PR. + +## Repo Structure + +- `/lib/*`: One CMake subdirectory for each library target that gets statically linked into the game. +- `/test`: Test projects. + +## Module Structure + +Each SDK module is its own CMake subdirectory at `/lib/` and has its own `include` and `src` +directories. For example for the module `atk`: + +``` +lib/atk/ +├── include/nn/ +│ ├── atk/ +│ └── atk.h +├── src/atk/ +│ └── atk_Something.cpp +└── CMakeLists.txt +``` + +The public header structure in `lib/*/include/nn` should follow the [same rules as nnSdk headers](https://github.com/open-ead/nnsdk/blob/main/CONTRIBUTING.md). + +If there needs to be a new module, you can copy one of the existing modules +and rename the CMake target in `lib/*/CMakeLists.txt`. Then, add the new module +in the following places: +- `/CMakeLists.txt`: Add a `add_subdirectory` near the end of the file. +- `/Taskfile.yml`: Add it to the `MODULES` list near the top of the file. +- `/test/header_check/CMakeLists.txt`: Add it to the `HEADER_CHECK_TARGETS` list. + +## PR Rules + +Please use English for PRs and squash your branch into one commit. +Keep PRs reasonably sized to get them reviewed faster. If there are multiple +things in the same PR, consider splitting them into multiple PRs. + +If it isn't straightforward from the usage or binary why something must be added, +please include an explanation or source. diff --git a/README.md b/README.md index 37098b00..0843094e 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,10 @@ This repository includes: Do not ask for or PR any copyrighted material to this repo. You will be ignored. Usage of the materials here outside of matching decompilation is not supported. -# Credits +## Credits - [Shadow](https://github.com/shadowninja108/) - For [Skyline](https://github.com/shadowninja108/Skyline), which was the primary inspiration and use case for this repo. - [Shibbo](https://github.com/shibbo) - For [OdysseyReversed](https://github.com/shibbo/OdysseyReversed/), which most of these headers came from. -# Development -For running commands please install [task](https://taskfile.dev), CMake, Ninja and Clang/LLVM. - -The Clang/LLVM toolchain is only used for formatting and running `clang-tidy`. -The version should match the [image used in the PR](https://github.com/open-ead/containers/blob/main/ubuntu-builder/Dockerfile) - -Before you begin, run `task clone-deps` to clone dependencies. - -Run `task pr` to run the same checks that the PR runs. Run `task fix` to fix the clang-format issues. - +## Development +Please see [CONTRIBUTING.md](./CONTRIBUTING.md) From 52d164bba628a7fd06465f5c128f588de79a2ea0 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Mon, 28 Sep 2026 18:31:53 -0700 Subject: [PATCH 2/2] with the toolchain update, no longer require clang toolchain in setup --- CONTRIBUTING.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d1da08ce..beff5559 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,8 +5,9 @@ To build and run checks, please install: - [task](https://taskfile.dev) for running commands. - CMake (check the version requirement in CMakeLists.txt) and Ninja. -- Clang/LLVM toolchain for your host system. This is only used for `clang-format` and `clang-tidy`. - The version should match [the image used in the PR checks](https://github.com/open-ead/containers/blob/main/ubuntu-builder/Dockerfile). + +Please run `task clone-deps configure` before running the other +commands. Workflows: - Run `task configure` to configure the CMake projects. @@ -15,6 +16,10 @@ Workflows: - Run `task pr` to run the same checks that the PR runs. It's a good idea to always run this one before you open or update a PR. +If there are errors after merging upstream updates, run `task clean clone-deps` +to clean CMake cache and update your local dependencies. If the error +persists, please ask for help in Discord. + ## Repo Structure - `/lib/*`: One CMake subdirectory for each library target that gets statically linked into the game.