一键导入
review
Review Ruby Fast LSP code changes and PRs using TigerStyle principles, project standards, and correctness checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Review Ruby Fast LSP code changes and PRs using TigerStyle principles, project standards, and correctness checks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | review |
| description | Review Ruby Fast LSP code changes and PRs using TigerStyle principles, project standards, and correctness checks. |
Use this skill when reviewing code changes, pull requests, or before merging code in the Ruby Fast LSP project. Provides a comprehensive checklist based on TigerStyle principles and project standards. Triggers: review, code review, PR review, pull request, check code, review changes.
"Code review is not about finding bugs. It's about maintaining code quality and sharing knowledge."
cargo testcargo clippycargo fmt --check// REJECT: Over 70 lines
fn massive_function() {
// 150 lines of code
}
// ACCEPT: Decomposed
fn main_function() {
let step1 = do_step1();
let step2 = do_step2(step1);
finalize(step2)
}
// REJECT: No assertions
fn process(data: &Data) -> Result {
// just processes, no validation
}
// ACCEPT: Validates invariants
fn process(data: &Data) -> Result {
assert!(!data.is_empty(), "Data cannot be empty");
assert!(data.len() < MAX_SIZE, "Data exceeds maximum size");
// process...
}
// REJECT: Recursion
fn traverse(node: &Node) {
traverse(node.left); // Recursive
}
// ACCEPT: Explicit stack
fn traverse(root: &Node) {
let mut stack = vec![root];
while let Some(node) = stack.pop() {
stack.extend(node.children());
}
}
// REJECT: Silent swallow
let _ = file.write(data);
// ACCEPT: Handle or log
file.write(data).context("Failed to write file")?;
// OR
if let Err(e) = file.write(data) {
warn!("Cache write failed: {}", e);
}
// REJECT: Option for errors
fn parse_config(path: &Path) -> Option<Config> // Why did it fail?
// ACCEPT: Result with error info
fn parse_config(path: &Path) -> Result<Config, ConfigError>
// REJECT: Unwrap in production
let doc = self.docs.get(&uri).unwrap();
// ACCEPT: Handle absence
let doc = self.docs.get(&uri).ok_or(QueryError::DocumentNotFound)?;
// OR for truly impossible cases
let doc = self.docs.get(&uri).expect("Document must exist after indexing");
// REJECT
fn getDef() -> Def // camelCase
let maxCnt = 10; // abbreviation
// ACCEPT
fn get_definition() -> Definition // snake_case
let max_count = 10; // full words
// REJECT
let timeout = 30; // 30 what?
let max_size = 1024; // bytes? KB?
// ACCEPT
let timeout_seconds = 30;
let max_size_bytes = 1024;
// REJECT: Handler directly uses indexer
// handlers/request.rs
use crate::indexer::RubyIndex;
// ACCEPT: Handler uses capabilities
// handlers/request.rs
use crate::capabilities::definition;
// REJECT: Scattered index access
fn find_def(&self) {
let index = self.index.lock();
let result = index.definitions.get(&name);
// manual lookup
}
// ACCEPT: Use IndexQuery
fn find_def(&self) {
let query = IndexQuery::new(&self.index, &uri);
query.find_definitions_at_position(pos)
}
// REJECT: New capability without tests
pub fn new_feature() -> Result { ... }
// No corresponding test file
// ACCEPT: Feature with tests
pub fn new_feature() -> Result { ... }
// Plus: tests/integration/new_feature.rs
// REJECT: Incomplete test
#[test]
fn test_find_definition() {
let result = find_definition("MyClass");
assert!(result.is_some()); // Doesn't verify content
}
// ACCEPT: Thorough test
#[test]
fn test_find_definition() {
let result = find_definition("MyClass");
assert!(result.is_some());
let loc = result.unwrap();
assert_eq!(loc.uri.path(), "/src/my_class.rb");
assert_eq!(loc.range.start.line, 5);
}
// REJECT: Clone in loop
for item in items {
process(item.clone()); // Clones every iteration
}
// ACCEPT: Borrow
for item in &items {
process(item);
}
// REJECT: Repeated allocation
let mut results = Vec::new();
for i in 0..1000 {
results.push(compute(i));
}
// ACCEPT: Pre-allocated
let mut results = Vec::with_capacity(1000);
for i in 0..1000 {
results.push(compute(i));
}
Use for issues that must be fixed:
**[BLOCKING]** This function is 120 lines. Please split into smaller
functions (max 70 lines per TigerStyle).
**[BLOCKING]** Unwrap on user input can panic. Use proper error handling.
Use for improvements that aren't blocking:
**[Suggestion]** Consider using `Ustr` here since this string is
frequently compared.
**[Suggestion]** This could be simplified with `filter_map()`.
Use to understand intent:
**[Question]** Why is this error being ignored? Is this intentional?
**[Question]** Would it make sense to add a test for the edge case
where the list is empty?
## Review: Approved
### Summary
Brief description of what was reviewed.
### Strengths
- Clean implementation of X
- Good test coverage for Y
### Minor Suggestions (non-blocking)
- Consider adding doc comment for public function
- Could simplify line 45 with iterator methods
Approved to merge!
## Review: Changes Requested
### Summary
Brief description of what was reviewed.
### Blocking Issues
1. **Function too long** (line 50-180): Split into smaller functions
2. **Missing error handling** (line 95): Don't ignore this error
### Non-blocking Suggestions
- Add test for empty input case
- Consider more descriptive variable name on line 30
Please address blocking issues before merge.
Run before reviewing any PR:
# Must pass
cargo test
cargo clippy -- -D warnings
cargo fmt --check
# Should run
cargo doc --no-deps
Every PR should pass:
.context()? or ok_or()unwrap() anywhere except tests// TODO without issue referenceDesign Ruby Fast LSP features, understand module responsibilities, apply layer boundaries, and make structural changes.
Create, update, validate, and maintain Ruby Fast LSP C4 architecture diagrams using LikeC4.
Implement or review error handling patterns in Ruby Fast LSP, including Result, Option, logging, failures, and exception flows.
Optimize Ruby Fast LSP performance, profile latency and memory, benchmark changes, and make performance-critical decisions.
Refactor Ruby Fast LSP modules, extract abstractions, reduce complexity, and preserve test coverage during structural changes.
Release a new version of ruby-fast-lsp. Bumps version in Cargo.toml, commits, tags, and pushes to trigger CI. Use when the user says /release, 'release', 'publish', 'bump version', 'cut a release', or 'new version'.