Skip to main content

rust-review

Rust code review guidelines for Coglet

소스 정보

저장소
replicate/cog
최근 소스 활동
2026년 4월 24일 19:38
감지된 SKILL.md 언어
영어
스타
9,490
포크
699

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
rust-review
description
Rust code review guidelines for Coglet
## Rust review guidelines This project uses Rust for Coglet (`crates/`), the prediction server that runs inside Cog containers. It handles HTTP requests, worker process management, and prediction execution. ### What linters already catch (skip these) clippy runs in CI. cargo-deny audits dependencies for license/advisory issues. Don't flag issues these would catch. ### What to look for **Error handling** - Use `thiserror` for typed errors in library code, `anyhow` for application errors - Don't use `.unwrap()` or `.expect()` in non-test code unless the invariant is documented - Error context: use `.context()` or `.with_context()` from anyhow, not bare `?` **Ownership and lifetimes** - Unnecessary cloning where a borrow would work - Lifetime issues that suggest a design problem (not just annotation noise) - Arc/Mutex when simpler patterns exist **Async (tokio)** - Blocking operations inside async contexts (use `spawn_blocking`) - Missing `.await` on futures (compiler catches some, but not all logical issues) - Proper cancellation handling and cleanup - Task/JoinHandle leaks **Safety** - Any `unsafe` block needs justification and a safety comment - FFI boundaries with Python (PyO3) -- check for panics across FFI, GIL handling - Memory safety in IPC between parent and worker processes **Architecture** - `crates/coglet/` is the core: HTTP server, worker orchestration, IPC - `crates/coglet-python/` is PyO3 bindings for Python predictor integration - Two-process architecture: parent (HTTP + orchestrator) and worker (Python execution) - Don't mix IPC concerns with HTTP handling - Snapshot tests use `insta` -- check if snapshots need updating **Dependencies** - New dependencies should be justified -- `crates/deny.toml` audits them - Prefer std or existing deps over adding new ones for small tasks
GitHub에서 보기