شعار Sota Rust

Sota Rust

المجتمع
martinholovsky
sota-rust

State-of-the-art Rust engineering (2026) for writing and auditing Rust code. Covers idiomatic ownership and API design, error handling and panic policy, unsafe discipline with Miri, formal verification (Kani proof harnesses, Flux refinement types), async/tokio (cancellation safety, structured concurrency, graceful shutdown), security and supply chain (cargo audit/deny/vet, integer overflow, serde hardening, zeroize), performance (profiling, allocation reduction, release profiles), and tooling/CI (clippy policy, nextest, MSRV, feature hygiene, edition 2024). Use when writing new Rust code, reviewing or auditing existing Rust, designing crate APIs, debugging borrow checker or Send/Sync errors, or hardening Rust services. Triggers: Rust, cargo, crate, tokio, unsafe, lifetime, borrow checker, clippy, async Rust, Cargo.toml, thiserror, anyhow, serde, Miri, MSRV, std::process::Command, subprocess, spawn a process, Kani, cargo kani, flux-rs, formal verification, proof harness.

نظرة عامة

الناشرmartinholovsky
المستودعSOTA-skills
اسم المهارةsota-rust
النجوم
28
التفريعات
3
الملفات المرفقة
9
الترخيصCC-BY-4.0
الروابط
  • تعليمات بصيغة Markdown

    ملف SKILL.md يُحمّله النموذج عند الحاجة، فلا يستهلك توكنات إلا عندما يَرِد طلب ذو صلة فعلًا.

  • تعمل مع أي نموذج لغوي كبير

    مهارات الذكاء الاصطناعي مكتوبة بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا تعمل مع GPT أو Claude أو Gemini أو Grok أو نموذج محلي.

  • الملفات المرفقة: 9

    نصوص برمجية وقوالب ومراجع يمكن للنموذج قراءتها أثناء عمله. الملفات للقراءة فقط ولا تُنفّذ أبدًا.

  • مفتوحة المصدر

    نشرها martinholovsky على GitHub. اطّلع على المصدر قبل تثبيتها.

التثبيت

ثبّت مهارة الذكاء الاصطناعي Sota Rust في TypingMind لاستخدامها مع أي نموذج لغوي كبير، أو أضفها إلى وكيل ذكاء اصطناعي آخر يقرأ SKILL.md.

1

التثبيت في TypingMind

يُثبّت TypingMind المهارة مباشرةً من مجلدها على GitHub — فيقرأ SKILL.md، ويجمع ملفات الموارد في حزمة، ويحفظ النتيجة محليًا.

  1. افتح التطبيق وانتقل إلى الإضافات → المهارات.
  2. اختر «تثبيت من GitHub».
  3. الصق رابط مجلد المهارة الموضّح أدناه وأكّد التثبيت.
    https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-rust
  4. فعّل المهارة في كل محادثة تريد إتاحتها فيها.
الإضافات → المهارات → إضافة مهارة → من رابط GitHub، ثم الصق رابط المجلد واضغط على «متابعة».
2

التثبيت في وكيل ذكاء اصطناعي آخر

يمكن لأي وكيل ذكاء اصطناعي يقرأ تنسيق Agent Skills استخدام هذه المهارة — انسخ المجلد إلى مجلد المهارات الخاص بذلك الوكيل.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/martinholovsky/SOTA-skills.git /tmp/SOTA-skills
mkdir -p .claude/skills
cp -r /tmp/SOTA-skills/skills/sota-rust .claude/skills/sota-rust
أعد تشغيل Claude Code بعد النسخ ليتعرّف على المهارة الجديدة.

استخدمها في TypingMind

فعّل Sota Rust في أي محادثة على TypingMind وسيتولى النموذج الباقي. تتضمن مطالبة النظام اسمها ووصفها، وبمجرد ورود طلب ذي صلة، يُحمّل النموذج التعليمات الكاملة تلقائيًا — فلا تحتاج إلى استدعائها يدويًا، ولا تستهلك أي توكنات حتى تُستخدم فعليًا.

يُحمّل النموذج Sota Rust تلقائيًا بمجرد ورود طلب ذي صلة بها.

تعمل مع أي نموذج ذكاء اصطناعي

