domains / families / software-engineering / code-structure
code-structure
separate
Use when multiple workflows duplicate the same operational logic, when deciding what belongs in actions vs shared services, or when refactoring repeated operational blocks across domain flows. Use when adding new features that share mechanics with existing ones.
When to use
- Multiple callers need the same low-level operation (sandbox creation, email sending, payment processing)
- You're copy-pasting operational logic between action files
- A bug fix in one workflow doesn't propagate to others doing the same thing
- Adding a new feature that shares mechanics with existing flows
When not to use
- Extraction that adds indirection without a concrete benefit
- Speculative abstractions with no current benefit
- Tasks where existing domain services, repositories, or framework patterns already fit
Skill page
Source