@diff-review-system/drs 1.0.0 → 1.1.2

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 (135) hide show
  1. package/.opencode/agent/github-reviewer.md +22 -7
  2. package/.opencode/agent/gitlab-reviewer.md +22 -7
  3. package/.opencode/agent/local-reviewer.md +21 -29
  4. package/.opencode/agent/review/performance.md +22 -13
  5. package/.opencode/agent/review/quality.md +22 -13
  6. package/.opencode/agent/review/security.md +22 -19
  7. package/.opencode/agent/review/style.md +22 -10
  8. package/.opencode/opencode.jsonc +7 -19
  9. package/README.md +175 -69
  10. package/dist/ci/runner.d.ts.map +1 -1
  11. package/dist/ci/runner.js +2 -4
  12. package/dist/ci/runner.js.map +1 -1
  13. package/dist/cli/index.js +14 -4
  14. package/dist/cli/index.js.map +1 -1
  15. package/dist/cli/init.d.ts.map +1 -1
  16. package/dist/cli/init.js +112 -23
  17. package/dist/cli/init.js.map +1 -1
  18. package/dist/cli/review-local.d.ts.map +1 -1
  19. package/dist/cli/review-local.js +27 -70
  20. package/dist/cli/review-local.js.map +1 -1
  21. package/dist/cli/review-mr.d.ts +1 -0
  22. package/dist/cli/review-mr.d.ts.map +1 -1
  23. package/dist/cli/review-mr.js +34 -119
  24. package/dist/cli/review-mr.js.map +1 -1
  25. package/dist/cli/review-pr.d.ts.map +1 -1
  26. package/dist/cli/review-pr.js +74 -114
  27. package/dist/cli/review-pr.js.map +1 -1
  28. package/dist/github/client.d.ts +199 -4
  29. package/dist/github/client.d.ts.map +1 -1
  30. package/dist/github/client.js +37 -2
  31. package/dist/github/client.js.map +1 -1
  32. package/dist/github/client.test.d.ts +2 -0
  33. package/dist/github/client.test.d.ts.map +1 -0
  34. package/dist/github/client.test.js +206 -0
  35. package/dist/github/client.test.js.map +1 -0
  36. package/dist/github/platform-adapter.d.ts +31 -0
  37. package/dist/github/platform-adapter.d.ts.map +1 -0
  38. package/dist/github/platform-adapter.js +127 -0
  39. package/dist/github/platform-adapter.js.map +1 -0
  40. package/dist/github/platform-adapter.test.d.ts +2 -0
  41. package/dist/github/platform-adapter.test.d.ts.map +1 -0
  42. package/dist/github/platform-adapter.test.js +40 -0
  43. package/dist/github/platform-adapter.test.js.map +1 -0
  44. package/dist/gitlab/client.d.ts +12 -0
  45. package/dist/gitlab/client.d.ts.map +1 -1
  46. package/dist/gitlab/client.js +18 -0
  47. package/dist/gitlab/client.js.map +1 -1
  48. package/dist/gitlab/diff-parser.test.d.ts +2 -0
  49. package/dist/gitlab/diff-parser.test.d.ts.map +1 -0
  50. package/dist/gitlab/diff-parser.test.js +315 -0
  51. package/dist/gitlab/diff-parser.test.js.map +1 -0
  52. package/dist/gitlab/platform-adapter.d.ts +27 -0
  53. package/dist/gitlab/platform-adapter.d.ts.map +1 -0
  54. package/dist/gitlab/platform-adapter.js +120 -0
  55. package/dist/gitlab/platform-adapter.js.map +1 -0
  56. package/dist/gitlab/platform-adapter.test.d.ts +2 -0
  57. package/dist/gitlab/platform-adapter.test.d.ts.map +1 -0
  58. package/dist/gitlab/platform-adapter.test.js +21 -0
  59. package/dist/gitlab/platform-adapter.test.js.map +1 -0
  60. package/dist/index.test.d.ts +2 -0
  61. package/dist/index.test.d.ts.map +1 -0
  62. package/dist/index.test.js +7 -0
  63. package/dist/index.test.js.map +1 -0
  64. package/dist/lib/code-quality-report.d.ts +44 -0
  65. package/dist/lib/code-quality-report.d.ts.map +1 -0
  66. package/dist/lib/code-quality-report.js +62 -0
  67. package/dist/lib/code-quality-report.js.map +1 -0
  68. package/dist/lib/code-quality-report.test.d.ts +2 -0
  69. package/dist/lib/code-quality-report.test.d.ts.map +1 -0
  70. package/dist/lib/code-quality-report.test.js +327 -0
  71. package/dist/lib/code-quality-report.test.js.map +1 -0
  72. package/dist/{gitlab → lib}/comment-formatter.d.ts +4 -2
  73. package/dist/lib/comment-formatter.d.ts.map +1 -0
  74. package/dist/{gitlab → lib}/comment-formatter.js +48 -15
  75. package/dist/lib/comment-formatter.js.map +1 -0
  76. package/dist/lib/comment-manager.d.ts +61 -0
  77. package/dist/lib/comment-manager.d.ts.map +1 -0
  78. package/dist/lib/comment-manager.js +91 -0
  79. package/dist/lib/comment-manager.js.map +1 -0
  80. package/dist/lib/config-model-overrides.test.d.ts +12 -0
  81. package/dist/lib/config-model-overrides.test.d.ts.map +1 -0
  82. package/dist/lib/config-model-overrides.test.js +224 -0
  83. package/dist/lib/config-model-overrides.test.js.map +1 -0
  84. package/dist/lib/config.d.ts +30 -1
  85. package/dist/lib/config.d.ts.map +1 -1
  86. package/dist/lib/config.js +70 -11
  87. package/dist/lib/config.js.map +1 -1
  88. package/dist/lib/config.test.d.ts +2 -0
  89. package/dist/lib/config.test.d.ts.map +1 -0
  90. package/dist/lib/config.test.js +28 -0
  91. package/dist/lib/config.test.js.map +1 -0
  92. package/dist/lib/context-loader.d.ts +29 -0
  93. package/dist/lib/context-loader.d.ts.map +1 -0
  94. package/dist/lib/context-loader.js +68 -0
  95. package/dist/lib/context-loader.js.map +1 -0
  96. package/dist/lib/diff-parser.d.ts.map +1 -0
  97. package/dist/{gitlab → lib}/diff-parser.js +3 -3
  98. package/dist/lib/diff-parser.js.map +1 -0
  99. package/dist/lib/issue-parser.d.ts +29 -0
  100. package/dist/lib/issue-parser.d.ts.map +1 -0
  101. package/dist/lib/issue-parser.js +151 -0
  102. package/dist/lib/issue-parser.js.map +1 -0
  103. package/dist/lib/issue-parser.test.d.ts +2 -0
  104. package/dist/lib/issue-parser.test.d.ts.map +1 -0
  105. package/dist/lib/issue-parser.test.js +281 -0
  106. package/dist/lib/issue-parser.test.js.map +1 -0
  107. package/dist/lib/platform-client.d.ts +130 -0
  108. package/dist/lib/platform-client.d.ts.map +1 -0
  109. package/dist/lib/platform-client.js +8 -0
  110. package/dist/lib/platform-client.js.map +1 -0
  111. package/dist/lib/position-validator.d.ts +36 -0
  112. package/dist/lib/position-validator.d.ts.map +1 -0
  113. package/dist/lib/position-validator.js +43 -0
  114. package/dist/lib/position-validator.js.map +1 -0
  115. package/dist/lib/review-orchestrator.d.ts +60 -0
  116. package/dist/lib/review-orchestrator.d.ts.map +1 -0
  117. package/dist/lib/review-orchestrator.js +183 -0
  118. package/dist/lib/review-orchestrator.js.map +1 -0
  119. package/dist/lib/unified-review-executor.d.ts +32 -0
  120. package/dist/lib/unified-review-executor.d.ts.map +1 -0
  121. package/dist/lib/unified-review-executor.js +228 -0
  122. package/dist/lib/unified-review-executor.js.map +1 -0
  123. package/dist/opencode/agent-loader.d.ts.map +1 -1
  124. package/dist/opencode/agent-loader.js +5 -10
  125. package/dist/opencode/agent-loader.js.map +1 -1
  126. package/dist/opencode/client.d.ts +3 -2
  127. package/dist/opencode/client.d.ts.map +1 -1
  128. package/dist/opencode/client.js +141 -28
  129. package/dist/opencode/client.js.map +1 -1
  130. package/package.json +28 -19
  131. package/dist/gitlab/comment-formatter.d.ts.map +0 -1
  132. package/dist/gitlab/comment-formatter.js.map +0 -1
  133. package/dist/gitlab/diff-parser.d.ts.map +0 -1
  134. package/dist/gitlab/diff-parser.js.map +0 -1
  135. /package/dist/{gitlab → lib}/diff-parser.d.ts +0 -0
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Main GitHub PR review orchestrator
3
3
  color: "#24292e"
4
- model: opencode/claude-opus-4-5
5
4
  tools:
6
5
  Read: true
7
6
  Glob: true
@@ -41,12 +40,28 @@ Use the Task tool to invoke these specialized review agents:
41
40
 
42
41
  ## Output Format
43
42
 
44
- Post findings as GitHub PR review comments with:
45
- - File path and line number references
46
- - Issue severity (CRITICAL, HIGH, MEDIUM, LOW)
47
- - Clear explanation of the problem
48
- - Suggested fix with code example
49
- - References to documentation when applicable
43
+ **IMPORTANT**: Specialized agents will output JSON-formatted findings. You MUST preserve and pass through their JSON output exactly as received.
44
+
45
+ The specialized agents output findings in this JSON format:
46
+ ```json
47
+ {
48
+ "issues": [
49
+ {
50
+ "category": "SECURITY" | "QUALITY" | "STYLE" | "PERFORMANCE",
51
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
52
+ "title": "Issue title",
53
+ "file": "path/to/file.ts",
54
+ "line": 42,
55
+ "problem": "Description",
56
+ "solution": "Fix description",
57
+ "references": ["https://..."],
58
+ "agent": "security"
59
+ }
60
+ ]
61
+ }
62
+ ```
63
+
64
+ When you receive JSON output from specialized agents, include it in your response so it can be parsed for posting inline comments on GitHub PR.
50
65
 
