원클릭으로
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".
Write idiomatic Rust following this project's patterns and conventions
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".
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 |
| user_invocable | false |
| autoactivate_when | editing or creating Rust (.rs) files in this workspace |
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 serde::..., use num_bigint::...)use crate::...)use std::...) — only when needed explicitlyuse 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 + ?.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, TokenSource)StaticSource, StaticTokenSource)Default for test sources via new() delegation&dyn Trait for trait object parameters (add Send + Sync only when required by async context)pub 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 types that roundtrip through JSON#[serde(untagged)] for flexible enums (like DisplayField, VisibleRule)#[serde(rename_all = "camelCase")] for JSON field mappingBox for tree structures (ParamType::Array(Box<ParamType>))RenderContext<'a>)Pass 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.rs)types/ subdirectory with submoduleslib.rspub(crate) for internal helpers shared between modules#[cfg(test)] mod tests { ... } at bottom of each moduleuse super::*; in test modulesif let ... { } else { panic!(...) }#[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();
// ... build calldata ...
let result = my_function(&descriptor).unwrap();
assert_eq!(result.field, "expected");
}
}
cargo fmt # Stable rustfmt, default width (100)
cargo clippy -- -D warnings
cargo test
No rustfmt.toml overrides — use default settings.
Before considering Rust code complete:
cargo fmt --check passescargo clippy -- -D warnings passescargo test passes (all 26+ tests).unwrap() in library code (tests are fine)thiserrorDebug and Clonelib.rs if publicDo NOT:
.unwrap() or .expect() in library codeeyre, anyhow, or Box<dyn Error> — only thiserrorasync / tokio outside the github-registry feature gateuse { foo, bar } — use one use per itemSend + Sync bounds on trait objects unless required by async contextrustfmt.toml — use defaultscargo +nightly fmt — use stable cargo fmt#[derive(Debug, Clone)] on public typesuniffi_compat/ moduleSee REFERENCE.md for advanced patterns specific to this project.