Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 53 additions & 51 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SuperClaude AI Code Review Pipeline
# Uses Claude Code Action with PAL MCP for enhanced code review
# Uses Claude Code Action with PAL MCP Consensus Code Review
# NON-BLOCKING: Advisory comments only, does not prevent merge

name: AI Code Review
Expand All @@ -13,7 +13,7 @@ on:

jobs:
ai-review:
name: Claude Code Review
name: PAL MCP Consensus Code Review
runs-on: ubuntu-latest
# Skip for dependabot PRs to avoid API costs
if: github.actor != 'dependabot[bot]'
Expand Down Expand Up @@ -41,21 +41,22 @@ jobs:
DIFF_STATS=$(git diff --stat origin/${{ github.base_ref }}...HEAD | tail -1)
echo "diff_stats=$DIFF_STATS" >> $GITHUB_OUTPUT

# Get list of changed Python files
PYTHON_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.py$' | head -20 | tr '\n' ' ')
# Get list of changed Python files (absolute paths)
PYTHON_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '\.py$' | head -20 | sed "s|^|$(pwd)/|" | tr '\n' ',' | sed 's/,$//')
echo "python_files=$PYTHON_FILES" >> $GITHUB_OUTPUT

# Check if tests were modified
TESTS_MODIFIED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -c '^tests/' || echo "0")
echo "tests_modified=$TESTS_MODIFIED" >> $GITHUB_OUTPUT

- name: Run Claude Code Review with PAL MCP
- name: Run PAL MCP Consensus Code Review
uses: anthropics/claude-code-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
timeout_minutes: 10
timeout_minutes: 15

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Remove deprecated timeout_minutes input from claude-code-action@v1 usage.

timeout_minutes is a deprecated input that was replaced in v1. Remove this line or move timeout configuration to GitHub Actions' job-level timeout-minutes setting. If you need to limit execution iterations, use claude_args: "--max-turns <value>" instead.

🧰 Tools
🪛 actionlint (1.7.9)

56-56: input "timeout_minutes" is not defined in action "anthropics/claude-code-action@v1". available inputs are "additional_permissions", "allowed_bots", "allowed_non_write_users", "anthropic_api_key", "assignee_trigger", "base_branch", "bot_id", "bot_name", "branch_prefix", "claude_args", "claude_code_oauth_token", "experimental_allowed_domains", "github_token", "label_trigger", "path_to_bun_executable", "path_to_claude_code_executable", "plugin_marketplaces", "plugins", "prompt", "settings", "show_full_output", "track_progress", "trigger_phrase", "use_bedrock", "use_commit_signing", "use_sticky_comment", "use_vertex"

(action)

🤖 Prompt for AI Agents
.github/workflows/ai-review.yml around line 56: the workflow uses the deprecated
action input timeout_minutes for claude-code-action@v1; remove the
timeout_minutes line from the action step and instead set a job-level
timeout-minutes in the workflow if you need a hard job timeout, or pass
claude_args: "--max-turns <value>" to limit Claude's iterations; update the file
to delete the timeout_minutes key and, if desired, add/adjust the workflow job's
timeout-minutes or add the claude_args option accordingly.

prompt: |
# SuperClaude PR Code Review
# SuperClaude PR Code Review - PAL MCP Consensus

**Repository**: ${{ github.repository }}
**PR Number**: ${{ github.event.pull_request.number }}
Expand All @@ -68,74 +69,75 @@ jobs:
## Instructions

You are reviewing a pull request for SuperClaude, an AI-enhanced development
framework for Claude Code. Please perform a thorough code review.
framework for Claude Code. Use PAL MCP's consensus code review to get
multi-model perspectives on the changes.

### Review Focus Areas
### Step 1: Get the PR diff
First, use `gh pr diff ${{ github.event.pull_request.number }}` to examine the changes.

1. **Code Quality**
- Python best practices and PEP 8 compliance
- Type hints usage and consistency
- Clear naming and documentation
- DRY principle adherence
### Step 2: Run PAL MCP Consensus Code Review
Use the `mcp__pal__codereview` tool to perform a comprehensive code review.

2. **Security** (Critical for MCP/AI framework)
- Input validation and sanitization
- Secret handling (no hardcoded credentials)
- Safe subprocess usage
- API key protection
Configure the review with:
- `review_type`: "full" (covers quality, security, performance, architecture)
- `relevant_files`: List the changed Python files from the diff
- Focus areas: security (critical for MCP/AI framework), code quality, testing

