Appearance
GitHub Copilot Configuration
This repository uses unified AI configuration from the .ai/ directory.
Core Instructions
For complete coding guidelines, see:
.ai/config/shared/instructions.md- TypeScript, Angular, and coding best practices.ai/config/shared/workspace.md- Project architecture and development commands.ai/config/shared/contributing.md- Commit conventions and workflow
Quick Reference (Inline Copy)
General
- Do not add any comments in the code annotating your changes
- Follow the existing code indentation
TypeScript Best Practices
- Use strict type checking
- Prefer type inference when the type is obvious
- Avoid the
anytype; useunknownwhen type is uncertain - Use modern ECMAScript features freely
- Don't use lodash (see: https://youmightnotneed.com/lodash/)
Angular Best Practices
- Always use standalone components over NgModules
- Don't use explicit
standalone: true(it is implied by default) - Use signals for state management
- Implement lazy loading for feature routes
- Use
NgOptimizedImagefor all static images
Components
- Keep components small and focused on a single responsibility
- Use
input()andoutput()functions instead of decorators - Use
computed()for derived state - Set
changeDetection: ChangeDetectionStrategy.OnPushin@Componentdecorator - Prefer inline templates for small components
- Prefer Reactive forms instead of Template-driven ones
- Do NOT use
ngClass, useclassbindings instead - Do NOT use
ngStyle, usestylebindings instead
State Management
- Use signals for local component state
- Use
computed()for derived state - Keep state transformations pure and predictable
Templates
- Keep templates simple and avoid complex logic
- Use native control flow (
@if,@for,@switch) instead of*ngIf,*ngFor,*ngSwitch - Use the async pipe to handle observables
Styling (CSS/Less)
- Use variables from
'theme/vars'for consistency in colors, spacing, and typography - Scope component styles using
:hostto avoid global style pollution - Use
remfor font sizes (0.1rem = 1px),pxfor borders/paddings - Never hardcode colors - always use theme variables
- Keep CSS selectors simple; avoid specificity wars
- Use Less nesting for organization
- Avoid
::ng-deep- use Input props or CSS attributes instead
Services
- Design services around a single responsibility
- Use
providedIn: 'root'for singleton services - Use
inject()instead of constructor injection
HTML Layout/Spacing Attribute Utilities
- Use attribute-based utilities:
layout,layout-horizontal,layout-vertical,layout-align-items-center,layout-space-between,layout-full-width,layout-full-height,layout-flex-1,padding-tb-small-xx,padding-lr,margin-lr-auto - Source:
libs/theme/util/theme/styles/utilities/layout.lessandspaces.less - Prefer for simple flex layouts and spacing; use component-scoped styles for complex cases
Naming Conventions
- Components:
{Name}Componentin{name}/{name}.component.ts - Services:
{Name}Servicein{name}.service.ts - Directives:
{Name}Directivein{name}.directive.ts - Pipes:
{Name}Pipein{name}.pipe.ts - Component selectors:
rt-{name}(namespace with rt-) - Pipe names: prefix with
rt(e.g.,rtDuration)
Testing
- Test framework: Vitest
- Use
@ngneat/spectator/vitestfor component/service testing - Import from
@ngneat/spectator/vitest(not@ngneat/spectator) - Tests use
.spec.tsextension - E2E tests in
{app-name}-e2eprojects using Cypress
For complete details, see .ai/config/shared/instructions.md.