claude-teammate 0.1.41 → 0.1.42

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-teammate",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "CLI bootstrapper for Claude Teammate.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/claude.js CHANGED
@@ -1037,7 +1037,7 @@ function buildGitHubPRReviewSystemPrompt() {
1037
1037
  "Skip trivial style-only issues unless they introduce a real risk.",
1038
1038
  "Classify each suggestion as Minor (non-blocking) or Major (should be addressed before merge).",
1039
1039
  "Where possible, produce a committable suggestion with the corrected code.",
1040
- "Return a summary paragraph describing what the PR does, followed by a summary of all suggestions.",
1040
+ "Return a summary with the following structure: Short overview (1–3 sentences), Key changes (bullet points), Summary of all suggestions (1-2 sentences).",
1041
1041
  "Return only structured output matching the provided schema."
1042
1042
  ].join(" ");
1043
1043
  }
@@ -1200,13 +1200,16 @@ Pull request number: ${input.pr?.number ?? ""}
1200
1200
  Pull request title:
1201
1201
  ${input.pr?.title ?? ""}
1202
1202
 
1203
+ Pull request description:
1204
+ ${input.pr?.body ?? "(empty)"}
1205
+
1203
1206
  Repository path:
1204
1207
  ${input.repoPath}
1205
1208
 
1206
1209
  Unified diff:
1207
1210
  ${input.diff || "(empty)"}
1208
1211
 
1209
- Review the diff carefully. Read related code files with Read, Grep, or Glob only when the diff alone is insufficient to judge correctness. Return a summary describing the PR and its suggestions.`;
1212
+ Return a concise PR summary in the schema summary field, plus any review suggestions in the schema suggestions field.`;
1210
1213
  }
1211
1214
 
1212
1215
  function buildEpicMemoryCleanupUserPrompt(input) {
@@ -377,28 +377,13 @@ export async function runWorkerCommand({ projectRoot }) {
377
377
  }
378
378
 
379
379
  try {
380
- const repoPath = await ensureReviewRepo(pr.repoUrl, runtimePaths.reviewReposDir);
381
- const prDetail = await github.fetchPullRequest(pr.repoUrl, pr.number);
382
- await checkoutPullRequestBranch(repoPath, prDetail.headRef, prDetail.headRepoCloneUrl);
383
-
384
- const diff = await github.fetchPullRequestDiff(pr.repoUrl, pr.number);
385
- const result = await runClaudePrReview({
386
- diff,
387
- repoPath,
388
- pr: prDetail,
380
+ const { prDetail, result } = await processReviewPullRequest({
381
+ pr,
382
+ github,
383
+ reviewReposDir: runtimePaths.reviewReposDir,
389
384
  timeoutMs: parseOptionalInt(values.CLAUDE_TIMEOUT_MS)
390
385
  });
391
386
 
392
- await github.createPullRequestReview(
393
- pr.repoUrl,
394
- pr.number,
395
- result.summary,
396
- result.suggestions,
397
- "COMMENT"
398
- );
399
-
400
- await github.addLabelsToPullRequest(pr.repoUrl, pr.number, ["AI-reviewed"]);
401
-
402
387
  processedPrs.push({
403
388
  repoUrl: pr.repoUrl,
404
389
  pullRequestNumber: String(pr.number),
@@ -455,6 +440,45 @@ export async function runWorkerCommand({ projectRoot }) {
455
440
  }, POLL_INTERVAL_MS);
456
441
  }
457
442
 
443
+ export async function processReviewPullRequest({
444
+ pr,
445
+ github,
446
+ reviewReposDir,
447
+ timeoutMs,
448
+ ensureReviewRepoFn = ensureReviewRepo,
449
+ fetchPullRequestFn = (repoUrl, prNumber) => github.fetchPullRequest(repoUrl, prNumber),
450
+ checkoutPullRequestBranchFn = checkoutPullRequestBranch,
451
+ fetchPullRequestDiffFn = (repoUrl, prNumber) => github.fetchPullRequestDiff(repoUrl, prNumber),
452
+ runClaudePrReviewFn = runClaudePrReview,
453
+ createPullRequestReviewFn = (repoUrl, prNumber, body, suggestions, event) =>
454
+ github.createPullRequestReview(repoUrl, prNumber, body, suggestions, event)
455
+ }) {
456
+ await github.addLabelsToPullRequest(pr.repoUrl, pr.number, ["AI-reviewed"]);
457
+ await github.postIssueComment(pr.repoUrl, pr.number, "I am reviewing the PR.");
458
+
459
+ const repoPath = await ensureReviewRepoFn(pr.repoUrl, reviewReposDir);
460
+ const prDetail = await fetchPullRequestFn(pr.repoUrl, pr.number);
461
+ await checkoutPullRequestBranchFn(repoPath, prDetail.headRef, prDetail.headRepoCloneUrl);
462
+
463
+ const diff = await fetchPullRequestDiffFn(pr.repoUrl, pr.number);
464
+ const result = await runClaudePrReviewFn({
465
+ diff,
466
+ repoPath,
467
+ pr: prDetail,
468
+ timeoutMs
469
+ });
470
+
471
+ await createPullRequestReviewFn(
472
+ pr.repoUrl,
473
+ pr.number,
474
+ result.summary,
475
+ result.suggestions,
476
+ "COMMENT"
477
+ );
478
+
479
+ return { prDetail, result };
480
+ }
481
+
458
482
  async function processJiraIssue({ issue, jira, github, botUser, config, projectRoot, runtimePaths, logger }) {
459
483
  const detail = await jira.fetchIssueDetails(issue.key);
460
484