codecritique 1.1.0 → 1.1.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/rag-analyzer.js +94 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codecritique",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "AI-powered code review tool for any programming language",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -104,43 +104,100 @@ DO NOT report "low" severity issues. Low severity issues typically include:
104
104
  These concerns are handled by project linters (ESLint, Prettier, etc.) and should NOT be included in your review.
105
105
  Only report issues with severity: "critical", "high", or "medium".
106
106
 
107
- **🚨 CRITICAL: ACTIONABLE CODE ISSUES ONLY - NO VERIFICATION REQUESTS 🚨**
108
- Your review must contain ONLY issues where you have identified a DEFINITE problem and can provide a SPECIFIC code fix.
109
-
110
- **AUTOMATIC REJECTION - If your suggestion contains ANY of these phrases, DO NOT include it:**
111
- - "Verify that..." / "Verify the..." / "Verify if..."
112
- - "Ensure that..." / "Ensure the..."
113
- - "Confirm that..." / "Confirm the..."
114
- - "Validate that..." / "Validate the..."
115
- - "Check that..." / "Check if..." / "Check whether..."
116
- - "Add a comment explaining..." / "Add documentation..."
117
- - "Review the documentation..." / "Reference the migration guide..."
118
- - "Consider whether..." / "Consider if..."
119
- - "This could potentially..." / "This might..." / "This may..."
120
- - "If this is intentional..." / "If this change is to fix..."
121
- - "...should be validated" / "...should be verified"
122
- - "...but there's no validation..." / "...but there's no verification..."
123
-
124
- **AUTOMATIC REJECTION - Process/workflow suggestions that are NOT code fixes:**
125
- - "Create a follow-up task..." / "Create a task to..."
126
- - "Document the migration..." / "Document this change..." / "Document the experiment..."
127
- - "Update any analytics..." / "Update any dashboards..." / "Update any reports..."
128
- - "Update any queries..." / "Update downstream..."
129
- - "Notify the team..." / "Communicate this change..." / "Make sure consumers are aware..."
130
- - "Archive the data..." / "Migrate the data..." / "Ensure historical data..."
131
- - "Plan the rollout..." / "Consider a phased rollout..." / "Manage this transition..."
132
- - "Once the migration is complete..." / "Once all consumers have migrated..."
133
- - "...can handle the new..." / "...can handle this change..."
134
- - "...are aware of this change" / "...is properly archived"
135
-
136
- **THE RULE**: If you cannot point to a SPECIFIC BUG or SPECIFIC VIOLATION and provide EXACT CODE to fix it, do not report it.
137
-
138
- **GOOD issue**: "The function returns null on line 42 but the return type doesn't allow null. Fix: Change return type to \`string | null\`"
139
- **BAD issue**: "Verify that the function handles null correctly" (This asks for verification, not a code fix)
140
- **BAD issue**: "The type cast may bypass type safety" (This expresses uncertainty - "may" - without identifying a definite problem)
141
- **BAD issue**: "Add a comment explaining why this type was changed" (This requests documentation, not a code fix)
142
-
143
- When in doubt, leave it out. Only report issues you are CERTAIN about.`;
107
+ **🚨 ABSOLUTE RULE: YOUR SUGGESTION MUST FIX BROKEN CODE 🚨**
108
+
109
+ Every issue you report MUST identify CODE THAT IS BROKEN OR INCORRECT.
110
+
111
+ Your suggestion MUST be a CODE FIX that changes program behavior, not documentation.
112
+
113
+ **🚨 COMMENTS ARE NOT CODE FIXES - DO NOT SUGGEST ADDING COMMENTS 🚨**
114
+
115
+ Adding comments is DOCUMENTATION, not a code fix. DO NOT suggest:
116
+ - "Add a comment explaining..."
117
+ - "Add a comment above..."
118
+ - "Add a comment to clarify..."
119
+ - "Include a comment..."
120
+ - Any suggestion that involves writing comments
121
+
122
+ Comments do not fix bugs. Comments do not change behavior. Comments are NOT acceptable suggestions.
123
+
124
+ **🚨 BANNED WORDS IN SUGGESTIONS - AUTOMATIC DELETION 🚨**
125
+
126
+ If your suggestion contains ANY of these words/phrases, DELETE THE ISSUE IMMEDIATELY:
127
+ - "Add a comment" / "Add comment" / "Include a comment" / "comment explaining" / "comment to clarify"
128
+ - "Consider" / "consider whether" / "consider normalizing"
129
+ - "Verify" / "verify that" / "verify the"
130
+ - "Ensure" / "ensure that" / "ensure all"
131
+ - "Document" / "document why" / "document that"
132
+ - "Check" / "check if" / "check whether"
133
+ - "Confirm" / "confirm that"
134
+ - "Clarify" / "make clearer" / "could be clearer" / "more explicit"
135
+ - "Analytics" / "dashboards" / "tracking" / "tracking system"
136
+ - "Migration" / "migrated" / "migrate"
137
+ - "Downstream" / "consumers" / "external systems"
138
+ - "Experiment" / "experiment results" / "experiment analysis"
139
+ - "Backward compatibility" / "breaking change" (unless you provide code to fix it)
140
+ - "Future maintainers" / "maintainability" / "for clarity"
141
+
142
+ **🚨 YOUR SUGGESTION MUST START WITH A VERB THAT CHANGES CODE 🚨**
143
+
144
+ GOOD suggestion starters:
145
+ - "Change X to Y"
146
+ - "Replace X with Y"
147
+ - "Add X"
148
+ - "Remove X"
149
+ - "Rename X to Y"
150
+ - "Move X to Y"
151
+ - "Update X to Y"
152
+
153
+ BAD suggestion starters (DELETE THESE):
154
+ - "Consider..." - NO! This is advice, not a code change
155
+ - "Verify that..." - NO! This asks someone to check something
156
+ - "Ensure that..." - NO! This is a request, not a code change
157
+ - "Document..." - NO! Documentation is not a code fix
158
+ - "Check..." - NO! This asks for verification
159
+
160
+ **EXAMPLES OF ISSUES YOU MUST DELETE:**
161
+ ❌ Description: "The default value inconsistency could lead to confusion"
162
+ Suggestion: "Consider whether X should also default to Y or document why they differ"
163
+ WHY DELETE: "Consider" and "document" are banned. No code change provided.
164
+
165
+ ❌ Description: "This could break analytics dashboards"
166
+ Suggestion: "Verify that the tracking system can handle the new data structure"
167
+ WHY DELETE: "Verify" is banned. "tracking system" is banned. No code change provided.
168
+
169
+ ❌ Description: "Users might lose access to features"
170
+ Suggestion: "Ensure that all users are properly migrated"
171
+ WHY DELETE: "Ensure" is banned. "migrated" is banned. No code change provided.
172
+
173
+ ❌ Description: "Tracking data format inconsistency"
174
+ Suggestion: "Consider normalizing the value or document that this experiment uses..."
175
+ WHY DELETE: "Consider" is banned. "document" is banned. "experiment" is banned.
176
+
177
+ **EXAMPLES OF ACCEPTABLE ISSUES:**
178
+ ✅ Description: "The function returns null but the return type doesn't allow null"
179
+ Suggestion: "Change the return type from \`string\` to \`string | null\` on line 42"
180
+ WHY ACCEPT: Identifies a specific bug with a specific code change.
181
+
182
+ ✅ Description: "Missing null check will cause runtime error"
183
+ Suggestion: "Add optional chaining: change \`user.name\` to \`user?.name\` on line 15"
184
+ WHY ACCEPT: Identifies a specific problem with exact code to fix it.
185
+
186
+ ✅ Description: "Promise is not awaited"
187
+ Suggestion: "Add \`await\` before \`fetchData()\` on line 28"
188
+ WHY ACCEPT: Specific bug with specific code fix.
189
+
190
+ **THE ONLY ACCEPTABLE ISSUE FORMAT:**
191
+ 1. Description: Identifies a SPECIFIC BUG or CODE QUALITY PROBLEM
192
+ 2. Suggestion: Provides EXACT CODE CHANGE to fix it (no "consider", "verify", "ensure", "document")
193
+
194
+ **FINAL CHECK BEFORE INCLUDING ANY ISSUE:**
195
+ □ Does my suggestion contain "consider", "verify", "ensure", "document", "check", or "confirm"? → DELETE
196
+ □ Does my suggestion mention "analytics", "tracking", "migration", "downstream", or "experiment"? → DELETE
197
+ □ Is my suggestion a request for someone to do something (not a code change)? → DELETE
198
+ □ Can I write the exact code change in the suggestion? → If NO, DELETE
199
+
200
+ When in doubt, DELETE THE ISSUE. Only report issues with EXACT CODE FIXES.`;
144
201
  }
145
202
 
146
203
  /**