skills/code-review/business-logic-review/SKILL.md
Review code for business logic correctness, edge cases, and alignment with requirements. Use for verifying feature implementations, catching logic errors, ensuring proper handling of business rules, and validating that code does what was intended.
npx skillsauth add simplerick0/com.ackhax.configs business-logic-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Verify code correctly implements business requirements and handles all cases.
Before reviewing code, clarify:
Walk through each user path:
Happy path: Normal successful flow
Error paths: Each way things can fail
Edge cases: Boundary conditions, empty states
For each rule, find where it's enforced:
Rule: "Users can only edit their own posts"
- Check: Is ownership validated?
- Where: Before edit operation
- How: user.id == post.author_id
Question implicit assumptions:
# Missing: What if user_id doesn't exist?
def get_user_orders(user_id):
return Order.query.filter_by(user_id=user_id).all()
# Better: Handle missing user
def get_user_orders(user_id):
user = User.query.get(user_id)
if not user:
raise UserNotFoundError(user_id)
return user.orders
# Bug: Off-by-one error
if age >= 18 and age < 65: # What about 65-year-olds?
apply_standard_rate()
# Correct: Clear boundaries
if 18 <= age <= 64:
apply_standard_rate()
elif age >= 65:
apply_senior_rate()
# Bug: Check-then-act race condition
if inventory.count > 0:
inventory.count -= 1 # Another request could decrement first
# Better: Atomic operation
result = Inventory.query.filter(
Inventory.id == item_id,
Inventory.count > 0
).update({Inventory.count: Inventory.count - 1})
if result == 0:
raise OutOfStockError()
# Bug: Can transition from any state to completed
def complete_order(order):
order.status = 'completed'
# Better: Validate state transitions
VALID_TRANSITIONS = {
'pending': ['processing', 'cancelled'],
'processing': ['completed', 'failed'],
}
def complete_order(order):
if 'completed' not in VALID_TRANSITIONS.get(order.status, []):
raise InvalidStateTransition(order.status, 'completed')
order.status = 'completed'
## Business Logic Review: [Feature Name]
### Requirements Verified
- [x] Requirement 1 - Implemented in `function_name()`
- [x] Requirement 2 - Implemented in `class.method()`
- [ ] Requirement 3 - **NOT FOUND**
### Logic Issues
- **[Location]**: [Description of logic error]
- Expected: [What should happen]
- Actual: [What the code does]
- Impact: [Business impact if not fixed]
### Edge Cases
| Case | Handled? | Location |
|------|----------|----------|
| Empty input | Yes | line 42 |
| User not found | No | - |
| Concurrent edit | No | - |
### Questions for Clarification
- [Question about unclear requirement]
development
Manage VSCode/Cursor configuration in this dotfiles repository. Use when working with settings.json, keybindings.json, or tasks.json files, or when asked about VSCode/Cursor configuration structure.
tools
Design user interfaces and experiences for web applications without requiring design tools. Use for wireframing in text/ASCII, defining user flows, creating component hierarchies, establishing design systems, planning responsive layouts, and making accessibility decisions.
development
Testing specialist focused on comprehensive test coverage for Python applications. Use for pytest patterns, unit/integration/E2E testing, fixtures, mocking, property-based testing with Hypothesis, and factory patterns.
development
Project management adapted for solo developers working without a team. Use for personal project planning, time-boxing work sessions, managing scope creep alone, maintaining momentum on side projects, tracking progress without overhead, making decisions without external input, and staying accountable to yourself.