aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/claude-code-review.yml
blob: 7f63c2df5aead43fe12b65eef54ed55a71b00be9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Claude Code Review

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  claude-review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      issues: read
      id-token: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Run Claude Code Review
        id: claude-review
        uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          use_sticky_comment: true
          prompt: |
            REPO: ${{ github.repository }}
            PR NUMBER: ${{ github.event.pull_request.number }}

            You are reviewing a PR for supermemory - a Turbo monorepo with multiple apps and packages.

            ## Repository Structure Context

            **Apps (apps/):**
            - `web` - Next.js web application (no tests)
            - `mcp` - Model Context Protocol server on Cloudflare Workers (no tests)
            - `browser-extension` - WXT-based browser extension (no tests)
            - `raycast-extension` - Raycast app extension (no tests)
            - `docs` - Mintlify documentation site

            **Published Packages (packages/) - with tests:**
            - `tools` - AI SDK memory tools (Vitest)
            - `ai-sdk` - supermemory AI SDK wrapper (Vitest)
            - `openai-sdk-python` - Python OpenAI integration (pytest)
            - `pipecat-sdk-python` - Python Pipecat integration (pytest)

            **Internal Packages (packages/) - no tests:**
            - `ui` - Shared React/Radix UI components
            - `lib` - Shared utilities
            - `hooks` - Custom React hooks
            - `memory-graph` - D3-based graph visualization
            - `validation` - Zod schemas

            ## Review Instructions

            1. First, run `gh pr diff` to see what files changed

            2. Based on the changes, review for:
               - **Code quality**: Follow Biome linting rules (double quotes, tabs, no default exports)
               - **Type safety**: Ensure proper TypeScript usage
               - **Security**: Check for injection vulnerabilities, credential exposure, unsafe patterns
               - **Performance**: Look for unnecessary re-renders (React), N+1 queries, memory leaks

            3. **Test coverage** - ONLY review if changes touch these packages:
               - `packages/tools/**` or `packages/ai-sdk/**` → Check for Vitest tests
               - `packages/openai-sdk-python/**` or `packages/pipecat-sdk-python/**` → Check for pytest tests
               - Skip test coverage review for apps and other packages (they have no test setup)

            4. **Package-specific concerns:**
               - Published packages (tools, ai-sdk, memory-graph, *-python): Check for breaking API changes
               - UI package: Check accessibility (a11y) and component API consistency
               - Web app: Check for proper data fetching patterns (TanStack Query), Zustand state management
               - MCP server: Check Hono routing and Cloudflare Workers compatibility

            5. Be concise and actionable. Focus on issues that matter, not style nitpicks (Biome handles that).

            Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

          claude_args: '--allowedTools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'