skills/angular-access-modifiers/SKILL.md
Recommended usage of access modifiers in Angular components: public readonly for API (inputs/outputs), protected readonly for template state, private readonly for internal logic. Trigger: When defining component properties in Angular.
npx skillsauth add araujomartin/angular-agent-skills angular-access-modifiersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Minimum Angular Version: 15.0.0
Maximum Angular Version: 21.0.0
Supported Versions: 15, 16, 17, 18, 19, 20, 21
Load this skill when:
Supported in: v17+
Use public readonly to expose the public API of the component, using the modern input() and output() functions for signal-based inputs and outputs.
import { Component, input, output, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-example',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<button (click)="save()">Save</button>`
})
export class ExampleComponent {
public readonly name = input.required<string>(); // input signal
public readonly saved = output<void>(); // output signal
save() {
this.saved.emit();
}
}
Supported in: v15+
Use protected readonly for properties accessed only by the class and the template (e.g., internal signals for displaying state).
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-template-state',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<div>{{ count() }}</div>`
})
export class TemplateStateComponent {
protected readonly count = signal(0);
}
Supported in: v15+
Use private readonly for properties only used inside the class (not accessible from the template or outside the component).
import { Component, signal, ChangeDetectionStrategy } from '@angular/core';
@Component({
selector: 'app-secret',
standalone: true,
changeDetection: ChangeDetectionStrategy.OnPush,
template: `<span>Secret logic</span>`
})
export class SecretComponent {
private readonly secretValue = signal('hidden');
}
For complete examples, common mistakes, and advanced patterns, see references/patterns.md.
Why this is problematic: Exposes internal state/logic unnecessarily.
export class BadComponent {
public count = 0; // ❌ Should be protected or private
}
✅ Instead:
export class GoodComponent {
protected readonly count = 0;
}
Why this is problematic: The template cannot access private members.
export class BadComponent {
private readonly count = 0; // ❌ Not accessible in the template
}
✅ Instead:
export class GoodComponent {
protected readonly count = 0; // ✅ Accessible in the template
}
| Task | Pattern | Version |
|------|---------|---------|
| Input signal | public readonly input() | v17+ |
| Output signal | public readonly output() | v17+ |
| Template state | protected readonly signal() | v15+ |
| Internal logic | private readonly signal() | v15+ |
documentation
Creates new AI agent skills for Angular following the Angular Agent Skills spec. Trigger: When user asks to create a new skill, add agent instructions, document Angular patterns for AI, or create skill documentation.
development
Modern function-based component inputs and models using Angular Signals API. Trigger: When defining component inputs, when migrating from decorators, when working with reactive component APIs, when implementing two-way binding.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.