Designs Angular reactive contracts that expose readonly Observables instead of mutable arrays, public Subjects, writable signals, or copied subscription state.
Ships in ngautopilot-angular. 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.
Use this skill to expose reactive state safely through readonly Observables. The goal is to prevent external mutation, reduce manual subscription state, and create stable contracts between services, facades, and components.
Use this skill when:
Subject or BehaviorSubject publicly.Expose readonly Observable contracts:
@Injectable()
export class UserStateService {
private readonly usersSubject = new BehaviorSubject<readonly User[]>([]);
readonly users$: Observable<readonly User[]> =
this.usersSubject.asObservable();
setUsers(users: readonly User[]): void {
this.usersSubject.next(users);
}
}
Expose loading and error state explicitly:
readonly loading$: Observable<boolean> = this.loadingSubject.asObservable();
readonly error$: Observable<unknown | null> = this.errorSubject.asObservable();
Use async in templates when the value is only rendered:
<app-user-list [users]="users$ | async" />
For Angular 16+ local signal state, expose readonly signals:
private readonly usersSignal = signal<readonly User[]>([]);
readonly users = this.usersSignal.asReadonly();
Keep Observables for async flows that need cancellation, retries, composition, or multiple emissions over time.
For new finite stream states, prefer literal unions, including discriminated unions when each state carries different data. Use an as const object or array only when runtime values are needed and derive the type from it. Validate untrusted emitted values at the boundary; preserve enums required by existing stream consumers.
Specify the temporal contract as well as the emitted type: when input takes effect, whether duplicate values trigger work, which overlapping response may survive, and whether an error completes the stream or allows another command. Keep empty, loading, and failure states distinguishable when consumers depend on that distinction.
Avoid exposing writable subjects:
usersSubject = new BehaviorSubject<User[]>([]);
Avoid public writable signals from state services:
readonly users = signal<User[]>([]);
Avoid copying stream values into mutable component fields unless imperative integration requires it:
this.userService.users$.subscribe((users) => {
this.users = users;
});
Avoid exposing API DTO streams directly to reusable UI components when a view model contract would be safer.
async for template-only Observable values when practical.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/ngautopilot-angular:angular--rxjs--observable-contractsfrom ngautopilot-angular
npx claudepluginhub janpereira-dev/ngautopilot --plugin ngautopilot-angular350 skills in this plugin
/angular--ai--angular-v22-agent-skills-integrationAngular v22 Agent Skills IntegrationUse official Angular Agent Skills as reference material without copying them blindly or replacing NgAutoPilot routing. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--ai--angular-v22-ai-tutor-safe-usageAngular v22 AI Tutor Safe UsageUse AI tutor workflows to teach Angular concepts without allowing unsafe code or secret exposure. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--ai--angular-v22-angular-mcp-agent-workflowAngular v22 Angular MCP Agent WorkflowReview the workspace boundary, permissions, and runtime evidence of an Angular MCP integration. For Angular 22 projects and 21-to-22 upgrade planning.
Other plugins' skills for the same job