Code quality verification skill for reviewer agents. Provides checklists for logic clarity, error handling, maintainability, and performance. Use during VERIFICATION phase to assess implementation quality.
Assesses code quality across logic, errors, maintainability, performance, and testing.
npx claudepluginhub mnthe/hardworker-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Systematic code quality assessment for ultrawork verification phase.
Structured checklists for evaluating code quality across multiple dimensions:
Checklist:
[ ] Functions have single, clear responsibilities
[ ] Functions are under 50 lines
[ ] Files are under 800 lines
[ ] Nesting depth is 4 levels or less
[ ] Control flow is straightforward (no convoluted conditionals)
[ ] Variable and function names are descriptive
[ ] No magic numbers (constants are named)
[ ] Complex logic has explanatory comments
[ ] Boolean conditions are readable (avoid double negatives)
[ ] Early returns reduce nesting
Red Flags:
x, tmp, data, thingif (status === 42)if { if { if { if { ... }}}}if (!(!isValid && !isExpired))Examples:
// ❌ Bad: Unclear logic, magic numbers
function process(x) {
if (x > 100 && x < 500) {
return x * 0.95;
}
return x;
}
// ✅ Good: Clear intent, named constants
const BULK_ORDER_MIN = 100;
const BULK_ORDER_MAX = 500;
const BULK_DISCOUNT_RATE = 0.95;
function applyBulkDiscount(orderTotal) {
const isBulkOrder = orderTotal >= BULK_ORDER_MIN && orderTotal <= BULK_ORDER_MAX;
return isBulkOrder ? orderTotal * BULK_DISCOUNT_RATE : orderTotal;
}
Checklist:
[ ] All async operations have error handling
[ ] try/catch blocks used for risky operations
[ ] Errors are logged with context
[ ] User-facing errors are sanitized
[ ] Error messages are actionable
[ ] No silent failures (empty catch blocks)
[ ] Edge cases are handled (null, undefined, empty arrays)
[ ] Input validation exists for external data
[ ] Database operations handle connection failures
[ ] API calls have timeout handling
Red Flags:
catch (e) {}throw new Error('error')Examples:
// ❌ Bad: Silent failure
try {
await saveUser(user);
} catch (e) {
// Silent failure - data loss risk
}
// ✅ Good: Proper error handling
try {
await saveUser(user);
} catch (error) {
logger.error('Failed to save user', { userId: user.id, error });
throw new Error('Unable to save user data. Please try again.');
}
Checklist:
[ ] No copy-pasted code blocks
[ ] Repeated logic is extracted to functions
[ ] Similar patterns use shared utilities
[ ] Constants are defined once
[ ] Configuration is centralized
[ ] Validation logic is reusable
[ ] Data transformation uses shared helpers
Red Flags:
Examples:
// ❌ Bad: Duplication
function validateEmail(email) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}
function isValidEmail(email) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}
// ✅ Good: Single source of truth
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
function validateEmail(email) {
return EMAIL_REGEX.test(email);
}
Checklist:
[ ] Consistent indentation (spaces/tabs)
[ ] Consistent naming convention (camelCase, PascalCase, etc.)
[ ] Consistent quote style (single/double)
[ ] No trailing whitespace
[ ] Proper spacing around operators
[ ] Consistent brace style
[ ] No commented-out code
[ ] No console.log statements in production code
[ ] Imports are organized (grouped, sorted)
[ ] No unused imports or variables
Red Flags:
getUserData(), get_user_info()console.log('HERE')Checklist:
[ ] Algorithms use appropriate complexity (O(n) vs O(n²))
[ ] Expensive operations are cached
[ ] Database queries use indexes
[ ] N+1 query problems avoided
[ ] Large datasets are paginated
[ ] Unnecessary re-renders prevented (React)
[ ] Heavy computations are memoized
[ ] File operations are batched
[ ] Network requests are minimized
Red Flags:
Examples:
// ❌ Bad: O(n²) complexity, N+1 queries
for (const order of orders) {
const user = await db.users.findById(order.userId); // N+1!
results.push({ ...order, user });
}
// ✅ Good: Single query with join
const ordersWithUsers = await db.orders
.find({ id: { $in: orderIds } })
.populate('user');
Checklist:
[ ] New code has corresponding tests
[ ] Tests verify actual behavior (not just pass)
[ ] Edge cases are tested
[ ] Error paths are tested
[ ] Test names describe what is tested
[ ] Tests are isolated (no shared state)
[ ] Mocks are used for external dependencies
[ ] Test coverage is adequate (not necessarily 100%)
Red Flags:
# Check for syntax errors
npm run lint
# Check for type errors (TypeScript)
npm run type-check
# Check for security issues
npm audit
Read the modified files completely. Check:
# Run tests
npm test
# Check coverage
npm run test:coverage
Verify:
Look for:
| Category | Weight | Score |
|---|---|---|
| Logic Clarity | 25% | 0-10 |
| Error Handling | 25% | 0-10 |
| Maintainability | 20% | 0-10 |
| Performance | 15% | 0-10 |
| Testing | 15% | 0-10 |
Overall Score = Weighted Average
| Issue | Fix |
|---|---|
| Large function | Extract smaller functions |
| Deep nesting | Use early returns, extract conditions |
| Magic numbers | Define named constants |
| No error handling | Add try/catch, validate inputs |
| Duplicated code | Extract shared utility |
| Poor naming | Rename to describe purpose |
| Missing tests | Write tests for new code |
| O(n²) loops | Use hash maps, optimize algorithm |
When reviewing code quality, collect evidence:
### Code Quality Assessment
- Logic Clarity: 8/10
- Functions under 50 lines: ✓
- Clear naming: ✓
- No magic numbers: ✓
- Error Handling: 7/10
- Try/catch present: ✓
- Null checks: ✓
- Missing timeout handling: ✗
- Maintainability: 9/10
- No duplication: ✓
- Consistent style: ✓
- Well-tested: ✓
Overall: 8/10 - Ready to merge
During VERIFICATION phase:
# Review implemented files
reviewer --task-id 1
# Add quality assessment to evidence
bun "{SCRIPTS_PATH}/task-update.js" --session ${CLAUDE_SESSION_ID} --id verify \
--add-evidence "Code Quality: 8/10 (Logic: 8, Errors: 7, Maintainability: 9)"
Must-have quality standards:
Nice-to-have quality improvements:
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.