Skip to content

docs(base): add component development best practices to AGENTS.md#13139

Open
vladitasev wants to merge 1 commit intomainfrom
docs/agents-best-practices
Open

docs(base): add component development best practices to AGENTS.md#13139
vladitasev wants to merge 1 commit intomainfrom
docs/agents-best-practices

Conversation

@vladitasev
Copy link
Contributor

@vladitasev vladitasev commented Feb 25, 2026

Add comprehensive guidance for AI coding assistants covering:

  • Public vs private property patterns
  • Avoiding hidden state in components
  • Counter properties anti-pattern
  • Boolean property defaults
  • Parent-child component communication
  • Typed slot accessors
  • Event binding in templates
  • i18n bundle naming when extending components
  • Lifecycle method best practices

Add comprehensive guidance for AI coding assistants covering:
- Public vs private property patterns
- Avoiding hidden state in components
- Counter properties anti-pattern
- Boolean property defaults
- Parent-child component communication
- Typed slot accessors
- Event binding in templates
- i18n bundle naming when extending components
- Lifecycle method best practices
expanded = false;

_onToggleClick() {
// Don't change directly - fire event for app to handle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add example like change event? where value is not passed into event details


### Typed Slot Accessors

Use typed slot accessors instead of `querySelector` for slotted content:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can point that slots are always initialized?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants