Agent skill

Angular Di

by Kilo-Org in Kilo-Org/kilo-marketplace

Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration.

MITAuto-check passedDevelopment

Install Angular Di

skills CLI
$ npx skills add Kilo-Org/kilo-marketplace --skill angular-di -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Kilo-Org/kilo-marketplace angular-di --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Kilo-Org/kilo-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/angular-di .claude/skills/angular-di && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
angular-di
GitHub stars
189
Token cost
~2.1k tokens
SKILL.md length
100 words
Files
3 (incl. references)
Skills in repo
87
Repo updated
First seen
Licence
MIT

At a glance

Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration.

  • Service architecture
  • SKILL.md covers Basic Injection, Provider Scopes, Injection Tokens and Provider Types, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Providing dependencies at different levels

What it does

Angular Di is an agent skill from Kilo-Org/kilo-marketplace. Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration. Use for service architecture, providing dependencies at different levels, creating injectable tokens, and managing singleton vs scoped services. Triggers on service creation, configuring providers, using injection tokens, or understanding DI hierarchy.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/di-patterns.md`).

It sits in Development, covering Design patterns. It works with Angular. The repository describes itself as: Kilo Marketplace - A curated collection of Skills, MCP Servers, and Modes for enhancing AI agent capabilities across the Kilo ecosystem—including Kilo Code (VS Code extension)… The licence is MIT.

When your agent uses it

  • Service architecture
  • Providing dependencies at different levels
  • Creating injectable tokens
  • Managing singleton vs scoped services

Example prompts

  • “/angular-di”

What it can do on your machine

Read from SKILL.md and the folder at commit ff51758. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Angular Di loads about 2.1k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 93 tokens; SKILL.md has 100 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Kilo-Org/kilo-marketplace at commit ff51758, republished under its MIT licence (© Kilo-Org). 100 words, ~2,082 tokens.

Download SKILL.mdSave it as .claude/skills/angular-di/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
angular-di
description
Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration. Use for service architecture, providing dependencies at different levels, creating injectable tokens, and managing singleton vs scoped services. Triggers on service creation, configuring providers, using injection tokens, or understanding DI hierarchy.
metadata.category
development

Angular Dependency Injection

Configure and use dependency injection in Angular v20+ with inject() and providers.

Basic Injection

Using inject()

Prefer inject() over constructor injection:

typescript
import { Component, inject } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { User } from './user.service';

@Component({
  selector: 'app-user-list',
  template: `...`,
})
export class UserList {
  // Inject dependencies
  private http = inject(HttpClient);
  private userService = inject(User);

  // Can use immediately
  users = this.userService.getUsers();
}
Injectable Services
typescript
import { Injectable, inject, signal } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root', // Singleton at root level
})
export class User {
  private http = inject(HttpClient);

  private users = signal<User[]>([]);
  readonly users$ = this.users.asReadonly();

  async loadUsers() {
    const users = await firstValueFrom(
      this.http.get<User[]>('/api/users')
    );
    this.users.set(users);
  }
}

Provider Scopes

Root Level (Singleton)
typescript
// Recommended: providedIn
@Injectable({
  providedIn: 'root',
})
export class Auth {}

// Alternative: in app.config.ts
export const appConfig: ApplicationConfig = {
  providers: [
    Auth,
  ],
};
Component Level (Instance per Component)
typescript
@Component({
  selector: 'app-editor',
  providers: [EditorState], // New instance for each component
  template: `...`,
})
export class Editor {
  private editorState = inject(EditorState);
}
Route Level
typescript
export const routes: Routes = [
  {
    path: 'admin',
    providers: [Admin], // Shared within this route tree
    children: [
      { path: '', component: AdminDashboard },
      { path: 'users', component: AdminUsers },
    ],
  },
];

Injection Tokens

Creating Tokens
typescript
import { InjectionToken } from '@angular/core';

// Simple value token
export const API_URL = new InjectionToken<string>('API_URL');

// Object token
export interface AppConfig {
  apiUrl: string;
  features: {
    darkMode: boolean;
    analytics: boolean;
  };
}

export const APP_CONFIG = new InjectionToken<AppConfig>('APP_CONFIG');

// Token with factory (self-providing)
export const WINDOW = new InjectionToken<Window>('Window', {
  providedIn: 'root',
  factory: () => window,
});

export const LOCAL_STORAGE = new InjectionToken<Storage>('LocalStorage', {
  providedIn: 'root',
  factory: () => localStorage,
});
Providing Token Values
typescript
// app.config.ts
export const appConfig: ApplicationConfig = {
  providers: [
    { provide: API_URL, useValue: 'https://api.example.com' },
    {
      provide: APP_CONFIG,
      useValue: {
        apiUrl: 'https://api.example.com',
        features: { darkMode: true, analytics: true },
      },
    },
  ],
};
Injecting Tokens
typescript
@Injectable({ providedIn: 'root' })
export class Api {
  private apiUrl = inject(API_URL);
  private config = inject(APP_CONFIG);
  private window = inject(WINDOW);

  getBaseUrl(): string {
    return this.apiUrl;
  }
}

Provider Types

useClass
typescript
// Provide implementation
{ provide: Logger, useClass: ConsoleLogger }

// Conditional implementation
{
  provide: Logger,
  useClass: environment.production
    ? ProductionLogger
    : ConsoleLogger,
}
useValue
typescript
// Static values
{ provide: API_URL, useValue: 'https://api.example.com' }

// Configuration objects
{ provide: APP_CONFIG, useValue: { theme: 'dark', language: 'en' } }
useFactory
typescript
// Factory with dependencies
{
  provide: User,
  useFactory: (http: HttpClient, config: AppConfig) => {
    return new User(http, config.apiUrl);
  },
  deps: [HttpClient, APP_CONFIG],
}

// Async factory (not recommended - use provideAppInitializer)
{
  provide: CONFIG,
  useFactory: () => fetch('/config.json').then(r => r.json()),
}
useExisting
typescript
// Alias to existing provider
{ provide: AbstractLogger, useExisting: ConsoleLogger }

// Multiple tokens pointing to same instance
providers: [
  ConsoleLogger,
  { provide: Logger, useExisting: ConsoleLogger },
  { provide: ErrorLogger, useExisting: ConsoleLogger },
]

Injection Options

Optional Injection
typescript
@Component({...})
export class My {
  // Returns null if not provided
  private analytics = inject(Analytics, { optional: true });

  trackEvent(name: string) {
    this.analytics?.track(name);
  }
}
Self, SkipSelf, Host
typescript
@Component({
  providers: [Local],
})
export class Parent {
  // Only look in this component's injector
  private local = inject(Local, { self: true });
}

@Component({...})
export class Child {
  // Skip this component, look in parent
  private parentService = inject(ParentSvc, { skipSelf: true });

  // Only look up to host component
  private hostService = inject(Host, { host: true });
}

Multi Providers

Collect multiple values for same token:

typescript
// Token for multiple validators
export const VALIDATORS = new InjectionToken<Validator[]>('Validators');

// Provide multiple values
providers: [
  { provide: VALIDATORS, useClass: RequiredValidator, multi: true },
  { provide: VALIDATORS, useClass: EmailValidator, multi: true },
  { provide: VALIDATORS, useClass: MinLengthValidator, multi: true },
]

// Inject as array
@Injectable()
export class Validation {
  private validators = inject(VALIDATORS); // Validator[]

  validate(value: string): ValidationError[] {
    return this.validators
      .map(v => v.validate(value))
      .filter(Boolean);
  }
}
HTTP Interceptors (Multi Provider)
typescript
// Interceptors use multi providers internally
export const appConfig: ApplicationConfig = {
  providers: [
    provideHttpClient(
      withInterceptors([
        authInterceptor,
        loggingInterceptor,
        errorInterceptor,
      ])
    ),
  ],
};

App Initializers

Run async code before app starts using provideAppInitializer:

typescript
import { provideAppInitializer, inject } from '@angular/core';

export const appConfig: ApplicationConfig = {
  providers: [
    Config,
    provideAppInitializer(() => {
      const configService = inject(Config);
      return configService.loadConfig();
    }),
  ],
};
Multiple Initializers
typescript
providers: [
  provideAppInitializer(() => {
    const config = inject(Config);
    return config.load();
  }),
  provideAppInitializer(() => {
    const auth = inject(Auth);
    return auth.checkSession();
  }),
]

Environment Injector

Create injectors programmatically:

typescript
import { createEnvironmentInjector, EnvironmentInjector, inject } from '@angular/core';

@Injectable({ providedIn: 'root' })
export class Plugin {
  private parentInjector = inject(EnvironmentInjector);

  loadPlugin(providers: Provider[]): EnvironmentInjector {
    return createEnvironmentInjector(providers, this.parentInjector);
  }
}

runInInjectionContext

Run code with injection context:

typescript
import { runInInjectionContext, EnvironmentInjector, inject } from '@angular/core';

@Injectable({ providedIn: 'root' })
export class Utility {
  private injector = inject(EnvironmentInjector);

  executeWithDI<T>(fn: () => T): T {
    return runInInjectionContext(this.injector, fn);
  }
}

// Usage
utilityService.executeWithDI(() => {
  const http = inject(HttpClient);
  // Use http...
});

For advanced patterns, see references/di-patterns.md.

© Kilo-Org, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/angular-di of Kilo-Org/kilo-marketplace.

  • SKILL.md
  • LICENSE
  • references/di-patterns.md

Open the folder on GitHubat commit ff51758

Compare with similar skills

Angular Di next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Angular Di compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Angular Di this skillKilo-Org/kilo-marketplace189—~2.1kAutomated safety check: PassMIT
Angular Clean Architecturefmflurry/settings-opencode171—~3.6kAutomated safety check: PassMIT
Angular Copfmflurry/settings-opencode171—~1.4kAutomated safety check: PassMIT
Angular Developerradix-ng/primitives274—~1.2kAutomated safety check: PassMIT
Angular Dependency InjectionHoangNguyen0403/agent-skills-standard570—~637Automated safety check: PassMIT
Angular Developermxtommy/Kip1274 repos~2.4kAutomated safety check: PassMIT

Similar skills

  • Angular Clean Architecture

    fmflurry/settings-opencode

    Scaffolds and extends Angular standalone feature MODULES under src/app/modules/{name} using Clean Architecture layering (presentation/application/core/infrastructure), a self-registering module…

    171 GitHub stars~3.6k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Angular Cop

    fmflurry/settings-opencode

    Pre-merge code review for Angular + TypeScript pull requests.

    171 GitHub stars~1.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Angular Developer

    radix-ng/primitives

    Angular framework reference for building this signals-first, headless directive library.

    274 GitHub stars~1.2k tokensUpdated 9 days ago
    DevelopmentAuto-check passed
  • Angular Dependency Injection

    HoangNguyen0403/agent-skills-standard

    Configure DI, inject() usage, and providers in Angular. An agent skill from HoangNguyen0403/agent-skills-standard.

    570 GitHub stars~637 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Generates Angular code and provides architectural guidance. An agent skill from mxtommy/Kip.

    127 GitHub starsUsed in 4 repos~2.4k tokens
    Frontend & DesignAuto-check passed
  • Swiftui View Refactor

    Dimillian/Skills

    Refactor and review SwiftUI view files with strong defaults for small dedicated subviews, MV-over-MVVM data flow, stable view trees, explicit dependency injection, and correct Observation usage.

    4k GitHub starsUsed in 5 repos~2k tokens
    DevelopmentAuto-check passed

More from Kilo-Org/kilo-marketplace

All 87 skills in this repo
  • AzureML Project Scaffolding

    Kilo-Org/kilo-marketplace

    Sets up and maintains AzureML-ready Python projects as uv workspaces with devcontainers, a Makefile and job YAML, so local runs match cloud jobs and experiments stay reproducible.

    189 GitHub stars~3.1k tokensUpdated 9 days ago
    Auto-check: notes
  • Jupyter Notebook Builder

    Kilo-Org/kilo-marketplace

    Creates, inspects, edits and runs Jupyter notebooks, scaffolding experiment or tutorial notebooks from templates and preferring a Jupyter MCP server over raw JSON edits.

    189 GitHub stars~1.3k tokensUpdated 9 days ago
    Auto-check passed
  • Tableau Dashboard Creator

    Kilo-Org/kilo-marketplace

    Takes a plain-language dashboard request through brand setup, data exploration, planning, an interactive HTML mock and a Tableau implementation spec.

    189 GitHub stars~3.8k tokensUpdated 9 days ago
    Auto-check: notes
  • Elasticsearch File Ingest

    Kilo-Org/kilo-marketplace

    Ingest and transform data files (CSV/JSON/Parquet/Arrow IPC) into Elasticsearch with stream processing and custom transforms.

    189 GitHub stars~2.8k tokensUpdated 9 days ago
    Auto-check passed
  • Nifi Flow Layout

    Kilo-Org/kilo-marketplace

    A skill your agent uses when arranging Apache NiFi processors, process groups, ports, comments, numbering, crossing connections, dense fan-in/fan-out, or reusable readable canvas layouts.

    189 GitHub stars~1.5k tokensUpdated 9 days ago
    Auto-check passed
  • Splunk Ingest Processor Setup

    Kilo-Org/kilo-marketplace

    Render Cisco Data Fabric ingest-time routing workflows and Splunk Cloud Platform Ingest Processor setup plans with SPL2 pipelines, source types, destinations, lifecycle handoffs, queue and…

    189 GitHub stars~1.2k tokensUpdated 9 days ago
    Auto-check passed

Works with

Categories

Questions about Angular Di

What does Angular Di do?

Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration. Angular Di is an agent skill from Kilo-Org/kilo-marketplace. Implement dependency injection in Angular v20+ using inject(), injection tokens, and provider configuration.

When should I use Angular Di?

Angular Di fits situations like: service architecture; providing dependencies at different levels; creating injectable tokens; managing singleton vs scoped services.

How do I install Angular Di in Claude Code?

Run `npx skills add Kilo-Org/kilo-marketplace --skill angular-di -a claude-code`. Or copy the skill folder (skills/angular-di in Kilo-Org/kilo-marketplace) into .claude/skills/angular-di in your project. Claude Code loads it when a task matches its description.

How do I install Angular Di in Codex?

Run `npx skills add Kilo-Org/kilo-marketplace --skill angular-di -a codex`. Or copy the skill folder (skills/angular-di in Kilo-Org/kilo-marketplace) into .agents/skills/angular-di in your project. Codex loads it when a task matches its description.

Can I use Angular Di in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Kilo-Org/kilo-marketplace --skill angular-di -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/angular-di, .gemini/skills/angular-di, .github/skills/angular-di and .opencode/skills/angular-di in your project.

What does Angular Di need to run?

SKILL.md names no scripts, command-line tools or credentials: Angular Di is instructions for the agent only.

Does Angular Di access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Angular Di safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Angular Di use?

Angular Di is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Angular Di use?

About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.9k tokens, read only when the agent opens those files.

What are the alternatives to Angular Di?

Skills that share tags, products or a category with Angular Di: Angular Clean Architecture (fmflurry/settings-opencode, 171 stars), Angular Cop (fmflurry/settings-opencode, 171 stars), Angular Developer (radix-ng/primitives, 274 stars) and Angular Dependency Injection (HoangNguyen0403/agent-skills-standard, 570 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Angular Di?

Kilo-Org (a GitHub organization) maintains it in Kilo-Org/kilo-marketplace, which has 189 GitHub stars. The repository holds 87 skills in this directory. The repository was last updated on September 28, 2026.

Source: Kilo-Org/kilo-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.