@diff-review-system/drs 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (287) hide show
  1. package/.opencode/agent/describe/pr-describer.md +221 -0
  2. package/.opencode/agent/review/documentation.md +56 -0
  3. package/.opencode/agent/review/performance.md +32 -130
  4. package/.opencode/agent/review/quality.md +36 -104
  5. package/.opencode/agent/review/security.md +32 -94
  6. package/.opencode/agent/review/style.md +26 -10
  7. package/.opencode/agent/review/unified-reviewer.md +74 -0
  8. package/.opencode/opencode.jsonc +4 -41
  9. package/.opencode/tool/write_json_output.ts +24 -0
  10. package/README.md +215 -82
  11. package/dist/ci/runner.d.ts.map +1 -1
  12. package/dist/ci/runner.js +4 -4
  13. package/dist/ci/runner.js.map +1 -1
  14. package/dist/cli/describe-mr.d.ts +11 -0
  15. package/dist/cli/describe-mr.d.ts.map +1 -0
  16. package/dist/cli/describe-mr.js +104 -0
  17. package/dist/cli/describe-mr.js.map +1 -0
  18. package/dist/cli/describe-pr.d.ts +12 -0
  19. package/dist/cli/describe-pr.d.ts.map +1 -0
  20. package/dist/cli/describe-pr.js +105 -0
  21. package/dist/cli/describe-pr.js.map +1 -0
  22. package/dist/cli/index.js +234 -20
  23. package/dist/cli/index.js.map +1 -1
  24. package/dist/cli/init.d.ts +1 -1
  25. package/dist/cli/init.d.ts.map +1 -1
  26. package/dist/cli/init.js +337 -120
  27. package/dist/cli/init.js.map +1 -1
  28. package/dist/cli/post-comments.d.ts +15 -0
  29. package/dist/cli/post-comments.d.ts.map +1 -0
  30. package/dist/cli/post-comments.js +216 -0
  31. package/dist/cli/post-comments.js.map +1 -0
  32. package/dist/cli/review-local.d.ts +3 -0
  33. package/dist/cli/review-local.d.ts.map +1 -1
  34. package/dist/cli/review-local.js +46 -63
  35. package/dist/cli/review-local.js.map +1 -1
  36. package/dist/cli/review-mr.d.ts +7 -0
  37. package/dist/cli/review-mr.d.ts.map +1 -1
  38. package/dist/cli/review-mr.js +88 -117
  39. package/dist/cli/review-mr.js.map +1 -1
  40. package/dist/cli/review-pr.d.ts +6 -0
  41. package/dist/cli/review-pr.d.ts.map +1 -1
  42. package/dist/cli/review-pr.js +81 -114
  43. package/dist/cli/review-pr.js.map +1 -1
  44. package/dist/cli/show-changes.d.ts +15 -0
  45. package/dist/cli/show-changes.d.ts.map +1 -0
  46. package/dist/cli/show-changes.js +184 -0
  47. package/dist/cli/show-changes.js.map +1 -0
  48. package/dist/github/client.d.ts +199 -4
  49. package/dist/github/client.d.ts.map +1 -1
  50. package/dist/github/client.js +37 -2
  51. package/dist/github/client.js.map +1 -1
  52. package/dist/github/client.test.d.ts +2 -0
  53. package/dist/github/client.test.d.ts.map +1 -0
  54. package/dist/github/client.test.js +206 -0
  55. package/dist/github/client.test.js.map +1 -0
  56. package/dist/github/platform-adapter.d.ts +31 -0
  57. package/dist/github/platform-adapter.d.ts.map +1 -0
  58. package/dist/github/platform-adapter.js +129 -0
  59. package/dist/github/platform-adapter.js.map +1 -0
  60. package/dist/github/platform-adapter.test.d.ts +2 -0
  61. package/dist/github/platform-adapter.test.d.ts.map +1 -0
  62. package/dist/github/platform-adapter.test.js +40 -0
  63. package/dist/github/platform-adapter.test.js.map +1 -0
  64. package/dist/gitlab/client.d.ts +12 -0
  65. package/dist/gitlab/client.d.ts.map +1 -1
  66. package/dist/gitlab/client.js +19 -1
  67. package/dist/gitlab/client.js.map +1 -1
  68. package/dist/gitlab/diff-parser.test.d.ts +2 -0
  69. package/dist/gitlab/diff-parser.test.d.ts.map +1 -0
  70. package/dist/gitlab/diff-parser.test.js +315 -0
  71. package/dist/gitlab/diff-parser.test.js.map +1 -0
  72. package/dist/gitlab/platform-adapter.d.ts +27 -0
  73. package/dist/gitlab/platform-adapter.d.ts.map +1 -0
  74. package/dist/gitlab/platform-adapter.js +121 -0
  75. package/dist/gitlab/platform-adapter.js.map +1 -0
  76. package/dist/gitlab/platform-adapter.test.d.ts +2 -0
  77. package/dist/gitlab/platform-adapter.test.d.ts.map +1 -0
  78. package/dist/gitlab/platform-adapter.test.js +21 -0
  79. package/dist/gitlab/platform-adapter.test.js.map +1 -0
  80. package/dist/index.test.d.ts +2 -0
  81. package/dist/index.test.d.ts.map +1 -0
  82. package/dist/index.test.js +7 -0
  83. package/dist/index.test.js.map +1 -0
  84. package/dist/lib/change-summary.d.ts +8 -0
  85. package/dist/lib/change-summary.d.ts.map +1 -0
  86. package/dist/lib/change-summary.js +2 -0
  87. package/dist/lib/change-summary.js.map +1 -0
  88. package/dist/lib/code-quality-report.d.ts +44 -0
  89. package/dist/lib/code-quality-report.d.ts.map +1 -0
  90. package/dist/lib/code-quality-report.js +62 -0
  91. package/dist/lib/code-quality-report.js.map +1 -0
  92. package/dist/lib/code-quality-report.test.d.ts +2 -0
  93. package/dist/lib/code-quality-report.test.d.ts.map +1 -0
  94. package/dist/lib/code-quality-report.test.js +327 -0
  95. package/dist/lib/code-quality-report.test.js.map +1 -0
  96. package/dist/{gitlab → lib}/comment-formatter.d.ts +6 -3
  97. package/dist/lib/comment-formatter.d.ts.map +1 -0
  98. package/dist/{gitlab → lib}/comment-formatter.js +63 -16
  99. package/dist/lib/comment-formatter.js.map +1 -0
  100. package/dist/lib/comment-formatter.test.d.ts +2 -0
  101. package/dist/lib/comment-formatter.test.d.ts.map +1 -0
  102. package/dist/lib/comment-formatter.test.js +607 -0
  103. package/dist/lib/comment-formatter.test.js.map +1 -0
  104. package/dist/lib/comment-manager.d.ts +61 -0
  105. package/dist/lib/comment-manager.d.ts.map +1 -0
  106. package/dist/lib/comment-manager.js +91 -0
  107. package/dist/lib/comment-manager.js.map +1 -0
  108. package/dist/lib/comment-manager.test.d.ts +2 -0
  109. package/dist/lib/comment-manager.test.d.ts.map +1 -0
  110. package/dist/lib/comment-manager.test.js +618 -0
  111. package/dist/lib/comment-manager.test.js.map +1 -0
  112. package/dist/lib/comment-poster.d.ts +21 -0
  113. package/dist/lib/comment-poster.d.ts.map +1 -0
  114. package/dist/lib/comment-poster.js +96 -0
  115. package/dist/lib/comment-poster.js.map +1 -0
  116. package/dist/lib/comment-poster.test.d.ts +5 -0
  117. package/dist/lib/comment-poster.test.d.ts.map +1 -0
  118. package/dist/lib/comment-poster.test.js +215 -0
  119. package/dist/lib/comment-poster.test.js.map +1 -0
  120. package/dist/lib/config-model-overrides.test.d.ts +12 -0
  121. package/dist/lib/config-model-overrides.test.d.ts.map +1 -0
  122. package/dist/lib/config-model-overrides.test.js +254 -0
  123. package/dist/lib/config-model-overrides.test.js.map +1 -0
  124. package/dist/lib/config.d.ts +93 -8
  125. package/dist/lib/config.d.ts.map +1 -1
  126. package/dist/lib/config.js +178 -25
  127. package/dist/lib/config.js.map +1 -1
  128. package/dist/lib/config.test.d.ts +2 -0
  129. package/dist/lib/config.test.d.ts.map +1 -0
  130. package/dist/lib/config.test.js +36 -0
  131. package/dist/lib/config.test.js.map +1 -0
  132. package/dist/lib/context-compression.d.ts +19 -0
  133. package/dist/lib/context-compression.d.ts.map +1 -0
  134. package/dist/lib/context-compression.js +170 -0
  135. package/dist/lib/context-compression.js.map +1 -0
  136. package/dist/lib/context-compression.test.d.ts +2 -0
  137. package/dist/lib/context-compression.test.d.ts.map +1 -0
  138. package/dist/lib/context-compression.test.js +33 -0
  139. package/dist/lib/context-compression.test.js.map +1 -0
  140. package/dist/lib/context-loader.d.ts +29 -0
  141. package/dist/lib/context-loader.d.ts.map +1 -0
  142. package/dist/lib/context-loader.js +75 -0
  143. package/dist/lib/context-loader.js.map +1 -0
  144. package/dist/lib/context-loader.test.d.ts +2 -0
  145. package/dist/lib/context-loader.test.d.ts.map +1 -0
  146. package/dist/lib/context-loader.test.js +207 -0
  147. package/dist/lib/context-loader.test.js.map +1 -0
  148. package/dist/lib/describe-core.d.ts +9 -0
  149. package/dist/lib/describe-core.d.ts.map +1 -0
  150. package/dist/lib/describe-core.js +71 -0
  151. package/dist/lib/describe-core.js.map +1 -0
  152. package/dist/lib/describe-core.test.d.ts +2 -0
  153. package/dist/lib/describe-core.test.d.ts.map +1 -0
  154. package/dist/lib/describe-core.test.js +208 -0
  155. package/dist/lib/describe-core.test.js.map +1 -0
  156. package/dist/lib/describe-output-path.test.d.ts +2 -0
  157. package/dist/lib/describe-output-path.test.d.ts.map +1 -0
  158. package/dist/lib/describe-output-path.test.js +51 -0
  159. package/dist/lib/describe-output-path.test.js.map +1 -0
  160. package/dist/lib/describe-parser.d.ts +3 -0
  161. package/dist/lib/describe-parser.d.ts.map +1 -0
  162. package/dist/lib/describe-parser.js +163 -0
  163. package/dist/lib/describe-parser.js.map +1 -0
  164. package/dist/lib/describe-parser.test.d.ts +2 -0
  165. package/dist/lib/describe-parser.test.d.ts.map +1 -0
  166. package/dist/lib/describe-parser.test.js +282 -0
  167. package/dist/lib/describe-parser.test.js.map +1 -0
  168. package/dist/lib/description-executor.d.ts +22 -0
  169. package/dist/lib/description-executor.d.ts.map +1 -0
  170. package/dist/lib/description-executor.js +72 -0
  171. package/dist/lib/description-executor.js.map +1 -0
  172. package/dist/lib/description-formatter.d.ts +37 -0
  173. package/dist/lib/description-formatter.d.ts.map +1 -0
  174. package/dist/lib/description-formatter.js +219 -0
  175. package/dist/lib/description-formatter.js.map +1 -0
  176. package/dist/{gitlab → lib}/diff-parser.d.ts +11 -0
  177. package/dist/lib/diff-parser.d.ts.map +1 -0
  178. package/dist/{gitlab → lib}/diff-parser.js +40 -3
  179. package/dist/lib/diff-parser.js.map +1 -0
  180. package/dist/lib/issue-parser.d.ts +29 -0
  181. package/dist/lib/issue-parser.d.ts.map +1 -0
  182. package/dist/lib/issue-parser.js +153 -0
  183. package/dist/lib/issue-parser.js.map +1 -0
  184. package/dist/lib/issue-parser.test.d.ts +2 -0
  185. package/dist/lib/issue-parser.test.d.ts.map +1 -0
  186. package/dist/lib/issue-parser.test.js +281 -0
  187. package/dist/lib/issue-parser.test.js.map +1 -0
  188. package/dist/lib/json-output-schema.d.ts +207 -0
  189. package/dist/lib/json-output-schema.d.ts.map +1 -0
  190. package/dist/lib/json-output-schema.js +124 -0
  191. package/dist/lib/json-output-schema.js.map +1 -0
  192. package/dist/lib/json-output-schema.test.d.ts +2 -0
  193. package/dist/lib/json-output-schema.test.d.ts.map +1 -0
  194. package/dist/lib/json-output-schema.test.js +92 -0
  195. package/dist/lib/json-output-schema.test.js.map +1 -0
  196. package/dist/lib/json-output.d.ts +43 -0
  197. package/dist/lib/json-output.d.ts.map +1 -0
  198. package/dist/lib/json-output.js +34 -0
  199. package/dist/lib/json-output.js.map +1 -0
  200. package/dist/lib/output-paths.d.ts +6 -0
  201. package/dist/lib/output-paths.d.ts.map +1 -0
  202. package/dist/lib/output-paths.js +5 -0
  203. package/dist/lib/output-paths.js.map +1 -0
  204. package/dist/lib/platform-client.d.ts +130 -0
  205. package/dist/lib/platform-client.d.ts.map +1 -0
  206. package/dist/lib/platform-client.js +8 -0
  207. package/dist/lib/platform-client.js.map +1 -0
  208. package/dist/lib/position-validator.d.ts +36 -0
  209. package/dist/lib/position-validator.d.ts.map +1 -0
  210. package/dist/lib/position-validator.js +43 -0
  211. package/dist/lib/position-validator.js.map +1 -0
  212. package/dist/lib/repository-validator.d.ts +52 -0
  213. package/dist/lib/repository-validator.d.ts.map +1 -0
  214. package/dist/lib/repository-validator.js +219 -0
  215. package/dist/lib/repository-validator.js.map +1 -0
  216. package/dist/lib/repository-validator.test.d.ts +5 -0
  217. package/dist/lib/repository-validator.test.d.ts.map +1 -0
  218. package/dist/lib/repository-validator.test.js +341 -0
  219. package/dist/lib/repository-validator.test.js.map +1 -0
  220. package/dist/lib/review-core.d.ts +66 -0
  221. package/dist/lib/review-core.d.ts.map +1 -0
  222. package/dist/lib/review-core.js +449 -0
  223. package/dist/lib/review-core.js.map +1 -0
  224. package/dist/lib/review-core.test.d.ts +2 -0
  225. package/dist/lib/review-core.test.d.ts.map +1 -0
  226. package/dist/lib/review-core.test.js +552 -0
  227. package/dist/lib/review-core.test.js.map +1 -0
  228. package/dist/lib/review-orchestrator.d.ts +77 -0
  229. package/dist/lib/review-orchestrator.d.ts.map +1 -0
  230. package/dist/lib/review-orchestrator.js +124 -0
  231. package/dist/lib/review-orchestrator.js.map +1 -0
  232. package/dist/lib/review-orchestrator.test.d.ts +2 -0
  233. package/dist/lib/review-orchestrator.test.d.ts.map +1 -0
  234. package/dist/lib/review-orchestrator.test.js +413 -0
  235. package/dist/lib/review-orchestrator.test.js.map +1 -0
  236. package/dist/lib/review-output-path.test.d.ts +2 -0
  237. package/dist/lib/review-output-path.test.d.ts.map +1 -0
  238. package/dist/lib/review-output-path.test.js +83 -0
  239. package/dist/lib/review-output-path.test.js.map +1 -0
  240. package/dist/lib/review-parser.d.ts +2 -0
  241. package/dist/lib/review-parser.d.ts.map +1 -0
  242. package/dist/lib/review-parser.js +100 -0
  243. package/dist/lib/review-parser.js.map +1 -0
  244. package/dist/lib/unified-review-executor.d.ts +49 -0
  245. package/dist/lib/unified-review-executor.d.ts.map +1 -0
  246. package/dist/lib/unified-review-executor.js +158 -0
  247. package/dist/lib/unified-review-executor.js.map +1 -0
  248. package/dist/lib/unified-review-executor.test.d.ts +5 -0
  249. package/dist/lib/unified-review-executor.test.d.ts.map +1 -0
  250. package/dist/lib/unified-review-executor.test.js +344 -0
  251. package/dist/lib/unified-review-executor.test.js.map +1 -0
  252. package/dist/lib/write-json-output.d.ts +13 -0
  253. package/dist/lib/write-json-output.d.ts.map +1 -0
  254. package/dist/lib/write-json-output.js +37 -0
  255. package/dist/lib/write-json-output.js.map +1 -0
  256. package/dist/opencode/agent-loader.d.ts +3 -4
  257. package/dist/opencode/agent-loader.d.ts.map +1 -1
  258. package/dist/opencode/agent-loader.js +51 -42
  259. package/dist/opencode/agent-loader.js.map +1 -1
  260. package/dist/opencode/agent-skill-overlay.d.ts +11 -0
  261. package/dist/opencode/agent-skill-overlay.d.ts.map +1 -0
  262. package/dist/opencode/agent-skill-overlay.js +164 -0
  263. package/dist/opencode/agent-skill-overlay.js.map +1 -0
  264. package/dist/opencode/client.d.ts +14 -5
  265. package/dist/opencode/client.d.ts.map +1 -1
  266. package/dist/opencode/client.js +311 -32
  267. package/dist/opencode/client.js.map +1 -1
  268. package/dist/opencode/client.test.d.ts +2 -0
  269. package/dist/opencode/client.test.d.ts.map +1 -0
  270. package/dist/opencode/client.test.js +317 -0
  271. package/dist/opencode/client.test.js.map +1 -0
  272. package/dist/opencode/opencode-paths.d.ts +2 -0
  273. package/dist/opencode/opencode-paths.d.ts.map +1 -0
  274. package/dist/opencode/opencode-paths.js +7 -0
  275. package/dist/opencode/opencode-paths.js.map +1 -0
  276. package/dist/opencode/skill-loader.d.ts +6 -0
  277. package/dist/opencode/skill-loader.d.ts.map +1 -0
  278. package/dist/opencode/skill-loader.js +36 -0
  279. package/dist/opencode/skill-loader.js.map +1 -0
  280. package/package.json +29 -20
  281. package/.opencode/agent/github-reviewer.md +0 -62
  282. package/.opencode/agent/gitlab-reviewer.md +0 -62
  283. package/.opencode/agent/local-reviewer.md +0 -71
  284. package/dist/gitlab/comment-formatter.d.ts.map +0 -1
  285. package/dist/gitlab/comment-formatter.js.map +0 -1
  286. package/dist/gitlab/diff-parser.d.ts.map +0 -1
  287. package/dist/gitlab/diff-parser.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Security vulnerability and OWASP Top 10 specialist
3
3
  color: "#E53E3E"
4
- model: opencode/claude-sonnet-4-5
5
4
  hidden: false
6
5
  tools:
7
6
  Read: true
@@ -9,107 +8,46 @@ tools:
9
8
  Grep: true
10
9
  ---
11
10
 
12
- You are a security expert specializing in vulnerability detection and OWASP Top 10 issues.
11
+ You are an elite security code reviewer with deep expertise in application security, threat modeling, and secure coding practices. Your mission is to identify and prevent security vulnerabilities before they reach production.
13
12
 
14
- ## Focus Areas
13
+ ## Security Vulnerability Assessment
15
14
 
16
- ### 1. Injection Attacks
17
- - SQL injection (parameterized queries)
18
- - NoSQL injection
19
- - Command injection (shell escaping)
20
- - XSS (input sanitization, output encoding)
21
- - LDAP/XML injection
15
+ - Systematically scan for OWASP Top 10 vulnerabilities (injection flaws, broken authentication, sensitive data exposure, XXE, broken access control, security misconfiguration, XSS, insecure deserialization, using components with known vulnerabilities, insufficient logging)
16
+ - Identify potential SQL injection, NoSQL injection, and command injection vulnerabilities
17
+ - Check for cross-site scripting (XSS) vulnerabilities in any user-facing output
18
+ - Look for cross-site request forgery (CSRF) protection gaps
19
+ - Examine cryptographic implementations for weak algorithms or improper key management
20
+ - Identify potential race conditions and time-of-check-time-of-use (TOCTOU) vulnerabilities
22
21
 
23
- ### 2. Authentication & Authorization
24
- - Broken authentication flows
25
- - Missing authorization checks
26
- - Insecure session management
27
- - JWT vulnerabilities
28
- - Privilege escalation
22
+ ## Input Validation and Sanitization
29
23
 
30
- ### 3. Sensitive Data Exposure
31
- - Hardcoded credentials
32
- - Logging sensitive data
33
- - Missing encryption (data at rest/transit)
34
- - Weak cryptography
35
- - Exposed API keys
24
+ - Verify all user inputs are properly validated against expected formats and ranges
25
+ - Ensure input sanitization occurs at appropriate boundaries (client-side validation is supplementary, never primary)
26
+ - Check for proper encoding when outputting user data
27
+ - Validate that file uploads have proper type checking, size limits, and content validation
28
+ - Ensure API parameters are validated for type, format, and business logic constraints
29
+ - Look for potential path traversal vulnerabilities in file operations
36
30
 
37
- ### 4. Security Misconfigurations
38
- - Debug mode in production
39
- - Default credentials
40
- - Unnecessary services enabled
41
- - Missing security headers
42
- - Verbose error messages
31
+ ## Authentication and Authorization Review
43
32
 
44
- ### 5. Other OWASP Top 10
45
- - Broken access control
46
- - Insecure deserialization
47
- - Using components with known vulnerabilities
48
- - Insufficient logging/monitoring
49
- - SSRF (Server-Side Request Forgery)
33
+ - Verify authentication mechanisms use secure, industry-standard approaches
34
+ - Check for proper session management (secure cookies, appropriate timeouts, session invalidation)
35
+ - Ensure passwords are properly hashed using modern algorithms (bcrypt, Argon2, PBKDF2)
36
+ - Validate that authorization checks occur at every protected resource access
37
+ - Look for privilege escalation opportunities
38
+ - Check for insecure direct object references (IDOR)
39
+ - Verify proper implementation of role-based or attribute-based access control
50
40
 
51
- ## Review Format
41
+ ## Analysis Methodology
52
42
 
53
- For each security issue found:
43
+ 1. Identify the security context and attack surface of the code
44
+ 2. Map data flows from untrusted sources to sensitive operations
45
+ 3. Examine each security-critical operation for proper controls
46
+ 4. Consider both common vulnerabilities and context-specific threats
47
+ 5. Evaluate defense-in-depth measures
54
48
 
55
- ```
56
- 🔒 SECURITY - [Vulnerability Type]
57
- File: [path]:[line]
58
- Severity: CRITICAL | HIGH | MEDIUM | LOW
49
+ ## Review Structure Guidance
59
50
 
60
- Problem:
61
- [Clear explanation of the vulnerability]
51
+ Provide findings in order of severity (Critical, High, Medium, Low, Informational). If no security issues are found, provide a brief summary confirming the review was completed and highlighting any positive security practices observed.
62
52
 
63
- Risk:
64
- [Potential impact and attack scenario]
65
-
66
- Fix:
67
- [Secure code example]
68
-
69
- References:
70
- - [OWASP link]
71
- - [CWE link if applicable]
72
- ```
73
-
74
- ## Examples
75
-
76
- ### SQL Injection
77
-
78
- ```typescript
79
- // ❌ VULNERABLE
80
- const query = `SELECT * FROM users WHERE id = ${userId}`
81
-
82
- // ✅ SECURE
83
- const query = 'SELECT * FROM users WHERE id = ?'
84
- const result = await db.query(query, [userId])
85
- ```
86
-
87
- ### XSS Prevention
88
-
89
- ```typescript
90
- // ❌ VULNERABLE
91
- element.innerHTML = userInput
92
-
93
- // ✅ SECURE
94
- element.textContent = userInput
95
- // or use a sanitization library
96
- element.innerHTML = DOMPurify.sanitize(userInput)
97
- ```
98
-
99
- ### Hardcoded Credentials
100
-
101
- ```typescript
102
- // ❌ VULNERABLE
103
- const apiKey = "sk-1234567890abcdef"
104
-
105
- // ✅ SECURE
106
- const apiKey = process.env.API_KEY
107
- ```
108
-
109
- Focus on exploitable vulnerabilities. Prioritize issues that could lead to:
110
- - Data breaches
111
- - Unauthorized access
112
- - Code execution
113
- - Denial of service
114
-
115
- Be precise with line numbers and provide actionable fixes.
53
+ Always consider the principle of least privilege, defense in depth, and fail securely. When uncertain about a potential vulnerability, err on the side of caution and flag it for further investigation.
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Code style, formatting, and documentation specialist
3
3
  color: "#805AD5"
