Multilanguage PR Review Skill
Overview
Modern repositories often contain code in multiple programming languages. A single repository might have:
- •A Python backend with FastAPI
- •A TypeScript frontend with React
- •Rust binaries for performance-critical operations
- •Go microservices
- •Bash scripts for automation and CI/CD
Reviewing PRs in such repositories requires understanding which languages are affected and applying the appropriate review standards for each.
Prerequisites
- •GitHub CLI (
gh) installed and authenticated - •Python 3.8+ for running detection scripts
- •Language-specific linters installed (ruff, mypy, ESLint, clippy, etc.)
- •Git for local diff analysis
Output
| Output Type | Format | Description |
|---|---|---|
| Language Detection Report | JSON | List of detected languages with file counts and lines changed per language |
| Linter Recommendations | JSON | Recommended linters, install commands, and run commands for each detected language |
| Review Summary | Markdown | Comprehensive review findings organized by language with cross-language impact analysis |
| Linter Results | Text/JSON | Aggregated output from all language-specific linters (ruff, ESLint, clippy, etc.) |
Instructions
- •Run
eia_detect_pr_languages.pyto identify all programming languages affected by the PR - •For each detected language, read the corresponding review patterns document from the references directory
- •Execute
eia_get_language_linters.pyto obtain the appropriate linters and their commands for each language - •Run all recommended linters against the changed files in their respective languages
- •Check for cross-language interface changes (API contracts, FFI boundaries, shared configuration)
- •Verify platform-specific code paths have appropriate guards and tests (see cross-platform-testing.md)
- •Compile linter results and findings into a comprehensive review summary organized by language
- •Write the final review comment with language-specific findings and cross-language impact analysis
Challenges of Multilanguage Repositories
- •Different coding standards: Each language has its own conventions for naming, formatting, and structure
- •Different testing frameworks: pytest for Python, Jest for JavaScript, cargo test for Rust
- •Different linting tools: ruff/mypy for Python, ESLint for JavaScript, Clippy for Rust
- •Cross-language interfaces: FFI boundaries, API contracts, data serialization
- •Platform-specific code: Code paths that only run on certain operating systems
When to Use This Skill
Use this skill when:
- •Reviewing a PR that touches files in multiple programming languages
- •Setting up review workflows for a polyglot repository
- •Determining which linters and checkers to run for changed files
- •Coordinating cross-language interface reviews
Quick Reference: Language Detection
For detailed language detection methods, see language-detection.md:
- •1.1 Detecting language from file extensions
- •1.2 Detecting language from shebang lines
- •1.3 Using .gitattributes linguist hints
- •1.4 Understanding GitHub's language detection algorithm
- •1.5 Handling mixed-language files
Quick Reference: Language-Specific Review Patterns
Python Reviews
See python-review-patterns.md:
- •2.1 Python code style and formatting checklist
- •2.2 Type hints verification and mypy compliance
- •2.3 Docstring standards (Google, NumPy, Sphinx)
- •2.4 Import organization and dependency management
- •2.5 Test framework patterns with pytest
- •2.6 Linting with ruff, mypy, and bandit
JavaScript/TypeScript Reviews
See javascript-review-patterns.md:
- •3.1 JavaScript/TypeScript code style checklist
- •3.2 Type safety patterns in TypeScript
- •3.3 Module system considerations (ESM vs CommonJS)
- •3.4 Test framework patterns with Jest and Vitest
- •3.5 Linting with ESLint and Prettier
Rust Reviews
- •4.1 Rust code style and idioms checklist
- •4.2 Memory safety patterns and ownership
- •4.3 Error handling with Result and Option
- •4.4 Clippy lints and configuration
- •4.5 Documentation standards with rustdoc
Go Reviews
- •5.1 Go code style and idioms checklist
- •5.2 Error handling patterns in Go
- •5.3 Package organization and naming
- •5.4 Test patterns with go test
- •5.5 Linting with golint, go vet, and staticcheck
Shell Script Reviews
- •6.1 Bash/Shell script review checklist
- •6.2 POSIX compatibility requirements
- •6.3 ShellCheck lints and fixes
- •6.4 Cross-platform considerations for macOS and Linux
Quick Reference: Cross-Platform Testing
See cross-platform-testing.md:
- •7.1 Testing on multiple operating systems
- •7.2 CI matrix configuration for GitHub Actions
- •7.3 Platform-specific test skips and annotations
- •7.4 Using Docker for reproducible builds
Decision Tree: PR Review Approach
START: New PR to review | v [1] Run eia_detect_pr_languages.py to identify languages | v [2] For each detected language: | +---> Is it Python? ---> Read python-review-patterns.md, run ruff + mypy | +---> Is it JavaScript/TypeScript? ---> Read javascript-review-patterns.md, run ESLint | +---> Is it Rust? ---> Read rust-review-patterns.md, run cargo clippy | +---> Is it Go? ---> Read go-review-patterns.md, run go vet + staticcheck | +---> Is it Bash/Shell? ---> Read shell-review-patterns.md, run ShellCheck | v [3] Check for cross-language interfaces: | +---> API contracts between services? ---> Verify schema compatibility | +---> FFI boundaries? ---> Check type mappings and safety | +---> Shared configuration? ---> Ensure consistency | v [4] Check for platform-specific code: | +---> Multiple OS targets? ---> Read cross-platform-testing.md | v [5] Run eia_get_language_linters.py for each language to get linter commands | v [6] Execute all linters and compile results | v [7] Write review summary with findings per language | v END
Included Scripts
eia_detect_pr_languages.py
Detects programming languages in a PR's changed files.
Usage:
# Detect languages in PR #123 python scripts/eia_detect_pr_languages.py --repo owner/repo --pr 123 # Detect languages in local diff python scripts/eia_detect_pr_languages.py --diff-file changes.diff
Output: JSON with language breakdown and file counts.
eia_get_language_linters.py
Returns recommended linters and commands for a given language.
Usage:
# Get linters for Python python scripts/eia_get_language_linters.py --language python # Get linters for multiple languages python scripts/eia_get_language_linters.py --languages python,javascript,rust
Output: JSON with linter names, install commands, and run commands.
Workflow Example
When reviewing a PR in a multilanguage repository:
# Step 1: Detect languages in the PR
python scripts/eia_detect_pr_languages.py --repo myorg/myrepo --pr 456
# Example output:
# {
# "languages": {
# "python": {"files": 12, "lines_changed": 450},
# "typescript": {"files": 5, "lines_changed": 200},
# "bash": {"files": 2, "lines_changed": 50}
# },
# "primary_language": "python"
# }
# Step 2: Get linters for detected languages
python scripts/eia_get_language_linters.py --languages python,typescript,bash
# Example output:
# {
# "python": {
# "linters": ["ruff", "mypy"],
# "commands": {
# "ruff": "ruff check .",
# "mypy": "mypy --strict ."
# }
# },
# ...
# }
# Step 3: Read the appropriate review patterns for each language
# Step 4: Run linters and compile results
# Step 5: Write comprehensive review
Common Pitfalls
- •Ignoring generated files: Many repos have generated code (protobuf, OpenAPI). Identify and skip these.
- •Over-linting vendored code: Third-party vendored code should be excluded from linting.
- •Missing cross-language impacts: A Python change might break a TypeScript client consuming its API.
- •Platform assumptions: Code working on Linux might fail on macOS due to path handling.
- •Different Python versions: A repo might support Python 3.8-3.12 with different type hint syntax.
Examples
Example 1: Detect Languages and Run Linters
# Detect languages in PR
python scripts/eia_detect_pr_languages.py --repo myorg/myrepo --pr 456
# Output: {"languages": {"python": {"files": 12}, "typescript": {"files": 5}}}
# Get recommended linters
python scripts/eia_get_language_linters.py --languages python,typescript
# Output: {"python": {"linters": ["ruff", "mypy"]}, "typescript": {"linters": ["eslint"]}}
# Run linters for each language
ruff check src/python/
eslint src/typescript/
Example 2: Cross-Language API Review
# Detect languages python scripts/eia_detect_pr_languages.py --repo myorg/myrepo --pr 789 # If both Python (backend) and TypeScript (frontend) changed, # verify API contracts are consistent between them # Check OpenAPI/JSON schema compatibility
Error Handling
Problem: Language detection returns unexpected results
Solution: Check .gitattributes for linguist overrides. Some files may be marked with linguist-language or linguist-detectable=false.
Problem: Linter fails to run
Solution: Ensure the linter is installed. Use eia_get_language_linters.py to get install commands.
Problem: Too many linting errors
Solution: For legacy codebases, consider using --fix flags where available (ruff --fix, eslint --fix) and reviewing the automated fixes.
Problem: Cross-platform test failures
Solution: Read cross-platform-testing.md section 7.3 for platform-specific skip annotations.
Checklist: Multilanguage PR Review
Copy this checklist and track your progress:
- • Detect all languages in the PR using eia_detect_pr_languages.py
- • Read the review patterns document for each detected language
- • Run appropriate linters for each language
- • Check for cross-language interface changes
- • Verify platform-specific code has appropriate guards
- • Ensure tests exist for new functionality in each language
- • Check CI configuration covers all affected languages
- • Verify documentation is updated if public APIs changed
Resources
- •references/language-detection.md - Language detection methods
- •references/python-review-patterns.md - Python review checklist
- •references/javascript-review-patterns.md - JavaScript/TypeScript review
- •references/rust-review-patterns.md - Rust review checklist
- •references/go-review-patterns.md - Go review checklist
- •references/shell-review-patterns.md - Shell script review
- •references/cross-platform-testing.md - Multi-OS testing