actions-pattern
Garante que novas Actions sigam o padrão de classes actions reutilizáveis do Easy Budget.
Best use case
actions-pattern is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Garante que novas Actions sigam o padrão de classes actions reutilizáveis do Easy Budget.
Teams using actions-pattern should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/actions-pattern/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How actions-pattern Compares
| Feature / Agent | actions-pattern | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Garante que novas Actions sigam o padrão de classes actions reutilizáveis do Easy Budget.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Padrão de Actions do Easy Budget
Esta skill define o padrão arquitetural para criação de Actions no sistema Easy Budget. Actions são classes focadas em uma única responsabilidade de negócio, reutilizáveis e composáveis.
## Estrutura Padrão
```php
<?php
declare(strict_types=1);
namespace App\Actions\ModuleName;
use App\Support\ServiceResult;
use Exception;
class ActionName
{
public function __construct(
private DependencyA $dependencyA,
private DependencyB $dependencyB
) {}
/**
* Descrição do que a action executa.
*/
public function execute(ParamType $param): ServiceResult
{
try {
// 1. Validações de pré-condição
if (!$this->isValid($param)) {
return ServiceResult::error('Mensagem de erro específica.');
}
// 2. Operações de banco em transação (se necessário)
return DB::transaction(function () use ($param) {
// Lógica de negócio
$result = $this->performAction($param);
// Registro de histórico (se aplicável)
$this->logAction($param, $result);
return ServiceResult::success($result, 'Mensagem de sucesso.');
});
} catch (Exception $e) {
return ServiceResult::error($e->getMessage());
}
}
private function isValid(ParamType $param): bool
{
// Lógica de validação
return true;
}
private function performAction(ParamType $param): mixed
{
// Implementação da ação
return $result;
}
private function logAction(ParamType $param, mixed $result): void
{
// Registro de histórico se o modelo suportar
if (method_exists($param, 'actionHistory')) {
$param->actionHistory()->create([
'tenant_id' => tenant('id'),
'action' => 'action_name',
'description' => 'Descrição da ação realizada.',
'user_id' => auth()->id(),
]);
}
}
}
```
## Regras de Composição
1. **Dependências via Constructor Injection**: Sempre injete dependências no construtor
2. **Método `execute` único**: Cada Action deve ter um único ponto de entrada
3. **ServiceResult obrigatório**: Sempre retorne `ServiceResult` para operações que podem falhar
4. **Transação de banco**: Use `DB::transaction()` para operações que modificam dados
5. **Tratamento de exceções**: Use try-catch e retorne erros via `ServiceResult::error()`
6. **Registro de histórico**: Use `actionHistory()` quando disponível
## Exemplo de Composição de Actions
```php
class ComplexBusinessAction
{
public function __construct(
private ActionA $actionA,
private ActionB $actionB,
private ActionC $actionC
) {}
public function execute(Context $context): ServiceResult
{
// Compõe múltiplas actions em um fluxo de negócio
$resultA = $this->actionA->execute($context);
if ($resultA->isError()) {
return $resultA;
}
return $this->actionB->execute($context);
}
}
```
## Quando Criar uma Nova Action
- Quando a lógica de negócio é reutilizável em múltiplos controllers
- Quando o fluxo envolve múltiplas operações transacionais
- Quando há necessidade de composição com outras actions
- Quando a lógica é complexa o suficiente para justificar separação
## Quando NÃO Criar uma Action
- Operações simples de CRUD que podem ir direto no Service
- Lógica que só é usada em um único lugar
- Operações que são apenas wrapper de repositoryRelated Skills
advanced-patterns
Advanced T-SQL patterns and techniques for SQL Server. Use this skill when: (1) User needs help with CTEs or recursive queries, (2) User asks about APPLY operator, (3) User wants MERGE or OUTPUT clause help, (4) User works with temporal tables, (5) User needs In-Memory OLTP guidance, (6) User asks about advanced grouping (ROLLUP, CUBE, GROUPING SETS).
advanced-js-mocking-patterns
Advanced mocking patterns for Jest and Vitest including module mocking, spies, and fake timers. PROACTIVELY activate for: (1) Module mocking, (2) Partial mocking with spies, (3) Mock lifecycle management, (4) Fake timers for time-dependent code, (5) Complex mock implementations. Triggers: "jest.mock", "vi.mock", "spyOn", "fakeTimers", "mockImplementation", "mockReturnValue", "mock lifecycle"
Advanced GetX Patterns
Advanced GetX features including Workers, GetxService, SmartManagement, GetConnect, GetSocket, bindings composition, and testing patterns
add-outbox-pattern
Add transactional outbox pattern for reliable event publishing with RavenDB (project)
patterns/adapter
Adapter (Wrapper) Pattern pattern for C development
ActiveRecord Query Patterns
Complete guide to ActiveRecord query optimization, associations, scopes, and PostgreSQL-specific patterns. Use this skill when writing database queries, designing model associations, creating migrations, optimizing query performance, or debugging N+1 queries and grouping errors.
github-actions
Create and configure GitHub Actions. Use when building custom actions, setting up runners, implementing security practices, or publishing to the marketplace.
actions-debugger
GitHub Actions のワークフロー実行エラーを調査し、原因を特定して解決策を提案する。「Actions エラー」「ワークフロー失敗」「CI が落ちた」「ビルド失敗」「テスト失敗」「Actions を調べて」「CI のエラーを見て」などで起動。失敗したジョブのログを分析し、具体的な修正方法を提示。
actions-cicd-practices
GitHub Actions and CI/CD best practices for automated testing, building, and deployment.
Action Pattern Conventions
This skill should be used when the user asks about "Laravel action pattern", "action class naming", "how to structure actions", "React component patterns", "Node.js service structure", "framework-specific conventions", or discusses creating reusable, focused classes following action pattern conventions in Laravel, Symfony, React, Vue, or Node.js projects.
Action Cable & WebSocket Patterns
Real-time WebSocket features with Action Cable in Rails. Use when: (1) Building real-time chat, (2) Live notifications/presence, (3) Broadcasting model updates, (4) WebSocket authorization. Trigger keywords: Action Cable, WebSocket, real-time, channels, broadcasting, stream, subscriptions, presence, cable
ace-pattern-learning
Search ACE playbook before implementing, building, fixing, debugging, or refactoring code. Capture patterns after completing substantial coding work.