mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 21:07:43 +00:00
a236b0d01d
Co-authored-by: weisd <im@weisd.in> Co-authored-by: houseme <housemecn@gmail.com>
76 lines
2.7 KiB
Markdown
76 lines
2.7 KiB
Markdown
# RustFS Agent Instructions (Global)
|
|
|
|
This root file keeps repository-wide rules only.
|
|
Use the nearest subdirectory `AGENTS.md` for path-specific guidance.
|
|
|
|
## Rule Precedence
|
|
|
|
1. System/developer instructions.
|
|
2. This file (global defaults).
|
|
3. The nearest `AGENTS.md` in the current path (more specific scope wins).
|
|
|
|
If repo-level instructions conflict, follow the nearest file and keep behavior aligned with CI.
|
|
|
|
## Communication and Language
|
|
|
|
- Respond in the same language used by the requester.
|
|
- Keep source code, comments, commit messages, and PR title/body in English.
|
|
|
|
## Change Style for Existing Logic
|
|
|
|
- Prefer direct, local code over extracting one-off helpers.
|
|
- Extract a helper only when logic is reused or the extraction materially clarifies a non-trivial flow.
|
|
- Preserve the existing control-flow and logic shape when fixing bugs or addressing review comments, especially in init, distributed coordination, locking, metadata, and concurrency paths.
|
|
- Do not refactor existing code only to make it easier to unit test.
|
|
- Keep fixes narrowly aligned with the requested behavior; avoid semantic-adjacent rewrites while touching sensitive paths.
|
|
|
|
## Sources of Truth
|
|
|
|
- Workspace layout and crate membership: `Cargo.toml` (`[workspace].members`)
|
|
- Local quality commands: `Makefile` and `.config/make/`
|
|
- CI quality gates: `.github/workflows/ci.yml`
|
|
- PR template: `.github/pull_request_template.md`
|
|
|
|
Avoid duplicating long crate lists or command matrices in instruction files.
|
|
Reference the source files above instead.
|
|
|
|
## Mandatory Before Commit
|
|
|
|
Run and pass:
|
|
|
|
```bash
|
|
make pre-commit
|
|
```
|
|
|
|
If `make` is unavailable, run the equivalent checks defined under `.config/make/`.
|
|
Do not commit when required checks fail.
|
|
|
|
## Git and PR Baseline
|
|
|
|
- Use feature branches based on the latest `main`.
|
|
- Follow Conventional Commits, with subject length <= 72 characters.
|
|
- Keep PR title and description in English.
|
|
- Use `.github/pull_request_template.md` and keep all section headings.
|
|
- Use `N/A` for non-applicable template sections.
|
|
- Include verification commands in the PR description.
|
|
- When using `gh pr create`/`gh pr edit`, use `--body-file` instead of inline `--body` for multiline markdown.
|
|
|
|
## Security Baseline
|
|
|
|
- Never commit secrets, credentials, or key material.
|
|
- Use environment variables or vault tooling for sensitive configuration.
|
|
- For localhost-sensitive tests, verify proxy settings to avoid traffic leakage.
|
|
|
|
## Scoped Guidance in This Repository
|
|
|
|
- `.github/AGENTS.md`
|
|
- `crates/AGENTS.md`
|
|
- `crates/config/AGENTS.md`
|
|
- `crates/ecstore/AGENTS.md`
|
|
- `crates/e2e_test/AGENTS.md`
|
|
- `crates/iam/AGENTS.md`
|
|
- `crates/kms/AGENTS.md`
|
|
- `crates/policy/AGENTS.md`
|
|
- `rustfs/src/admin/AGENTS.md`
|
|
- `rustfs/src/storage/AGENTS.md`
|