Code Style
SkillDocs & knowledgeEnforces the Topcoat repository's Rust coding and documentation style rules when your agent writes or edits code.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Code Style skill
About this capability
Always use this skill before writing or editing Rust code or documentation in the Topcoat repository
What this skill tells your AI
The instructions your AI receives, as published by tokio-rs/topcoat in .agents/skills/style/SKILL.md and read by ahel’s review.
General
- Keep related code together: a struct is immediately followed by its inherent
impland then its trait impls, before the next struct in the file. Unit tests (#[cfg(test)] mod tests) go at the very bottom of the file. - Free functions are allowed, but first consider whether a more idiomatic Rust grouping onto a struct exists.
- Unsafe code is not allowed in this project, unless wrapped by a reputable dependency.
- Avoid needless allocations, it is reasonable to refactor the code a bit to make it faster.
- After adding a new feature, check if it makes sense to rewrite unit tests for the entire module instead of adding a few. When rewriting, make sure to keep all tested edge cases intact.
Barrel files
Name a module's file after the module and place it alongside its directory (foo.rs next to foo/), never foo/mod.rs. A barrel file declares all submodules and re-exports each with a glob; only third-party items are re-exported by name.
mod content;
mod error;
mod request;
pub use content::*;
pub use error::*;
pub use request::*;
pub use http::Method;
When a module's submodules are peers that make up a whole (the CLI commands fmt, dev, asset; the macros expr, procedure, shard), put anything shared between them in a common submodule so it does not read as another peer.
Dependencies
- Declare every dependency in the top-level
Cargo.tomlunder[workspace.dependencies]with only a version and no features. Crates pull it in withworkspace = trueand opt into features there.
Documentation
- Item docs describe what something is/does and how to use it. Avoid implementation details unless relevant to a caller.
- Describe the current state only; never reference previous iterations ("this used to be A but is now B").
- Avoid exhaustively listig specific implementations or uses that could evolve over time and go stale. Keep documentation robust to changes.
- Avoid mentioning unrelated items, like "this is used by X to do Y". Focus on describing only the item itself.
- Use only ASCII characters in both code and documentation, e.g.
->instead of unicode arrow or...instead of ellipsis character. - Avoid em-dashes entirely. Use colons and semicolons sparingly.
- Avoid using
ignorefor code snippets to keep them type-checked. - Use simple, concise language, no fancy words.
Signals
- GitHub stars
- 5k
- Forks
- 175
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Gateway key
style-tokio-rs- Source
- github.com/tokio-rs/topcoat