|
| 1 | +# RustFS Operator Agent Instructions (Global) |
| 2 | + |
| 3 | +This root file keeps repository-wide rules only. |
| 4 | +Use the nearest subdirectory `AGENTS.md` for path-specific guidance. |
| 5 | + |
| 6 | +## Rule Precedence |
| 7 | + |
| 8 | +1. System/developer instructions. |
| 9 | +2. This file (global defaults). |
| 10 | +3. The nearest `AGENTS.md` in the current path (more specific scope wins). |
| 11 | + |
| 12 | +If repo-level instructions conflict, follow the nearest file and keep behavior aligned with CI. |
| 13 | + |
| 14 | +## Communication and Language |
| 15 | + |
| 16 | +- Respond in the same language used by the requester. |
| 17 | +- Keep source code, comments, commit messages, and PR title/body in English. |
| 18 | + |
| 19 | +## Sources of Truth |
| 20 | + |
| 21 | +- Workspace layout: `Cargo.toml` |
| 22 | +- Project overview and architecture: `CLAUDE.md` |
| 23 | +- Local quality commands: `Makefile` |
| 24 | +- CI quality gates: `.github/workflows/ci.yml` |
| 25 | +- PR template: `.github/pull_request_template.md` |
| 26 | + |
| 27 | +Avoid duplicating long command matrices in instruction files. |
| 28 | +Reference the source files above instead. |
| 29 | + |
| 30 | +## Mandatory Before Commit |
| 31 | + |
| 32 | +Run and pass: |
| 33 | + |
| 34 | +```bash |
| 35 | +make pre-commit |
| 36 | +``` |
| 37 | + |
| 38 | +This runs: `fmt-check` → `clippy` → `test` → `console-lint` → `console-fmt-check`. |
| 39 | + |
| 40 | +Do not commit when required checks fail. |
| 41 | + |
| 42 | +## Git and PR Baseline |
| 43 | + |
| 44 | +- Use feature branches based on the latest `main`. |
| 45 | +- Follow Conventional Commits, with subject length <= 72 characters. |
| 46 | +- Keep PR title and description in English. |
| 47 | +- Use `.github/pull_request_template.md` and keep all section headings. |
| 48 | +- Use `N/A` for non-applicable template sections. |
| 49 | +- Include verification commands in the PR description. |
| 50 | +- When using `gh pr create`/`gh pr edit`, use `--body-file` instead of inline `--body` for multiline markdown: |
| 51 | + ```bash |
| 52 | + cat > /tmp/pr_body.md <<'EOF' |
| 53 | + ...markdown... |
| 54 | + EOF |
| 55 | + gh pr create ... --body-file /tmp/pr_body.md |
| 56 | + ``` |
| 57 | +
|
| 58 | +## Security Baseline |
| 59 | +
|
| 60 | +- Never commit secrets, credentials, or key material. |
| 61 | +- Use environment variables or vault tooling for sensitive configuration. |
| 62 | +- Credential Secrets must contain `accesskey` and `secretkey` keys (both valid UTF-8, minimum 8 characters). |
| 63 | +
|
| 64 | +## Architecture Constraints |
| 65 | +
|
| 66 | +- All pools within a single Tenant form ONE unified RustFS cluster. |
| 67 | +- Do not assume pool-based storage tiering. For separate clusters, use separate Tenants. |
| 68 | +- Error handling uses `snafu`. New files must include Apache 2.0 license headers. |
| 69 | +- Do not invent RustFS ports/constants; verify against `CLAUDE.md` and official sources. |
0 commit comments