Agent skill
helpers
Stateless utility classes providing shared formatting, conversion, or calculation logic needed across multiple parts of the application.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/helpers
SKILL.md
Name: Helpers Description: Stateless utility classes providing shared formatting, conversion, or calculation logic needed across multiple parts of the application. Compatible Agents: general-purpose, backend Tags: app/Helpers/**/*.php, laravel, php, backend, helper, utility
Rules
- Helper classes live in
app/Helpers/ - Naming:
PascalCasewith aHelpersuffix →StringHelper,MoneyHelper,DateHelper - Helpers are for utilities needed in multiple places across the project
- For testability, static methods are acceptable but not enforced — use your judgement
- Never put business logic in helpers — use Actions or Services
- Never put database queries in helpers — use Model Scopes
- Never put HTTP requests in helpers — use Services
Examples
namespace App\Helpers;
use Carbon\Carbon;
class DateHelper
{
public static function format(mixed $date, string $format = 'd M Y'): ?string
{
if (is_null($date)) {
return null;
}
return Carbon::parse($date)->format($format);
}
}
namespace App\Helpers;
class MoneyHelper
{
public static function format(int $amountInCents, string $currency = 'CHF'): string
{
return number_format($amountInCents / 100, 2) . ' ' . $currency;
}
}
// Usage in a Resource
'created_at' => DateHelper::format($this->created_at),
'amount' => MoneyHelper::format($this->amount_in_cents),
Anti-Patterns
- Putting business logic in a helper (belongs in an Action or Service)
- Putting database queries in a helper (use Model scopes instead)
- Using a helper for logic only needed in one place (keep it inline)
- Creating a catch-all
AppHelperorUtilsclass — keep helpers domain-specific
References
- Carbon Documentation
- Related:
Actions/SKILL.md— for business logic - Related:
Resources/SKILL.md— helpers are commonly used for formatting in API resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?