mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-12-02 00:37:18 +00:00
## Summary
Adds the `rust-style-guide` Agent Skill under
`.fabro/skills/rust-style-guide/` so Fabro workflow agent stages can
apply the project's Rust conventions when writing or reviewing Rust
code.
Skills are discovered by convention from
`{git_root}/.fabro/skills/*/SKILL.md` at agent-session startup — there's
no manifest wiring or per-workflow declaration. Once present, every
agent stage lists the skill in its system prompt and registers the
`use_skill` tool, so an agent can load it (or a node prompt can
reference `/rust-style-guide`). Committing it here (rather than relying
on a local `~/.fabro/skills` copy) is what makes it available to
**remote, clone-based runs** (Docker/Daytona), which only see committed
+ pushed files.
## Contents (44 files)
- `SKILL.md` — entry point (with a short note pointing the agent at the
in-repo location of the supporting files, since Fabro hands the agent
the `SKILL.md` body and it reads the rest itself)
- `guidelines.md` + `guidelines/` — 38 Rust style policy pages
- `workflows/` — 4 procedure pages (new project, library release,
performance investigation, code review/refactor)
## Source / attribution
Vendored from https://github.com/brynary/rust-style-guide (commit
`8fd2a4f`), trimmed to the runtime skill payload; the upstream repo's
mdBook site and authoring scaffolding are omitted. Note: the upstream
repo has **no LICENSE file** — flagging for a call on
attribution/licensing before merge.
## Notes
- No behavior/code change — this is skill content only; nothing is
compiled or bundled.
- No `{{user_input}}` placeholder was added; agents reference the skill
in prose or via `use_skill`. (If we later want deterministic
`/rust-style-guide <task>` slash expansion in node prompts, add the
placeholder to `SKILL.md` then.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3.5 KiB
3.5 KiB
Code Review and Refactor
Use this workflow when reviewing, refactoring, or changing existing Rust code in a project that already has structure and conventions.
Required Guidelines
Load guidelines.md, then load these guideline pages as needed:
- Library vs application conventions
- Public API evolution
- rustc and Clippy lints
- Property tests, snapshots, benchmarks, and CI
- Panics, unwrap, expect, and assertions
- Error propagation, context, and messages
- Ownership, borrowing, and clone policy
- Concurrency primitives
- Logging and observability
- Unsafe code and macros
Load narrower pages for the code you touch, such as newtypes, traits, async task lifecycle, validation, collections, or documentation.
Workflow
- Classify the code first: published library API, shared in-repo library, application/service, CLI, test support, or tests.
- Identify the behavioral surface being changed and the callers affected. Treat externally consumed APIs as stricter than internal application code.
- Load only the guideline pages relevant to that surface.
- Scan high-risk patterns before editing: accidental public API changes, hidden panics, flattened errors, unnecessary clones or lifetimes, locks across
.await, blocking work on async paths, unredacted logs, unsafe, and macro-generated behavior. - Make the smallest coherent change. Preserve existing local style unless it conflicts with this guide or the requested behavior.
- Add or update tests at the level where the behavior is observable.
- Run verification appropriate to the change: formatter, Clippy, tests, MSRV/all-features checks, or a narrower command when the project makes the full suite impractical.
- Report what changed, what was verified, and any exceptions or skipped checks with the reason.
Review Checklist
- Scope: Did the change affect library, application, CLI, or test-only behavior?
- API: Did
pub, re-exports, features, MSRV, or public dependencies change? - Errors: Are recoverable failures returned with source chains and boundary context?
- Panics: Are
unwrap,expect,panic!, and assertions limited to invariants? - Ownership: Are clones, borrows, and owned snapshots named honestly?
- Async/concurrency: Are task ownership, cancellation, blocking work, and lock scopes explicit?
- Observability: Are logs structured, low-noise, and free of secrets?
- Unsafe/macros: Is any unsafe or macro complexity justified, isolated, and documented?
- Tests: Does coverage protect behavior rather than private implementation churn?
- Verification: Were the commands run fresh, and are skipped checks explained?
Avoid
- Do not load every guideline page by default.
- Do not refactor unrelated code while reviewing a focused change.
- Do not apply library-level ceremony to private application internals without a reason.
- Do not relax lint, test, or safety policy to make a local change easier.
- Do not report a change as verified without naming the commands that ran.
- Do not hide exceptions; document why the local case differs from the default rule.