Guides separation of Angular signal responsibilities: signal() for source state, computed() for derivations, linkedSignal() for writable dependent state, resource() for async boundaries, and effect() for side effects.
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 separate Angular signal responsibilities correctly:
signal() owns mutable source state.computed() owns pure readonly derivation.linkedSignal() owns dependent writable state with controlled override.resource() owns async signal-based state boundaries.effect() and afterRenderEffect() run external side effects for non-signal APIs.The goal is to avoid mixing state ownership, derivation, reactive execution context, rendering, async loading, and side effects in the same reactive block.
Use this decision model before changing code:
signal -> mutable source state
computed -> pure readonly derivation
linkedSignal -> dependent writable state with controlled override
resource -> async signal-based state boundary
template/host -> reactive rendering consumer
effect -> external side effect before DOM render commit
afterRenderEffect -> external DOM or rendering side effect after DOM render commit
Default to this order:
signal -> computed -> linkedSignal -> resource/template -> effect/afterRenderEffect
Use this skill when Angular components, directives, services, or signal stores contain:
effect();computed();computed() values being treated as writable;effect() used for business rules, state propagation, or internal data transformation;await are tracked by the original reactive context.Identify explicit source state first:
readonly searchTerm = signal('');
readonly items = signal<Item[]>([]);
readonly selectedId = signal<string | null>(null);
Move pure derivations to computed():
readonly filteredItems = computed(() => {
const term = this.searchTerm().trim().toLowerCase();
return this.items().filter((item) =>
item.name.toLowerCase().includes(term),
);
});
Use linkedSignal() only when the value is derived from another signal and still has a valid manual override:
readonly options = signal<Option[]>([]);
readonly selectedOption = linkedSignal<Option[], Option | undefined>({
source: this.options,
computation: (options, previous) => {
return (
options.find((option) => option.id === previous?.value?.id) ??
options[0]
);
},
});
selectOption(optionId: string): void {
const option = this.options().find((item) => item.id === optionId);
if (option) {
this.selectedOption.set(option);
}
}
Keep effect() at the boundary with non-signal APIs:
constructor(private readonly analytics: AnalyticsService) {
effect(() => {
this.analytics.trackSearch(this.searchTerm());
});
}
Use afterRenderEffect() only when the side effect needs the DOM after Angular has rendered:
constructor(private readonly chart: ChartAdapter) {
afterRenderEffect(() => {
this.chart.render(this.chartData());
});
}
Read tracked signals before an async boundary:
effect(async () => {
const theme = this.theme();
await this.loadData();
this.logger.info('Loaded data for theme', theme);
});
Use untracked() only for incidental reads that must not become dependencies:
effect(() => {
const user = this.currentUser();
untracked(() => {
this.logger.info('User changed', {
user,
counter: this.counter(),
});
});
});
Do not copy one signal into another with effect():
readonly total = signal(0);
constructor() {
effect(() => {
this.total.set(this.items().length);
});
}
Prefer:
readonly total = computed(() => this.items().length);
Do not treat computed() as writable:
readonly total = computed(() => this.items().length);
updateTotal(): void {
this.total.set(10);
}
Do not introduce linkedSignal() just because computed() is readonly. If there is no valid manual override, use computed().
Do not put business rules in effect() when the rule can be expressed as source state plus pure derivation.
Do not rely on signal reads after await to be tracked by the same reactive context:
effect(async () => {
await this.loadData();
this.logger.info(this.theme());
});
Do not hide unclear state ownership with untracked().
Do not place expensive logic directly in templates or host bindings. Use computed() for memoized derivation and keep rendering expressions simple.
signal() or an existing owned state boundary.computed().linkedSignal() only when manual override is valid.resource() or the existing async model.effect() is limited to external side effects and non-signal APIs.afterRenderEffect() is limited to DOM or rendering work that requires committed DOM.effect() only copies one signal into another.computed() is treated as writable.await is incorrectly assumed to be tracked.computed().linkedSignal().When this skill is used, the agent should return:
computed() over effect-based propagation.linkedSignal(), resource(), effect(), or afterRenderEffect() that remains.Before:
readonly fullName = signal('');
constructor() {
effect(() => {
this.fullName.set(`${this.firstName()} ${this.lastName()}`);
});
}
After:
readonly fullName = computed(() => {
return `${this.firstName()} ${this.lastName()}`;
});
Before:
readonly defaultTab = computed(() => this.tabs()[0]);
selectTab(tab: Tab): void {
this.defaultTab.set(tab);
}
After:
readonly selectedTab = linkedSignal<Tab[], Tab | undefined>({
source: this.tabs,
computation: (tabs, previous) => {
return tabs.find((tab) => tab.id === previous?.value?.id) ?? tabs[0];
},
});
selectTab(tab: Tab): void {
this.selectedTab.set(tab);
}
Before:
@for (item of items().filter(matchesSearchTerm); track item.id) {
<app-item-row [item]="item" />
}
After:
readonly visibleItems = computed(() => {
return this.items().filter((item) => this.matchesSearchTerm(item));
});
@for (item of visibleItems(); track item.id) {
<app-item-row [item]="item" />
}
Test behavior, not Angular internals:
computed() values;computed() remains readonly by design;linkedSignal() initializes from the source;linkedSignal() preserves a valid manual selection after the source changes;linkedSignal() resets or reconciles when the previous selection is no longer valid;effect() calls external dependencies only when expected;afterRenderEffect() integrations are covered with DOM or adapter tests;Example:
it('preserves selected option when the source changes and the option still exists', () => {
const component = new ShippingMethodPickerComponent();
component.options.set([
{ id: 'ground', label: 'Ground' },
{ id: 'air', label: 'Air' },
]);
component.selectOption('air');
component.options.set([
{ id: 'air', label: 'Air updated' },
{ id: 'sea', label: 'Sea' },
]);
expect(component.selectedOption()?.id).toBe('air');
});
effect() used for state propagation can cause circular updates and extra change detection work.effect() used for business logic makes behavior harder to predict and test.linkedSignal() can hide unclear state ownership if overused.computed() must stay pure and readonly.resource() should not become a dumping ground for unrelated UI logic.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
/ngautopilot-angular:angular--signals--signal-computed-linked-effect-boundariesfrom 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.
/angular--ai--angular-v22-devserver-self-healing-loopAngular v22 Devserver Self Healing LoopUse devserver build logs as an agent feedback loop while keeping validation deterministic. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--ai--angular-v22-webmcp-tool-exposureAngular v22 WebMCP Tool ExposureDesign WebMCP tool exposure with narrow capabilities, validation, permissions, and auditability. For Angular 22 projects and 21-to-22 upgrade planning.
/angular--architecture--angular-enterprise-onboarding-planAngular Enterprise Onboarding PlanDesigns Angular enterprise onboarding paths that ramp developers through project conventions, architecture boundaries, testing discipline, and version-aware delivery expectations.