Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

openai-codex-rust-patterns

БесплатноБез исполняемых скриптовНе проверен

OpenAI Codex Rust coding patterns distilled from the codex-rs workspace. Use this skill whenever writing, reviewing, or refactoring Rust code — especially for…

pproencaот pproenca★ 231 звезда на GitHub

Об этом скилле

OpenAI Codex Rust Best Practices

Distilled from openai/codex codex-rs/ — a 119-crate, 2,008-file Rust workspace that ships the Codex CLI coding agent. Contains 63 rules across 11 categories, each citing the exact file in codex-rs where the pattern lives, so you can write Rust the way its top contributors (Michael Bolin, jif-oai, Ahmed Ibrahim, Eric Traut, Pavel Krymets) actually ship it. Citations were refreshed against main at commit 8a94430 (2026-05-25).

When to Apply

Reference these guidelines when:

  • Writing or reviewing async Rust code that spawns tokio tasks, owns cancellation tokens, or manages long-lived background workers.
  • Designing error enums, Result flows, retry loops, or layer boundaries in a library or service.
  • Building a CLI tool that spawns subprocesses, enforces sandboxing, or runs LLM-generated code safely.
  • Architecting a Cargo workspace with more than ~5 crates, deciding what to split out, and how to manage shared dependencies.
  • Adding tests to a Rust codebase where existing tests are inline mod tests { ... } blocks and scaling is becoming painful.
  • Implementing a JSON-RPC or custom wire protocol with serde — especially one that must evolve without breaking clients.
  • Reading API keys or other secrets into memory, or hardening a binary that handles credentials against core dumps, debugger attach, and LD_PRELOAD.
  • Enforcing a network egress allowlist that must survive DNS rebinding, or loading untrusted plugins/extensions.
  • Wiring OpenTelemetry traces, logs, or metrics into a service that has privacy constraints around PII.
  • Building a Ratatui-based TUI that streams LLM output, handles paste bursts, or manages raw-mode terminal state.
  • Any time you find yourself reaching for .unwrap(), .lock().unwrap(), anyhow::Result<()>, or #[cfg(feature = "test")] — this skill explains what codex does instead.

Rule Categories by Priority

Priority Category Impact Prefix
1 Defensive Coding & Panic Discipline CRITICAL defensive-
2 Error Handling & Result Discipline CRITICAL errors-
3 Async, Concurrency & Cancellation HIGH async-
4 Sandboxing & Process Isolation HIGH sandbox-
5 Secrets & Process Hardening HIGH secrets-
6 Type Design & Invariants HIGH types-
7 Testing Architecture MEDIUM-HIGH testing-
8 Protocol & Serde Design MEDIUM-HIGH proto-
9 Workspace & Crate Organization MEDIUM workspace-
10 Observability & Tracing MEDIUM otel-
11 TUI (Ratatui) Rendering MEDIUM tui-

Quick Reference

1. Defensive Coding & Panic Discipline (CRITICAL)

2. Error Handling & Result Discipline (CRITICAL)

Полный SKILL.md на GitHub

Установить openai-codex-rust-patterns в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

AGENTS.mdREADME.mdgotchas.mdmetadata.jsonreferences/_sections.mdreferences/async-abort-on-drop-handle.mdreferences/async-biased-select-for-cancellation.mdreferences/async-bounded-vs-unbounded-channel-split.mdreferences/async-child-cancellation-tokens.mdreferences/async-graceful-then-forceful-cancel.mdreferences/async-shared-boxfuture-joinhandle.mdreferences/defensive-banned-interpreter-prefixes.mdreferences/defensive-canonicalize-approval-cache-key.mdreferences/defensive-debug-assert-with-early-return.mdreferences/defensive-deny-unwrap-workspace-wide.mdreferences/defensive-fault-isolate-plugin-load.mdreferences/defensive-head-tail-output-buffer.mdreferences/defensive-io-drain-timeout-grandchildren.mdreferences/defensive-recover-poisoned-lock.mdreferences/defensive-refuse-to-run-unsandboxed.mdreferences/errors-boundary-error-translator.mdreferences/errors-carry-retry-delay-in-variant.mdreferences/errors-exhaustive-retryable-match.mdreferences/errors-io-error-with-context-struct.mdreferences/errors-struct-display-payload.mdreferences/errors-tool-call-respond-vs-fatal.mdreferences/errors-transient-permanent-type-split.mdreferences/otel-field-empty-then-record.mdreferences/otel-instrument-at-trace-level.mdreferences/otel-layered-subscribers-env-filter.mdreferences/otel-log-only-vs-trace-safe-targets.mdreferences/otel-w3c-traceparent-propagation.mdreferences/proto-double-option-tri-state.mdreferences/proto-experimental-runtime-gate.mdreferences/proto-internal-vs-wire-error-split.mdreferences/proto-internally-tagged-rpc-dispatch.mdreferences/proto-removed-feature-tombstone.mdreferences/proto-rename-alias-wire-migration.mdreferences/proto-sse-idle-timeout-terminator.mdreferences/sandbox-argv0-multiplex-binary.md

FAQ

Что делает скилл openai-codex-rust-patterns?

OpenAI Codex Rust coding patterns distilled from the codex-rs workspace. Use this skill whenever writing, reviewing, or refactoring Rust code — especially for async agents, CLI tools, sandboxing, secret handling, Ratatui TUIs, JSON-RPC protocols, tokio-based services, or any codebase that needs defensive panic discipline. Trigger even when the user does not explicitly mention Codex, because the patterns generalize to any production Rust workspace. Covers async cancellation, error enum design, process sandboxing, DNS-rebinding defense, credential hardening (zeroize/mlock/ctor), Cargo workspace architecture, wiremock-based fakes, insta snapshot testing, OpenTelemetry tracing, and Ratatui rendering.

Как установить скилл openai-codex-rust-patterns?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл openai-codex-rust-patterns запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить openai-codex-rust-patterns с