مهارات الذكاء الاصطناعي هي تعليمات بصيغة Markdown وليست شيفرة خاصة بمزوّد معيّن، لذا لا ترتبط Sota Rust بالنموذج الذي كُتبت له. ثبّتها مرة واحدة في TypingMind واستخدمها مع GPT-5 أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو نموذج محلي تشغّله بنفسك — كل ذلك باستخدام مفاتيح API الخاصة بك.

  • تُحمَّل عند الحاجة فقط

    تتضمن مطالبة النظام الاسم والوصف فقط. وتُجلب التعليمات عند أول طلب ذي صلة، لذا لا تترتب أي تكلفة على المهارة غير المستخدمة.

  • بدّل النماذج أثناء المحادثة

    لأن المهارة تعليمات وليست شيفرة، فإن تغيير النموذج لا يعطّلها — فالنموذج التالي يقرأ ملف SKILL.md نفسه.

تعليمات المهارة

هذا هو محتوى SKILL.md الذي يُحمّله النموذج. اقرأه قبل التثبيت — فالمهارة عبارة عن تعليمات سيتبعها نموذجك.

SOTA Rust (2026)

Purpose

This skill encodes the 2026 state of the art for production Rust: the idioms, security posture, performance discipline, and CI baseline expected of an expert Rust codebase. It assumes a recent stable Rust toolchain, edition 2024 (Rust ≥1.85; next edition expected ~2027), and the tokio 1.x API. Verify the latest toolchain release at blog.rust-lang.org. It serves two modes — BUILD (write new code to this standard) and AUDIT (find where existing code falls short, with severity and evidence). The detailed rules live in rules/*.md; load only the files relevant to the task (see index below). Every rules file ends with an "Audit checklist" of grep/clippy patterns — use those verbatim in AUDIT mode.

BUILD mode

When writing or modifying Rust code:

  1. Scope the work, load the rules. Pick the relevant rules/ files from the index. Touching async code? Load 04. Adding a dependency, parsing network input? Load 05. Spawning an external program? Load 08. Writing any unsafe? Load 03 — no exceptions. Proving a parser, decoder or arithmetic function panic- and overflow-free, or touching any #[kani::*] or Flux #[spec]? Load 09.
  2. Design types first. Newtypes for domain primitives, errors per subsystem (thiserror for libs, anyhow for apps), ownership tree before Arc<Mutex<_>>, public API minimal and borrowed (&str/&[T] params). Parse, don't validate: constructors enforce invariants.
  3. Write to the non-negotiables (bottom of this file) without being asked. They are defaults, not suggestions; deviations carry a written justification at the site (e.g. expect with invariant message, #[expect(lint, reason = "...")], which fails once the exception is stale; rules/07 §1).
  4. Wire the scaffolding with the code, not after: lints in [lints], deny.toml + cargo deny in CI for anything deployed, Miri job if unsafe exists, nextest, MSRV declared and tested, benches for claimed-hot paths. See rules/07 §9 for the CI shape to copy.
  5. Verify before claiming done: cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo nextest run + cargo test --doc, and cargo doc warning-free for libraries. If you wrote unsafe: cargo +nightly miri test over it. If the crate has Kani harnesses: run them (no cargo kani here? ask the operator to install it, router principle 6, rather than skip) through the cover gate (rules/09 §4) — a bare cargo kani passes vacuous proofs. If you claimed performance: show the benchmark.
  6. Comment intent at decision points the next reader will question: justified clones, cancel-safety of select! arms, SAFETY comments, channel-capacity choices, poisoning policy.

AUDIT mode

Coverage: every rules/ file's Audit checklist applies in AUDIT mode. Mark one not applicable only with its reason in the report — never skip a file because the thing it checks for is absent, since that absence may be the finding.

When reviewing or auditing existing Rust:

  1. Recon first: cargo metadata/workspace layout (in a checkout you do not trust, every cargo command runs its rustc-wrapper and [build] rustc, a toolchain its rust-toolchain.toml names by path, and a registry credential provider: pin RUSTUP_TOOLCHAIN first, then both, and read with --no-deps, rules/07 §4a), Cargo.toml profiles and features, CI config, rg 'unsafe' --count-matches, dependency tree (cargo tree -d), and rg -c 'kani::|flux_rs' -t rust .. Load 09 when proofs are present (audit them as controls that can pass vacuously) or when a security-critical crate parses untrusted input or wraps unsafe behind a safe API (§1 decides whether a missing harness is a finding). This decides which rules files to load and where risk concentrates (network input? unsafe? async service?).
  2. Run the audit checklists at the end of each loaded rules file — they are ordered grep/clippy hunts with pre-calibrated severities.
  3. Validate every finding: read the surrounding code; a grep hit is a lead, not a finding. Confirm reachability (is the unwrap on an attacker-influenced path?) before assigning severity.
  4. Report with the finding format below. Prefer few, true, prioritized findings over volume. Note positive observations where the code is already SOTA (prevents "fixes" that regress good decisions).

Severity conventions

SeverityMeaningExamples
CriticalExploitable now, or UBreachable UB, unsound safe API, SQLi/path traversal, authn bypass, unwinding across FFI, secrets in logs+repo
HighExploitable under realistic conditions, or correctness lossattacker-reachable panic/OOM (DoS), wrapped arithmetic on untrusted lengths, cancellation data loss, deadlock (block_on in async, lock across await), unbounded channels fed by network, missing dep-audit in deployed-service CI
MediumLatent defect or eroded defensemissing SAFETY comments, no Miri CI on unsafe crate, swallowed errors (.ok(), filter_map(Result::ok)) uncommented, untested MSRV, non-additive features, orphaned spawned tasks
LowHygiene, idiom, maintainabilityclone-to-satisfy-borrowck, index loops, missing #[non_exhaustive], missing # Errors docs, blanket #[allow] without reason

Severity scales with reachability (attacker-controlled > user > operator > build-time) and blast radius (process death > request failure > slow).

Finding format

Expands the router's canonical row (file:line | rule | severity | effort | fix, which wins on a cross-domain roll-up); evidence block and report order: sota rules/03 §2 and §5.

[SEVERITY] short title
  Where: path/to/file.rs:123 (fn name / module)
  What:  the defect, in one or two sentences
  Why:   concrete consequence (exploit path, failure mode, cost)
  Fix:   specific change — code sketch or named pattern from rules/NN
  Effort: trivial | small | medium | large
  Refs:  rules/NN §M; clippy lint or RUSTSEC id if applicable

Group findings by severity, Critical first. End with: checklist coverage (which rules files were applied), what was not reviewed, and quick wins (one-line fixes with outsized value).

Rules index

FileRead this when...
rules/01-ownership-and-api-design.mdDesigning structs/traits/modules/workspaces; fighting the borrow checker; deciding clone vs borrow vs Rc/Arc; newtype, typestate, builder patterns; sealed traits, coherence; comparison-trait (Eq/Ord) invariants and the 1.98 derived-PartialOrd fast path; exhaustive matching; iterator-chain idioms; money as integer minor units or decimal, and arithmetic edge cases (NaN/inf from parse::<f64>, MIN / -1, Duration::try_from_secs_f64, §3)
rules/02-errors-and-panics.mdChoosing thiserror vs anyhow/eyre; designing error enums; unwrap/expect policy and invariant messages; context discipline; panic policy for servers, FFI (a panic leaving extern "C" aborts since 1.81), and Drop (no panic in destructors); assert! is a panic and debug_assert! is not a check in release; Option/Result combinator flow; not unwrapping an Option back into a sentinel (unwrap_or(-1), serde(default) on numbers)
rules/03-unsafe-discipline.mdWriting or reviewing ANY unsafe; SAFETY comment standards; UB catalog (aliasing, uninit, transmute, FFI lifetimes); the FFI boundary (values of restricted types arriving from C, null pointers and callbacks, core::ffi widths, bindgen/cbindgen, opaque handles); leak APIs (mem::forget, Box::leak, into_raw without from_raw); Miri/sanitizers/loom in CI; cargo-geiger; soundness review protocol
rules/04-async-tokio.mdAnything async: tokio, spawn vs spawn_blocking, Send/Sync bound errors, select! and cancellation safety, JoinSet/TaskTracker, channel selection, locks across await, async traits, graceful shutdown; request-scoped state: task_local! scope, never a thread_local! (§4)
rules/05-security-supply-chain.mdNetwork-facing or deployed code; adding dependencies; cargo audit/deny/vet; integer overflow on untrusted input; panic-DoS; zeroize/constant-time for secrets; serde hardening (untagged enums, size limits); service-edge defaults; outbound requests to a caller-influenced URL (SSRF: reqwest dns_resolver connect-time check, redirect policy, IP literals, §7); regex as a control (regex::escape, whole-input anchors, fancy-regex backtracking limit, §7); app-set cookie attributes and debug build / tokio-console in production (§7); raw-SQL sinks (sqlx QueryBuilder::push/AssertSqlSafe, diesel sql_query/sql::<T>, §7); spawning external programs moved to rules/08
rules/06-performance.mdPerformance work or claims: profiling (samply/perf/flamegraph, criterion/divan), allocation reduction (Cow/SmallVec/buffer reuse), accidental clones, iterator fusion, release profile (LTO, codegen-units, panic=abort), PGO; hasher choice vs HashDoS (unkeyed FxHash/fnv vs runtime-seeded ahash, §4)
rules/07-tooling-ci.mdSetting up or auditing repo scaffolding: clippy policy and pedantic triage, rustfmt, nextest, MSRV declaration+testing, build config outside Cargo.toml (RUSTFLAGS/.cargo/config.toml in any ancestor overriding the profile, rustc-wrapper, dev/test profiles keeping overflow checks, stable channel, target tier), additive feature flags, docs.rs discipline, edition 2024 migration (newly unsafe env::set_var), crates.io Trusted Publishing (GitHub Actions; GitLab.com public beta), CI baseline. Test strategy — suite shape, TDD, doubles, test data, flake policy — lives in sota-testing; load it for any build that writes logic. This file owns Rust runner mechanics only.
rules/08-external-programs.mdSpawning processes with std::process::Command: argv vs shell, .bat/.cmd on Windows, environment and working directory, kill-and-wait on every exit path, deadlines, output limits (formerly rules/05 section 9, now §1); code evaluation from input — mlua stdlib, rhai limits, libloading (R9.8)
rules/09-formal-verification.mdProving rather than sampling: Kani harnesses (panic, overflow, out-of-bounds and pointer validity over every input within a bound; function and loop contracts; autoharness), Flux refinement types for index/length relations; vacuity (a proof over zero executions prints the same success line — the trailing cover!() and the cover gate), mutation adequacy of postconditions, the unstable flags that silently change what is checked, and soundness limits of contracts on unsafe code. BUILD and AUDIT both

Top-10 non-negotiables

  1. No unwrap()/bare expect() on production paths. Propagate with ? + context; expect("...") only with a message proving the invariant. An attacker-reachable panic is a DoS. (rules/02)
  2. Every unsafe block has a // SAFETY: comment discharging the called API's documented preconditions, and lives behind a sound safe abstraction. Unsafe code without Miri in CI is unaudited code. (rules/03)
  3. Libraries: thiserror enums with #[source] chains. Applications: anyhow with .context(). Never anyhow::Error in a public lib API; never silently swallowed errors. (rules/02)
  4. Never block the async runtime: no sync I/O, std::thread::sleep, or sustained CPU inside async fn; spawn_blocking or a compute pool. No std::sync::MutexGuard held across .await. (rules/04)
  5. Every select!/timeout/abort path is cancellation-reviewed: futures dropped at any .await; cancel-unsafe ops don't go in select! arms; invariants spanning awaits get drop guards. Spawned tasks are owned (JoinSet/TaskTracker), never orphaned. (rules/04)
  6. Untrusted input gets checked arithmetic, size limits, and depth limits: checked_*/try_into on lengths (release mode wraps silently), body-size caps before parsing, no #[serde(untagged)] or uncapped with_capacity on hostile data. (rules/05)
  7. Supply chain is CI-enforced: cargo deny/cargo audit on PRs + scheduled, Cargo.lock committed, new deps vetted (cargo vet or documented review), git deps pinned by rev. (rules/05)
  8. Secrets are typed (SecretString/Zeroizing), redacted from Debug/logs, and compared in constant time (ct_eq). Key material only from OS randomness. (rules/05)
  9. Don't clone to satisfy the borrow checker; don't take owned params you only read. &str/&[T] in signatures, split borrows, mem::take; newtypes over primitive obsession; exhaustive matches (no lazy _ => on owned enums). (rules/01)
  10. CI gate: fmt + clippy -D warnings (triaged pedantic) + nextest + doctests + MSRV job + feature-matrix check. Performance claims require benchmarks; release profile (LTO/codegen-units/panic strategy) is a deliberate, documented choice. (rules/06, 07)

الملفات المرفقة

يقرأ النموذج هذه الملفات عند الحاجة أثناء تحميل المهارة. وهي متاحة للقراءة ولا تُنفّذ أبدًا.

الأسئلة الشائعة

ماذا تفعل مهارة الذكاء الاصطناعي Sota Rust؟

State-of-the-art Rust engineering (2026) for writing and auditing Rust code. Covers idiomatic ownership and API design, error handling and panic policy, unsafe discipline with Miri, formal verification (Kani proof harnesses, Flux refinement types), async/tokio (cancellation safety, structured concurrency, graceful shutdown), security and supply chain (cargo audit/deny/vet, integer overflow, serde hardening, zeroize), performance (profiling, allocation reduction, release profiles), and tooling/CI (clippy policy, nextest, MSRV, feature hygiene, edition 2024). Use when writing new Rust code, r...

لماذا تستخدم Sota Rust على TypingMind؟

لأنك تثبّتها مرة واحدة وتستخدمها مع أي نموذج. مهارة Sota Rust عبارة عن نص Markdown وليست شيفرة خاصة بمزود بعينه، لذا تعمل المهارة نفسها مع GPT-5 أو Claude أو Gemini أو Grok أو نموذج محلي، ويمكنك تبديل النموذج أثناء المحادثة دون تعطّل المهارة. يعمل TypingMind بمفاتيح API الخاصة بك، فتدفع للمزودين مباشرةً بدلًا من اشتراك لكل مقعد، وتبقى مهاراتك ومحادثاتك في مساحة التخزين الخاصة بك.

