Skip to content

Latest commit

 

History

History
64 lines (51 loc) · 3.54 KB

File metadata and controls

64 lines (51 loc) · 3.54 KB

AGENTS.md — ServiceManager frontend

Guidance for AI coding agents working in this repository.

Read first

  • PLAN.md — implementation plan, API reference, per-phase "Implementation Notes"
  • STATE.md — progress snapshot: phase status, file map, open items, environment quirks

Project skills — USE THEM

This project ships local skills under .opencode/skills/. Do not rely on model memory for Angular or Angular Material; the local references are version-matched (angular/components v22) and authoritative.

  • angular-developer (.opencode/skills/angular-developer/SKILL.md) General Angular work: components, signals, resource, HTTP, DI, routing, styling, testing, CLI. Read the relevant references/*.md for the topic at hand.

  • angular-material (.opencode/skills/angular-material/SKILL.md) Angular Material + CDK. Rule: before writing or modifying markup for any mat-* component, open its reference .opencode/skills/angular-material/references/<name>.md (e.g. card.md, toolbar.md, dialog.md) and follow its documented structure. The SKILL.md index alone is NOT sufficient — reading only the index and then writing markup from memory is a known failure mode (it produced a mat-card built from plain <div>s, missing all Material section padding). Material pitfall to remember: <mat-card> adds no padding of its own — use the predefined sections (mat-card-header / mat-card-title / mat-card-subtitle / mat-card-content / mat-card-actions / mat-card-footer).

Hard-won API facts (Angular 22 — do not re-discover)

  • resource() no longer accepts Observables (Promise/stream loader only). For HttpClient observables use rxResource() from @angular/core/rxjs-interop (rxResource<T, R>({ stream: () => obs }), R = void without params, no debugName).
  • Material theming: single mat.theme() on html with theme-type: color-scheme; colors compile to light-dark(...) and follow color-scheme on <html>. The old define-standard-theme / all-component-themes / m3-define-palette APIs are gone in v22. App colors: var(--mat-sys-*).
  • @Service() decorator = root singleton. OnPush is the default — never set it explicitly. input()/output(), host: object, native @if/@for control flow.
  • Test runner is karma/Jasmine (deliberate override of the v22 vitest default).

Commands

  • npm start — dev server on port 4200 (pinned in angular.json; backend CORS depends on it)
  • npm run build — production build (budgets: 500 kB warning / 1 MB error initial)
  • npm test — karma headless
  • There is no lint target in the scaffold; ng add @angular-eslint is needed first
  • Backend for live checks: http://localhost:5193 (test unit example-sleep.service)
  • API base URL: derived from the page origin + /api in production (src/app/core/env.ts, same-origin, no CORS); the development build swaps in http://localhost:5193/api via fileReplacements (env.development.ts)

Conventions

  • Build mode: act without asking, then verify (build + tests + live DOM check when UI changed)
  • Headless verification trick: google-chrome --headless --no-sandbox --virtual-time-budget=12000 --dump-dom http://localhost:4200/
  • Commit per phase; after each phase add a ### Phase N — Implementation Notes subsection to PLAN.md
  • Service names carry the .service suffix — use verbatim, never strip/re-append
  • Tone mappers keep an unknown-value fallback (D-Bus error names can appear)
  • Update STATE.md when ending a session / handing off to a fresh context