ワンクリックで
rust-quality
Write idiomatic Rust following this project's patterns and conventions
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Write idiomatic Rust following this project's patterns and conventions
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Diagnose a wallet clear-signing failure from a pasted diagnostic capture or capture JSON file. Use when asked to "debug clear signing", "diagnose calldata capture", "diagnose typed data capture", "reproduce a clear-signing failure", or similar for either calldata or EIP-712.
Fetch real blockchain transactions from Etherscan and validate them against an ERC-7730 descriptor using the Rust library. Reports pass/fail per function. Use when asked to "generate tests for this descriptor", "fetch real transactions for testing", "test descriptor with real data", or "/generate-tests <path-or-url>".
Fetch real blockchain transactions from Etherscan and validate them against an ERC-7730 descriptor using the Rust library. Use when asked to "generate tests for this descriptor", "fetch real transactions for testing", "test descriptor with real data", or "smoke test this descriptor against mainnet activity".
Fetch real blockchain transactions from Etherscan and validate them against an ERC-7730 descriptor using the Rust library. Use when asked to "generate tests for this descriptor", "fetch real transactions for testing", "test descriptor with real data", or "smoke test this descriptor against mainnet activity".
Write idiomatic Rust following this project's patterns and conventions
Validate that every function signature key in a ERC-7730 descriptor's display.formats matches an on-chain selector. Use when asked to "check this descriptor", "validate descriptor against on-chain", "are these function signatures correct", or "check for selector mismatches".
| name | rust-quality |
| description | Write idiomatic Rust following this project's patterns and conventions |
Write idiomatic Rust code that follows this project's established patterns. This
library (ERC-7730 v2 clear signing) is the standalone version of yttrium's
clear signing module, adapted for Rust 2021 edition with a single-crate
architecture. Async (tokio/reqwest) is used behind the github-registry
feature for HTTP descriptor resolution and UniFFI async exports.
.rs filesStandard use per item, not block use { } style. Group by:
use tiny_keccak::{Hasher, Keccak};
use crate::error::DecodeError;
thiserror with #[derive(Debug, Error)]#[error("...")] messages with context#[from] for automatic conversion from sub-errors.unwrap() in library code; use Result and ?.map_err(|e| ...)#[derive(Debug, Error)]
pub enum MyError {
#[error("invalid input: {0}")]
InvalidInput(String),
#[error("not found: key={key}, context={context}")]
NotFound { key: String, context: String },
#[error("decode error: {0}")]
Decode(#[from] DecodeError),
}
DescriptorSource and TokenSourceStaticSourceDefault for test sources via new() delegation&dyn Trait for trait object parameters; add Send + Sync only when async requires itpub trait MySource {
fn lookup(&self, key: &str) -> Option<MyResult>;
}
pub struct StaticMySource {
data: HashMap<String, MyResult>,
}
impl Default for StaticMySource {
fn default() -> Self { Self::new() }
}
#[derive(Debug, Clone)] on all public types#[derive(Debug, Clone, Serialize, Deserialize)] for JSON roundtrips#[serde(untagged)] for flexible enums like DisplayField and VisibleRule#[serde(rename_all = "camelCase")] for JSON field mappingBox in recursive enums where neededPass a mutable RenderContext<'a> through rendering pipelines to accumulate
warnings and carry shared state:
struct RenderContext<'a> {
descriptor: &'a Descriptor,
decoded: &'a DecodedArguments,
chain_id: u64,
token_source: &'a dyn TokenSource,
warnings: Vec<String>,
}
decoder.rs, engine.rs, resolver.rstypes/ with submoduleslib.rspub(crate) for internal helpers shared between modules#[cfg(test)] mod tests { ... } at the bottom of each moduleuse super::*; in test modules#[cfg(test)]
mod tests {
use super::*;
fn test_descriptor_json() -> &'static str {
r#"{ ... }"#
}
#[test]
fn test_my_feature() {
let descriptor = Descriptor::from_json(test_descriptor_json()).unwrap();
let result = my_function(&descriptor).unwrap();
assert_eq!(result.field, "expected");
}
}
cargo fmt
cargo clippy -- -D warnings
cargo test
Use stable defaults. Do not introduce rustfmt.toml overrides.
cargo fmt --check passescargo clippy -- -D warnings passescargo test passes.unwrap() in library codethiserrorDebug and Clonelib.rsDo not:
.unwrap() or .expect() in library codeeyre, anyhow, or Box<dyn Error> instead of structured errorsasync or tokio outside the github-registry feature gateuse { foo, bar }Send + Sync bounds unless async requires itrustfmt.toml#[derive(Debug, Clone)] on public typesuniffi_compat/Read REFERENCE.md for project-specific Rust patterns.