Skip to content

Commit 0be3991

Browse files
authored
Merge pull request #157 from bookedsolidtech/feature/update-validation-docs
docs: update validation workflow with severity scoring and slot rules
2 parents 651e884 + fa6138f commit 0be3991

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.automaker/context/validation-workflow.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,34 @@ suggest_fix({
9393
| `specificity` | `important`, `id-selector`, `deep-nesting`, `inline-style` |
9494
| `layout` | `host-display`, `fixed-dimensions`, `position-override`, `overflow-hidden` |
9595

96+
## Reading Validation Results
97+
98+
`validate_component_code` returns a `summary` object with severity-scored, prioritized results:
99+
100+
```
101+
{
102+
summary: {
103+
clean: false,
104+
totalIssues: 5,
105+
errors: 2, // Will break at runtime — fix before shipping
106+
warnings: 2, // May break in dark mode, a11y, or theme changes
107+
info: 1, // Best practice suggestions
108+
verdict: "2 errors (will break at runtime — fix before shipping), 2 warnings...",
109+
topIssues: [ // Top 10, sorted by severity (errors first)
110+
{ severity: "error", category: "shadowDom", message: "...", line: 5 },
111+
...
112+
]
113+
}
114+
}
115+
```
116+
117+
**Severity classification:**
118+
| Severity | Categories | When it matters |
119+
|---|---|---|
120+
| error | shadowDom, imports, shadowDomJs, eventUsage, methodCalls | Always — code is broken |
121+
| warning | a11y, tokenFallbacks, themeCompat, colorContrast, scope, shorthand, slotChildren, attributeConflicts | Dark mode, accessibility, theme switching |
122+
| info | specificity, layout, transitionAnimation, htmlUsage, cssVars, composition | Code quality, maintainability |
123+
96124
## Don't Know Which Validators to Run?
97125

98126
Call `recommend_checks` with your code — it analyzes the content type and returns a prioritized list.
@@ -117,3 +145,5 @@ Call `recommend_checks` with your code — it analyzes the content type and retu
117145
16. **Don't set `innerHTML` on web components** — use slot content or the component's properties/methods
118146
17. **Don't transition standard CSS properties on component hosts** — transitions on `color`, `background`, etc. only affect the host box, not shadow internals. Transition CSS custom properties instead.
119147
18. **Don't hardcode colors alongside design tokens** — if background uses a token but text color is hardcoded, theme changes will break contrast
148+
19. **Style slotted content in light DOM CSS, not `::slotted()`**`::slotted()` only works inside shadow root stylesheets. Target slotted elements directly in your page CSS before they're slotted in.
149+
20. **Slotted content inherits font styles but not layout**`color`, `font-size`, `line-height` inherit from the shadow DOM, but `margin`, `padding`, `display` must be set in light DOM CSS

0 commit comments

Comments
 (0)