3. **Architecture**
- Consistency with existing patterns in SuperClaude/
- Proper separation of concerns
- MCP integration patterns
The codereview tool will:
1. Analyze the code systematically
2. Identify issues by severity (critical, high, medium, low)
3. Provide expert validation of findings

4. **Testing**
- Test coverage for new functionality
- Edge case handling
- Mock usage for external dependencies

5. **Performance**
- Async/await best practices
- Resource cleanup
- Caching considerations

### Review Output

Use `gh pr diff` to examine the changes, then post a structured review
using `gh pr comment` with the following format:
### Step 3: Post Results
After the consensus review completes, post the results using `gh pr comment`
with this format:

```markdown
## AI Code Review Summary
## 🤖 PAL MCP Consensus Code Review

### Overview
[Brief summary of changes]
[Brief summary of changes reviewed]

### Critical Issues
[List any blocking issues that should be addressed before merge]
### 🔴 Critical Issues
[Any blocking issues - must fix before merge]

### Suggestions
[Non-blocking improvements that would enhance code quality]
### 🟠 High Priority
[Important issues that should be addressed]

### Positive Observations
[Good patterns and practices observed in the PR]
### 🟡 Medium Priority
[Improvements recommended]

### Test Coverage
[Assessment of test coverage for changes]
### 🟢 Positive Observations
[Good patterns and practices observed]

### 📊 Review Summary
| Category | Rating |
|----------|--------|
| Security | ⭐⭐⭐⭐☆ |
| Code Quality | ⭐⭐⭐⭐☆ |
| Architecture | ⭐⭐⭐⭐☆ |
| Testing | ⭐⭐⭐☆☆ |

---
*This review was generated by Claude Code with PAL MCP tools.*
*This review was generated by PAL MCP Consensus Code Review.*
*Multiple AI models were consulted to validate findings.*
*Review is advisory - please use human judgment for final decisions.*
```

claude_args: >-
--allowed-tools
"Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*),Bash(gh issue view:*),Bash(gh issue list:*),Bash(gh search:*)"
"Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__pal__codereview,mcp__pal__consensus"

- name: Review complete
if: always()
run: |
echo "## AI Review Status" >> $GITHUB_STEP_SUMMARY
echo "## 🤖 PAL MCP Consensus Code Review Status" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Multi-model consensus code review has been posted to the PR." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "AI code review has been posted to the PR." >> $GITHUB_STEP_SUMMARY
echo "**Features:**" >> $GITHUB_STEP_SUMMARY
echo "- Full review covering security, quality, performance, architecture" >> $GITHUB_STEP_SUMMARY
echo "- Issues categorized by severity (critical/high/medium/low)" >> $GITHUB_STEP_SUMMARY
echo "- Expert model validation of findings" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Note**: This review is advisory only and does not block merging." >> $GITHUB_STEP_SUMMARY
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.10']

steps:
- name: Checkout repository
Expand Down Expand Up @@ -84,15 +84,15 @@ jobs:
-v

- name: Upload coverage artifact
if: matrix.python-version == '3.11'
if: matrix.python-version == '3.10'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml
retention-days: 7

- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
Expand All @@ -102,10 +102,10 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# ============================================
# Coverage Gate - Enforce 80% threshold
# Coverage Gate - Incrementally targeting 80%
# ============================================
coverage-gate:
name: Coverage Gate (45%)
name: Coverage Gate (35%)
needs: test
runs-on: ubuntu-latest
steps:
Expand All @@ -128,11 +128,13 @@ jobs:
env:
SUPERCLAUDE_OFFLINE_MODE: "1"
run: |
# Coverage threshold lowered to 45% to match current state
# Target: incrementally increase to 80%
# Coverage threshold set to 35% (above current ~30%)
# Target: incrementally increase via Issue #7 phased plan:
# Phase 0: 35% (current) -> Phase 1: 40% -> Phase 2: 55%
# Phase 3: 70% -> Phase 4: 80%
pytest tests/ -m "not slow and not integration" \
--cov=SuperClaude \
--cov-fail-under=45 \
--cov-fail-under=35 \
--tb=short \
-q

Expand Down
Loading
Loading