This directory contains the AI-enhanced CI/CD workflows for the Professor Oak project.
Triggers: Push to main/develop, Pull Requests
Jobs:
- Build & Test: Uses devcontainers to build and test the MCP server
- Lint: TypeScript type checking
- Security Scan: npm audit + TruffleHog secret detection
Tech Stack:
- DevContainers CI action for consistent build environments
- Vitest for testing
- TruffleHog for secret scanning
Triggers: PR opened/updated, Comments with @claude
Jobs:
-
Claude Code Review: AI-powered code review using Anthropic's Claude
- MCP server best practices validation
- TypeScript quality checks
- Security analysis
- Testing coverage validation
- Documentation completeness
-
Test Coverage Report: Automated coverage reporting on PRs
-
Build Check: Validates build artifacts
Special Features:
- Responds to @claude mentions in PR comments
- Context-aware reviews focused on MCP server patterns
- Constructive, actionable feedback
Triggers: Push, PR, Weekly schedule (Sundays 3 AM UTC)
Features:
- Static analysis for security vulnerabilities
- JavaScript/TypeScript code scanning
- Extended security queries
- Automated weekly scans
Configuration:
- npm: Weekly updates for MCP server dependencies
- GitHub Actions: Weekly updates for workflow actions
- Docker: Weekly updates for base images
Settings:
- Runs every Monday at 9 AM UTC
- Automatic PR creation with labels
- Conventional commit messages
Triggers: Version tags (v*..)
Jobs:
- Create Release: Automated changelog generation
- Build Docker: Multi-platform Docker image build and publish to GHCR
Outputs:
- GitHub Release with changelog
- Docker image:
ghcr.io/tomblancdev/professor-oak - Tags: version, major.minor, major, latest
Add these secrets to your repository settings:
-
ANTHROPIC_API_KEY (Required for AI code review)
- Get from: https://console.anthropic.com/
- Permissions: API key with access to Claude Sonnet 4.5
-
GITHUB_TOKEN (Automatically provided)
- Used for GitHub API interactions
-
Enable GitHub Actions:
- Settings → Actions → General → Allow all actions
-
Enable GitHub Container Registry:
- Settings → Packages → Enable packages
-
Branch Protection Rules (Recommended):
Branch: main - Require status checks to pass before merging ✓ Build & Test (MCP Server) ✓ Lint Check ✓ Build Status - Require pull request reviews before merging - Require conversation resolution before merging
The AI reviewer runs automatically on all PRs, analyzing:
- Code quality and TypeScript best practices
- MCP server patterns (tool descriptions, error handling, etc.)
- Security vulnerabilities
- Test coverage
Comment on any PR with:
@claude review this code for security issues
The AI will respond with targeted analysis based on your request.
The AI reviewer is specifically trained to check:
-
MCP Server Patterns
- Tool descriptions teach AI when to use tools
- Structured JSON responses
- Idempotent operations
- Proper Zod schema validation
-
Security
- No hardcoded secrets
- Input validation
- File path sanitization
- Environment variable usage
-
TypeScript Quality
- Type safety
- Avoiding 'any' types
- Async/await error handling
-
Testing
- Test coverage for new features
- Edge case handling
- Proper mocking
Edit pr-review.yml:
model: claude-opus-4-5-20251101 # For more powerful reviewsEdit dependabot.yml:
schedule:
interval: "daily" # or "monthly"Add steps to ci.yml:
- name: Custom Check
run: npm run custom-scriptBased on 2025 MCP and GitHub Actions best practices:
- Container-First Approach: All builds use devcontainers for consistency
- Semantic Versioning: Automated via release tags
- Security as Code: TruffleHog, CodeQL, npm audit
- AI-Powered Reviews: Claude Code for context-aware feedback
- Idempotent Workflows: Can be re-run safely
- Observability: Test results, coverage reports, build artifacts
- Automated Dependencies: Dependabot for security patches
- Actions tab → Select workflow → View logs
# Run locally with same devcontainer
cd mcp/professor-oak-mcp
docker compose upcd mcp/professor-oak-mcp
npm run test:run -- --coverage- Check
ANTHROPIC_API_KEYis set - Verify GitHub App is installed (if using claude-code-action)
- Check workflow permissions in repo settings
- Ensure devcontainer.json is valid
- Check npm dependencies are locked (package-lock.json)
- Verify Docker is available on runner
- Ensure vitest is configured with coverage
- Check coverage directory path in workflow
- Verify tests are actually running
Need help? Open an issue or consult the learning materials.