diff --git a/.cursor/rules/git-workflow.md b/.cursor/rules/git-workflow.md index 1d29d9c..443b550 100644 --- a/.cursor/rules/git-workflow.md +++ b/.cursor/rules/git-workflow.md @@ -9,6 +9,6 @@ alwaysApply: true - **Documentation-only work** — Commit directly on **`main`**. This means Markdown (`.md`) under `docs/`, root and nested `README.md` files, `neon_sprawl_vision.plan.md`, and other prose docs. No feature branch required. -- **Code or implementation changes** — Use a **branch** (e.g. `feature/…`, `fix/…`), then merge to `main` when ready. This includes application source (**C#**, **GDScript**), Godot scenes and project files, `docker-compose.yml`, `.csproj` / build config, CI workflows, **JSON/YAML game data** under `content/`, and JSON Schema when it ships with data pipelines—not standalone doc prose. +- **Code or implementation changes** — Use a **branch**, then merge to `main` when ready. **Branch names must start with the Jira key** (e.g. `NS-14-click-to-move`); **commit subjects must start with the same key** (e.g. `NS-14: …`). See [jira-git-naming](jira-git-naming.md). This includes application source (**C#**, **GDScript**), Godot scenes and project files, `docker-compose.yml`, `.csproj` / build config, CI workflows, **JSON/YAML game data** under `content/`, and JSON Schema when it ships with data pipelines—not standalone doc prose. When a change mixes documentation and code, treat it as a **code change** (use a branch). diff --git a/.cursor/rules/jira-git-naming.md b/.cursor/rules/jira-git-naming.md new file mode 100644 index 0000000..4a7669f --- /dev/null +++ b/.cursor/rules/jira-git-naming.md @@ -0,0 +1,31 @@ +--- +description: Branch names and commit messages must lead with the Jira issue key +alwaysApply: true +--- + +# Jira keys in branches and commits (Neon Sprawl) + +Project key in Jira is **`NS`** unless a different key is used for the issue (match the issue you are implementing). + +## Branch names + +- Put the **Jira key first**, then a short **kebab-case** slug (and optional type). The key must be the **first path segment** of the branch name. +- **Good:** `NS-14-click-to-move`, `NS-20-fix-health-desync`, `NS-14/feature/terrain-spike` (key still first segment if using slashes). +- **Avoid:** `feature/click-to-move` with no key, or `fix/ns-14-foo` with the key not at the start. + +When suggesting or creating a branch for story **NS-14**, use something like **`NS-14-`**, not `feature/ns-14-…` with the key buried after a prefix. + +## Commit messages + +- **First token** of the subject line must be the **Jira key and number**, then **`:`** and the summary. +- **Good:** `NS-14: add direct click-to-move steering`, `NS-20: fix duplicate spawn on reconnect` +- **Avoid:** `fix(client): …` or `feat: …` **without** the Jira key at the front. If you use Conventional Commits, place them **after** the key: `NS-14: feat(client): click-to-move prototype` + +**Multi-issue commits:** Prefer one issue per commit; if unavoidable, list keys: `NS-14, NS-18: shared nav refactor`. + +**No Jira issue (rare):** Maintenance or repo-only changes with no ticket — use **`chore:`** as the prefix (e.g. `chore: update .gitignore`). Do not invent fake keys. + +## Agent behavior + +- When creating a **branch** or **commit** for tracked work, **infer the key** from the current story (e.g. user says NS-14), the branch already in use, or the Jira issue fetched via MCP. +- Follow [git workflow](git-workflow.md) (branch vs `main`) and [commit-and-review](commit-and-review.md) (no commit until the user asks).