Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

reference-compiler-clireference compiler CLI 命令行

Agent Skill

reference-compiler-cli 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

18,204

周安装

774

GitHub Stars

100,070

下载量

6,378
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:reference-compiler-cli(reference compiler CLI 命令行)
来源仓库:https://github.com/angular/angular
仓库路径:skills/reference-compiler-cli
安装命令:
npx skills add https://github.com/angular/angular --skill reference-compiler-cli
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/angular/angular --skill reference-compiler-cli

简介

reference-compiler-cli 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适用于 Angular 项目重构时的编译配置调整、AOT 优化或构建产物分析。
  • 可读取 tsconfig、angular.json 并关联相关 Issue 中的已知问题。
  • 安装命令:npx skills add https://github.com/angular/angular --skill reference-compiler-cli。
  • Angular 主仓库体积庞大,部分技能可能响应较慢或信息不全。

SKILL.md

Angular Compiler CLI (ngtsc) Architecture

Overview

The packages/compiler-cli package contains the Angular Compiler (Ivy), often referred to as ngtsc. It is a wrapper around the TypeScript compiler (tsc) that extends it with Angular-specific capabilities.

The core goal of ngtsc is to compile Angular decorators (like @Component, @Directive, @Pipe) into static properties on the class (Ivy instructions, e.g., static ɵcmp =...). It also performs template type checking and ahead-of-time (AOT) compilation.

Mental Model

The compiler is designed as a lazy, incremental, and partial compilation pipeline.

  1. Wrapper Pattern: NgtscProgram wraps the standard ts.Program. It intercepts calls to act as a drop-in replacement for standard tooling.
  2. Traits System: Every class with an Angular decorator is considered a "Trait". The compiler manages the state of these traits through a state machine:

- Pending: Detected but not processed. - Analyzed: Metadata extracted, template parsed (but dependencies not yet linked). - Resolved: Dependencies (directives/pipes in template) resolved, import cycles handled. - Skipped: Not an Angular class.

  1. Lazy Analysis: Analysis only happens when necessary (e.g., when diagnostics are requested or emit is prepared).
  2. Output AST: The compiler generates an intermediate "Output AST" (o.Expression) for the generated code, which is then translated into TypeScript AST nodes during the emit phase.

Key Subsystems

1. Core Orchestration (ngtsc/core)

  • NgtscProgram: The public API implementing api.Program. It manages the ts.Program and the NgCompiler.
  • NgCompiler: The brain of the compiler. It orchestrates the compilation phases (Analysis, Resolution, Type Checking, Emit). It holds the TraitCompiler.

2. Trait Compilation (ngtsc/transform)

  • TraitCompiler: Manages the lifecycle of "Traits". It iterates over source files, identifies decorated classes, and delegates to the appropriate DecoratorHandler.
  • Trait: A state container for a class, holding its handler, analysis results, and resolution results.

3. Decorator Handlers (ngtsc/annotations)

  • DecoratorHandler: An interface for handling specific decorators.
  • ComponentDecoratorHandler: The most complex handler. It:

- Extracts metadata (selector, inputs, outputs). - Parses the template. - Resolves used directives and pipes (R3TargetBinder). - Generates the ɵcmp instruction.

  • DirectiveDecoratorHandler, PipeDecoratorHandler, NgModuleDecoratorHandler: Handle their respective decorators.

4. Template Type Checking (ngtsc/typecheck)

  • TemplateTypeChecker: Generates "Type Check Blocks" (TCBs). A TCB is a block of TypeScript code that represents the template's logic in a way tsc can understand and check for errors.
  • TypeCheckBlock: The actual generated code that validates bindings, events, and structural directives.

5. Metadata & Scope (ngtsc/metadata, ngtsc/scope)

  • MetadataReader: Reads Angular metadata from source files (using LocalMetadataRegistry) and .d.ts files (using DtsMetadataReader).
  • ScopeRegistry: Determines the "compilation scope" of a component (which directives/pipes are available to it), handling NgModule transitive exports and Standalone Component imports.

6. Emit & Transformation (ngtsc/transform)

  • ivyTransformFactory: A TypeScript transformer factory.
  • IvyCompilationVisitor: Visits classes, triggers compilation via TraitCompiler, and collects the Output AST.
  • IvyTransformationVisitor: Translates the Output AST into TypeScript AST, injects the static ɵ... fields, and removes the original decorators.

Compilation Phases

  1. Construction: NgtscProgram creates NgCompiler, which sets up all registries and the TraitCompiler.
  2. Analysis (analyzeSync):

- The TraitCompiler scans files. - DecoratorHandlers extract metadata and parse templates. - No cross-file resolution happens here (allowing for parallelism and caching).

  1. Resolution (resolve):

- TraitCompiler resolves traits. - Components link their templates to specific Directives and Pipes (found via ScopeRegistry). - Import cycles are detected and handled (e.g., via "remote scoping").

  1. Type Checking:

- TemplateTypeChecker creates TCBs for all components. - TypeScript diagnostics are retrieved for these TCBs.

  1. Emit (prepareEmit):

- ivyTransformFactory is created. - TS emit is called. - The transformers run, injecting the compiled Ivy instructions into the JS/DTS output.

Important File Locations

  • packages/compiler-cli/src/ngtsc/program.ts: Entry point (NgtscProgram).
  • packages/compiler-cli/src/ngtsc/core/src/compiler.ts: Core logic (NgCompiler).
  • packages/compiler-cli/src/ngtsc/transform/src/trait.ts: Trait state machine.
  • packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts: Component compilation logic.
  • packages/compiler-cli/src/ngtsc/typecheck/src/template_type_checker.ts: Type checking logic.
  • packages/compiler-cli/src/ngtsc/transform/src/transform.ts: AST transformation logic.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.88%
按下载量换算2,416

Claude

27.67%
按下载量换算1,765

Cursor

18.56%
按下载量换算1,184

Gemini CLI

8.71%
按下载量换算556

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills