/otter:logic-component-shapefrom otter
Decision tree for choosing between a single component and container/presenter split, plus which componentStructure and componentType to generate. Invoked by logic-placement and logic-review.
Ships in otter. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Returns: single component, or container + presenter, plus the componentStructure to generate and the componentType to declare.
Default to a single component. A split separates data and business-logic access from pure presentation, and the container/presenter documentation says a component interacting with external entities may be split — not that it must be.
The split puts a seam between data access and presentation so one can vary without touching the other. It is worth its cost only when something on one side actually varies.
CRITERION A one data source, several UI flavours
dense table on desktop and stacked cards on mobile; an A/B variant; or a
presenter integrators swap or configure at runtime — through the CMS or
Otter's component replacement mechanism — which is just another flavour
supplied from outside, and needs the display half to be its own component
whose inputs and outputs are the contract
without the seam: the fetch is duplicated per variant, or the template
branches on display concerns
CRITERION B one UI flavour, several data sources
a passenger list rendered from a search result on one screen and from a
saved itinerary on another
without the seam: the presentation is copied, and the copies drift
IF A or B is true -> BRANCH A: container + presenter
ELSE -> BRANCH B: single component
Name what varies before splitting. If you cannot say which of data source, display, or integrator-supplied implementation will differ, there is nothing for the seam to absorb.
"The logic feels complex enough to separate" is not an additional criterion. Complexity alone is a human judgement call — see the split without variation stop-and-ask in logic-placement.
SCHEMATIC ng g component <name> --componentStructure=full
VERIFY the container injects Store, services, or SDK clients, and dispatches
the presenter declares inputs and outputs only
the presenter renders from a spec by supplying inputs alone
| Concern | Owner |
|---|---|
Inject Store, dispatch, select | container |
| Call a service or SDK client for shared data | container |
| Map store or API models to view models | container |
| Business rules, custom validators, submit handling | container |
| Router, guards, query params | container |
| Choose which presenter flavour to render | container |
| Format, sort, filter data already received | presenter |
| Local UI state (open/closed, tab, page, hover) | presenter |
| Emit user intent upward | presenter |
| Styling, animation, breakpoints | presenter |
Data down through inputs, events up through outputs.
The leak is often indirect. A presenter that injects no store and makes no HTTP client can still reach both through a service. Judge by what the service does, not by what the presenter imports: if it selects from the store, calls an API, or triggers a side effect beyond the component, it belongs in the container. A presenter may inject presentation helpers only — formatting, breakpoints.
SCHEMATIC ng g component <name> --componentStructure=simple
VERIFY no -cont or -pres suffix anywhere in file, class, selector, or template
no container that would only forward its inputs
Shapes where nothing can vary:
Splitting anyway produces a container that only forwards inputs, which is the failure mode to avoid. The documentation applies the same rule to the folder layout:
A component with only a presenter and no container should not have a presenter folder
A functional area containing only one block should not have a sub-folder for it
A single component is not a dead end: ng g component --componentStructure=presenter adds the display half later to what already exists.
| Decision | componentStructure |
|---|---|
| Single component | simple |
| Container + presenter pair | full |
| Container only, presenter already exists | container |
| Presenter only, added to an existing container | presenter |
Use otter-schematics to discover the schematic and its current options.
It also produces the naming and folder layout, so neither needs deriving by hand —
see the container/presenter documentation for the *-cont / *-pres conventions.
Every Otter component carries @O3rComponent({ componentType }), and the value must agree with the container/presenter role assigned above.
| Value | Meaning | Role |
|---|---|---|
Page | Displays an application route | container |
Block | Handles a functional area | container |
ExposedComponent | Needs to be exposed in the CMS | presenter |
Component | Neither exposed nor fitting the others | presenter, or a single unsplit component |
A mismatch reliably means logic sits in the wrong place: a Page that injects nothing and only holds display state is a presenter; a Component that dispatches store actions is a container.
Either the type or the logic must move.
Choosing between Block and ExposedComponent is a CMS-exposure decision, not a placement one — see the CMS replacement undecided stop-and-ask in logic-placement.
@O3rComponent({ componentType: 'Page' })
@Component({
selector: 'my-app-passengers-cont',
imports: [PassengersPres],
templateUrl: './passengers-cont.html',
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PassengersCont implements OnInit {
private readonly store = inject(Store);
private readonly passengerApi = inject(PassengerApi);
/** Passengers to display, selected from the store */
public readonly passengers = toSignal(this.store.pipe(select(selectAllPassengers)), { initialValue: [] });
public ngOnInit() {
this.store.dispatch(setPassengersEntitiesFromApi({
call: this.passengerApi.getPassengers(),
requestId: 'passengers-initial-load'
}));
}
/** Forwarded from the presenter's output */
public onPassengerSelected(passengerId: string) {
this.store.dispatch(selectPassenger({ passengerId }));
}
}
@O3rComponent({ componentType: 'ExposedComponent' })
@Component({
selector: 'my-app-passengers-pres',
templateUrl: './passengers-pres.html',
styleUrls: ['./passengers-pres.scss'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PassengersPres {
/** Passengers to render */
public readonly passengers = input.required<Passenger[]>();
/** Emitted when the user picks a passenger */
public readonly passengerSelected = output<string>();
/** Local UI state: nothing outside this component needs it */
public readonly sortDirection = signal<'asc' | 'desc'>('asc');
/** Display ordering derived from inputs plus local state */
public readonly sortedPassengers = computed(() => {
const factor = this.sortDirection() === 'asc' ? 1 : -1;
return [...this.passengers()].toSorted((a, b) => factor * a.lastName.localeCompare(b.lastName));
});
}
The presenter renders from a spec by supplying passengers alone — that is the test for a clean split.
Additional details:
passengers into the presenter's required signal input.
Why the bridge needs initialValue and why | async would not fit are in rxjs-vs-signals.@Localization on a translations property still requires the decorator-based @Input(), so check which form the decorator you need supports rather than generalizing to signals.@O3rComponent decorator and component typesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub amadeusitgroup/otter --plugin otter11 skills in this plugin
/logic-placementDecide where new logic belongs — component shape, logic layer, and store variant — when designing a component, service, or store in an Angular/Otter workspace. Use `logic-review` to assess existing code./logic-reviewReview existing components, services, or stores for misplaced logic — presenter leaks, componentType mismatches, wrong store variants. Use `logic-placement` when designing something new./logic-state-layerDecision tree for whether logic belongs in the component class, a service, or an NgRx store, including service scope and where API calls go. Invoked by `logic-placement` and `logic-review`, not directly./logic-store-typeDecision tree for which NgRx store variant to generate — entity or simple, sync or async. Invoked by `logic-placement` and `logic-review` once a store is justified, not directly; it does not decide whether a store is warranted./otter-mcp-setupThis skill should be used when the `@o3r/mcp` MCP server is not available and needs to be installed, or when the user asks to "install otter mcp", "setup otter mcp", or "configure otter mcp server"./otter-new-configThis skill should be used when the user asks to "add configuration to a component", "introduce a config flag", "add a feature toggle", "add a runtime config", "create a config property", or when any new configuration flag is being introduced in an Otter workspace. Guides scope decisions, safe defaults, and absence-detection patterns.Other plugins' skills for the same job