moai-essentials-review
1
总安装量
1
周安装量
#78070
全站排名
安装命令
npx skills add https://github.com/ajbcoding/claude-skill-eval --skill moai-essentials-review
Agent 安装分布
amp
1
cline
1
opencode
1
cursor
1
continue
1
kimi-cli
1
Skill 文档
Enterprise Code Review Automation v4.0.0
Skill Metadata
| Field | Value |
|---|---|
| Skill Name | moai-essentials-review |
| Version | 4.0.0 Enterprise (2025-11-12) |
| Core Framework | TRUST 5 principles automation |
| AI Integration | â Context7 MCP, AI quality analysis |
| Auto-load | On code commit or PR creation |
| Languages | 25+ languages with specialized analysis |
| Lines of Content | 880+ with 16+ production examples |
| Progressive Disclosure | 3-level (automation, analysis, advanced) |
What It Does
Automates comprehensive code review process with AI-powered quality checks, TRUST 5 principle validation, security vulnerability detection, performance analysis, test coverage verification, and detailed review feedback generation.
3-Phase Automated Review
Phase 1: Automated Checks (5 minutes)
Syntax & Linting:
â Run linters (pylint, eslint, golint, etc.)
â Check code formatting (black, prettier, gofmt)
â Type checking (mypy, TypeScript, go vet)
Security Scanning:
â Dependency vulnerabilities (safety, npm audit, cargo audit)
â Credential detection (git-secrets, detect-secrets)
â OWASP Top 10 checks
Test Coverage:
â Coverage â¥85%
â Critical paths covered
â Edge cases tested
Phase 2: AI Quality Analysis (15 minutes)
TRUST 5 Validation:
â T - Tests present and comprehensive
â R - Code readable and maintainable
â U - Unified with codebase patterns
â S - Security best practices
Design Analysis:
â SOLID principles
â Design patterns appropriate
â Scalability concerns
â Performance implications
Phase 3: Human Review (20 minutes)
Architectural Review:
â Does solution fit architecture?
â Any alternatives considered?
â Trade-offs documented?
Business Logic:
â Does it solve the problem?
â Any edge cases missed?
â User experience impact?
Documentation:
â README updated
â API docs current
â Examples provided
AI-Powered Quality Checks
Code Quality Metrics
class CodeQualityAnalyzer:
"""AI-powered code quality analysis."""
async def analyze(self, code: str) -> QualityReport:
metrics = {
"complexity": calculate_cyclomatic(code), # Should be <10
"testability": assess_testability(code), # Should be >0.85
"maintainability": calculate_maintainability(code), # Should be >80
"readability": assess_readability(code), # Should be clear
"security_issues": scan_for_vulnerabilities(code), # Should be 0
"performance_concerns": detect_patterns(code), # Should be minimal
}
return QualityReport(metrics)
TRUST 5 Automated Checks
T - Test First:
ââ Coverage â¥85%? â
ââ Happy path covered? â
ââ Edge cases tested? â
ââ Error scenarios? â
R - Readable:
ââ Functions <50 lines? â
ââ Meaningful names? â
ââ Comments explain WHY? â
ââ Complexity <10? â
U - Unified:
ââ Follows team patterns? â
ââ Consistent style? â
ââ Error handling aligned? â
ââ Logging strategy consistent? â
S - Secured:
ââ Inputs validated? â
ââ No hardcoded secrets? â
ââ SQL injection prevention? â
ââ XSS prevention? â
T - Trackable:
ââ SPEC referenced? â
Security Vulnerability Detection
Critical Checks:
â Hardcoded credentials (API keys, passwords)
â SQL injection vectors
â XSS vulnerabilities
â CSRF token absence
â Unsafe deserialization
â Privilege escalation paths
High Priority:
â Missing input validation
â Weak cryptography
â Insecure randomness
â Race conditions
â Dependency vulnerabilities
Medium Priority:
â Missing error messages
â Insufficient logging
â Memory leaks
â Resource exhaustion risks
Performance Analysis
Detection Patterns:
â O(n²) algorithms in O(n) context
â Unnecessary file I/O in loops
â Blocking operations in async code
â Memory allocations in hot paths
â Inefficient string concatenation
â Database queries without indexing
Optimization Suggestions:
â Use more efficient algorithm
â Cache results
â Batch operations
â Use async/await properly
â Index database columns
Automated Review Report
# Code Review Report
## Summary
â
**Status**: APPROVED (with 2 minor notes)
- Test Coverage: 87% â
- Security: â Clean
- Performance: â No concerns
- Design: â Good
- TRUST 5: All checks passed
## TRUST 5 Assessment
### T - Test First: â
Coverage: 87% (target â¥85%)
- Happy path: â Covered
- Edge cases: â 5 tests
- Error scenarios: â 3 tests
### R - Readable: â
All functions <50 lines, clear names
### U - Unified: â
Consistent with team patterns
### S - Secured: â
- No credentials: â
- Input validation: â
- Error messages safe: â
### T - Trackable: â
- SPEC-042 referenced
- 5 tests linked
- Code linked to PR
## Detailed Findings
### Strengths
1. â
Excellent test coverage (87%)
2. â
Clean, readable code
3. â
Proper error handling
4. â
Security best practices followed
### Minor Notes
1. â ï¸ Function `calculate_discount` could use type hints
2. â ï¸ Consider adding cache for frequently called API
### Recommendations
1. Add type hints to improve IDE support
2. Consider Redis caching for API calls
## Approval
â
**Ready to merge** - All TRUST 5 checks passed
Integration with Context7
Live Security Patterns: Get latest vulnerability detection from official databases
Performance Optimization: Context7 provides version-specific optimization patterns
Language Updates: Context7 includes latest language/framework best practices
Best Practices
DO
- â Run automated checks before human review
- â Provide specific, actionable feedback
- â Explain WHY improvements are needed
- â Link to official documentation
- â Flag security issues immediately
- â Enforce TRUST 5 consistently
- â Update based on new findings
- â Track metrics over time
DON’T
- â Block on automated issues alone (let linters handle)
- â Miss security vulnerabilities
- â Accept coverage <85%
- â Ignore deprecated patterns
- â Skip performance analysis
- â Approve without TRUST 5 validation
- â Add comments that code already explains
Related Skills
moai-alfred-code-reviewer(Manual review guidance)moai-essentials-debug(Debugging techniques)
For detailed analysis guidelines: reference.md
For real-world examples: examples.md
Last Updated: 2025-11-12
Status: Production Ready (Enterprise v4.0.0)