Files
librefang-registry/workflows/code-review.toml
T
Evan 492faabd57 feat: update minimax default to M2.7, add zh i18n to workflow templates (#19)
- aliases: minimax default → MiniMax-M2.7, minimax-highspeed → MiniMax-M2.7-highspeed
- workflow templates: add [i18n.zh] section with Chinese name/description
2026-03-24 13:00:20 +09:00

47 lines
2.6 KiB
TOML

id = "code-review"
name = "Code Review"
description = "Parallel code analysis pipeline that evaluates correctness, security, and style independently, then synthesises findings into a unified review summary."
category = "engineering"
tags = ["code", "review", "security", "quality"]
[i18n.zh]
name = "代码审查"
description = "并行代码分析流水线,独立评估正确性、安全性和代码风格,然后将发现汇总为统一的审查报告。"
[[parameters]]
name = "code"
description = "The source code or diff to review"
param_type = "string"
required = true
[[parameters]]
name = "language"
description = "Programming language of the code"
param_type = "string"
required = false
default = "auto-detect"
[[parameters]]
name = "context"
description = "Additional context about the codebase or change purpose"
param_type = "string"
required = false
default = ""
[[steps]]
name = "review_correctness"
prompt_template = "Review the following {{language}} code for correctness. Analyse:\n- Logic errors and edge cases\n- Error handling completeness\n- Null/undefined safety\n- Off-by-one errors and boundary conditions\n- Resource leaks (memory, file handles, connections)\n- Concurrency issues (race conditions, deadlocks)\n\nContext: {{context}}\n\nCode:\n{{code}}"
[[steps]]
name = "review_security"
prompt_template = "Perform a security review of the following {{language}} code. Check for:\n- Injection vulnerabilities (SQL, command, XSS)\n- Authentication and authorisation flaws\n- Sensitive data exposure (logging secrets, hardcoded credentials)\n- Input validation gaps\n- Insecure cryptographic usage\n- Path traversal and SSRF risks\n- Dependency vulnerabilities\n\nContext: {{context}}\n\nCode:\n{{code}}"
[[steps]]
name = "review_style"
prompt_template = "Review the following {{language}} code for style and maintainability. Evaluate:\n- Naming conventions and clarity\n- Function/method length and complexity\n- Code duplication\n- Documentation and comments quality\n- Consistent formatting\n- Appropriate use of language idioms\n- API design and public interface clarity\n\nContext: {{context}}\n\nCode:\n{{code}}"
[[steps]]
name = "synthesise"
prompt_template = "Synthesise the three independent code review analyses below into a unified review summary. Prioritise findings by severity (critical, high, medium, low). Remove duplicates across analyses. Produce a final verdict: approve, request-changes, or needs-discussion.\n\nCorrectness review:\n{{review_correctness}}\n\nSecurity review:\n{{review_security}}\n\nStyle review:\n{{review_style}}"
depends_on = ["review_correctness", "review_security", "review_style"]