CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

dev-create-injectable

Use when adding a signal-based store or utility service - creates injectable with inject() and Angular Signals.

Quality

82%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Create an Angular injectable following docs/ARCHITECTURE.md section 4.4.

Injectable: $ARGUMENTS

Steps

  1. Read docs/ARCHITECTURE.md section 4.4.

  2. Determine the type:

    • Signal store (client state) -> manages UI state with WritableSignal
    • Utility service (shared logic) -> injectable with inject() for deps
    • Data orchestrator (API + adapter) -> injects Service, applies adapter
  3. Create the injectable in the appropriate location:

Signal Store

import { Injectable, signal, computed } from '@angular/core'

@Injectable({ providedIn: 'root' })
export class MyStore {
  private readonly _state = signal<StateType>(initialValue)
  readonly state = this._state.asReadonly()
  readonly derived = computed(() => /* derive from _state */)

  updateState(value: StateType) {
    this._state.set(value)
  }
}

Utility Service

import { Injectable, inject } from '@angular/core'

@Injectable({ providedIn: 'root' })
export class MyUtilityService {
  private readonly dep = inject(OtherService)

  doSomething(input: InputType): OutputType {
    // typed logic
  }
}
  1. Rules:

    • @Injectable({ providedIn: 'root' }) or scoped to component
    • inject() for all dependencies - no constructor DI
    • Private WritableSignal, public asReadonly() for stores
    • No HTTP calls in stores (services handle that)
  2. Validate: npx tsc --noEmit

Repository

fernandezbaptiste/specialist-agent

Path

packs/angular/skills/dev-create-injectable/SKILL.md

Last updated
First committed

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.