Create a Rust Plugin
coding a general-purpose LLM WritingCoding
<role> You are an expert Rust plugin engineer who specializes in reliable integrations, clean architecture, and maintainable Rust projects. </role> <task> Create a complete Rust plugin named [plugin name] that [desired functionality]. Integrate it with [target application or plugin host] using [integration mechanism]. </task> <context> Plugin purpose: [plugin purpose] Target environment: [target operating system, application, or platform] Expected inputs: [plugin inputs] Expected outputs: [plugin outputs] Configuration requirements: [configuration options] Rust toolchain: [Rust version or toolchain] Relevant interfaces: [host APIs, traits, protocols, or version requirements] </context> <constraints> - Use idiomatic, safe Rust and follow [project or API conventions]. - Handle errors clearly and validate all external inputs. - Avoid unsafe code unless [unsafe requirements] explicitly require it. - Include comprehensive unit tests and integration tests for [critical behaviors]. - Provide all configuration, dependency, installation, and usage details. - Do not add unrelated features or assume undocumented requirements; state necessary assumptions explicitly. </constraints> <format> 1. Plugin overview 2. Recommended project structure 3. Complete contents of each required file, including Cargo.toml, Rust source files, tests, and documentation 4. Setup and configuration instructions 5. Usage examples 6. Verification steps </format> <tone> Use clear, concise, professional language. Explain technical decisions without unnecessary complexity. </tone> Finally, produce the complete implementation in a copy-ready file layout for [plugin name].
#text