business-logic
Installation
SKILL.md
Business Logic Engineering
Purpose
Business logic is the layer where the product lives. It is the difference between "save a row to the database" (data access) and "process a refund only if the order was placed within 30 days and the product has not been shipped" (business rule). This skill exists because vibe-coders frequently collapse business rules into route handlers or database queries, making them invisible, untestable, and impossible to change without breaking something.
SOP: Business Logic Design and Implementation
Step 1 - Extract the Domain Rules First
Before writing any code, explicitly state every business rule in plain language. Ask the user:
- What are the conditions that must be true for this action to succeed?
- What happens when those conditions are not met?
- Are there time-based rules? (e.g., "within 30 days", "before end of billing cycle")
- Are there role-based rules? (e.g., "only admins can...", "only the resource owner can...")
- What state changes happen as a result of this action?