@decantr/cli 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +2 -2
- package/dist/{chunk-66RIAQLH.js → chunk-D3W3MYKT.js} +49 -90
- package/dist/{chunk-6RJSFLT4.js → chunk-T7CQSJGV.js} +390 -379
- package/dist/{heal-54MKDDSQ.js → heal-VYEGIUAS.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{upgrade-25IURU4X.js → upgrade-TXVD2WIN.js} +1 -1
- package/package.json +1 -1
- package/src/bundled/blueprints/default.json +1 -2
- package/src/templates/DECANTR.md.template +8 -9
- package/src/templates/essence-summary.md.template +1 -1
- package/src/templates/project.json.template +1 -2
- package/src/templates/task-add-page.md.template +7 -8
- package/src/templates/task-modify.md.template +8 -9
- package/src/templates/task-scaffold.md.template +1 -2
|
@@ -8,7 +8,7 @@ import { readFileSync, writeFileSync, existsSync } from "fs";
|
|
|
8
8
|
import { join } from "path";
|
|
9
9
|
var TELEMETRY_ENDPOINT = "https://api.decantr.ai/v1/telemetry/guard";
|
|
10
10
|
var TELEMETRY_TIMEOUT_MS = 3e3;
|
|
11
|
-
var DNA_RULES = /* @__PURE__ */ new Set(["style", "
|
|
11
|
+
var DNA_RULES = /* @__PURE__ */ new Set(["style", "density", "accessibility", "theme-mode"]);
|
|
12
12
|
async function sendGuardMetrics(metrics) {
|
|
13
13
|
try {
|
|
14
14
|
const controller = new AbortController();
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "./chunk-
|
|
2
|
-
import "./chunk-
|
|
1
|
+
import "./chunk-D3W3MYKT.js";
|
|
2
|
+
import "./chunk-T7CQSJGV.js";
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ Decantr is a design intelligence layer that sits between you (the AI code genera
|
|
|
18
18
|
|
|
19
19
|
DNA defines the foundational design rules. **DNA violations are errors** -- they must never happen without updating the essence first.
|
|
20
20
|
|
|
21
|
-
DNA axioms include: Theme (
|
|
21
|
+
DNA axioms include: Theme (id, mode, shape), Spacing (density, content gap), Typography (scale, weights), Color (palette, accent count), Radius (philosophy, base), Elevation (system, levels), Motion (preference, reduce-motion), Accessibility (WCAG level, focus-visible), and Personality traits.
|
|
22
22
|
|
|
23
23
|
### Blueprint (Structural Layout)
|
|
24
24
|
|
|
@@ -33,13 +33,12 @@ Blueprint includes: Sections (grouped by archetype with role, shell, and scoped
|
|
|
33
33
|
| # | Rule | Layer | What It Checks |
|
|
34
34
|
|---|------|-------|----------------|
|
|
35
35
|
| 1 | Style | DNA (error) | Code uses the theme specified in DNA |
|
|
36
|
-
| 2 |
|
|
37
|
-
| 3 |
|
|
38
|
-
| 4 |
|
|
39
|
-
| 5 |
|
|
40
|
-
| 6 |
|
|
41
|
-
| 7 |
|
|
42
|
-
| 8 | Pattern existence | Blueprint (warn) | Patterns referenced exist in the registry |
|
|
36
|
+
| 2 | Density | DNA (error) | Spacing follows the density profile |
|
|
37
|
+
| 3 | Accessibility | DNA (error) | Code meets the WCAG level |
|
|
38
|
+
| 4 | Theme-mode | DNA (error) | Theme/mode combination is valid |
|
|
39
|
+
| 5 | Structure | Blueprint (warn) | Pages exist in the blueprint sections |
|
|
40
|
+
| 6 | Layout | Blueprint (warn) | Pattern order matches the layout spec |
|
|
41
|
+
| 7 | Pattern existence | Blueprint (warn) | Patterns referenced exist in the registry |
|
|
43
42
|
|
|
44
43
|
### Enforcement Tiers
|
|
45
44
|
|
|
@@ -96,7 +95,7 @@ Run `decantr check` to validate code against the spec.
|
|
|
96
95
|
decantr status # Project health
|
|
97
96
|
decantr check # Detect drift violations
|
|
98
97
|
decantr get pattern X # Fetch a pattern spec from registry
|
|
99
|
-
decantr get
|
|
98
|
+
decantr get theme X # Fetch theme details and decorators
|
|
100
99
|
decantr search <query> # Search the registry
|
|
101
100
|
```
|
|
102
101
|
|
|
@@ -11,12 +11,11 @@ You are adding new pages or features to an existing Decantr project. Guided mode
|
|
|
11
11
|
| # | Layer | Rule | Enforcement | What It Means |
|
|
12
12
|
|---|-------|------|-------------|---------------|
|
|
13
13
|
| 1 | DNA | **Style** | ENFORCED | You MUST use theme `{{THEME_STYLE}}` |
|
|
14
|
-
| 2 | DNA | **
|
|
15
|
-
| 3 | DNA | **
|
|
16
|
-
| 4 | DNA | **
|
|
17
|
-
| 5 |
|
|
18
|
-
| 6 | Blueprint |
|
|
19
|
-
| 7 | Blueprint | Layout | advisory | Pattern order is flexible |
|
|
14
|
+
| 2 | DNA | **Density** | ENFORCED | You MUST follow density `{{DENSITY}}` |
|
|
15
|
+
| 3 | DNA | **Accessibility** | ENFORCED | You MUST meet WCAG level from essence |
|
|
16
|
+
| 4 | DNA | **Theme-mode** | ENFORCED | Theme/mode combination must be compatible |
|
|
17
|
+
| 5 | Blueprint | **Structure** | ENFORCED | Page MUST exist in essence before generating code |
|
|
18
|
+
| 6 | Blueprint | Layout | advisory | Pattern order is flexible |
|
|
20
19
|
| 8 | Blueprint | **Pattern-exists** | ENFORCED | All patterns must exist in the registry |
|
|
21
20
|
|
|
22
21
|
## Before You Start
|
|
@@ -64,7 +63,7 @@ Before adding a page:
|
|
|
64
63
|
During code generation:
|
|
65
64
|
|
|
66
65
|
- [ ] Use theme `{{THEME_STYLE}}` for all styling
|
|
67
|
-
- [ ] Use
|
|
66
|
+
- [ ] Use theme `{{THEME_RECIPE}}` decorators for decoration
|
|
68
67
|
- [ ] Follow the shell structure ({{DEFAULT_SHELL}})
|
|
69
68
|
- [ ] Include patterns from the layout array
|
|
70
69
|
|
|
@@ -72,7 +71,7 @@ After generation:
|
|
|
72
71
|
|
|
73
72
|
- [ ] Run `npx @decantr/cli validate`
|
|
74
73
|
- [ ] Verify the page matches the theme
|
|
75
|
-
- [ ] Check that the
|
|
74
|
+
- [ ] Check that the theme decorator styles are applied
|
|
76
75
|
|
|
77
76
|
## Violation Response
|
|
78
77
|
|
|
@@ -11,12 +11,11 @@ You are modifying existing code in a Decantr project. ALL 8 guard rules are enfo
|
|
|
11
11
|
| # | Layer | Rule | Enforcement | Consequence of Violation |
|
|
12
12
|
|---|-------|------|-------------|--------------------------|
|
|
13
13
|
| 1 | DNA | **Style** | STRICT | ERROR — Code rejected |
|
|
14
|
-
| 2 | DNA | **
|
|
15
|
-
| 3 | DNA | **
|
|
16
|
-
| 4 | DNA | **
|
|
17
|
-
| 5 |
|
|
18
|
-
| 6 | Blueprint | **
|
|
19
|
-
| 7 | Blueprint | **Layout** | STRICT | ERROR — Pattern order must match exactly |
|
|
14
|
+
| 2 | DNA | **Density** | STRICT | WARNING — Flagged for review |
|
|
15
|
+
| 3 | DNA | **Accessibility** | STRICT | ERROR — Code rejected |
|
|
16
|
+
| 4 | DNA | **Theme-mode** | STRICT | ERROR — Code rejected |
|
|
17
|
+
| 5 | Blueprint | **Structure** | STRICT | ERROR — Code rejected |
|
|
18
|
+
| 6 | Blueprint | **Layout** | STRICT | ERROR — Pattern order must match exactly |
|
|
20
19
|
| 8 | Blueprint | **Pattern-exists** | STRICT | ERROR — Code rejected |
|
|
21
20
|
|
|
22
21
|
## Violation Response Protocol
|
|
@@ -75,7 +74,7 @@ For the page you're modifying, verify:
|
|
|
75
74
|
- Shell matches the page's `shell` property
|
|
76
75
|
- Patterns match the page's `layout[]` in order
|
|
77
76
|
- Theme matches `theme.style`
|
|
78
|
-
-
|
|
77
|
+
- Theme decorators match `theme.id`
|
|
79
78
|
|
|
80
79
|
### 3. Plan Changes
|
|
81
80
|
|
|
@@ -93,7 +92,7 @@ Before modifying:
|
|
|
93
92
|
- [ ] Page exists in essence structure
|
|
94
93
|
- [ ] I know the exact layout order: `{{LAYOUT}}`
|
|
95
94
|
- [ ] I will use theme: `{{THEME_STYLE}}`
|
|
96
|
-
- [ ] I will use
|
|
95
|
+
- [ ] I will use theme: `{{THEME_RECIPE}}`
|
|
97
96
|
- [ ] I will follow density: `{{DENSITY}}`
|
|
98
97
|
|
|
99
98
|
During modification:
|
|
@@ -144,7 +143,7 @@ Swapping `chart-grid` and `data-table` is a Layout guard violation.
|
|
|
144
143
|
| "Theme mismatch" | Used different theme | Revert to `{{THEME_STYLE}}` |
|
|
145
144
|
| "Page undefined" | Edited undeclared page | Add page to essence first |
|
|
146
145
|
| "Layout order wrong" | Patterns out of order | Match `layout[]` exactly |
|
|
147
|
-
| "
|
|
146
|
+
| "Theme mismatch" | Wrong decoration style | Use `{{THEME_RECIPE}}` |
|
|
148
147
|
| "Density drift" | Wrong spacing values | Use `{{CONTENT_GAP}}` tokens |
|
|
149
148
|
|
|
150
149
|
## Proposing Essence Changes
|
|
@@ -17,8 +17,7 @@ During scaffolding, the following rules are recommendations, not requirements:
|
|
|
17
17
|
| # | Layer | Rule | Status | Guidance |
|
|
18
18
|
|---|-------|------|--------|----------|
|
|
19
19
|
| 1 | DNA | Style | Advisory | Use the theme from essence, but creative variations are acceptable |
|
|
20
|
-
| 2 | DNA |
|
|
21
|
-
| 3 | DNA | Density | Advisory | Follow spacing guidelines loosely |
|
|
20
|
+
| 2 | DNA | Density | Advisory | Follow spacing guidelines loosely |
|
|
22
21
|
| 4 | DNA | Accessibility | Advisory | Meet WCAG level from essence where possible |
|
|
23
22
|
| 5 | DNA | Theme-mode | Advisory | Use the specified theme/mode combination |
|
|
24
23
|
| 6 | Blueprint | Structure | Advisory | Follow the page structure, add placeholder content |
|