business-logic-entry-point-prefer-top-level-functions

Installation
SKILL.md

Prefer Top-Level Functions for Business Logic Entry Points

Goal

When implementing a business-logic entry point, prefer a top-level function over a class or object, as long as the project stack allows it without introducing friction.

A top-level function is a function defined at module scope, not inside a class or object. It is the simplest code shape for an entry point: one function, one module, no wrapper.

What Counts as In Scope

Apply this skill to code that does one or more of these things:

  • defines a new business-logic entry point and must choose between a top-level function, a class, or an object
  • wraps a single entry-point function in a class or object without a clear reason
  • uses a class or object only as a container for one public method plus dependency injection that could be achieved with function parameters or closures

The Rule

  1. Default to a top-level function for each business-logic entry point.
Related skills

More from code-sherpas/agent-skills

Installs
6
First Seen
Mar 24, 2026