4
- model: opencode/claude-haiku-4-5
5
4
  hidden: false
6
5
  tools:
7
6
  Read: true
@@ -30,6 +29,10 @@ You are a code style reviewer ensuring consistency and documentation quality.
30
29
  - Outdated comments
31
30
  - JSDoc/TSDoc completeness
32
31
  - README updates needed
32
+ - New CLI flags or config options documented in README
33
+ - Command examples formatted consistently and kept up-to-date
34
+ - Markdown formatting issues (headings, code fences, lists, links)
35
+ - Consistent terminology for key concepts and feature names
33
36
 
34
37
  ### 4. Type Safety (TypeScript)
35
38
  - Missing type annotations
@@ -45,17 +48,30 @@ You are a code style reviewer ensuring consistency and documentation quality.
45
48
 
46
49
  ## Review Format
47
50
 
51
+ **IMPORTANT**: You MUST output your findings in structured JSON format for automated processing.
52
+
53
+ After your analysis, provide a JSON code block with all issues found:
54
+
55
+ ```json
56
+ {
57
+ "issues": [
58
+ {
59
+ "category": "STYLE",
60
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
61
+ "title": "Brief title of the style issue",
62
+ "file": "path/to/file.ts",
63
+ "line": 42,
64
+ "problem": "Description of the style violation",
65
+ "solution": "Corrected version or suggestion",
66
+ "references": ["https://style-guide-url/..."],
67
+ "agent": "style"
68
+ }
69
+ ]
70
+ }
48
71
  ```
