用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill code-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | code-review |
| description | | Use when this capability is needed. |
Without a structured code review process, developers often overlook critical bugs, introduce inconsistent patterns, or fail to leverage the full potential of specific libraries like Pydantic for data validation or Click for CLI structure. This leads to increased technical debt, harder-to-maintain code, and a higher risk of runtime errors, especially when integrating with complex LLM APIs. This skill provides a systematic approach to code review, ensuring that new contributions are robust, readable, and align with the project's standards and tech stack.
Activate when the user mentions:
Do NOT activate for: "write code", "debug an error", "run tests"
Click, Pydantic, pytest, Gemini, Groq, Anthropic, OpenAI, rich, etc.) are being used effectively and correctly.pip freeze) with the CI/CD environment or the developer's environment.To provide a meaningful review, it's crucial to first grasp the scope and intent of the changes, identifying which files were modified and the problem they aim to solve.
# Assuming a Git workflow, review the changes between the feature branch and the base branch.
# Replace 'feature-branch' and 'main' with the actual branch names.
git diff main...feature-branch
Running the project's tests locally is essential to catch any regressions or failures introduced by the new code and to ensure that new features are adequately covered by tests.
pytest
Maintaining consistent code style and structure, especially for Click commands, Pydantic models, and rich output, is vital for readability and long-term maintainability.
Manually review the code for:
Click commands and options, ensuring user-friendliness.Pydantic for data validation and schema definition, particularly for LLM inputs/outputs.rich for formatting terminal output, if applicable.Thoroughly evaluating the logic ensures the code correctly implements the intended features, handles edge cases, and interacts reliably with the various LLM APIs (Gemini, Groq, Anthropic, OpenAI).
Manually review the code for:
google-generativeai, groq, openai, and anthropic libraries.Clear documentation and comments are crucial for future developers to understand, maintain, and extend the codebase, especially in complex projects involving multiple LLM integrations.
Manually review the code for:
Providing clear, actionable, and constructive feedback is key to a successful code review process, enabling the author to understand and implement the suggested improvements.
Manually summarize findings, suggest improvements, and ask clarifying questions. Focus on specific lines or blocks of code.
Validation ensures that the code review process was effective, confirming that all identified issues have been addressed and the code is ready for integration.
# After the author addresses feedback, re-run tests to confirm fixes and no new issues.
pytest
# If applicable, manually test the functionality to ensure it works as expected.
# Example: If main.py defines a CLI, run a relevant command.
python main.py --help
❌ Don't provide vague feedback like "This code is bad." This is unhelpful and doesn't guide the author towards improvement.
✅ Do provide specific, actionable feedback, referencing exact lines of code and explaining why a change is suggested (e.g., "Consider using a Pydantic Field with min_length for api_key on line X to ensure better validation, as Pydantic is already in use.").
❌ Don't ignore existing project conventions or established patterns for using libraries like Click or Pydantic. This leads to inconsistent code.
✅ Do ensure new code aligns with existing patterns, leveraging the strengths of each library as demonstrated in other parts of the project, or introducing new best practices consistently.
# Example of using Pydantic for robust input validation, a common area for code review.
# This ensures that API inputs are well-formed before interacting with LLM services.
from pydantic import BaseModel, Field, HttpUrl
from typing import Optional
class LLMRequest(BaseModel):
prompt: str = Field(..., min_length=10, description="The text prompt for the LLM.")
model_name: str = Field("gpt-3.5-turbo", description="The name of the LLM model to use.")
temperature: float = Field(0.7, ge=0.0, le=1.0, description="Sampling temperature for text generation.")
max_tokens: int = Field(150, ge=1, description="Maximum number of tokens to generate.")
api_key: Optional[str] = Field(None, description="API key for the LLM service. Can be from environment.")
# Example of a custom validator, often a good point for review
# @validator('model_name')
# def check_model_name(cls, v):
# supported_models = ["gpt-3.5-turbo", "gemini-pro", "claude-3-opus-20240229", "llama3-8b-8192"]
# if v not in supported_models:
# raise ValueError(f"Unsupported model name: {v}. Must be one of {supported_models}")
# return v
# In a code review, one might check if all necessary fields are validated,
# if custom validators are appropriate, and if the default values make sense.
Source: Amitro123/project-rules-generator — distributed by TomeVault.