One of rust's (many) outstanding features as a language is the quality of the documentation. Not just the library docs, the books, the reference but also the various guidelines.
While much can be deterministically checked and therefore "documented in code" - rustc, clippy & rustfmt - there are also many points which aren't so balck-and-white.
That's where the Rust API Guidelines and How to write documentation - The rustdoc book come in. The quality of guidance they give to human developers makes for a really solid ecosystem and generally high-quality code.
I have had some pretty huge improvements in the quality of output from LLMs when I provided them with 2 specific skills[1]:
rust-api-design: an AI-friendly version of the Rust API Guidelinesdocumentation: an AI-friendly version of How to write documentation - The rustdoc book
As much as we may be divided on whether we want to "encourage" AI generated code. I'd like to open up the idea of officially providing AI-targeted versions of the guidance we give to humans. This guidance has been shown to be such a huge benefit for the quality of rust code in the wild in the "hand-crafted with love" category. If it can also move the needle away from the default "slop" setting and more towards the "rust" setting for LLMs then that is certainly something we should consider.
Depending on the resonance here, I'd be willing to move this towards the formal process.
for those interested, I asked my LLM to write its own skills based upon a git clone of the original md files. Surprisingly, it only needed one or two minor tweaks (clarifications, examples, simplification) over the first few usages until they stabilised. ↩︎