كيف أثبّت Sota Rust في TypingMind؟

افتح الإضافات → المهارات → التثبيت من GitHub في TypingMind والصق https://github.com/martinholovsky/SOTA-skills/tree/main/skills/sota-rust. يقرأ TypingMind ملف SKILL.md الخاص بها، ويجمع ملفاتها ويثبّتها كمهارة يمكنك تفعيلها لكل محادثة على حدة.

ما نماذج الذكاء الاصطناعي التي يمكنها استخدام Sota Rust؟

أي نموذج تربطه في TypingMind. مهارات الذكاء الاصطناعي عبارة عن تعليمات Markdown وليست شيفرة خاصة بمزود بعينه، لذا يمكن لكل من GPT وClaude وGemini وGrok والنماذج المحلية تحميل هذه المهارة عندما يتوافق الطلب معها.

كم نموذج ذكاء اصطناعي يمكنني استخدامه مع Sota Rust؟

أي عدد تريده. ما دام النموذج يدعم المهارات، يمكنك استخدام Sota Rust معه، سواء كان GPT أو Claude أو Gemini أو Grok أو DeepSeek أو Mistral أو Llama أو غيرها، وكل ذلك على TypingMind باستخدام مفاتيح API الخاصة بك.

هل مهارة الذكاء الاصطناعي Sota Rust مجانية؟

