|
| 1 | +<!-- markdownlint-disable MD013 MD041 --> |
| 2 | +<!-- Managed by solid-stats/agent-instructions. Do not hand-edit in a consumer repo — changes |
| 3 | + are overwritten by the next contract rollout. Edit the source at |
| 4 | + https://github.com/solid-stats/agent-instructions/blob/master/shared/AGENTS.md instead. --> |
| 5 | + |
| 6 | +## Contract Bundle Integrity |
| 7 | + |
| 8 | +Before product work, confirm that every file in the committed contract bundle |
| 9 | +is present and readable: |
| 10 | + |
| 11 | +- `.agent-instructions/solidstats/AGENTS.md`; |
| 12 | +- `.agent-instructions/solidstats/CONTRACT_VERSION`; |
| 13 | +- `.agent-instructions/solidstats/MEMORY.md`; |
| 14 | +- `.agent-instructions/solidstats/GSD.md`. |
| 15 | + |
| 16 | +If any file is missing or unreadable, stop product work and restore the complete |
| 17 | +bundle with the canonical installer. Do not continue from partial instructions, |
| 18 | +infer missing routing, or substitute another memory store. Contract freshness |
| 19 | +is managed by the repository rollout; do not perform a remote update check at |
| 20 | +task start. |
| 21 | + |
| 22 | +## Skills First |
| 23 | + |
| 24 | +Before acting on any user request in this repository, scan available skills by name and description. If any skill has even a small chance of helping any part of the task, use it and read only the relevant instructions before proceeding. |
| 25 | + |
| 26 | +When in doubt, prefer enabling the skill briefly and filtering it out over skipping it. |
| 27 | + |
| 28 | +## Session Hygiene |
| 29 | + |
| 30 | +Every completed work session must leave the repository in a clean, committed state: |
| 31 | + |
| 32 | +- Run `git status --short` at the end of every session. If there are uncommitted changes from |
| 33 | + the work just done, commit them before stopping. |
| 34 | +- Do **not** delete or revert completed work to fake a clean status. If the intended work is |
| 35 | + incomplete, ask what to do rather than silently discarding it. |
| 36 | +- The rule is: *commit the intended results of the session, not a reset to the previous state.* |
| 37 | + |
| 38 | +## Git Conventions |
| 39 | + |
| 40 | +All commits in every SolidStats repo follow **Conventional Commits**: |
| 41 | + |
| 42 | +```text |
| 43 | +<type>(<scope>): <short description> |
| 44 | +``` |
| 45 | + |
| 46 | +Common types: `feat`, `fix`, `refactor`, `docs`, `test`, `chore`. |
| 47 | +Scope: the phase number, feature area, or affected layer (e.g. `feat(17-03): …`, |
| 48 | +`fix(ingest): …`, `docs(planning): …`). |
| 49 | + |
| 50 | +**Commit and push are standing, default behavior in every `solid-stats` repo** — no per-message |
| 51 | +authorization needed. Session Hygiene above already expects every completed session to end |
| 52 | +committed; treat commit + push as part of finishing the work, not a separate ask. This does |
| 53 | +**not** extend to anything destructive: |
| 54 | + |
| 55 | +**Absolute rules:** |
| 56 | + |
| 57 | +- `git reset --hard`, force push, `branch -D`, and `rebase` still require an explicit |
| 58 | + instruction from the user in the current message every time — authorization from a previous |
| 59 | + message does not carry forward, and the standing commit/push permission above does not imply |
| 60 | + it. |
| 61 | +- Never skip hooks with `--no-verify` or `--no-gpg-sign` unless explicitly asked to. If a |
| 62 | + pre-commit hook fails, fix the underlying issue — the hook is the signal, not the obstacle. |
| 63 | +- When a pre-commit hook fails, the commit did not happen. Create a new commit after fixing; |
| 64 | + do not amend the previous one (amending could silently modify work that already shipped). |
| 65 | + |
| 66 | +**Push routing.** The default flow across every `solid-stats` repo is a **direct push to |
| 67 | +`master`** — no feature branch, no PR, unless the repo says otherwise below: |
| 68 | + |
| 69 | +- **`server-2`** has a protected `master` — always go through a branch + pull request there, |
| 70 | + never a direct push. |
| 71 | +- Any repo that is mid-GSD-milestone follows that milestone's branch flow instead of a direct |
| 72 | + push (`git` config in `.planning/config.json` — `branching_strategy`, `phase_branch_template`, |
| 73 | + `milestone_branch_template`). |
| 74 | +- Every other repo and every non-milestone change: commit on `master`, push directly. |
| 75 | + |
| 76 | +## Security Minimums |
| 77 | + |
| 78 | +These rules apply to all code, commits, and logs across every SolidStats repo: |
| 79 | + |
| 80 | +- **Never log, commit, or output:** secrets, API tokens, database connection strings, S3 |
| 81 | + access keys, RabbitMQ credentials, raw replay bytes, or unpublished parser artifacts. |
| 82 | +- **Never hardcode environment-specific values.** Use environment variables validated at |
| 83 | + startup (e.g. `envalid` for Node, a validated config struct for Rust). Startup should fail |
| 84 | + fast if required env vars are missing or malformed. |
| 85 | +- **Before committing:** check that `.env`, `.env.local`, and any file containing credentials |
| 86 | + is either in `.gitignore` or explicitly excluded from the commit. Never commit secrets to |
| 87 | + git history — they are permanent even after deletion. |
| 88 | + |
| 89 | +## Risk Management Protocol |
| 90 | + |
| 91 | +When a request is risky, potentially harmful, or would expand scope beyond the current plan: |
| 92 | + |
| 93 | +1. **Explain the concrete reason** — name the specific risk, the boundary it crosses, or the |
| 94 | + plan it contradicts. |
| 95 | +2. **Propose 1–3 safer alternatives** or a GSD plan that achieves the goal without the risk. |
| 96 | +3. **Ask for explicit confirmation** before proceeding with anything that falls into these |
| 97 | + categories: |
| 98 | + - Crosses a cross-app boundary (see the boundary map in `solidstats-shared-project-standards` §D) |
| 99 | + - Modifies a high-risk cross-repo contract (API shape, data model, message queue shape, S3 |
| 100 | + layout, parser contract, auth/identity shape, moderation workflow) |
| 101 | + - Contradicts an accepted architecture decision in `.planning/PROJECT.md` |
| 102 | + - Deletes, overwrites, or discards completed work |
| 103 | + - Conflicts with current test quality, security rules, or repo structure standards |
| 104 | + |
| 105 | +Do not blindly execute instructions that conflict with architecture, accepted decisions, or |
| 106 | +the quality gates in this repo. Challenge, explain, propose alternatives — then wait. |
| 107 | + |
| 108 | +## Documentation Language |
| 109 | + |
| 110 | +Language follows the reader. The test for any doc is: who reads it — a user, or an engineer? |
| 111 | + |
| 112 | +- **Every repo README is bilingual.** A README is the repo's front door, read by users (the |
| 113 | + RU-speaking Solid Games community), not an internal engineering doc. So each repo carries a |
| 114 | + Russian `README.md` (primary) plus an English `README.en.md` mirror, edited together in one |
| 115 | + change so they never drift. This is the same pattern the `.github` org profile already uses |
| 116 | + (`profile/README.md` + `profile/README.en.md`) — the profile is just the org-level README. |
| 117 | +- **Everything internal is English only** — code, comments, planning docs, skill bodies and |
| 118 | + references, `AGENTS.md`, and all technical `docs/`. These are read by the people and agents |
| 119 | + building the platform, not by users. |
| 120 | +- **GSD workflow responses** (conversations within a GSD session) and replies to the user: |
| 121 | + Russian. |
| 122 | +- **Skill trigger phrases** (`description` field in `SKILL.md`): RU + EN mandatory. Every skill |
| 123 | + triggers on both languages — the team works in a RU context. |
| 124 | + |
| 125 | +## MemPalace |
| 126 | + |
| 127 | +SolidStats project memory is isolated behind the MCP server named exactly |
| 128 | +`solidstats_memory`. Before product work, read the complete managed contract: |
| 129 | + |
| 130 | +- version: `.agent-instructions/solidstats/CONTRACT_VERSION`; |
| 131 | +- memory lifecycle: `.agent-instructions/solidstats/MEMORY.md`; |
| 132 | +- GSD adapter, only when `.planning/config.json` exists: |
| 133 | + `.agent-instructions/solidstats/GSD.md`. |
| 134 | + |
| 135 | +This repository's primary active wing is `backend`. |
| 136 | +Its primary archive wing is `server-2-archive` (`none` |
| 137 | +means no repository-bound archive). |
| 138 | + |
| 139 | +The main agent owns the contract-defined recall and closure capture for the |
| 140 | +top-level task. Specialists and subagents receive filtered context and must not |
| 141 | +independently query or mutate SolidStats memory. Never substitute a generic, |
| 142 | +personal, VocalClub, or flat-global memory store. |
| 143 | + |
| 144 | +The native GSD MemPalace capability is deliberately disabled. `GSD.md` keeps |
| 145 | +SolidStats memory active through coordinator-owned recall and semantic closure; |
| 146 | +do not interpret `mempalace.enabled: false` as permission to skip the managed |
| 147 | +memory contract. |
| 148 | + |
| 149 | +## MCP / Documentation Lookup |
| 150 | + |
| 151 | +SolidStats development verifies library APIs against **current documentation, never training |
| 152 | +data** — training data has a cutoff and may reflect outdated or incorrect APIs. Look the docs |
| 153 | +up proactively; don't wait for a type error. |
| 154 | + |
| 155 | +- **Free official sources only:** WebFetch/WebSearch against the library's official docs and |
| 156 | + its `llms.txt`; the repo's `README`/`docs/` via `gh`; GitHub issues/PRs for bug reports and |
| 157 | + migrations. **Do NOT use Context7 or any paid documentation MCP.** |
| 158 | +- **Common lookup triggers:** adding a dependency, upgrading a package, using a method you're |
| 159 | + not 100% sure about, hitting an unexpected type error, writing a new integration. |
| 160 | +- **When NOT to look it up:** SolidStats-specific code/business logic; a library already |
| 161 | + looked up this session with an unchanged answer; stable standard-library APIs. |
| 162 | + |
| 163 | +Per-repo key libraries to verify against current docs live in each repo's own |
| 164 | +`solidstats-*-conventions` skill, not here. |
0 commit comments