Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
16 changes: 10 additions & 6 deletions .claude/skills/sc-test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Test execution with coverage analysis and quality reporting.
# Watch mode with auto-fix
/sc:test --watch --fix

# Web search for testing guidance
# Web search for testing guidance (uses Rube MCP's LINKUP_SEARCH)
/sc:test --linkup --query "pytest asyncio best practices"
```

Expand All @@ -39,8 +39,8 @@ Test execution with coverage analysis and quality reporting.
| `--coverage` | bool | false | Generate coverage report |
| `--watch` | bool | false | Continuous watch mode |
| `--fix` | bool | false | Auto-fix simple failures |
| `--linkup` | bool | false | Web search for guidance |
| `--query` | string | - | Search query for LinkUp |
| `--linkup` | bool | false | Web search for guidance (via Rube MCP) |
| `--query` | string | - | Search query for LINKUP_SEARCH |

## Personas Activated

Expand Down Expand Up @@ -94,9 +94,13 @@ mcp__pal__consensus(
### Rube Usage Patterns

```bash
# Search for testing best practices (--linkup)
mcp__rube__RUBE_SEARCH_TOOLS(queries=[
{"use_case": "web search for testing patterns", "known_fields": "query:pytest fixtures"}
# Search for testing best practices (--linkup flag uses LINKUP_SEARCH)
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "LINKUP_SEARCH", "arguments": {
"query": "pytest fixtures best practices",
"depth": "deep",
"output_type": "sourcedAnswer"
}}
])

# Post test results to Slack
Expand Down
162 changes: 146 additions & 16 deletions .github/workflows/ai-review.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SuperClaude AI Code Review Pipeline
# Uses Claude Code Action with PAL MCP Consensus Code Review
# Dual Provider: AWS Bedrock (Primary) + Anthropic API (Fallback)
# NON-BLOCKING: Advisory comments only, does not prevent merge

name: AI Code Review
Expand All @@ -18,24 +19,43 @@ jobs:
timeout-minutes: 15
# Skip for dependabot PRs to avoid API costs
if: github.actor != 'dependabot[bot]'
continue-on-error: true

permissions:
contents: read
pull-requests: write
issues: read
id-token: write

env:
BEDROCK_CONFIGURED: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK != '' }}
ANTHROPIC_KEY_SET: ${{ secrets.ANTHROPIC_API_KEY != '' }}

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

- name: Validate provider configuration
id: validate_providers
run: |
if [[ "${{ env.BEDROCK_CONFIGURED }}" != "true" ]] && [[ "${{ env.ANTHROPIC_KEY_SET }}" != "true" ]]; then
echo "::warning::No Claude API provider configured (AWS Bedrock or Anthropic API). Skipping review."
echo "skip_review=true" >> $GITHUB_OUTPUT
else
echo "skip_review=false" >> $GITHUB_OUTPUT
echo "Provider check passed:"
echo " - Bedrock: ${{ env.BEDROCK_CONFIGURED }}"
echo " - Anthropic: ${{ env.ANTHROPIC_KEY_SET }}"
fi

- name: Get PR context
if: steps.validate_providers.outputs.skip_review != 'true'
id: context
run: |
# Get changed files count
FILES_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | wc -l)
FILES_CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | wc -l | tr -d ' ')
echo "files_changed=$FILES_CHANGED" >> $GITHUB_OUTPUT

# Get diff statistics
Expand All @@ -50,11 +70,101 @@ jobs:
TESTS_MODIFIED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | grep '^tests/' | wc -l | tr -d ' ')
echo "tests_modified=${TESTS_MODIFIED:-0}" >> $GITHUB_OUTPUT

- name: Run PAL MCP Consensus Code Review
- name: PAL MCP Review (AWS Bedrock - Primary)
if: steps.validate_providers.outputs.skip_review != 'true' && env.BEDROCK_CONFIGURED == 'true'
id: bedrock_review
uses: anthropics/claude-code-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
use_bedrock: "true"
show_full_output: true
max_turns: 20
prompt: |
# SuperClaude PR Code Review - PAL MCP Consensus

**Repository**: ${{ github.repository }}
**PR Number**: ${{ github.event.pull_request.number }}
**PR Title**: ${{ github.event.pull_request.title }}
**Files Changed**: ${{ steps.context.outputs.files_changed }}
**Diff Stats**: ${{ steps.context.outputs.diff_stats }}
**Python Files**: ${{ steps.context.outputs.python_files }}
**Tests Modified**: ${{ steps.context.outputs.tests_modified }}

## Instructions

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

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

### Step 2: Run PAL MCP Consensus Code Review
Use the `mcp__pal__codereview` tool to perform a comprehensive code review.

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

The codereview tool will:
1. Analyze the code systematically
2. Identify issues by severity (critical, high, medium, low)
3. Provide expert validation of findings

### Step 3: Post Results
After the consensus review completes, post the results using `gh pr comment`
with this format:

```markdown
## PAL MCP Consensus Code Review (via AWS Bedrock)

### Overview
[Brief summary of changes reviewed]

### Critical Issues
[Any blocking issues - must fix before merge]

### High Priority
[Important issues that should be addressed]

### Medium Priority
[Improvements recommended]

### Positive Observations
[Good patterns and practices observed]

### Review Summary
| Category | Rating |
|----------|--------|
| Security | /5 |
| Code Quality | /5 |
| Architecture | /5 |
| Testing | /5 |

---
*This review was generated by PAL MCP Consensus Code Review (AWS Bedrock).*
*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:*),mcp__pal__codereview,mcp__pal__consensus"
env:
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
AWS_REGION: ${{ secrets.AWS_REGION || 'us-east-1' }}
CLAUDE_CODE_USE_BEDROCK: "1"

- name: PAL MCP Review (Anthropic API - Fallback)
if: steps.validate_providers.outputs.skip_review != 'true' && env.ANTHROPIC_KEY_SET == 'true' && (env.BEDROCK_CONFIGURED != 'true' || steps.bedrock_review.outcome != 'success')
id: anthropic_review
uses: anthropics/claude-code-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
show_full_output: true
max_turns: 20
prompt: |
# SuperClaude PR Code Review - PAL MCP Consensus

Expand Down Expand Up @@ -93,33 +203,33 @@ jobs:
with this format:

```markdown
## πŸ€– PAL MCP Consensus Code Review
## PAL MCP Consensus Code Review (via Anthropic API - Fallback)

### Overview
[Brief summary of changes reviewed]

### πŸ”΄ Critical Issues
### Critical Issues
[Any blocking issues - must fix before merge]

### 🟠 High Priority
### High Priority
[Important issues that should be addressed]

### 🟑 Medium Priority
### Medium Priority
[Improvements recommended]

### 🟒 Positive Observations
### Positive Observations
[Good patterns and practices observed]

### πŸ“Š Review Summary
### Review Summary
| Category | Rating |
|----------|--------|
| Security | β­β­β­β­β˜† |
| Code Quality | β­β­β­β­β˜† |
| Architecture | β­β­β­β­β˜† |
| Testing | β­β­β­β˜†β˜† |
| Security | /5 |
| Code Quality | /5 |
| Architecture | /5 |
| Testing | /5 |

---
*This review was generated by PAL MCP Consensus Code Review.*
*This review was generated by PAL MCP Consensus Code Review (Anthropic API - Fallback).*
*Multiple AI models were consulted to validate findings.*
*Review is advisory - please use human judgment for final decisions.*
```
Expand All @@ -128,12 +238,32 @@ jobs:
--allowed-tools
"Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__pal__codereview,mcp__pal__consensus"

- name: Review complete
- name: Review status
if: always()
run: |
echo "## πŸ€– PAL MCP Consensus Code 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

if [[ "${{ steps.validate_providers.outputs.skip_review }}" == "true" ]]; then
echo "**Status**: Skipped - No providers configured" >> $GITHUB_STEP_SUMMARY
exit 0
fi

BEDROCK_STATUS="${{ steps.bedrock_review.outcome || 'skipped' }}"
ANTHROPIC_STATUS="${{ steps.anthropic_review.outcome || 'skipped' }}"

echo "| Provider | Status |" >> $GITHUB_STEP_SUMMARY
echo "|----------|--------|" >> $GITHUB_STEP_SUMMARY
echo "| AWS Bedrock (Primary) | $BEDROCK_STATUS |" >> $GITHUB_STEP_SUMMARY
echo "| Anthropic API (Fallback) | $ANTHROPIC_STATUS |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [[ "$BEDROCK_STATUS" == "success" ]] || [[ "$ANTHROPIC_STATUS" == "success" ]]; then
echo "**Result**: Multi-model consensus code review posted to PR" >> $GITHUB_STEP_SUMMARY
else
echo "**Result**: Review failed (both providers)" >> $GITHUB_STEP_SUMMARY
fi

echo "" >> $GITHUB_STEP_SUMMARY
echo "**Features:**" >> $GITHUB_STEP_SUMMARY
echo "- Full review covering security, quality, performance, architecture" >> $GITHUB_STEP_SUMMARY
Expand Down
Loading
Loading