نعم. نشرها martinholovsky على GitHub بموجب ترخيص CC-BY-4.0. لا تدفع إلا لمزود الذكاء الاصطناعي الخاص بك مقابل التوكنات التي تستخدمها.

ما هي مهارات الذكاء الاصطناعي؟

مهارة الذكاء الاصطناعي حزمة تعليمات قابلة لإعادة الاستخدام تعلّم نموذج الذكاء الاصطناعي كيفية تنفيذ مهمة محددة. وتتبع تنسيق Agent Skills المفتوح: ملف SKILL.md يتضمن اسمًا ووصفًا، إلى جانب أي نصوص برمجية أو قوالب أو ملفات مرجعية قد يحتاج إليها النموذج. لا يقرأ النموذج التعليمات إلا عندما يتوافق طلبك مع المهارة، لذا لا تترتب على المهارة المثبتة أي تكلفة حتى تُستخدم.

كيف تختلف مهارات الذكاء الاصطناعي عن الإضافات أو موصلات MCP؟

تمنح الإضافة أو موصل MCP النموذج أدوات جديدة يمكنه استدعاؤها، وهي شيفرة تُنفَّذ في مكان ما وتُرجع نتيجة. أما مهارة الذكاء الاصطناعي فتزوّد النموذج بالمعرفة ومنهجية العمل: كيفية التعامل مع مهمة، والخطوات التي ينبغي اتباعها، وما ينبغي أن تكون عليه المخرجات الجيدة. المهارات عبارة عن نصوص Markdown، لذا لا تحتاج إلى خادم أو مفتاح API أو بيئة تشغيل، وتعمل مع أي نموذج.

عرض الكل

أنشئ مساحة عملك للذكاء الاصطناعي الآن

اشترك في نشرتنا البريدية لتصلك أخبار الميزات الجديدة والهدايا القادمة 👇