diffprism 0.38.0 → 0.39.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.
package/dist/bin.js CHANGED
@@ -134,29 +134,81 @@ description: Open current code changes in DiffPrism's browser-based review UI fo
134
134
 
135
135
  # DiffPrism Review
136
136
 
137
- When the user invokes \`/review\`, call \`mcp__diffprism__open_review\` with:
137
+ You have 9 DiffPrism MCP tools available. Use them proactively \u2014 don't wait for the user to ask.
138
138
 
139
- - \`diff_ref\`: \`"working-copy"\` (or what the user specified, e.g. \`"staged"\`, or a GitHub PR ref like \`"owner/repo#123"\`)
140
- - \`title\`: Brief summary of the changes
141
- - \`reasoning\`: Your reasoning about the implementation decisions
142
- - \`post_to_github\`: Set to \`true\` to post the review back to GitHub (only for PR refs)
139
+ ## Workflow 1: Self-Review Before Human Review
143
140
 
144
- The tool blocks until the human submits their review. Handle the result:
141
+ After making multi-file changes, **proactively self-review before requesting human review**:
145
142
 
143
+ 1. Run \`mcp__diffprism__analyze_diff\` with \`diff_ref: "working-copy"\`
144
+ 2. Check the response for:
145
+ - **Pattern flags** \u2014 console.logs left in, TODO comments, security issues (hardcoded secrets, SQL injection, XSS)
146
+ - **Test coverage gaps** \u2014 new code paths without corresponding tests
147
+ - **High complexity scores** \u2014 functions or files with elevated complexity
148
+ 3. **Fix any issues found** \u2014 remove debug logs, add missing tests, simplify complex code
149
+ 4. Only then open a human review with \`mcp__diffprism__open_review\`
150
+
151
+ This should happen automatically after significant changes. You don't need the user to ask.
152
+
153
+ ## Workflow 2: Annotated Human Review
154
+
155
+ When opening a review, help the reviewer by flagging what matters:
156
+
157
+ 1. Call \`mcp__diffprism__open_review\` with:
158
+ - \`diff_ref\`: \`"working-copy"\` (or what the user specified, e.g. \`"staged"\`, \`"HEAD~3..HEAD"\`)
159
+ - \`title\`: Brief summary of the changes
160
+ - \`reasoning\`: Your reasoning about implementation decisions
161
+ - \`annotations\`: Array of inline findings to pre-populate the review (see tool schema)
162
+ 2. Use annotations to flag:
163
+ - Areas of uncertainty ("I chose approach X over Y because...")
164
+ - Security-sensitive changes
165
+ - Performance implications
166
+ - Anything the reviewer should look at closely
167
+ 3. After opening, use \`mcp__diffprism__flag_for_attention\` to highlight files that need careful review (e.g. auth logic, data migrations, public API changes)
168
+ 4. Use \`mcp__diffprism__add_annotation\` to post additional findings about specific lines if you discover issues while the review is open
169
+
170
+ Handle the review result:
146
171
  - **\`approved\`** \u2014 Proceed with the task.
147
172
  - **\`changes_requested\`** \u2014 Read comments, make fixes, offer to re-review.
148
173
  - If \`postReviewAction\` is \`"commit"\` \u2014 commit the changes.
149
174
  - If \`postReviewAction\` is \`"commit_and_pr"\` \u2014 commit and open a PR.
150
175
 
151
- ## Headless Tools
176
+ ## Workflow 3: PR Review
177
+
178
+ To review a GitHub pull request:
179
+
180
+ 1. Call \`mcp__diffprism__review_pr\` with \`pr: "owner/repo#123"\` or a full GitHub PR URL
181
+ 2. Set \`post_to_github: true\` to post the review back to GitHub after the human submits
182
+ 3. The tool fetches the PR diff, runs analysis, and opens the review UI
183
+
184
+ ## Tool Reference
185
+
186
+ ### Review Lifecycle
187
+ | Tool | Purpose |
188
+ |------|---------|
189
+ | \`open_review\` | Open browser review UI for local changes. Blocks until submitted. |
190
+ | \`review_pr\` | Open browser review UI for a GitHub PR. Blocks until submitted. |
191
+ | \`get_review_result\` | Fetch result from a previous review (advanced \u2014 \`open_review\` already returns it). |
192
+ | \`update_review_context\` | Push updated reasoning/description to a running review session. |
193
+
194
+ ### Headless Analysis
195
+ | Tool | Purpose |
196
+ |------|---------|
197
+ | \`analyze_diff\` | Returns analysis JSON (patterns, complexity, test gaps) without opening a browser. |
198
+ | \`get_diff\` | Returns structured diff JSON (file-level and hunk-level changes). |
152
199
 
153
- - \`mcp__diffprism__analyze_diff\` \u2014 Returns analysis JSON (patterns, complexity, test gaps) without opening a browser. Use proactively to self-check before requesting review.
154
- - \`mcp__diffprism__get_diff\` \u2014 Returns structured diff JSON.
200
+ ### Annotation & Flagging
201
+ | Tool | Purpose |
202
+ |------|---------|
203
+ | \`add_annotation\` | Post a finding/suggestion/question on a specific line in a running review. |
204
+ | \`flag_for_attention\` | Mark files for human attention with warning annotations. |
205
+ | \`get_review_state\` | Get current state of a review session including all annotations. |
155
206
 
156
207
  ## Rules
157
208
 
158
- - Only open a review when the user explicitly asks (\`/review\` or "review my changes").
159
- - Headless tools can be used proactively without user request.
209
+ - **Self-review is proactive** \u2014 run \`analyze_diff\` after significant changes without being asked.
210
+ - **Human review requires explicit request** \u2014 only open \`open_review\` when the user asks (\`/review\`, "review my changes", or as part of a defined workflow like PR creation).
211
+ - **Annotate generously** \u2014 the more context you provide in annotations, the faster the reviewer can make decisions.
160
212
  `;
161
213
 
162
214
  // cli/src/commands/setup.ts
@@ -756,7 +808,7 @@ async function serverStop() {
756
808
 
757
809
  // cli/src/index.ts
758
810
  var program = new Command();
759
- program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.38.0" : "0.0.0-dev");
811
+ program.name("diffprism").description("Local-first code review tool for agent-generated changes").version(true ? "0.39.0" : "0.0.0-dev");
760
812
  program.command("demo").description("Open a sample review to see DiffPrism in action").option("--dev", "Use Vite dev server").action(demo);
761
813
  program.command("review [ref]").description("Open a browser-based diff review (local git ref or GitHub PR ref like owner/repo#123)").option("--staged", "Review staged changes").option("--unstaged", "Review unstaged changes").option("-t, --title <title>", "Review title").option("--reasoning <text>", "Agent reasoning about the changes").option("--dev", "Use Vite dev server with HMR instead of static files").option("--post-to-github", "Automatically post review back to GitHub without prompting").action(review);
762
814
  program.command("review-pr <pr>", { hidden: true }).action((pr, flags) => review(pr, flags));
@@ -117,7 +117,7 @@ async function handlePrReview(pr, options) {
117
117
  async function startMcpServer() {
118
118
  const server = new McpServer({
119
119
  name: "diffprism",
120
- version: true ? "0.38.0" : "0.0.0-dev"
120
+ version: true ? "0.39.0" : "0.0.0-dev"
121
121
  });
122
122
  server.tool(
123
123
  "open_review",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "diffprism",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "type": "module",
5
5
  "description": "Local-first code review tool for agent-generated code changes",
6
6
  "bin": {