본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

rust-code-style

저장소 빌드 도구의 Rust 코드를 작성하고 검토하도록 돕습니다. CLI 설계, 오류 처리, 타입, 서식, 린트, 테스트, 크레이트 의존성, Bazel 검사를 다루며 자동 작업 도구와 사용자용 명령을 구분합니다.

원문원문 설명 보기

Write or review Rust in the build tools.

JetBrains/intellij-community스타 20,685(GitHub 20,685 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Rust 빌드 도구 구현하기
  • CLI 오류와 종료 코드 검토하기
  • Rust와 Bazel 검사 절차 확인하기

한국어 소개

할 수 있는 일

이 스킬은 빌드 도구 Rust 워크스페이스에서 코드를 작성하고 검토할 때 적용하는 규칙을 정리합니다. 먼저 도구가 Bazel에서 호출하는 자동 작업인지, 사람이나 에이전트가 사용하는 CLI인지 구분한 뒤 각각에 맞는 인자 형식과 오류 처리 방식을 선택합니다. 경로 타입, 오류에 문맥을 추가하는 방법, 린트 예외 작성법, 크레이트 분리 조건, 테스트와 테스트 데이터의 위치도 다룹니다. 변경 전후에 실행할 cargo fmt, Clippy, Bazel 동기화 및 빌드 확인, Windows 대상 검사 명령도 안내합니다.

이럴 때 유용합니다

dev-dist tools, BT, Air UI-lane tooling 등의 Rust 워크스페이스를 수정하거나, 기존 코드가 CLI 동작, 오류 처리, 테스트 규칙에 맞는지 확인할 때 유용합니다.

사용 예시

  • “이 Rust 명령의 인자 처리를 워크스페이스 규칙에 맞춰 주세요.”
  • “오류 처리와 종료 코드 설계를 검토해 주세요.”
  • “변경 후 필요한 Rust와 Bazel 검사를 정리해 주세요.”

주의 사항

이 스킬은 자료에 명시된 저장소의 Rust 도구 워크스페이스를 대상으로 합니다. 검증에는 Rust, Bazel, Bun 환경과 워크스페이스별 명령이 필요합니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호입력 거부 처리, 종료 코드, Windows에서 문제가 되는 API 제한을 설명합니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족Rust, Bazel, Bun과 워크스페이스별 명령이 필요하다고 명시합니다.

점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md9.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- Generated by community/.ai/render-guides.mjs; edit community/.agents/skills/rust-code-style/SKILL.md -->

Rust Code Style

These rules apply to the Rust tool workspaces: the dev-dist tools, BT and the Air UI-lane tooling. The spec of a workspace is community/build/rust-tools/README.md. It names the files, the Bazel targets and the checks that every workspace has. This skill holds the idioms.

First, find the audience

A tool has one of two audiences. The audience picks the error model and the command line grammar.

Action toolPerson- or agent-facing CLI
Writes the command lineBazel, in an actiona person, an agent or a script
Examplesthe packer, the collector, the composer, the descriptor writerbt, vm
Error modelanyhow, ERROR: {e:#}, a nonzero exita typed Refusal with a stable code and exit
Command linethe cli crate, --key=valueclap derive
Crate closurepinned in closure.txtnot pinned

Bazel reads only "nonzero" from an action tool. A person or an agent branches on the exit code and on the refusal code.

1. Two error models

An action tool returns anyhow::Result from every function and prints the chain once. main.rs stays thin:

fn main() -> ExitCode {
    ExitCode::from(run(std::env::args_os().skip(1), &mut std::io::stdout(), &mut std::io::stderr()))
}

run calls the tool and passes an error to cli::report, which prints ERROR: {error:#}. Each tool keeps its own exit codes. bins/runtime-layout/src/main.rs of the dev-dist tools shows the shape.

A person- or agent-facing CLI answers a Refusal { code, message, exit, details }. The code is the stable half that a caller automates against. The shared crate community/tools/bt/crates/refusal holds the type, with the details as JSON text. Its type parameter is the exit vocabulary, so each tool keeps its own exit codes: bt uses u8 with the codes 0 to 6 of community/tools/bt/crates/bt-core/src/exit.rs, and the Air UI-lane controller uses avl_base::Exit. A tool that converts a refusal of another tool maps the exit by its meaning, never by its number.

2. Two command line grammars

Bazel writes the argv of an action tool, so the tool reads it with the cli crate. The crate has no dependency, and it refuses every other form with one text. community/build/dev-dist-tools/crates/cli/API.md lists the refusals.

let mut options = cli::parse(args)?;
let output = options.require("--output")?;
let parts = options.take_all("--part")?;
options.finish()?; // refuses an option that the tool did not take

A person- or agent-facing CLI uses clap derive: help, environment variables, suggestions and -- passthrough. community/tools/bt/bins/bt/src/options.rs is the example. Use no third grammar and no hand-written argument loop.

3. Format

  • The width is 140 columns, as in the root .editorconfig. The synced rustfmt.toml of each workspace sets it.
  • Run cargo fmt in the workspace directory before every commit.
  • Format a whole workspace in its own commit, without other changes.

4. Lints

  • Every crate follows the shared table: [lints] workspace = true in its Cargo.toml. The crate macro fails without it.
  • A site exception is #[expect(lint, reason = "...")], never #[allow]. An expectation that stops firing fails the build, so a stale exception shows.
  • clippy.toml bans fs::canonicalize and the tempfile calls that fail past MAX_PATH on Windows. A site that needs a banned call states why:
#[expect(
    clippy::disallowed_methods,
    reason = "the parent resolves the expected directory with the same call, so both sides agree on /private on macOS"
)]

5. Errors in libraries

  • Use anyhow in a library too. Use io::Result only where a caller branches on the ErrorKind, as fscopy does.
  • A refusal names the refused input: the file, the line, the field or the value.
  • Add the path as context at the I/O call: .with_context(|| format!("cannot read {}", path.display())).
  • A test pins the whole chain with format!("{error:#}"). A test that checks a kind uses error.downcast_ref::<io::Error>().

6. Types

  • Use an enum where a Go port used flags or a struct of options. A match then covers every case.
  • Use Path and PathBuf for every host path. Use str only for a slash-form path inside a distribution or a jar. distpath validates such a path once, at the input boundary.
  • Write pub(crate) inside a binary. The unreachable_pub lint is on.
  • Keep main.rs thin: parse, call, report. The work lives in modules that the tests call directly.

7. Crates

  • A crate exists when two binaries share it, or when it is the frozen-bytes engine of one binary with its own goldens. Code that one binary uses lives in that binary.
  • An action tool pins its crate closure in closure.txt, such as community/build/dev-dist-tools/bins/content-module-packer/closure.txt. A change to any crate in the closure reruns every action of the tool, so <bin>_closure_test makes each new crate a visible choice.
  • Prefer a maintained crate to own code. The exception is a crate that would re-key an action tool, when about 30 lines replace it. State the reason in one sentence of the doc comment:
/// It is written by hand, because a crate dependency in the packer re-keys every packing action when the crate changes.
pub(crate) fn is_versioned_module_info(name: &str) -> bool {
  • Support the subset: a tool accepts only the input that the repository produces. It refuses all other input with an error that names the input. The API.md of the crate lists each refusal.

8. Tests

  • <module>.rs ends with #[cfg(test)] mod tests;, and the tests live in <module>/tests.rs. The tests of lib.rs or main.rs live in src/tests.rs. There is no mod.rs: mod_module_files is on.
  • The process-level tests of a binary live in tests/cli.rs. The run-time CARGO_BIN_EXE_<name> gives the binary. Under Bazel the path is relative, so make it absolute before the test changes the directory.
  • Shared test helpers live in a dev-only testkit crate. Shipped code never depends on it.
  • A test finds testdata/ through one lookup: the variable that the crate macro sets under Bazel, such as DDT_TESTDATA_DIR, and the run-time CARGO_MANIFEST_DIR under cargo. The rules_rust process wrapper refuses env!("CARGO_MANIFEST_DIR"). A file that include_str! reads is compile_data of the crate.
  • Never edit a golden by hand. Regenerate it with the update path of its test.
  • The Windows check is the clippy-windows-* targets of the workspace and the cross-target cargo clippy below.

9. Docs

  • The README.md of a workspace holds the crate map and the gates.
  • The API.md of a crate under the subset rule holds the supported subset and a refusal table.
  • A doc comment documents a declaration. The rationale of a change goes in the commit message or an ADR, not in a comment.

10. Versions

  • A requirement names the current full version, such as serde = "1.0.229". Cargo reads it as a caret requirement.
  • Cargo.lock is the pin, and rules_rs reads it.
  • To stay current, run cargo update, raise the requirements to the locked versions, and refresh the hub.

Refresh a crate hub

community/MODULE.bazel generates @ddt and @bt from the workspace Cargo.toml and Cargo.lock. After a change of Cargo.lock, update the Bazel lockfiles of both roots. For the dev-dist tools:

cd community && ./bazel.cmd build --nobuild --lockfile_mode=update //build/dev-dist-tools/...
cd .. && ./bazel.cmd build --nobuild --lockfile_mode=update @community//build/dev-dist-tools/... //build/dev-dist-tools/...

For BT, use //tools/bt/... and @community//tools/bt/.... The extension watches only the workspace Cargo.toml and Cargo.lock. A dependency that moves between [dev-dependencies] and [dependencies] of a member leaves the lock unchanged. Then touch the workspace Cargo.toml, for example with a comment line, and run the commands again.

The gates

Run them before a commit, in addition to the gates of the workspace README:

cargo fmt --check && cargo clippy --all-targets      # in the workspace directory
bun community/build/rust-tools/sync.mjs --check
cd community && ./bazel.cmd test //build/dev-dist-tools/... //tools/bt/... //build/rust-tools/...
RUSTC_BOOTSTRAP=1 cargo clippy -Zbuild-std=std,panic_abort --target x86_64-pc-windows-msvc --workspace --all-targets

From the ultimate root, also run ./bazel.cmd test @community//build/dev-dist-tools/... //build/dev-dist-tools/.... The clippy tests of a community crate run only from community/, because the clippy aspect skips a target of an external repository.

Where things live

WhatWhere
The spec of a workspace, the checks, how a workspace joinscommunity/build/rust-tools/README.md
The lint, format and clippy sources, and sync.mjscommunity/build/rust-tools/
The Bazel macro core: rust_tool_crate, optimized_binary, windows_clippy_testscommunity/build/rust-tools/defs.bzl
The dev-dist tools: crate map, gates, agent rulescommunity/build/dev-dist-tools/README.md and AGENTS.md
BTcommunity/tools/bt/README.md
The Air UI-lane tooling: crate map, gates, agent rulescommunity/tools/vm/README.md and AGENTS.md

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

actions

무료요약 있음

IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.

  • IDE 메뉴에 새 동작 추가
  • 동작 등록이나 아이콘 변경
  • 동작 이름과 설명 정리
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

bazel-test-migration

무료요약 있음

IntelliJ JPS 테스트 모듈을 Bazel로 옮기고 Bazel에서만 발생하는 실패를 조사하는 안내서입니다. 의존성, 플러그인, 테스트 데이터와 runfiles 문제를 확인하고 생성된 대상과 이전된 테스트를 검증합니다.

  • 기존 JPS 테스트 모듈을 Bazel로 이전할 때
  • Bazel에서만 실패하는 테스트를 조사할 때
  • 테스트 의존성과 데이터 설정을 확인할 때
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

code-style

무료요약 있음

IntelliJ 프로젝트 규칙에 맞춰 Kotlin과 Java 코드를 작성하거나 검토합니다. 언어 선택, 서식, 봉인 타입, 스레드 주석, 제어 흐름 예외 처리를 확인합니다.

  • IntelliJ 규칙에 맞는 Kotlin 작성
  • Java 코드 검토
  • 예외 처리와 봉인 타입 분기 확인
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

commits

무료요약 있음

이 가이드는 IntelliJ 프로젝트의 변경 사항을 목적별로 나누고 프로젝트 형식에 맞는 커밋 메시지를 작성하도록 돕습니다. 티켓이 있으면 번호와 변경 설명을, 없으면 레이블과 하위 시스템명을 사용하며 필요에 따라 이유와 판단을 본문에 담습니다.

  • 티켓이 있는 변경의 프로젝트 형식 메시지 작성
  • 테스트나 문서 커밋에 적절한 레이블 적용
  • 기존 커밋 메시지를 규칙에 맞게 수정
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compare-python-typecheckers

무료요약 있음

여러 Python 타입 검사기로 코드 조각이나 파일의 타입 추론과 오류 판정을 비교합니다. 도구별 결과, 실행 시간, 진단 내용을 Markdown 보고서로 모아 저장할 수 있습니다.

  • 검사기별 타입 추론 비교
  • 코드가 타입 오류로 판정되는지 확인
  • 여러 도구의 진단 결과 비교
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

compose-ui-architecture

무료요약 있음

Compose Desktop 화면을 구성할 때 컴포저블은 렌더링을 맡고 프레젠터나 코디네이터는 앱 결정을 맡도록 구조를 정리합니다. 상태 소유권, Effect, 재사용 컴포넌트 API, 지연 목록 키, 애니메이션과 성능을 개별 UI 변경에 맞춰 살펴봅니다.

  • 화면 렌더링과 프레젠터 판단 분리
  • UI 상태를 둘 위치 정리
  • Effect 키와 코루틴 사용 검토
JetBrains/intellij-community2.1만2026년 10월 29일 업데이트

JetBrains의 스킬 모두 보기

이 스킬의 문제 신고