Agent Skills: DMC Best Practices

|

UncategorizedID: bjornmelin/dev-skills/dmc-best-practices

Install this agent skill to your local

pnpm dlx add-skill https://github.com/BjornMelin/dev-skills/tree/HEAD/skills/dmc-best-practices

Skill Files

Browse the full folder contents for dmc-best-practices.

Download Skill

Loading file tree…

skills/dmc-best-practices/SKILL.md

Skill Metadata

Name
dmc-best-practices
Description
|

DMC Best Practices

Definitive best practices for building Dash applications with Dash Mantine Components. Rules are organized by impact level and category.

Priority Categories

| Priority | Category | Impact | Prefix | Rules | |----------|----------|--------|--------|-------| | 1 | Architecture | CRITICAL | arch- | 4 | | 2 | Callbacks | CRITICAL/HIGH | callback- | 6 | | 3 | Styling | HIGH/MEDIUM | style- | 5 | | 4 | Data Management | HIGH | data- | 4 | | 5 | Performance | MEDIUM-HIGH | perf- | 3 | | 6 | Forms & Validation | MEDIUM | form- | 2 | | 7 | Theming | MEDIUM | theme- | 3 | | 8 | DMC v2.x Migrations | MEDIUM | v2- | 2 | | 9 | Accessibility | MEDIUM | a11y- | 1 |

Top 10 Critical Rules

  1. Wrap layout in MantineProvider - All DMC components require it
  2. Never modify global variables in callbacks - Breaks multi-worker deployments
  3. Use State not Input for values that shouldn't trigger callbacks
  4. Define callbacks before app.run() - Registration must happen first
  5. Prevent circular callbacks - Outputs feeding inputs cause infinite loops
  6. Return JSON-serializable values - Only dict, list, str, number, bool, None
  7. Use static CSS selectors - Never target .m_* dynamic classes
  8. Custom colors need 10 shades - Exactly 10 (0=lightest, 9=darkest)
  9. Use dcc.Store for client data - Not global variables
  10. Debounce text inputs - Limit callback firing on rapid changes

Rules Index

Architecture (CRITICAL)

Callbacks (CRITICAL/HIGH)

Styling (HIGH/MEDIUM)

Data Management (HIGH)

Performance (MEDIUM-HIGH)

Forms & Validation (MEDIUM)

Theming (MEDIUM)

DMC v2.x Migrations (MEDIUM)

Accessibility (MEDIUM)

Full Reference

See AGENTS.md for the complete compiled reference with all rules expanded.