feat: add review mode for PR code reviews

- Add 'review' as a new execution mode in action.yml
- Use default GitHub Action token (ACTIONS_TOKEN) for review mode
- Create review mode implementation with GitHub MCP tools included by default
- Move review-specific prompt to review mode's generatePrompt method
- Add comprehensive review workflow instructions for inline comments
- Fix type safety with proper mode validation
- Keep agent mode's simple inline prompt handling
This commit is contained in:
km-anthropic
2025-07-30 15:50:57 -07:00
parent 1f6e3225b0
commit bbc8c6d6d5
6 changed files with 312 additions and 9 deletions
+3 -1
View File
@@ -13,11 +13,12 @@
import type { Mode, ModeName } from "./types";
import { tagMode } from "./tag";
import { agentMode } from "./agent";
import { reviewMode } from "./review";
import type { GitHubContext } from "../github/context";
import { isAutomationContext } from "../github/context";
export const DEFAULT_MODE = "tag" as const;
export const VALID_MODES = ["tag", "agent"] as const;
export const VALID_MODES = ["tag", "agent", "review"] as const;
/**
* All available modes.
@@ -26,6 +27,7 @@ export const VALID_MODES = ["tag", "agent"] as const;
const modes = {
tag: tagMode,
agent: agentMode,
review: reviewMode,
} as const satisfies Record<ModeName, Mode>;
/**