Восстановлены потерянные правила при рефакторинге AGENTS.md
This commit is contained in:
261
AGENTS.md
261
AGENTS.md
@@ -1,91 +1,204 @@
|
|||||||
# AGENTS.md
|
# AGENTS.md
|
||||||
|
|
||||||
## General Rules (MUST)
|
## Execution Model (MUST)
|
||||||
|
- Read this file first; treat as system-level constraints.
|
||||||
|
- Priority:
|
||||||
|
1. User instructions
|
||||||
|
2. AGENTS.md
|
||||||
|
3. Existing code/style
|
||||||
|
4. Best practices
|
||||||
|
- Prefer minimal, non-breaking changes.
|
||||||
|
- Do not introduce unnecessary abstractions.
|
||||||
|
|
||||||
### Git Collaboration Policy (General)
|
---
|
||||||
- Commit/push only after explicit user approval.
|
|
||||||
- After approval: commit and push immediately.
|
|
||||||
- Branch switch prompt (`fix/*` or `feat/*`): ask at dialogue start; reuse the explicit user decision for all subsequent fix/feature tasks in the same dialogue.
|
|
||||||
- Pending clarification/approval question: ask once, in a single short message; do not repeat the same pending question in a separate final message.
|
|
||||||
- After finishing work in `fix/*` or `feat/*`: propose either
|
|
||||||
1. creating an MR into `main`, or
|
|
||||||
2. merging to `main` immediately and deleting the `fix/*`/`feat/*` branch.
|
|
||||||
- If push fails: retry up to 2 more times with 3s pause.
|
|
||||||
- Approval prompts for pending actions: short direct phrasing, no soft/opening phrases; response format is mandatory:
|
|
||||||
- binary action: yes/no question.
|
|
||||||
- multiple actions/combinations: numbered options only.
|
|
||||||
|
|
||||||
### Cleanup (General)
|
## Communication (MUST)
|
||||||
- Do not leave temporary/debug artifacts in repo.
|
- Answer first, then request approval if needed.
|
||||||
- Remove additional debug/temp dirs unless user asked to keep them.
|
- Concise, meaningful, no filler.
|
||||||
|
- Do not end response with only procedural choice.
|
||||||
|
|
||||||
### Rules Maintenance (General)
|
Approval/clarification:
|
||||||
- For changes to rules files (`AGENTS.md`, `ACTIONS.md`): prefer optimized, compressed edits for AI-agent execution (machine-readable, unambiguous).
|
- ask once, no repetition
|
||||||
- Keep rule updates minimal and non-duplicative: merge overlapping points, remove redundancy, preserve intent.
|
- binary → yes/no
|
||||||
|
- multiple → numbered options + brief context
|
||||||
|
|
||||||
### Communication (General)
|
- File links: relative paths, `/`, spaces as `%20`.
|
||||||
- Project file links in user-facing Markdown: relative paths, `/` separators, spaces encoded as `%20`.
|
|
||||||
|
|
||||||
## Project-Specific Rules (MUST)
|
---
|
||||||
|
|
||||||
### Scope
|
## Git Workflow (MUST)
|
||||||
- Repository purpose: standalone Russian localization mod only.
|
- Never commit/push without explicit user approval.
|
||||||
- Allowed domain: localization content + packaging/release metadata.
|
- After approval → commit + push immediately.
|
||||||
- Forbidden: gameplay logic, Script Extender content, unrelated assets.
|
- Commit messages: Russian, factual (what was done).
|
||||||
- Keep repository source-only.
|
|
||||||
- Never commit `.pak` or temporary build artifacts.
|
|
||||||
|
|
||||||
### Canonical Paths
|
After work in `fix/*` or `feat/*`:
|
||||||
- Mod sources: `Mods/DnD 5.5e AIO Russian`
|
1. MR → main
|
||||||
- Russian localization: `Mods/DnD 5.5e AIO Russian/Localization/Russian/russian.xml`
|
2. merge → main + delete branch
|
||||||
- Mod metadata: `Mods/DnD 5.5e AIO Russian/meta.lsx`
|
|
||||||
- Build script (single source of build truth): `scripts/build.ps1`
|
|
||||||
- CI workflow: `.gitea/workflows/build.yml`
|
|
||||||
- Glossary (primary terminology reference): `glossary/glossary.normalized.json`
|
|
||||||
- Action catalog and command playbooks: `ACTIONS.md`
|
|
||||||
- Upstream English reference: `https://github.com/Yoonmoonsik/dnd55e/blob/main/Mods/DnD2024_897914ef-5c96-053c-44af-0be823f895fe/Localization/English/english.xml`
|
|
||||||
|
|
||||||
### Packaging Invariants
|
Push failure:
|
||||||
- `.pak` must contain only BG3 mod structure under `Mods/...`.
|
- retry ≤2 times, 3s delay
|
||||||
- Required content in `.pak`:
|
|
||||||
- `Mods/DnD 5.5e AIO Russian/meta.lsx`
|
|
||||||
- `Mods/DnD 5.5e AIO Russian/Localization/Russian/russian.xml`
|
|
||||||
- Must not leak into `.pak`: `.git`, `.gitea`, `scripts`, `tools`, `.tools`, `build`, staging dirs.
|
|
||||||
- Staging for packaging must be in `%TEMP%`, not in dot-prefixed repo dirs.
|
|
||||||
|
|
||||||
### Build/CI Contract
|
---
|
||||||
- CI workflow stays thin:
|
|
||||||
1. prepare workspace
|
## Scope (MUST)
|
||||||
|
- Repo = Russian localization mod only.
|
||||||
|
|
||||||
|
Allowed:
|
||||||
|
- localization content
|
||||||
|
- packaging/release metadata
|
||||||
|
|
||||||
|
Forbidden:
|
||||||
|
- gameplay logic
|
||||||
|
- Script Extender
|
||||||
|
- unrelated assets
|
||||||
|
|
||||||
|
- Repo must remain source-only.
|
||||||
|
- Never commit `.pak` or build artifacts.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Paths (MUST)
|
||||||
|
- Mod: `Mods/DnD 5.5e AIO Russian`
|
||||||
|
- Localization: `Mods/DnD 5.5e AIO Russian/Localization/Russian/russian.xml`
|
||||||
|
- Metadata: `Mods/DnD 5.5e AIO Russian/meta.lsx`
|
||||||
|
- Build: `scripts/build.ps1`
|
||||||
|
- CI: `.gitea/workflows/build.yml`
|
||||||
|
- Glossary: `glossary/glossary.normalized.json`
|
||||||
|
- Actions: `ACTIONS.md`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Packaging (MUST)
|
||||||
|
- `.pak` contains ONLY `Mods/...`
|
||||||
|
|
||||||
|
Required:
|
||||||
|
- `meta.lsx`
|
||||||
|
- `russian.xml`
|
||||||
|
|
||||||
|
Forbidden in `.pak`:
|
||||||
|
- `.git`, `.gitea`
|
||||||
|
- `scripts`, `tools`, `.tools`
|
||||||
|
- `build`, staging dirs
|
||||||
|
|
||||||
|
Staging:
|
||||||
|
- use `%TEMP%`
|
||||||
|
- not inside repo
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Build & CI (MUST)
|
||||||
|
Flow:
|
||||||
|
1. prepare
|
||||||
2. download Divine
|
2. download Divine
|
||||||
3. call `scripts/build.ps1`
|
3. run `scripts/build.ps1`
|
||||||
4. publish tag archive
|
4. publish
|
||||||
- Expected build outputs:
|
|
||||||
- `build/DnD 5.5e AIO Russian.pak`
|
Outputs:
|
||||||
|
- `build/*.pak`
|
||||||
- `build/info.json`
|
- `build/info.json`
|
||||||
- `build/DnD 5.5e AIO Russian <tag>.zip` (for tag builds)
|
- `build/*.zip` (tag only)
|
||||||
- Release ZIP must include only `.pak` + `info.json`.
|
|
||||||
- CI triggers: tag `v*` and manual dispatch; not every push to `main`.
|
|
||||||
|
|
||||||
### Version/Release Rules
|
Release ZIP:
|
||||||
- Read release version only from `save/region[@id="Config"]/node[@id="root"]/children/node[@id="ModuleInfo"]/attribute[@id="Version64"]` via explicit XML parsing.
|
- only `.pak` + `info.json`
|
||||||
- `PublishVersion` must not be changed during release preparation.
|
|
||||||
- Release tag must match the source-of-truth version.
|
|
||||||
- Decision logic before tagging:
|
|
||||||
1. If `ModuleInfo/Version64` was manually changed (e.g. BG3 Toolkit), use matching tag and release.
|
|
||||||
2. If `ModuleInfo/Version64` equals latest released version, bump version first (e.g. `scripts/set-version.ps1 -VersionTag <tag>`), commit, then create/push tag.
|
|
||||||
- `scripts/build.ps1` derives release `Version64` from tag and writes it to generated `info.json` and staged `meta.lsx`.
|
|
||||||
|
|
||||||
### info.json Contract
|
Triggers:
|
||||||
- Top-level keys: `Mods`, `MD5`.
|
- tag `v*`
|
||||||
- Per-mod keys: `Author`, `Name`, `Folder`, `Version`, `Description`, `UUID`, `Created`, `Dependencies`, `Group`.
|
- manual only
|
||||||
- `Dependencies` is an array of UUIDs.
|
|
||||||
- Current dependency UUID: `897914ef-5c96-053c-44af-0be823f895fe`.
|
|
||||||
|
|
||||||
### Git Collaboration Policy (Project-Specific)
|
---
|
||||||
- Commit messages and comments: Russian.
|
|
||||||
- Commit message content: what was done (not what should be done).
|
|
||||||
- If changes affect `.pak` contents or build/release flow: propose releasing next version.
|
|
||||||
- For released versions in user-facing messages: provide direct archive link in Markdown format `[version](url)` when derivable (acceptable immediately after tag push, even before CI finishes).
|
|
||||||
|
|
||||||
### Cleanup (Project-Specific)
|
## Versioning (CRITICAL)
|
||||||
- Ignored/temp patterns include: `build/`, `build-stage*`, `.tools/`, `*.pak`.
|
Source of truth:
|
||||||
|
`ModuleInfo/Version64`
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- do not change `PublishVersion`
|
||||||
|
- tag MUST match version
|
||||||
|
|
||||||
|
Before tag:
|
||||||
|
1. if version already changed → use it
|
||||||
|
2. if same as last → bump:
|
||||||
|
`scripts/set-version.ps1 -VersionTag <tag>`
|
||||||
|
|
||||||
|
`build.ps1`:
|
||||||
|
- derives version from tag
|
||||||
|
- writes to `info.json` + staged `meta.lsx`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## info.json (MUST)
|
||||||
|
Root:
|
||||||
|
- `Mods`, `MD5`
|
||||||
|
|
||||||
|
Per mod:
|
||||||
|
- Author, Name, Folder, Version
|
||||||
|
- Description, UUID, Created
|
||||||
|
- Dependencies (array), Group
|
||||||
|
|
||||||
|
Dependency UUID:
|
||||||
|
`897914ef-5c96-053c-44af-0be823f895fe`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Guardrails (MUST)
|
||||||
|
|
||||||
|
Before commit:
|
||||||
|
- scope valid (localization/metadata only)
|
||||||
|
- no forbidden content
|
||||||
|
- no build artifacts (`.pak`, `build/`, staging)
|
||||||
|
- packaging invariants intact
|
||||||
|
- version consistent (if applicable)
|
||||||
|
|
||||||
|
Before push:
|
||||||
|
- explicit user approval
|
||||||
|
- commit message valid (RU, factual)
|
||||||
|
|
||||||
|
Before release:
|
||||||
|
- version == tag
|
||||||
|
- version bumped if needed
|
||||||
|
- CI/build contract valid
|
||||||
|
- outputs correct (no extra files)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Release & Changelog (MUST)
|
||||||
|
|
||||||
|
- Every release MUST include changelog.
|
||||||
|
|
||||||
|
Changelog:
|
||||||
|
- language: Russian
|
||||||
|
- concise, user-facing
|
||||||
|
- describe WHAT changed
|
||||||
|
- group logically
|
||||||
|
|
||||||
|
Sources:
|
||||||
|
- prefer diff over commits
|
||||||
|
|
||||||
|
Diff rules:
|
||||||
|
- inspect real file changes
|
||||||
|
|
||||||
|
Localization (`russian.xml`):
|
||||||
|
- added / changed / removed strings
|
||||||
|
- summarize user-visible impact (UI, spells, descriptions)
|
||||||
|
|
||||||
|
Metadata / CI:
|
||||||
|
- describe effect, not raw edits
|
||||||
|
|
||||||
|
Large diff:
|
||||||
|
- group + summarize
|
||||||
|
|
||||||
|
If no visible changes:
|
||||||
|
- state "техническое обновление"
|
||||||
|
|
||||||
|
Before release:
|
||||||
|
- generate changelog draft
|
||||||
|
- ask for approval
|
||||||
|
|
||||||
|
Release message:
|
||||||
|
- version
|
||||||
|
- changelog
|
||||||
|
- `[version](url)` if derivable
|
||||||
|
|
||||||
|
Do not:
|
||||||
|
- invent changes
|
||||||
|
- include internal noise
|
||||||
Reference in New Issue
Block a user