Linus-Dashboard
AGENTS.md214 starsChanged 31 days agoMITView on GitHub
Contribution rules, including the frontend build, which is never committed, are in the root AGENTS.md. It wins over this file.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- debugSkill
- implementSkill
- release-betaSkill
- release-checkSkill
- release-rollbackSkill
- release-stableSkill
- reviewSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
47 rules. About 0 are common, 29 are distinctive, and 18 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈29
Distinctive · estimate
This author's own choices. Worth a look.
18
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 79
Test embedded dashboards (if configured)
- Distinctive: line 80
Check version compatibility warning
- Distinctive: line 86
Always clear browser cache after updates (cache issues are common)
- Very specific: line 105
Use async/await for asynchronous operations
- Distinctive: line 107
No blocking operations in dashboard generation
- Distinctive: line 110
Use path aliases when configured
- Distinctive: line 117
Use type aliases for unions
- Very specific: line 118
Avoid any (use unknown if necessary)
- Distinctive: line 133
Always await async calls
- Very specific: line 134
Use asyncio.gather() for parallel operations
- Very specific: line 135
Use aiohttp not requests
- Very specific: line 144
Use async_setup and async_setup_entry
- Very specific: line 166
Check integration is loaded: grep "Setting up Linus Dashboard" /config/home-assistant.log
- Distinctive: line 167
Check panel registration: Look for "Registered WebSocket command"
- Distinctive: line 168
Check resources are loaded: Browser DevTools → Network tab
- Distinctive: line 171
Check browser console for errors
- Distinctive: line 172
Verify Mushroom and other cards are loaded
- Distinctive: line 173
Check entity IDs are valid
- Distinctive: line 177
Always clear cache after updates (Ctrl+Shift+R)
- Distinctive: line 178
Check version query parameter is appended to resources
- Distinctive: line 179
Check manifest version matches bundle version
- Very specific: line 182
Run npm run type-check to find issues
- Distinctive: line 183
Check imports are correct
- Distinctive: line 184
Verify types match Home Assistant data structures
- Very specific: line 188
Check manifest.json is valid JSON
- Very specific: line 189
Check requirements are satisfied
- Distinctive: line 190
Check Python syntax errors
- Distinctive: line 191
Check logs for stack traces
- Very specific: line 194
Check files exist in www/ directory
- Distinctive: line 195
Check static path registration succeeded
- Distinctive: line 196
Check resource registration logs
- Distinctive: line 197
Verify version query parameter
- Very specific: line 200
Check command is registered in async_setup
- Distinctive: line 201
Verify command decorator syntax
- Distinctive: line 202
Check response format matches expected schema
- Distinctive: line 207
When releasing a new version, update ALL of these files:
- Very specific: line 228
Create src/views/XxxView.ts extending AbstractView
- Very specific: line 231
Add icon to src/variables.ts → VIEWS_ICONS
- Distinctive: line 232
Test card generation and navigation
- Very specific: line 237
Use in relevant view's getCards() method
- Distinctive: line 238
Test rendering with sample entities
- Very specific: line 241
Add constant to custom_components/linus_dashboard/const.py
- Very specific: line 242
Update config_flow.py to include in options flow
- Very specific: line 243
Update websocket_get_entities in __init__.py to include in response
- Very specific: line 245
Add translations to translations/en.json and translations/fr.json
- Distinctive: line 259
Debouncing: Avoid regenerating dashboard on every state change
- Distinctive: line 261
Large Installs: Test with 500+ entities to ensure performance
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Guidelines for Linus Dashboard
Contribution rules, including the frontend build, which is never committed, are in the root AGENTS.md. It wins over this file.
Build/Lint/Test Commands
Frontend (TypeScript)
- Build production:
npm run buildormake build - Build development:
npm run build:devormake build-watch(watch mode) - Type check:
npm run type-check - Lint:
npm run lintormake lint - Lint check:
npm run lint:check
Backend (Python)
- Format:
python3 -m ruff format . - Lint:
python3 -m ruff check .
Home Assistant
- Start HA:
./ha-env/bin/hass -c /configormake dev - Check config:
./ha-env/bin/hass -c /config --script check_config - Stop HA:
pkill -f "hass -c /config"
Testing on Home Assistant
Starting Home Assistant
# From workspace root
cd /workspaces/Linus-Dashboard
# Start HA (normal mode)
./ha-env/bin/hass -c /config
# Start in debug mode
./ha-env/bin/hass -c /config --debugAccess
- Web UI: http://localhost:8123
- Config directory:
/config/ - Custom component:
/config/custom_components/linus_dashboard/ - Frontend bundles:
/config/custom_components/linus_dashboard/www/ - Logs:
/config/home-assistant.log
Useful Commands
# Stop HA
pkill -f "hass -c /config"
# Watch logs (filter for Linus Dashboard)
tail -f /config/home-assistant.log | grep linus_dashboard
# Watch logs (all)
tail -f /config/home-assistant.log
# Check integration is loaded
grep "Setting up Linus Dashboard" /config/home-assistant.log
# Clear browser cache after updates
# Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)Testing Workflow
- Make changes to TypeScript files in
src/ - Build the frontend:
npm run build # or npm run build:dev for watch mode - Verify output in
custom_components/linus_dashboard/www/linus-strategy.js - Restart Home Assistant:
pkill -f hass && ./ha-env/bin/hass -c /config - Clear browser cache (Ctrl+Shift+R)
- Open Linus Dashboard (bow-tie icon in sidebar)
- Check browser console (F12) for errors
- Test features:
- Navigate to different views (areas, domains)
- Test embedded dashboards (if configured)
- Check version compatibility warning
- Verify card rendering
Important Notes
- Custom component is in
/config/custom_components/linus_dashboard/ - Frontend bundles MUST be rebuilt after TypeScript changes
- Always clear browser cache after updates (cache issues are common)
- Version in
manifest.jsonmust match version inpackage.jsonandsrc/linus-strategy.ts - Resources are cache-busted with
?v=X.X.Xquery parameter
Code Style Guidelines
TypeScript (Frontend)
- Naming:
- Classes:
PascalCase(e.g.,LinusStrategy,AreaView) - Functions/methods:
camelCase(e.g.,getCards,generateDashboard) - Constants:
UPPER_SNAKE_CASE(e.g.,AGGREGATE_DOMAINS,DOMAIN) - Private methods:
_camelCase(e.g.,_processView)
- Classes:
- Functions:
- Max 50 lines
- Type all parameters and return values
- JSDoc comments for public methods
- Single responsibility principle
- Early returns for guard clauses
- Async:
- Use
async/awaitfor asynchronous operations - Handle errors with try/catch
- No blocking operations in dashboard generation
- Use
- Imports:
- Group imports: External → Home Assistant types → Local
- Use path aliases when configured
- Error handling:
- Log errors to console with
[Linus Dashboard]prefix - Provide fallbacks for non-critical failures
- Throw errors for critical failures (breaks dashboard)
- Log errors to console with
- Types:
- Define interfaces for complex objects
- Use type aliases for unions
- Avoid
any(useunknownif necessary)
Python (Backend)
- Naming:
- snake_case for functions/variables
- PascalCase for classes
- UPPER_SNAKE_CASE for constants
- _private for private methods
- Functions:
- Max 50 lines
- Type hints required
- Docstrings for public functions
- Single responsibility
- Early returns
- Async:
- Always await async calls
- Use
asyncio.gather()for parallel operations - Use
aiohttpnotrequests - Handle
CancelledError
- Imports:
- Standard lib → Third-party → Home Assistant → Local
- Error handling:
- Specific exceptions
- Appropriate logging levels
HomeAssistantErrorfor user-facing errors
- HA patterns:
- Use
async_setupandasync_setup_entry - Store data in
hass.data[DOMAIN][entry_id] - Cleanup in
async_unload_entry - Register resources with cache-busting
- Use
Build Configuration
- Rspack:
- Production config:
rspack.config.cjs(minified) - Development config:
rspack.dev.config.cjs(source maps, watch) - Output to
custom_components/linus_dashboard/www/
- Production config:
- Babel:
- Transpile for browser compatibility
- Target modern browsers (ES2020)
- TypeScript:
- Strict mode enabled
- No implicit any
- Check all files
Debugging Tips
Frontend Issues
- Dashboard not appearing:
- Check integration is loaded:
grep "Setting up Linus Dashboard" /config/home-assistant.log - Check panel registration: Look for "Registered WebSocket command"
- Check resources are loaded: Browser DevTools → Network tab
- Check integration is loaded:
- Cards not rendering:
- Check browser console for errors
- Verify Mushroom and other cards are loaded
- Check entity IDs are valid
- Verify area assignments
- Cache issues:
- Always clear cache after updates (Ctrl+Shift+R)
- Check version query parameter is appended to resources
- Check manifest version matches bundle version
- TypeScript errors:
- Run
npm run type-checkto find issues - Check imports are correct
- Verify types match Home Assistant data structures
- Run
Backend Issues
- Integration not loading:
- Check
manifest.jsonis valid JSON - Check
requirementsare satisfied - Check Python syntax errors
- Check logs for stack traces
- Check
- Resources not loading:
- Check files exist in
www/directory - Check static path registration succeeded
- Check resource registration logs
- Verify version query parameter
- Check files exist in
- WebSocket errors:
- Check command is registered in
async_setup - Verify command decorator syntax
- Check response format matches expected schema
- Check command is registered in
Version Management
Updating Version
When releasing a new version, update ALL of these files:
package.json→"version": "X.X.X"custom_components/linus_dashboard/manifest.json→"version": "X.X.X"custom_components/linus_dashboard/const.py→VERSION = "X.X.X"src/linus-strategy.ts→ Update version comment if presentREADME.md→ Update badge if present
Use version-bump-prompt:
npm run bump:release # Automatically updates all filesCache-Busting
- Resources are loaded with
?v=X.X.Xquery parameter - This forces browsers to fetch new version after updates
- Version is read from
manifest.jsonviaget_version()function - Critical for avoiding "red error" issues after updates
Common Patterns
Adding a New View
- Create
src/views/XxxView.tsextendingAbstractView - Implement
getCards()method - Register in
src/linus-strategy.ts→createDomainSubviews() - Add icon to
src/variables.ts→VIEWS_ICONS - Test card generation and navigation
Adding a New Card Type
- Create
src/cards/XxxCard.tsextendingAbstractCard - Implement
getCard(entity, options)method - Use in relevant view's
getCards()method - Test rendering with sample entities
Adding a New Configuration Option
- Add constant to
custom_components/linus_dashboard/const.py - Update
config_flow.pyto include in options flow - Update
websocket_get_entitiesin__init__.pyto include in response - Access in TypeScript via
Helper.strategyOptions.xxx - Add translations to
translations/en.jsonandtranslations/fr.json
Embedded Dashboard Support
- User configures embedded dashboard in integration options
- Frontend receives list via WebSocket
embedLovelace.ts→loadEmbeddedDashboard()fetches dashboard configprocessEmbeddedViews()extracts cards and metadata- Views are injected into Linus Dashboard with proper styling
Performance Considerations
- Lazy Loading: Views are generated on-demand, not all at once
- Entity Filtering: Filter entities early in the pipeline
- Caching: Helper singleton caches hass state
- Debouncing: Avoid regenerating dashboard on every state change
- Bundle Size: Watch the size reported by
npm run build - Large Installs: Test with 500+ entities to ensure performance
Testing Checklist
Before releasing:
- TypeScript compiles without errors (
npm run type-check) - ESLint passes (
npm run lint:check) - Production build succeeds (
npm run build) - Bundle size is reasonable (reported by
npm run build) - Home Assistant loads integration without errors
- Dashboard appears in sidebar with bow-tie icon
- All views render correctly (areas, domains, home)
- Cards interact correctly (click, toggle, etc.)
- Embedded dashboards work (if configured)
- Version check works (test with mismatched versions)
- Translations are complete (English and French)
- Cache-busting works (test by updating version)
- Works on mobile devices (responsive design)
- No console errors in browser
- No errors in Home Assistant logs
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

