AI

Link: https://uproger.com/ya-zastavil-llm-pisat-rust-polgoda-vot-chto-oni-stabilno-lomayut/

Всегда применять SDD при планировании приложения (OpenSpec или SpecKit).

Prompt для AI-coding с Rust async

Add these Rust engineering constraints to the spec:

  • Use RED/GREEN TDD. First write the tests;
  • Pin all the dependencies crates (tokio, reqwest, serde and others) in spec to specific versions;
  • For every async function planned explicitly show cancel safety: add function comment if it is cancel-safe, not cance-safe and why;
  • If any unsafe blocks will be made, each must have safety invariants in block comment: // SAFETY:;
  • For any code with complex lifetimes, put a comment showing an example of a caller function for this block;
  • Check code with clippy::pedantic and clippty:nursery options turned on.