From 55234c4d70cf862d25c82562cef8110f96eec24e Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Fri, 20 Mar 2026 08:18:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs(guide):=20=E6=B7=BB=E5=8A=A0=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E5=BC=80=E5=8F=91=E6=8C=87=E5=8D=97=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建了项目结构和模块组织说明 - 添加了构建测试和开发命令指南 - 定义了代码风格和命名约定规范 - 提供了测试指南和最佳实践 - 包含了提交和拉取请求准则 - 记录了解决方案文件和目录布局说明 --- AGENTS.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..a12d9e8 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,42 @@ +# Repository Guidelines + +## Project Structure & Module Organization + +`GFramework.sln` is the entry point for the full .NET solution. Runtime code lives in `GFramework.Core/`, +`GFramework.Game/`, `GFramework.Godot/`, and `GFramework.Ecs.Arch/`. Interface-only contracts stay in the paired +`*.Abstractions/` projects. Roslyn generators are split across `GFramework.SourceGenerators/`, +`GFramework.Godot.SourceGenerators/`, and `GFramework.SourceGenerators.Common/`. Tests mirror the runtime modules in +`GFramework.Core.Tests/`, `GFramework.Game.Tests/`, `GFramework.Ecs.Arch.Tests/`, and +`GFramework.SourceGenerators.Tests/`. Documentation is under `docs/`, Godot templates under `Godot/script_templates/`, +and repository utilities under `scripts/` and `refactor-scripts/`. + +## Build, Test, and Development Commands + +- `dotnet build GFramework.sln` builds the full solution from the repo root. +- `dotnet test GFramework.sln --no-build` runs all NUnit test projects after a build. +- `dotnet test GFramework.Core.Tests --filter "FullyQualifiedName~CommandExecutorTests.Execute"` runs a focused NUnit + test. +- `bash scripts/validate-csharp-naming.sh` checks PascalCase namespace and directory rules used by CI. +- `cd docs && bun install && bun run dev` starts the VitePress docs site locally. + +## Coding Style & Naming Conventions + +Use standard C# formatting with 4-space indentation and one public type per file. The repository keeps `ImplicitUsings` +disabled and `Nullable` enabled, so write explicit `using` directives and annotate nullability carefully. Follow +`PascalCase` for types, methods, namespaces, directories, and constants; use `_camelCase` for private fields and +`camelCase` for locals and parameters. Keep namespaces aligned with folders, for example +`GFramework.Core.Architectures`. + +## Testing Guidelines + +Tests use NUnit 4 with `Microsoft.NET.Test.Sdk`; some suites also use Moq. Place tests in the matching module test +project and name files `*Tests.cs`. Prefer directory parity with production code, for example `GFramework.Core/Logging/` +and `GFramework.Core.Tests/Logging/`. Add or update tests for every behavior change, especially public APIs, source +generators, and integration paths. + +## Commit & Pull Request Guidelines + +Recent history follows Conventional Commit style such as `feat(events): ...`, `refactor(localization): ...`, +`docs(guide): ...`, and `test(localization): ...`. Keep commits scoped and imperative. PRs should explain the +motivation, implementation, and validation commands run; link related issues; and include screenshots when docs, UI, or +Godot-facing behavior changes. From ccb51791a33fca19a9e3d5d3ba9390a60ca1e41b Mon Sep 17 00:00:00 2001 From: GeWuYou <95328647+GeWuYou@users.noreply.github.com> Date: Fri, 20 Mar 2026 08:24:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs(guide):=20=E6=9B=B4=E6=96=B0=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=92=8C=E6=8B=89=E5=8F=96=E8=AF=B7=E6=B1=82=E6=8C=87?= =?UTF-8?q?=E5=8D=97=E4=B8=AD=E7=9A=84=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复了 "Conventional Commit" 到 "Conventional Commits" 的拼写 - 确保文档中使用的术语与业界标准保持一致 --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index a12d9e8..cc14ef5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,7 +36,7 @@ generators, and integration paths. ## Commit & Pull Request Guidelines -Recent history follows Conventional Commit style such as `feat(events): ...`, `refactor(localization): ...`, +Recent history follows Conventional Commits style such as `feat(events): ...`, `refactor(localization): ...`, `docs(guide): ...`, and `test(localization): ...`. Keep commits scoped and imperative. PRs should explain the motivation, implementation, and validation commands run; link related issues; and include screenshots when docs, UI, or Godot-facing behavior changes.