Skip to content

Commit 0f4a3f1

Browse files
marcinnJezSonic
authored andcommitted
Update CONTRIBUTING guidelines
1 parent a46e932 commit 0f4a3f1

1 file changed

Lines changed: 77 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,81 @@
11
# Contributing
22

3+
## Guidelines
4+
5+
Every change should be reviewed and tested, either manually or automatically.
6+
For this reason, contributions should be topic-focused and as small as possible.
7+
They should be readable to reviewers, and the intent of the change should be
8+
clear from the code, commit history, and pull request description.
9+
10+
Contributors should follow these rules:
11+
12+
* Keep patches as small as possible.
13+
* Focus on a single topic per pull request.
14+
* Do not change unrelated implementation details "by the way".
15+
* Avoid unnecessary code reformatting.
16+
* Review your own changes before requesting review.
17+
* Use Draft Pull Requests for work in progress.
18+
* Format the code according to the project style before requesting review
19+
(see: `scripts/style-<fix|check>`).
20+
* Explain non-trivial design or ownership decisions in the pull request
21+
description.
22+
23+
### AI Guidelines
24+
25+
AI coding agents can be useful tools, but they can also generate bloated,
26+
incorrect, or incomprehensible code. They may also produce implementations
27+
that do not fit the project architecture.
28+
29+
The general rule is: you are always responsible for the code you ship.
30+
31+
For this reason, contributors should follow these rules:
32+
33+
* AI is a helper, not a substitute for understanding.
34+
* Never trust AI output blindly. Review and test the code.
35+
* You must be able to explain the code you submit.
36+
* If AI generates something unclear, rewrite it, simplify it, or refactor it manually.
37+
* Do not use AI to make architecture decisions.
38+
* Give AI agents the smallest and most precise tasks possible.
39+
* Prefer planning, analysis, and review prompts over large open-ended code generation.
40+
* Do not submit AI-generated changes that you do not fully understand.
41+
42+
### C++ / GDExtension Guidelines
43+
44+
This project uses C++ through Godot-CPP and GDExtension. The C++ layer should
45+
follow Godot's object model, memory model, and API conventions as closely as
46+
possible.
47+
48+
The goal is not to write isolated "pure C++" code and then attach it to Godot.
49+
The goal is to extend Godot in a way that remains compatible with Godot's
50+
lifetime rules, reference counting, editor integration, scripting API, resource
51+
system, and rendering/server APIs.
52+
53+
Contributors should follow these rules:
54+
55+
* Prefer Godot types and containers when data crosses the Godot API boundary.
56+
* Use `Ref<T>` for Godot `Resource` objects where ownership is shared or managed
57+
by Godot.
58+
* Use `Object`, `Resource`, `Node`, and other Godot base classes according to
59+
their intended lifetime model.
60+
* Avoid storing raw pointers unless the ownership and lifetime are explicit.
61+
* Do not keep raw pointers to Godot objects in long-lived containers without a
62+
clear unregister or validation mechanism.
63+
* Avoid unnecessary `new`, `delete`, `memnew`, and `memdelete`.
64+
* Do not mix Godot-managed lifetime with manual C++ lifetime unless there is a
65+
clear reason and the ownership model is documented.
66+
* Avoid building parallel pure C++ object graphs that duplicate Godot's object,
67+
resource, or scene model.
68+
* Keep pure C++ helper code small, local, and implementation-specific.
69+
* Do not expose pure C++ lifetime assumptions to GDScript or editor-facing APIs.
70+
* Be careful with `RID` ownership and release order.
71+
* Be careful with singleton registration, access, and shutdown order.
72+
* Be careful with signals emitted during creation, reload, teardown, or cache
73+
invalidation.
74+
75+
If a change affects ownership, caching, reload logic, singleton lifetime,
76+
resource lifetime, or `RID` management, the pull request description should
77+
explain the intended lifetime model.
78+
379
## Request for changes/ Pull Requests
480
You first need to create a fork of this repository to commit your changes to it. Methods to fork a repository can be found in the [GitHub Documentation](https://docs.github.com/en/get-started/quickstart/fork-a-repo).
581

@@ -25,4 +101,4 @@ git switch --create [prefix]/[feature-or-fix-name]
25101

26102
Commit your changes, then push the branch to your fork with `git push -u fork` and open a pull request on the base repository.
27103

28-
Your code style must comply with [our Code style](CODE_STYLE.md) and pass CI/CD checks in order for your contribution to be merged
104+
Your code style must comply with [our Code style](CODE_STYLE.md) and pass CI/CD checks in order for your contribution to be merged

0 commit comments

Comments
 (0)