Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

reference-core — Claude Code skill: what it does, how to install

Explains the runtime architecture of Angular's packages/core. Use it when modifying Ivy instructions, dependency injection, or signals.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add angular/angular --skill reference-core -a claude-code
Open on GitHub

What reference-core does

This skill guides assistants through the runtime architecture in packages/core. It details the Ivy rendering engine (packages/core/src/render3), where templates compile into runtime instructions like ɵɵelementStart. View instance state sits in the LView array, while static structure and metadata belong to the parallel TView.data array.

The codebase is heavily tuned for memory efficiency and execution speed. It uses bitmasks and flat arrays instead of objects, alongside global functions like getLView() to avoid passing context arguments. Dependency injection splits into R3Injector hierarchies for modules and Node Injectors stored directly inside the LView Expando section. Node resolution checks Bloom filters in TView.data before walking up the view tree.

Any change to runtime state alters the LView memory layout across its HEADER, DECLS, VARS, and EXPANDO sections. You must run tests with Bazel to verify modifications against the core test suite.

What it helps with

  • navigate the parallel array memory layout of LView and TView
  • modify Ivy runtime instructions under packages/core/src/render3
  • trace token resolution through Node Injector Bloom filters
  • adjust runtime state without corrupting the LView slot offsets

Example prompts for the agent

  • Explain the memory layout differences between LView and TView in packages/core
  • Help me implement a runtime Ivy instruction in packages/core/src/render3/instructions
  • How does the Node Injector use Bloom filters before falling back to R3Injector?

How to install reference-core

1Skills CLI (Vercel)

npx skills add angular/angular --skill reference-core -a claude-code

2Manually: put the files in place

~/.claude/skills/reference-core/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/reference-core/

From the same set4

The whole set →

Similar

accessibility-compliance Seth Hobson This skill guides accessibility audits and interface work involving keyboard navigation, screen readers, and forms. Use it when building against WCAG 2.2. Claude Code CX Codex Cursor 14,596installs site-md official google-labs-code Generates a .stitch/SITE.md constitution file from requirements or project briefs for the Stitch Build Loop. Claude Code CX Codex Cursor +1 3,600installs ima-sdk-client-side official Google LLC This skill supports Google IMA SDK integrations for client-side video and audio ads requested through VAST or VMAP. Use it for websites, apps, and TV platforms. Claude Code Gemini CLI CX Codex 4,500installs e2e-tests-studio mastra-ai A skill that automatically generates Playwright E2E tests when you modify playground components. Tests product behavior—data persistence, feature workflows, action side effects—not just UI states. Claude Code CX Codex Cursor +1 2,500installs ima-dai-sdk official Google LLC This skill guides Google IMA DAI SDK integration for loading HLS and DASH streams. Use it for livestreams or video on demand in apps and websites. Claude Code Gemini CLI CX Codex 4,300installs frontend-design official anthropics This skill guides intentional visual design for new interfaces and redesigns. Use it when a generic generated UI is not enough. Claude Code Claude.ai 1,025,790installs design-taste-frontend Leonxlnx This skill directs the design of public pages and work screens, then checks the result in a browser through screenshots. Use it when an interface feels generic or unfinished. Claude Code CX Codex Cursor +1 673,100installs prototype Matt Pocock Creates throwaway prototypes for checking state logic or exploring UI before committing the decision to the main codebase. Claude Code 986,201installs

Questions about reference-core

How do I install reference-core in Claude Code?

Run npx skills add angular/angular --skill reference-core -a claude-code in your terminal. This creates the skill file at ~/.claude/skills/reference-core/SKILL.md.

What does reference-core do?

It provides the mental model and architecture guidelines for Angular's packages/core. It covers the Ivy rendering engine, dependency injection, change detection strategies, and signals.

How does dependency injection resolve tokens in the Node Injector?

The Node Injector is an embedded data structure in the LView Expando section rather than a class. It checks Bloom filters stored in TView.data at the current node index before walking up the view tree, falling back to R3Injector if unresolved.

Source text

SKILL.md · MIT
---
name: reference-core
description: Explains the mental model and architecture of the code under `packages/core`. You MUST use this skill any time you plan to work with code in `packages/core`
---

# Angular Core (`packages/core`) Mental Model

This document outlines the architecture and mental model for `packages/core`, the heart of the Angular framework.

## 1. High-Level Architecture

`packages/core` contains the runtime logic for Angular. Its primary responsibilities are:

1.  **Rendering (Ivy/Render3)**: Transforming templates into DOM updates.
2.  **Dependency Injection (DI)**: Managing object creation and lifetime.
3.  **Change Detection**: Synchronizing the model with the view.
4.  **Reactivity**: Signals and Zone.js integration.

## 2. Rendering Engine (Ivy / Render3)

The rendering engine (located in `packages/core/src/render3`) uses an **instruction-based** approach.

### Key Concepts

- **Instructions**: The Angular compiler transforms templates into a sequence of instruction calls (e.g., `ɵɵelementStart`, `ɵɵtext`, `ɵɵproperty`). These instructions are executed at runtime to create and update the view.
  - _Location_: `packages/core/src/render3/instructions`

- **LView (Logical View)**: An array containing the _state_ of a specific view instance. It holds:
  - DOM nodes (`RElement`, `RText`).
  - Binding values (for change detection).
  - Directive/Component instances.
  - _Context_: `packages/core/src/render3/interfaces/view.ts`

- **TView (Template View)**: An object describing the _static structure_ of a view; its parallel array is `TView.data`. It is shared across all instances (`LView`s) of the same component/template. It holds:
  - Property names for bindings.
  - Node relationship information.
  - Compiled directive definitions.
  - _Context_: `packages/core/src/render3/interfaces/view.ts`

- **Memory Layout**: `LView` and `TView.data` are parallel arrays. Index `i` in `LView` corresponds to metadata at index `i` in `TView.data`.
  - `HEADER`: Fixed size, contains context (Parent, Host, etc.).
  - `DECLS`: Static nodes (elements, text, pipes).
  - `VARS`: Binding values.
  - `EXPANDO`: Dynamic data (host bindings, injectors).

### The Render Cycle

1.  **Creation Mode**: Instructions create DOM nodes and store them in `LView`.
2.  **Update Mode**: Instructions check current values against previous values stored in `LView`. If changed, they update the DOM.

## 3. Dependency Injection (DI)

DI in Angular is hierarchical and split into two systems that interact:

### Module Injector (`R3Injector`)

- Configured via `@NgModule.providers` or `providedIn: 'root'`.
- Stored in a hierarchy of `R3Injector` instances.
- _Location_: `packages/core/src/di/r3_injector.ts`

### Node Injector

- Configured via `@Component.providers` or `@Directive.providers`.
- **Not a class**, but a data structure embedded in the `LView` ("Expando" section).
- Uses **Bloom Filters** (`TView.data`) to quickly check if a token is present at a specific node index before traversing up the tree.
- Resolves tokens starting from the current node, walking up the view tree (Element Injector hierarchy), and falling back to the Module Injector if not found.

## 4. Change Detection

- **Dirty Checking**: Angular checks if values bound in templates have changed.
- **Strategies**:
  - `OnPush`: The default. Checks when inputs change, events fire, template signals update, or the view is explicitly marked for checking.
  - `Eager`: Checks whenever the change detection traversal reaches the component. (`Default` is the deprecated alias for `Eager`.)
- **Signals**: The new reactivity primitive. Signals notify the scheduler when they change, potentially allowing for fine-grained updates (Zoneless).

## 5. Key Directories to Know

- `src/render3`: The Ivy rendering engine.
  - `instructions`: The runtime instructions called by compiled code.
  - `interfaces`: `LView`, `TView`, `TNode` definitions.
- `src/di`: Dependency injection system.
- `src/change_detection`: Change detection logic.
- `src/zone`: Zone.js integration.
- `src/render3/reactivity`: Signals implementation (`signal`, `computed`, `effect`), built on the reactive graph in `primitives/signals`.

## 6. Conventions & Gotchas

- **Prefixes**: Private/Internal exports often start with `ɵ`.
- **Global State**: Ivy relies heavily on global state (e.g., `getLView()`) during instruction execution to avoid passing context arguments everywhere. This is for performance and code size.
- **Performance**: The code is highly optimized for performance and memory. You will see arrays used instead of objects, bitmasks, and manual memory management patterns. **Respect these patterns.**

## 7. How to Modify Core

1.  **Understand the Instruction**: If modifying runtime behavior, find the corresponding instruction in `src/render3/instructions`.
2.  **Check `LView`/`TView` Impact**: If adding state, understand where it fits in the `LView` array.
3.  **Tests**: Core has extensive tests. Run them using Bazel.

© angular · MIT · angular/angular

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor