Files
librefang-registry/workflows/code-review.toml
T
Evan 6e48be1e31 feat: add workflow templates (#9)
9 bundled workflow templates:
- data-pipeline: ETL extract/transform/validate
- content-review: multi-agent draft/quality/accuracy/edit
- customer-support: tiered triage/response/escalation
- code-review: parallel correctness+security+style analysis
- research: research/fact-check/summarize
- content-pipeline: research → write → edit article creation
- translate-polish: auto-detect language, translate, review
- brainstorm: ideation → evaluation → action plan
- weekly-report: raw notes → organized → polished report
2026-03-22 12:37:04 +09:00

43 lines
2.4 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"]
[[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"]