plutonium-interaction

Encapsulate resource actions into reusable interaction classes with validations and outcomes.

68|10|Updated Jan 10, 2024
One-click install
npx skills add https://github.com/radioactive-labs/plutonium-core --skill plutonium-interaction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plutonium-interaction
Source: https://github.com/radioactive-labs/plutonium-core/tree/main/.claude/skills/plutonium-interaction
Command: npx skills add https://github.com/radioactive-labs/plutonium-core --skill plutonium-interaction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Encapsulates business logic into reusable, testable interactions that can be shared across resources and actions, reducing duplication and ensuring consistent behavior.

Core Features & Use Cases

  • Encapsulation of resource actions as standalone interaction classes with defined inputs, validations, and outcomes.
  • Support for presentation metadata, policy checks, and chained executions to compose complex workflows.
  • Easy testing and reuse across controllers, definitions, and UI layers.

Quick Start

Create a new interaction class inheriting from ResourceInteraction and implement an execute method to perform the desired operation.

Frequently Asked Questions about plutonium-interaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I encapsulate and reuse business logic for Rails resource actions?

You can encapsulate business logic into reusable, testable interactions by creating classes that inherit from ResourceInteraction, reducing duplication and ensuring consistent behavior across Rails resources.

What is the best way to test business actions in a Plutonium app?

The best way to test business actions is to encapsulate them as standalone interaction classes with defined inputs, validations, and outcomes, allowing easy testing and reuse across controllers and UI layers.

Can I implement policy checks and validation in Rails resource interactions?

Yes, resource interactions support policy checks and validations by defining attributes, inputs, and outcomes such as succeed or failed, alongside presentation hooks for UI integration.

Does plutonium-interaction support bulk and collection actions for Ruby resources?

Yes, plutonium-interaction applies to Rails-style Plutonium apps to implement record, collection, and bulk actions with validation, presentation, and policy integration.

How do you chain executions to build complex workflows in Rails?

You can build complex workflows by using chained executions on standalone interaction classes, composing multiple resource interactions with defined inputs and outcomes across controllers.

When should I move business logic into standalone interaction classes?

You should move business logic into standalone interaction classes when you need to share actions across resources, reduce duplication, and ensure consistent behavior with policy and presentation integration.