| name | code-review |
|---|---|
| description | Automated PR review using comprehensive checklist tailored for modularized Contentstack CLI |
/code-review- Review all current changes with full checklist/code-review --scope typescript- Focus on TypeScript configuration and patterns/code-review --scope testing- Focus on Mocha/Chai test patterns/code-review --scope oclif- Focus on command structure and OCLIF patterns/code-review --scope packages- Focus on package structure and organization
/code-review --severity critical- Show only critical issues (security, breaking changes)/code-review --severity high- Show high and critical issues/code-review --severity all- Show all issues including suggestions
/code-review --package contentstack-config- Review changes in specific package/code-review --package-type plugin- Review plugin packages only (auth, config)/code-review --package-type library- Review library packages (command, utilities, dev-dependencies)
/code-review --files commands- Review command files only/code-review --files tests- Review test files only/code-review --files utils- Review utility files
- Package organization: Proper placement in
packages/structure - pnpm workspace: Correct
package.jsonworkspace configuration - Build artifacts: No
lib/directories committed to version control - Dependencies: Proper use of shared utilities (
@contentstack/cli-command,@contentstack/cli-utilities) - Scripts: Consistent build, test, and lint scripts across packages
- Plugin packages (auth, config): Have
oclif.commandsconfiguration - Library packages (command, utilities, dev-dependencies): Proper exports in package.json
- Main package (contentstack): Aggregates plugins correctly
- Dependency versions: Using beta versions appropriately (~version ranges)
- Configuration compliance: Follows package TypeScript config (
strict: false,target: es2017) - Naming conventions: kebab-case files, PascalCase classes, camelCase functions
- Import patterns: ES modules with proper default/named exports
- Type safety: No unnecessary
anytypes in production code
- Base class usage: Extends
@contentstack/cli-commandCommand - Command structure: Proper
static description,static examples,static flags - Topic organization: Uses
cmtopic structure (cm:config:set,cm:auth:login) - Error handling: Uses
handleAndLogErrorfrom utilities - Flag validation: Early validation and user-friendly error messages
- Service delegation: Commands orchestrate, services implement business logic
- Framework compliance: Uses Mocha + Chai (not Jest)
- File patterns: Follows
*.test.tsnaming convention - Directory structure: Proper placement in
test/unit/ - Test organization: Arrange-Act-Assert pattern consistently used
- Isolation: Proper setup/teardown with beforeEach/afterEach
- No real API calls: All external dependencies properly mocked
- Consistent patterns: Use
handleAndLogErrorfrom utilities - User-friendly messages: Clear error descriptions for end users
- Logging: Proper use of
log.debugfor diagnostic information - Status messages: Use
cliuxfor user feedback (success, error, info)
- TypeScript compilation: Clean compilation with no errors
- OCLIF manifest: Generated for command discovery
- README generation: Commands documented in package README
- Source maps: Properly configured for debugging
- No build artifacts in commit:
.gitignoreexcludeslib/directories
- Test structure: Tests in
test/unit/with descriptive names - Command testing: Uses @oclif/test for command validation
- Error scenarios: Tests for both success and failure paths
- Mocking: All dependencies properly mocked
- Correct metadata: name, description, version, author
- Script definitions: build, compile, test, lint scripts present
- Dependencies: Correct versions of shared packages
- Main/types: Properly configured for library packages
- OCLIF config: Present for plugin packages
- No secrets: No API keys or tokens in code or tests
- Input validation: Proper validation of user inputs and flags
- Process management: Appropriate use of error codes
- File operations: Safe handling of file system operations
- Naming consistency: Follow established conventions
- Comments: Only for non-obvious logic (no "narration" comments)
- Error messages: Clear, actionable messages for users
- Module organization: Proper separation of concerns
- Lint compliance: ESLint checks for code style
- TypeScript compiler: Successful compilation to
lib/directories - Test execution: All tests pass successfully
- Build verification: Build scripts complete without errors
- Command usability: Clear help text and realistic examples
- Error handling: Appropriate error messages and recovery options
- Test quality: Comprehensive test coverage for critical paths
- Monorepo consistency: Consistent patterns across all packages
- Flag design: Intuitive flag names and combinations
- Inconsistent TypeScript settings: Mixed strict mode without reason
- Real API calls in tests: Unmocked external dependencies
- Missing error handling: Commands that fail silently
- Poor test organization: Tests without clear Arrange-Act-Assert
- Build artifacts committed:
lib/directories in version control - Unclear error messages: Non-actionable error descriptions
- Inconsistent flag naming: Similar flags with different names
- Missing command examples: Examples not showing actual usage
- Command properly extends
@contentstack/cli-commandCommand - Flags defined with proper types from
@contentstack/cli-utilities - Error handling uses
handleAndLogErrorutility - User feedback uses
cliuxutilities - Tests use Mocha + Chai pattern with mocked dependencies
- Package.json has correct scripts (build, compile, test, lint)
- TypeScript compiles with no errors
- Tests pass:
pnpm test - No
.onlyor.skipin test files - Build succeeds:
pnpm run build - OCLIF manifest generated successfully
- All review items addressed
- No build artifacts in commit
- Tests added for new functionality
- Documentation updated if needed
- No console.log() statements (use log.debug instead)
- Error messages are user-friendly
- No secrets or credentials in code