From 5ed792b09f063a34555a648bdfea007b580bc243 Mon Sep 17 00:00:00 2001 From: SepComet <202308010230@stu.csust.edu.cn> Date: Thu, 2 Apr 2026 10:32:33 +0800 Subject: [PATCH] import openspec --- AGENTS.md | 33 +++++++++++++++++++++++++++++++++ openspec/config.yaml | 20 ++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 AGENTS.md create mode 100644 openspec/config.yaml diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3fc76b0 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,33 @@ +# Repository Guidelines + +## Project Structure & Module Organization +This repository is a Unity `2022.3 LTS` project. Core gameplay code lives in `Assets/GameMain/Scripts` (for example UI, entity, procedure, events, and data-table related logic). Shared runtime/framework code is in `Assets/GameFramework`. Third-party plugins are under `Assets/Plugins` (such as DOTween). Main scenes are in `Assets/GameMain/Scenes` (`Menu.unity`, `Main.unity`, `Game.unity`), and the local launcher flow starts from `Assets/Launcher.unity`. + +Data content and tooling are split across `Assets/GameMain/DataTables`, the localized data-table folder at project root, and `Tools/`. + +Do not commit generated folders: `Library/`, `Temp/`, `Logs/`, `obj/`. + +## Build, Test, and Development Commands +- `Unity -projectPath .` + Opens the project in Unity Editor. +- `VampireLike.sln` + Open the C# solution in Rider/Visual Studio for code changes. +- Unity Editor: open `Assets/Launcher.unity` and press Play + Runs the local game flow end-to-end. +- Unity Editor: `Window > General > Test Runner` + Run EditMode/PlayMode tests interactively. +- `Unity -batchmode -projectPath . -runTests -testPlatform editmode -quit -logFile Logs/editmode-tests.log` + Executes EditMode tests via CLI and writes logs for CI/local verification. + +## Coding Style & Naming Conventions +Use C# with 4-space indentation and K&R braces. Keep one main type per file, and match file name to type name. Use `PascalCase` for public types/members and `camelCase` for locals/parameters. For Inspector exposure, prefer `[SerializeField] private` fields instead of `public` fields. + +Always keep `.meta` files when adding or moving Unity assets to preserve GUID references. + +## Testing Guidelines +`com.unity.test-framework` is included (NUnit style). Place tests in `Assets/Tests/` or module-local `Tests/` folders. Name test files `*Tests.cs`. Use EditMode tests for pure logic and PlayMode tests for runtime/scene behavior. Update or add tests for gameplay logic and UI controller/use-case changes. + +## Commit & Pull Request Guidelines +Recent history favors concise, descriptive commit messages (often Chinese), e.g. `Feature: add launcher scene and update project settings`. Keep commits focused and include module context (`UI`, `Procedure`, `Entity`) when useful. + +PRs should include: change summary, affected scenes/modules, test evidence (Test Runner or CLI logs), linked issue/task, and screenshots or short video for UI/visual updates. diff --git a/openspec/config.yaml b/openspec/config.yaml new file mode 100644 index 0000000..392946c --- /dev/null +++ b/openspec/config.yaml @@ -0,0 +1,20 @@ +schema: spec-driven + +# Project context (optional) +# This is shown to AI when creating artifacts. +# Add your tech stack, conventions, style guides, domain knowledge, etc. +# Example: +# context: | +# Tech stack: TypeScript, React, Node.js +# We use conventional commits +# Domain: e-commerce platform + +# Per-artifact rules (optional) +# Add custom rules for specific artifacts. +# Example: +# rules: +# proposal: +# - Keep proposals under 500 words +# - Always include a "Non-goals" section +# tasks: +# - Break tasks into chunks of max 2 hours