Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

prism-angular-component

/prism-angular-component

Tworzy samodzielne komponenty Angular (standalone) dla biblioteki ng-prism lub fikstur testowych według jej konwencji, z dekoratorem @Showcase.

Repozytorium
ng-prism ↗
Licencja
MIT
Ostatnia zmiana repozytorium
20.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 20.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Tworzy samodzielne komponenty Angular (standalone) dla biblioteki ng-prism lub fikstur testowych według jej konwencji, z dekoratorem @Showcase.

Wyzwalacze z opisu

create componentadd componentnew component
Oryginalny opis (EN)

Creates Angular standalone components for the ng-prism library or test fixtures. Triggers on "create component", "add component", "new component". Follows ng-prism conventions with @Showcase decorator support.

Jak działa

  1. Component Template
  2. Showcase-Annotated Component (Test Fixture / Demo)
  3. Conventions
  4. Checklist
Sekcje z nagłówków SKILL.md, w oryginale · 97 linii, 429 słów
Podgląd SKILL.md
---
name: prism-angular-component
description: Creates Angular standalone components for the ng-prism library or test fixtures. Triggers on "create component", "add component", "new component". Follows ng-prism conventions with @Showcase decorator support.
---

# Angular Component Creation — ng-prism

Create Angular standalone components for the ng-prism project.

> **Context:** ng-prism is a library, not an app. Components are either:
>
> 1. **Internal UI components** for the styleguide app (`src/app/`)
> 2. **Test fixture components** with `@Showcase` decorator (`__fixtures__/`)

## Component Template

```typescript
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';

@Component({
    selector: 'prism-example',
    standalone: true,
    imports: [],
    templateUrl: './example.component.html',
    styleUrl: './example.component.css',
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class ExampleComponent {
    readonly title = input.required<string>();
    readonly disabled = input(false);
    readonly clicked = output<void>();
}
```

## Showcase-Annotated Component (Test Fixture / Demo)

```typescript
import { ChangeDetectionStrategy, Component, input, output } from '@angular/core';
import { Showcase } from '@ng-prism/core';

@Showcase({
    title: 'Example',
    category: 'Inputs',
    description: 'An example component',
    variants: [
        { name: 'Default', inputs: { label: 'Click me' } },
        { name: 'Disabled', inputs: { label: 'Disabled', disabled: true } }
    ],
    tags: ['form', 'action']
})
@Component({
    selector: 'my-example',
    standalone: true,
    template: `<button [disabled]="disabled()" (click)="clicked.emit()">{{ label() }}</button>`,
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class ExampleComponent {
    /** Button label text */
    readonly label = input('Button');

    /** Whether the button is disabled */
    readonly disabled = input(false);

    /** Click event */
    readonly clicked = output<void>();
}
```

> **Note:** Signals, not decorators — also for showcased components. The scanner
> reads `@Input()` metadata as well, but `component.scanner.ts` prints a warning
> for it: "uses @Input() decorators which are not fully supported. Migrate to
> input() signals for full ng-prism support." The fixtures under `__fixtures__/`
> that still carry decorators (e.g. `button.component.ts`, `card.component.ts`)
> exist to cover exactly that path; `signal-button.component.ts` covers the
> signal path. Do not take them as a template for new components.

## Conventions

- **Selector prefix:** `prism-` for internal UI components
- **Standalone:** Always `standalone: true` (explicit)
- **Change detection:** Always `ChangeDetectionStrategy.OnPush`
- **DI:** Use `inject()` function, not constructor injection
- **Signals:** Use `input()` / `output()` everywhere — internal components and
  showcased ones alike. `@Input()` / `@Output()` only in the fixtures that
  deliberately cover the legacy path, never in new code.
- **File location:**
    - Internal UI: feature folder under `packages/ng-prism/src/app/<feature>/`
      (e.g. `canvas/`, `panels/`, `sidebar/`, `shared/`) — there is no
      `src/app/components/` directory
    - Test fixtures: `packages/ng-prism/src/builder/scanner/__fixtures__/`
- **Imports:** `.js` extension on _relative_ import paths (ESM). Bare
  specifiers like `@angular/core` stay unchanged.

## Checklist

- [ ] `standalone: true` explicit
- [ ] `ChangeDetectionStrategy.OnPush`
- [ ] Correct selector prefix (`prism-` internal, custom for fixtures)
- [ ] `.js` extensions on relative imports (ESM; bare specifiers stay as they are)
- [ ] JSDoc on each `input()` / `output()` member (the scanner extracts it)

Wersje

W bazie nie ma innych skilli o nazwie prism-angular-component.

Migawka bazy z 13.11.2026 · wersja paczki 4a28c6307238 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100prism-showcase-component
    Oznacza komponent Angular dekoratorem @Showcase, aby ng-prism mógł go wykryć i pokazać w styleguide.
  • 100showcase
    Pisze dekoratory @Showcase w bibliotekach Angular z ng-prism, sprawdza ostrzeżenia buildu i brakujące komponenty w styleguide.
  • 85prism
    Działa jako inżynier frontendu: komponenty UI, dashboardy, wdrożenie design systemu i audyty frontendu.
  • 100prism-component
    Implementuje wielokrotnego użytku, dostępny i otypowany komponent UI na podstawie specyfikacji projektu, przy tworzeniu widgetów i realizacji makiet.
  • 90angular-architecture
    Układa strukturę aplikacji Angular 17 lub nowszej: komponenty standalone, organizację według funkcji, leniwe ładowanie i sygnały dla stanu.
  • 100angular
    Pokazuje, jak używać custom elements w Angularze, w tym wymaganą konfigurację CUSTOM_ELEMENTS_SCHEMA, w modułach i komponentach standalone.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.