51
66
  ## Example Agent Invocation
52
67
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Main GitLab MR review orchestrator
3
3
  color: "#FC6D26"
4
- model: opencode/claude-opus-4-5
5
4
  tools:
6
5
  Read: true
7
6
  Glob: true
@@ -41,12 +40,28 @@ Use the Task tool to invoke these specialized review agents:
41
40
 
42
41
  ## Output Format
43
42
 
44
- Post findings as GitLab MR discussion threads with:
45
- - File path and line number references
46
- - Issue severity (CRITICAL, HIGH, MEDIUM, LOW)
47
- - Clear explanation of the problem
48
- - Suggested fix with code example
49
- - References to documentation when applicable
43
+ **IMPORTANT**: Specialized agents will output JSON-formatted findings. You MUST preserve and pass through their JSON output exactly as received.
44
+
45
+ The specialized agents output findings in this JSON format:
46
+ ```json
47
+ {
48
+ "issues": [
49
+ {
50
+ "category": "SECURITY" | "QUALITY" | "STYLE" | "PERFORMANCE",
51
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
52
+ "title": "Issue title",
53
+ "file": "path/to/file.ts",
54
+ "line": 42,
55
+ "problem": "Description",
56
+ "solution": "Fix description",
57
+ "references": ["https://..."],
58
+ "agent": "security"
59
+ }
60
+ ]
61
+ }
62
+ ```
63
+
64
+ When you receive JSON output from specialized agents, include it in your response so it can be parsed for posting inline comments on GitLab MR discussion threads.
50
65
 
51
66
  ## Example Agent Invocation
52
67
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Local git diff reviewer for pre-push analysis
3
3
  color: "#38A169"
4
- model: opencode/claude-sonnet-4-5
5
4
  tools:
6
5
  Read: true
7
6
  Glob: true
@@ -38,34 +37,27 @@ Use the Task tool to invoke these agents based on the changed files:
38
37
 
39
38
  ## Output Format
40
39
 
