primitives angular.instructions.md

Coding guidelines for TypeScript and Angular applications, including component structure, state handling, templates, forms, and performance practices.

In plain words
What is it for?
Use them when creating or reviewing Angular components, routes, forms, images, and application state.
Why use it?
They provide consistent rules for writing maintainable Angular code and help avoid common typing, accessibility, and application-structure problems.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/radix-ng/primitives/angular
Clone the repo
git clone --depth 1 https://github.com/radix-ng/primitives

Made for: GitHub Copilot.

Per session 492 This file is loaded in full into every session.
When invoked 492 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00492 $0.00492
Opus 5 $0.00246 $0.00246
Sonnet 5 $0.00098 $0.00098
Haiku 4.5 $0.00049 $0.00049

Measured yesterday against content hash 40efde5aefbd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

primitives angular.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.github/instructions/angular.instructions.md · 57 lines

How it starts

The opening of the file, as written. The whole thing — 57 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in TypeScript, Angular, and scalable web application development. You write maintainable, performant, and accessible code following Angular and TypeScript best practices.

TypeScript Best Practices

  • Use strict type checking
  • Prefer type inference when the type is obvious
  • Avoid the any type; use unknown when type is uncertain

Angular Best Practices

  • Always use standalone components over NgModules
  • Must NOT set standalone: true inside Angular decorators. It's the default.
  • Use signals for state management
  • Implement lazy loading for feature routes
  • Do NOT use the @HostBinding and @HostListener decorators. Put host bindings inside the host object of the @Component or @Directive decorator instead
  • Use NgOptimizedImage for all static images.
    • NgOptimizedImage does not work for inline base64 images.

Components

  • Keep components small and focused on a single responsibility
  • Use input() and output() functions instead of decorators
  • Use computed() for derived state
  • Set changeDetection: ChangeDetectionStrategy.OnPush in @Component decorator
  • Prefer inline templates for small components
  • Prefer Reactive forms instead of Template-driven ones
  • Do NOT use ngClass, use class bindings instead
  • DO NOT use ngStyle, use style bindings instead

State Management

  • Use signals for local component state
  • Use computed() for derived state
  • Keep state transformations pure and predictable
  • Do NOT use mutate on signals, use update or set instead

Templates

  • Keep templates simple and avoid complex logic
  • Use native control flow (@if, @for, @switch) instead of *ngIf, *ngFor, *ngSwitch
  • Use the async pipe to handle observables

Services

  • Design services around a single responsibility
  • Use the providedIn: 'root' option for singleton services
  • Use the inject() function instead of constructor injection

Common pitfalls

  • Control flow (@if):
    • You cannot use as expressions in @else if (...). E.g. invalid code: @else if (bla(); as x).

Read the full file on GitHub · 57 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 57 lines · 492 tokens per session scan A 40efde5aefbd

Subscribe to this mod's changes

primitives angular.instructions.md is an instructions file published in the GitHub repository radix-ng/primitives (269 stars, last pushed 7d ago), licensed MIT. It adds 492 tokens to every session, about $0.0025 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

core-web copilot-instructions.md

Copilot instructions for db-ux-design-system/core-web: All development instructions, build commands, validation steps, coding rules, and the pull request workflow are maintained in AGENTS.md at the repository root. Read that file first before starting any task.

db-ux-design-system/core-web · 90 tokens

core-web AGENTS.md

AGENTS.md instructions for db-ux-design-system/core-web, covering db ux design system v3 core web, working effectively, required prerequisites, bootstrap and setup and build and test.

db-ux-design-system/core-web · 6,996 tokens

ark CLAUDE.md

Instructions for chakra-ui/ark, covering ark ui - claude development guide, documentation structure, quick start, common commands and install dependencies.

chakra-ui/ark · 647 tokens

fundamental-ngx AGENTS.md

Instructions for SAP/fundamental-ngx, covering angular 22+ development guidelines, persona, quick reference, essential commands and build/lint/test specific library.

SAP/fundamental-ngx · 3,066 tokens

fundamental-ngx CLAUDE.md

Instructions for SAP/fundamental-ngx, covering fundamental ngx, architecture, commands, build / lint / test a library and affected only (prefer this for validation).

SAP/fundamental-ngx · 2,765 tokens

openbridge-webcomponents watch-radial-instruments.instructions.md

Instructions for Ocean-Industries-Concept-Lab/openbridge-webcomponents, covering watch & radial instruments, architecture overview, key principle: logic in watch.ts, instruments stay thin, shared sibling modules and layering & stacking pattern.

Ocean-Industries-Concept-Lab/openbridge-webcomponents · 10,138 tokens