49
- ✨ STYLE - [Issue Type]
50
- File: [path]:[line]
51
- Priority: BLOCKING | ADVISORY
52
-
53
- Issue:
54
- [Style violation]
55
72
 
56
- Suggestion:
57
- [Corrected version]
58
- ```
73
+ **Required fields**: category, severity, title, file, problem, solution
74
+ **Optional fields**: line (line number), references (array of URLs)
59
75
 
60
76
  ## Examples
61
77
 
@@ -0,0 +1,74 @@
1
+ ---
2
+ description: Unified review agent covering security, quality, style, performance, and documentation
3
+ color: "#6B46C1"
4
+ hidden: false
5
+ tools:
6
+ Read: true
7
+ Glob: true
8
+ Grep: true
9
+ ---
10
+
11
+ You are a unified code review agent responsible for reviewing changes across **security**, **quality**, **style**, **performance**, and **documentation** in a single pass. Focus on issues introduced in the diff and keep feedback concise and actionable.
12
+
13
+ ## Review Priorities
14
+
15
+ - **Security**: injection risks, auth/authorization flaws, secrets exposure, unsafe deserialization.
16
+ - **Quality**: correctness, error handling, edge cases, maintainability.
17
+ - **Performance**: inefficient loops, unnecessary I/O, excessive allocations.
18
+ - **Style**: naming, consistency, readability, TypeScript best practices.
19
+ - **Documentation**: missing or inaccurate comments, README/API doc drift.
20
+
21
+ ## Output Requirements
22
+
23
+ - You MUST call the `write_json_output` tool with:
24
+ - `outputType`: `"review_output"`
25
+ - `payload`: the JSON object described below
26
+ - After calling the tool, return **only** the JSON pointer returned by the tool
27
+ (e.g. `{"outputType":"review_output","outputPath":".drs/review-output.json"}`)
28
+ - Do **not** return raw JSON directly.
29
+ - Do **not** include markdown, code fences, or extra text.
30
+ - Follow this exact schema:
31
+
32
+ ```json
33
+ {
34
+ "timestamp": "ISO-8601 timestamp or descriptive string",
35
+ "summary": {
36
+ "filesReviewed": 0,
37
+ "issuesFound": 0,
38
+ "bySeverity": {
39
+ "CRITICAL": 0,
40
+ "HIGH": 0,
41
+ "MEDIUM": 0,
42
+ "LOW": 0
43
+ },
44
+ "byCategory": {
45
+ "SECURITY": 0,
46
+ "QUALITY": 0,
47
+ "STYLE": 0,
48
+ "PERFORMANCE": 0,
49
+ "DOCUMENTATION": 0
50
+ }
51
+ },
52
+ "issues": [
53
+ {
54
+ "category": "SECURITY" | "QUALITY" | "STYLE" | "PERFORMANCE" | "DOCUMENTATION",
55
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
56
+ "title": "Brief title",
57
+ "file": "path/to/file.ts",
58
+ "line": 42,
59
+ "problem": "Description of the problem",
60
+ "solution": "Concrete fix or mitigation",
61
+ "references": ["https://link1", "https://link2"],
62
+ "agent": "unified"
63
+ }
64
+ ]
65
+ }
66
+ ```
67
+
68
+ If there are no issues, set `issues` to `[]` and keep summary counts at `0`.
69
+
70
+ ### Important Constraints
71
+ - **Only report issues on changed or added lines** (lines starting with `+` in the diff).
72
+ - Prioritize **additions over deletions**; deletions are context only.
73
+ - Be specific: include file names and line numbers when available.
74
+ - Keep severities calibrated (use HIGH/CRITICAL sparingly).
@@ -1,52 +1,15 @@
1
1
  {
2
2
  "$schema": "https://opencode.ai/config.json",
3
3
 
4
- // Global instructions for DRS review behavior
5
- "instructions": [
6
- ".gitlab-review.md"
7
- ],
8
-
9
- // LLM provider configuration
10
- "provider": {
11
- "opencode": {
12
- "options": {}
13
- }
14
- },
15
-
16
- // Custom tools configuration
4
+ // Tools available to DRS review agents
5
+ // Note: Agent model configuration is done via .drs/drs.config.yaml
17
6
  "tools": {
18
- "gitlab-api": true,
19
- "github-api": true,
20
- "Bash": true,
21
7
  "Read": true,
22
8
  "Glob": true,
23
9
  "Grep": true,
10
+ "Bash": true,
11
+ "write_json_output": true,
24
12
  "Write": false,
25
13
  "Edit": false
26
- },
27
-
28
- // Agent model configuration
29
- "agent": {
30
- "gitlab-reviewer": {
31
- "model": "opencode/claude-opus-4-5"
32
- },
33
- "github-reviewer": {
34
- "model": "opencode/claude-opus-4-5"
35
- },
36
- "local-reviewer": {
37
- "model": "opencode/claude-sonnet-4-5"
38
- },
39
- "review/security": {
40
- "model": "opencode/claude-sonnet-4-5"
41
- },
42
- "review/quality": {
43
- "model": "opencode/claude-sonnet-4-5"
44
- },
45
- "review/style": {
46
- "model": "opencode/claude-haiku-4-5"
47
- },
48
- "review/performance": {
49
- "model": "opencode/claude-sonnet-4-5"
50
- }
51
14
  }
52
15
  }
@@ -0,0 +1,24 @@
1
+ import { tool } from '@opencode-ai/plugin';
2
+ import { writeJsonOutput } from '../../src/lib/write-json-output.js';
3
+
4
+ export default tool({
5
+ description: 'Write validated JSON output for DRS agents.',
6
+ args: {
7
+ outputType: tool.schema
8
+ .enum(['describe_output', 'review_output'])
9
+ .describe('The DRS output type to validate and write'),
10
+ payload: tool.schema.any().describe('JSON value or JSON string to write'),
11
+ pretty: tool.schema.boolean().optional().describe('Pretty-print JSON output'),
12
+ indent: tool.schema
13
+ .number()
14
+ .int()
15
+ .min(2)
16
+ .max(8)
17
+ .optional()
18
+ .describe('Indent size when pretty-printing'),
19
+ },
20
+ async execute({ outputType, payload, pretty, indent }) {
21
+ const pointer = await writeJsonOutput({ outputType, payload, pretty, indent });
22
+ return JSON.stringify(pointer);
23
+ },
24
+ });