41
- Terminal output with color coding:
42
-
43
- ```
44
- 🔍 Local Diff Review
45
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
46
-
47
- 📊 Summary
48
- Files reviewed: X
49
- Issues found: Y
50
- 🔴 Critical: N
51
- 🟡 High: N
52
- 🟠 Medium: N
53
- ⚪ Low: N
54
-
55
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
56
- [Severity] [Type]: [Issue Title]
57
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
58
- 📁 [file]:[line]
59
-
60
- [Detailed explanation]
61
-
62
- ✅ Fix: [Suggested solution]
63
-
64
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
-
66
- ✅ Recommendation: Fix critical issues before pushing
40
+ **IMPORTANT**: Specialized agents will output JSON-formatted findings. You MUST preserve and pass through their JSON output exactly as received.
41
+
42
+ The specialized agents output findings in this JSON format:
43
+ ```json
44
+ {
45
+ "issues": [
46
+ {
47
+ "category": "SECURITY" | "QUALITY" | "STYLE" | "PERFORMANCE",
48
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
49
+ "title": "Issue title",
50
+ "file": "path/to/file.ts",
51
+ "line": 42,
52
+ "problem": "Description",
53
+ "solution": "Fix description",
54
+ "references": ["https://..."],
55
+ "agent": "security"
56
+ }
57
+ ]
58
+ }
67
59
  ```
68
60
 
69
- Use colored output for terminal visibility. Be concise but actionable.
61
+ When you receive JSON output from specialized agents, include it in your response so it can be parsed and displayed in the terminal with color coding.
70
62
 
71
- Prioritize critical security issues and blocking quality problems.
63
+ Be concise but actionable. Prioritize critical security issues and blocking quality problems.
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Performance and optimization expert
3
3
  color: "#DD6B20"
4
- model: opencode/claude-sonnet-4-5
5
4
  hidden: false
6
5
  tools:
7
6
  Read: true
@@ -50,20 +49,30 @@ You are a performance engineer identifying optimization opportunities.
50
49
 
51
50
  ## Review Format
52
51
 
52
+ **IMPORTANT**: You MUST output your findings in structured JSON format for automated processing.
53
+
54
+ After your analysis, provide a JSON code block with all issues found:
55
+
56
+ ```json
57
+ {
58
+ "issues": [
59
+ {
60
+ "category": "PERFORMANCE",
61
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
62
+ "title": "Brief title of the performance issue",
63
+ "file": "path/to/file.ts",
64
+ "line": 42,
65
+ "problem": "Description of the performance problem and estimated impact",
66
+ "solution": "Improved approach with code example",
67
+ "references": ["https://web.dev/...", "https://optimization-guide/..."],
68
+ "agent": "performance"
69
+ }
70
+ ]
71
+ }
53
72
  ```
54
- ⚡ PERFORMANCE - [Issue Type]
55
- File: [path]:[line]
56
- Impact: HIGH | MEDIUM | LOW
57
-
58
- Issue:
59
- [Performance problem]
60
73
 
61
- Current Cost:
62
- [Estimated complexity or impact]
63
-
64
- Optimization:
65
- [Improved approach with code example]
66
- ```
74
+ **Required fields**: category, severity, title, file, problem, solution
75
+ **Optional fields**: line (line number), references (array of URLs)
67
76
 
68
77
  ## Examples
69
78
 
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  description: Code quality, patterns, and maintainability expert
3
3
  color: "#3182CE"
4
- model: opencode/claude-sonnet-4-5
5
4
  hidden: false
6
5
  tools:
7
6
  Read: true
@@ -50,20 +49,30 @@ You are a senior software engineer reviewing code quality and maintainability.
50
49
 
51
50
  ## Review Format
52
51
 
52
+ **IMPORTANT**: You MUST output your findings in structured JSON format for automated processing.
53
+
54
+ After your analysis, provide a JSON code block with all issues found:
55
+
56
+ ```json
57
+ {
58
+ "issues": [
59
+ {
60
+ "category": "QUALITY",
61
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
62
+ "title": "Brief title of the issue",
63
+ "file": "path/to/file.ts",
64
+ "line": 42,
65
+ "problem": "Explanation of the issue and why it matters for maintainability",
66
+ "solution": "Better approach with code example",
67
+ "references": ["https://refactoring.guru/...", "https://martinfowler.com/..."],
68
+ "agent": "quality"
69
+ }
70
+ ]
71
+ }
53
72
  ```
54
- 📊 QUALITY - [Issue Type]
55
- File: [path]:[line]
56
- Importance: HIGH | MEDIUM | LOW
57
-
58
- Problem:
59
- [Explanation of the issue]
60
73
 
61
- Impact:
62
- [Why this matters for maintainability]
63
-
64
- Suggestion:
65
- [Better approach with code example]
66
- ```
74
+ **Required fields**: category, severity, title, file, problem, solution
75
+ **Optional fields**: line (line number), references (array of URLs)
67
76
 
68
77
  ## Examples
69
78
 
@@ -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
@@ -50,26 +49,30 @@ You are a security expert specializing in vulnerability detection and OWASP Top
50
49
 
51
50
  ## Review Format
52
51
 
53
- For each security issue found:
54
-
52
+ **IMPORTANT**: You MUST output your findings in structured JSON format for automated processing.
53
+
54
+ After your analysis, provide a JSON code block with all issues found:
55
+
56
+ ```json
57
+ {
58
+ "issues": [
59
+ {
60
+ "category": "SECURITY",
61
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
62
+ "title": "Brief title of the vulnerability",
63
+ "file": "path/to/file.ts",
64
+ "line": 42,
65
+ "problem": "Clear explanation of the vulnerability and potential impact",
66
+ "solution": "Secure code example or fix description",
67
+ "references": ["https://owasp.org/...", "https://cwe.mitre.org/..."],
68
+ "agent": "security"
69
+ }
70
+ ]
71
+ }
55
72
  ```
56
- 🔒 SECURITY - [Vulnerability Type]
57
- File: [path]:[line]
58
- Severity: CRITICAL | HIGH | MEDIUM | LOW
59
-
60
- Problem:
61
- [Clear explanation of the vulnerability]
62
-
63
- Risk:
64
- [Potential impact and attack scenario]
65
73
 
66
- Fix:
67
- [Secure code example]
68
-
69
- References:
70
- - [OWASP link]
71
- - [CWE link if applicable]
72
- ```
74
+ **Required fields**: category, severity, title, file, problem, solution
75
+ **Optional fields**: line (line number), references (array of URLs)
73
76
 
74
77
  ## Examples
75
78
 
@@ -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
@@ -45,17 +44,30 @@ You are a code style reviewer ensuring consistency and documentation quality.
45
44
 
46
45
  ## Review Format
47
46
 
47
+ **IMPORTANT**: You MUST output your findings in structured JSON format for automated processing.
48
+
49
+ After your analysis, provide a JSON code block with all issues found:
50
+
51
+ ```json
52
+ {
53
+ "issues": [
54
+ {
55
+ "category": "STYLE",
56
+ "severity": "CRITICAL" | "HIGH" | "MEDIUM" | "LOW",
57
+ "title": "Brief title of the style issue",
58
+ "file": "path/to/file.ts",
59
+ "line": 42,
60
+ "problem": "Description of the style violation",
61
+ "solution": "Corrected version or suggestion",
62
+ "references": ["https://style-guide-url/..."],
63
+ "agent": "style"
64
+ }
65
+ ]
66
+ }
48
67
  ```
49
- ✨ STYLE - [Issue Type]
50
- File: [path]:[line]
51
- Priority: BLOCKING | ADVISORY
52
-
53
- Issue:
54
- [Style violation]
55
68
 
56
- Suggestion:
57
- [Corrected version]
58
- ```
69
+ **Required fields**: category, severity, title, file, problem, solution
70
+ **Optional fields**: line (line number), references (array of URLs)
59
71
 
60
72
  ## Examples
61
73
 
@@ -1,18 +1,6 @@
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
4
  // Custom tools configuration
17
5
  "tools": {
18
6
  "gitlab-api": true,
@@ -28,25 +16,25 @@
28
16
  // Agent model configuration
29
17
  "agent": {
30
18
  "gitlab-reviewer": {
31
- "model": "opencode/claude-opus-4-5"
19
+ "model": "opencode/glm-4.7-free"
32
20
  },
33
21
  "github-reviewer": {
34
- "model": "opencode/claude-opus-4-5"
22
+ "model": "opencode/glm-4.7-free"
35
23
  },
36
24
  "local-reviewer": {
37
- "model": "opencode/claude-sonnet-4-5"
25
+ "model": "opencode/glm-4.7-free"
38
26
  },
39
27
  "review/security": {
40
- "model": "opencode/claude-sonnet-4-5"
28
+ "model": "opencode/glm-4.7-free"
41
29
  },
42
30
  "review/quality": {
43
- "model": "opencode/claude-sonnet-4-5"
31
+ "model": "opencode/glm-4.7-free"
44
32
  },
45
33
  "review/style": {
46
- "model": "opencode/claude-haiku-4-5"
34
+ "model": "opencode/glm-4.7-free"
47
35
  },
48
36
  "review/performance": {
49
- "model": "opencode/claude-sonnet-4-5"
37
+ "model": "opencode/glm-4.7-free"
50
38
  }
51
39
  }
52
40
  }