@decantr/cli 1.0.0-beta.8 → 1.0.0
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/chunk-PDX44BCA.js +11 -0
- package/dist/chunk-PWTUBGGJ.js +359 -0
- package/dist/heal-2OPN63OT.js +63 -0
- package/dist/index.js +932 -306
- package/dist/upgrade-FWICWIQW.js +68 -0
- package/package.json +3 -2
- package/src/bundled/blueprints/default.json +24 -0
- package/src/bundled/patterns/content-section.json +27 -0
- package/src/bundled/patterns/footer.json +27 -0
- package/src/bundled/patterns/form-basic.json +27 -0
- package/src/bundled/patterns/hero.json +28 -0
- package/src/bundled/patterns/nav-header.json +28 -0
- package/src/bundled/shells/default.json +20 -0
- package/src/bundled/themes/default.json +48 -0
- package/src/templates/DECANTR.md.template +145 -6
- package/src/templates/task-add-page.md.template +3 -3
- package/src/templates/task-modify.md.template +2 -2
- package/src/templates/task-scaffold.md.template +2 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
RegistryClient
|
|
4
|
+
} from "./chunk-PWTUBGGJ.js";
|
|
5
|
+
import "./chunk-PDX44BCA.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/upgrade.ts
|
|
8
|
+
import { readFileSync, existsSync } from "fs";
|
|
9
|
+
import { join } from "path";
|
|
10
|
+
var GREEN = "\x1B[32m";
|
|
11
|
+
var YELLOW = "\x1B[33m";
|
|
12
|
+
var RESET = "\x1B[0m";
|
|
13
|
+
var DIM = "\x1B[2m";
|
|
14
|
+
async function cmdUpgrade(projectRoot = process.cwd()) {
|
|
15
|
+
const essencePath = join(projectRoot, "decantr.essence.json");
|
|
16
|
+
if (!existsSync(essencePath)) {
|
|
17
|
+
console.error("No decantr.essence.json found. Run `decantr init` first.");
|
|
18
|
+
process.exitCode = 1;
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const essence = JSON.parse(readFileSync(essencePath, "utf-8"));
|
|
22
|
+
const client = new RegistryClient({
|
|
23
|
+
cacheDir: join(projectRoot, ".decantr", "cache")
|
|
24
|
+
});
|
|
25
|
+
console.log("Checking for updates...\n");
|
|
26
|
+
const upgrades = [];
|
|
27
|
+
if (essence.theme?.style) {
|
|
28
|
+
const theme = await client.fetchTheme(essence.theme.style);
|
|
29
|
+
if (theme && theme.data.version) {
|
|
30
|
+
const current = essence.theme.version || "0.0.0";
|
|
31
|
+
if (theme.data.version !== current) {
|
|
32
|
+
upgrades.push({
|
|
33
|
+
type: "theme",
|
|
34
|
+
id: essence.theme.style,
|
|
35
|
+
currentVersion: current,
|
|
36
|
+
latestVersion: theme.data.version
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (essence.blueprint) {
|
|
42
|
+
const blueprint = await client.fetchBlueprint(essence.blueprint);
|
|
43
|
+
if (blueprint && blueprint.data.version) {
|
|
44
|
+
const current = essence.blueprintVersion || "0.0.0";
|
|
45
|
+
if (blueprint.data.version !== current) {
|
|
46
|
+
upgrades.push({
|
|
47
|
+
type: "blueprint",
|
|
48
|
+
id: essence.blueprint,
|
|
49
|
+
currentVersion: current,
|
|
50
|
+
latestVersion: blueprint.data.version
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (upgrades.length === 0) {
|
|
56
|
+
console.log(`${GREEN}Everything is up to date.${RESET}`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
console.log("Available upgrades:\n");
|
|
60
|
+
for (const u of upgrades) {
|
|
61
|
+
console.log(` ${u.type}/${u.id}: ${DIM}${u.currentVersion}${RESET} -> ${GREEN}${u.latestVersion}${RESET}`);
|
|
62
|
+
}
|
|
63
|
+
console.log(`
|
|
64
|
+
${YELLOW}Run with --apply to apply upgrades.${RESET}`);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
cmdUpgrade
|
|
68
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decantr/cli",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Decantr CLI — search the registry, validate essence files, and access design intelligence from the terminal",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
-
"src/templates"
|
|
19
|
+
"src/templates",
|
|
20
|
+
"src/bundled"
|
|
20
21
|
],
|
|
21
22
|
"publishConfig": {
|
|
22
23
|
"access": "public"
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "default",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/blueprint.v1.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Decantr Default",
|
|
7
|
+
"description": "Minimal starter blueprint for offline scaffolding. Visit decantr.ai/registry for more options.",
|
|
8
|
+
"tags": ["starter", "minimal", "offline"],
|
|
9
|
+
"compose": ["starter"],
|
|
10
|
+
"theme": {
|
|
11
|
+
"style": "default",
|
|
12
|
+
"mode": "system",
|
|
13
|
+
"recipe": null,
|
|
14
|
+
"shape": "rounded"
|
|
15
|
+
},
|
|
16
|
+
"personality": ["clean", "minimal"],
|
|
17
|
+
"features": [],
|
|
18
|
+
"routes": {
|
|
19
|
+
"/": {
|
|
20
|
+
"shell": "default",
|
|
21
|
+
"page": "home"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "content-section",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/pattern.v2.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Content Section",
|
|
7
|
+
"description": "Generic content section with heading and body.",
|
|
8
|
+
"components": [],
|
|
9
|
+
"default_preset": "standard",
|
|
10
|
+
"presets": {
|
|
11
|
+
"standard": {
|
|
12
|
+
"description": "Centered content with max-width",
|
|
13
|
+
"layout": {
|
|
14
|
+
"layout": "stack",
|
|
15
|
+
"atoms": "_flex _col _gap4 _py8 _px6 _mxauto _maxw[800px]"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"default_layout": {
|
|
20
|
+
"layout": "stack",
|
|
21
|
+
"atoms": "_flex _col _gap4 _py8 _px6 _mxauto _maxw[800px]",
|
|
22
|
+
"slots": {
|
|
23
|
+
"heading": "Section heading",
|
|
24
|
+
"body": "Section content"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "footer",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/pattern.v2.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Footer",
|
|
7
|
+
"description": "Page footer with links and copyright.",
|
|
8
|
+
"components": ["Link"],
|
|
9
|
+
"default_preset": "standard",
|
|
10
|
+
"presets": {
|
|
11
|
+
"standard": {
|
|
12
|
+
"description": "Simple footer with links and copyright",
|
|
13
|
+
"layout": {
|
|
14
|
+
"layout": "row",
|
|
15
|
+
"atoms": "_flex _aic _jcsb _px6 _py4 _borderT _fgmuted"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"default_layout": {
|
|
20
|
+
"layout": "row",
|
|
21
|
+
"atoms": "_flex _aic _jcsb _px6 _py4 _borderT _fgmuted",
|
|
22
|
+
"slots": {
|
|
23
|
+
"links": "Footer links",
|
|
24
|
+
"copyright": "Copyright notice"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "form-basic",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/pattern.v2.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Basic Form",
|
|
7
|
+
"description": "Simple form with inputs and submit button.",
|
|
8
|
+
"components": ["Input", "Button", "Label"],
|
|
9
|
+
"default_preset": "standard",
|
|
10
|
+
"presets": {
|
|
11
|
+
"standard": {
|
|
12
|
+
"description": "Vertical form with stacked fields",
|
|
13
|
+
"layout": {
|
|
14
|
+
"layout": "stack",
|
|
15
|
+
"atoms": "_flex _col _gap4"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"default_layout": {
|
|
20
|
+
"layout": "stack",
|
|
21
|
+
"atoms": "_flex _col _gap4",
|
|
22
|
+
"slots": {
|
|
23
|
+
"fields": "Form input fields",
|
|
24
|
+
"actions": "Submit/cancel buttons"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "hero",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/pattern.v2.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Hero",
|
|
7
|
+
"description": "Landing page hero section with headline, subheadline, and CTA.",
|
|
8
|
+
"components": ["Button"],
|
|
9
|
+
"default_preset": "standard",
|
|
10
|
+
"presets": {
|
|
11
|
+
"standard": {
|
|
12
|
+
"description": "Centered hero with headline and CTA",
|
|
13
|
+
"layout": {
|
|
14
|
+
"layout": "stack",
|
|
15
|
+
"atoms": "_flex _col _aic _tc _py12 _gap6"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"default_layout": {
|
|
20
|
+
"layout": "stack",
|
|
21
|
+
"atoms": "_flex _col _aic _tc _py12 _gap6",
|
|
22
|
+
"slots": {
|
|
23
|
+
"headline": "Main headline text",
|
|
24
|
+
"subheadline": "Supporting description",
|
|
25
|
+
"cta": "Call-to-action button(s)"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "nav-header",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/pattern.v2.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Navigation Header",
|
|
7
|
+
"description": "Top navigation bar with logo, links, and actions.",
|
|
8
|
+
"components": ["Button", "Link"],
|
|
9
|
+
"default_preset": "standard",
|
|
10
|
+
"presets": {
|
|
11
|
+
"standard": {
|
|
12
|
+
"description": "Horizontal nav with logo left, links center, actions right",
|
|
13
|
+
"layout": {
|
|
14
|
+
"layout": "row",
|
|
15
|
+
"atoms": "_flex _aic _jcsb _px6 _py3 _borderB"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"default_layout": {
|
|
20
|
+
"layout": "row",
|
|
21
|
+
"atoms": "_flex _aic _jcsb _px6 _py3 _borderB",
|
|
22
|
+
"slots": {
|
|
23
|
+
"logo": "Brand logo or name",
|
|
24
|
+
"links": "Navigation links",
|
|
25
|
+
"actions": "Action buttons (login, signup)"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "default",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/shell.v1.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"name": "Default Shell",
|
|
6
|
+
"description": "Simple top-nav + main content layout.",
|
|
7
|
+
"layout": "stack",
|
|
8
|
+
"atoms": "_flex _col _minh[100vh]",
|
|
9
|
+
"config": {
|
|
10
|
+
"regions": ["header", "body"],
|
|
11
|
+
"header": {
|
|
12
|
+
"height": "auto",
|
|
13
|
+
"sticky": true
|
|
14
|
+
},
|
|
15
|
+
"body": {
|
|
16
|
+
"scroll": true,
|
|
17
|
+
"flex": 1
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "default",
|
|
3
|
+
"$schema": "https://decantr.ai/schemas/theme.v1.json",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"decantr_compat": ">=1.0.0",
|
|
6
|
+
"name": "Decantr Default",
|
|
7
|
+
"description": "Neutral theme that works in light and dark modes. Clean and professional.",
|
|
8
|
+
"tags": ["neutral", "light", "dark", "minimal"],
|
|
9
|
+
"personality": "clean + minimal + professional",
|
|
10
|
+
"seed": {
|
|
11
|
+
"primary": "#3B82F6",
|
|
12
|
+
"secondary": "#6B7280",
|
|
13
|
+
"accent": "#8B5CF6",
|
|
14
|
+
"background": "#FFFFFF"
|
|
15
|
+
},
|
|
16
|
+
"palette": {
|
|
17
|
+
"background": {
|
|
18
|
+
"light": "#FFFFFF",
|
|
19
|
+
"dark": "#18181B"
|
|
20
|
+
},
|
|
21
|
+
"surface": {
|
|
22
|
+
"light": "#F9FAFB",
|
|
23
|
+
"dark": "#27272A"
|
|
24
|
+
},
|
|
25
|
+
"surface-raised": {
|
|
26
|
+
"light": "#F3F4F6",
|
|
27
|
+
"dark": "#3F3F46"
|
|
28
|
+
},
|
|
29
|
+
"border": {
|
|
30
|
+
"light": "#E5E7EB",
|
|
31
|
+
"dark": "#52525B"
|
|
32
|
+
},
|
|
33
|
+
"text": {
|
|
34
|
+
"light": "#111827",
|
|
35
|
+
"dark": "#FAFAFA"
|
|
36
|
+
},
|
|
37
|
+
"text-muted": {
|
|
38
|
+
"light": "#6B7280",
|
|
39
|
+
"dark": "#A1A1AA"
|
|
40
|
+
},
|
|
41
|
+
"primary": {
|
|
42
|
+
"light": "#3B82F6",
|
|
43
|
+
"dark": "#60A5FA"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"modes": ["light", "dark", "system"],
|
|
47
|
+
"shapes": ["rounded", "sharp", "pill"]
|
|
48
|
+
}
|
|
@@ -98,6 +98,20 @@ When a user request would violate guard rules:
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
### Theme Quick Reference
|
|
102
|
+
|
|
103
|
+
{{THEME_QUICK_REFERENCE}}
|
|
104
|
+
|
|
105
|
+
**To fetch complete theme and recipe specs:**
|
|
106
|
+
```bash
|
|
107
|
+
npx @decantr/cli get theme {{THEME_STYLE}}
|
|
108
|
+
npx @decantr/cli get recipe {{THEME_RECIPE}}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
{{ACCESSIBILITY_SECTION}}
|
|
112
|
+
|
|
113
|
+
{{SEO_SECTION}}
|
|
114
|
+
|
|
101
115
|
### Pages
|
|
102
116
|
|
|
103
117
|
{{PAGES_TABLE}}
|
|
@@ -112,16 +126,32 @@ When a user request would violate guard rules:
|
|
|
112
126
|
|
|
113
127
|
**Always check these before generating UI code:**
|
|
114
128
|
|
|
115
|
-
###
|
|
129
|
+
### Quick Commands
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Get full theme spec (colors, palette, modes)
|
|
133
|
+
npx @decantr/cli get theme {{THEME_STYLE}}
|
|
134
|
+
|
|
135
|
+
# Get recipe decorators and effects
|
|
136
|
+
npx @decantr/cli get recipe {{THEME_RECIPE}}
|
|
137
|
+
|
|
138
|
+
# Get pattern structure and presets
|
|
139
|
+
npx @decantr/cli get pattern <pattern-name>
|
|
116
140
|
|
|
117
|
-
|
|
141
|
+
# Search for patterns
|
|
142
|
+
npx @decantr/cli search <query>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### With MCP Tools (If Available)
|
|
146
|
+
|
|
147
|
+
> Note: MCP tools require the `@decantr/mcp-server` to be configured. If these tools are not available, use the CLI commands above.
|
|
118
148
|
|
|
119
149
|
1. `decantr_read_essence` — Load the current essence
|
|
120
150
|
2. `decantr_check_drift` — Verify your planned changes won't violate rules
|
|
121
151
|
3. `decantr_resolve_pattern` — Get pattern details before implementing
|
|
122
152
|
4. `decantr_suggest_patterns` — Find appropriate patterns for new sections
|
|
123
153
|
|
|
124
|
-
### Without MCP Tools
|
|
154
|
+
### Without MCP Tools or CLI
|
|
125
155
|
|
|
126
156
|
1. Read `decantr.essence.json` in the project root
|
|
127
157
|
2. Verify the page you're editing exists in `structure[]`
|
|
@@ -159,7 +189,7 @@ After generating code, verify:
|
|
|
159
189
|
Run validation to check for violations:
|
|
160
190
|
|
|
161
191
|
```bash
|
|
162
|
-
decantr validate
|
|
192
|
+
npx @decantr/cli validate
|
|
163
193
|
```
|
|
164
194
|
|
|
165
195
|
Or use the MCP tool:
|
|
@@ -205,6 +235,115 @@ Use the same component variants throughout a pattern. If buttons are `primary` s
|
|
|
205
235
|
|
|
206
236
|
---
|
|
207
237
|
|
|
238
|
+
## CSS Implementation
|
|
239
|
+
|
|
240
|
+
### HTML Setup
|
|
241
|
+
|
|
242
|
+
Your `index.html` MUST have theme and mode attributes:
|
|
243
|
+
|
|
244
|
+
```html
|
|
245
|
+
<!DOCTYPE html>
|
|
246
|
+
<html lang="en" data-theme="{{THEME_STYLE}}" data-mode="{{THEME_MODE}}">
|
|
247
|
+
<head>
|
|
248
|
+
<meta name="color-scheme" content="{{THEME_MODE}}">
|
|
249
|
+
...
|
|
250
|
+
</head>
|
|
251
|
+
</html>
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Why this matters:**
|
|
255
|
+
- `data-theme` enables theme switching via JS without reloading CSS
|
|
256
|
+
- `data-mode` enables light/dark toggle
|
|
257
|
+
- `color-scheme` tells the browser to style native controls (scrollbars, inputs) correctly
|
|
258
|
+
|
|
259
|
+
### CSS Layer Structure
|
|
260
|
+
|
|
261
|
+
Use `@layer` for proper cascade control:
|
|
262
|
+
|
|
263
|
+
```css
|
|
264
|
+
@layer decantr.reset, decantr.tokens, decantr.decorators, decantr.patterns, decantr.utilities, app;
|
|
265
|
+
|
|
266
|
+
@layer decantr.reset {
|
|
267
|
+
*, *::before, *::after { box-sizing: border-box; }
|
|
268
|
+
body { margin: 0; }
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
@layer decantr.tokens {
|
|
272
|
+
/* Base spacing (theme-agnostic) */
|
|
273
|
+
:root {
|
|
274
|
+
--gap1: 4px;
|
|
275
|
+
--gap2: 8px;
|
|
276
|
+
--gap3: 12px;
|
|
277
|
+
--gap4: 16px;
|
|
278
|
+
--gap6: 24px;
|
|
279
|
+
--gap8: 32px;
|
|
280
|
+
--gap12: 48px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Theme-specific tokens */
|
|
284
|
+
html[data-theme="{{THEME_STYLE}}"] {
|
|
285
|
+
color-scheme: {{THEME_MODE}};
|
|
286
|
+
|
|
287
|
+
/* Seed colors from theme */
|
|
288
|
+
--d-primary: /* from theme.seed.primary */;
|
|
289
|
+
--d-secondary: /* from theme.seed.secondary */;
|
|
290
|
+
--d-accent: /* from theme.seed.accent */;
|
|
291
|
+
--d-bg: /* from theme.seed.background */;
|
|
292
|
+
|
|
293
|
+
/* Surface stack */
|
|
294
|
+
--d-surface: rgba(255, 255, 255, 0.03);
|
|
295
|
+
--d-surface-raised: rgba(255, 255, 255, 0.06);
|
|
296
|
+
--d-border: rgba(255, 255, 255, 0.1);
|
|
297
|
+
|
|
298
|
+
/* Text hierarchy */
|
|
299
|
+
--d-text: #FFFFFF;
|
|
300
|
+
--d-text-secondary: rgba(255, 255, 255, 0.7);
|
|
301
|
+
--d-text-muted: rgba(255, 255, 255, 0.4);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
@layer decantr.decorators {
|
|
306
|
+
/* Recipe-specific classes from {{THEME_RECIPE}} */
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
@layer decantr.patterns {
|
|
310
|
+
.pattern-hero { }
|
|
311
|
+
.pattern-kpi-grid { }
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
@layer app {
|
|
315
|
+
/* Your application overrides */
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Variable Naming Convention
|
|
320
|
+
|
|
321
|
+
| Prefix | Purpose | Example |
|
|
322
|
+
|--------|---------|---------|
|
|
323
|
+
| `--d-` | Core Decantr tokens | `--d-primary`, `--d-bg` |
|
|
324
|
+
| `--{recipe}-` | Recipe-specific | `--lum-orb-opacity` |
|
|
325
|
+
| `--gap{N}` | Spacing tokens | `--gap4`, `--gap8` |
|
|
326
|
+
|
|
327
|
+
### Theme Switching (JavaScript)
|
|
328
|
+
|
|
329
|
+
```javascript
|
|
330
|
+
// Switch theme
|
|
331
|
+
document.documentElement.dataset.theme = 'newTheme';
|
|
332
|
+
|
|
333
|
+
// Switch mode
|
|
334
|
+
document.documentElement.dataset.mode = 'light';
|
|
335
|
+
document.querySelector('meta[name="color-scheme"]').content = 'light';
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Get Full Theme/Recipe Specs
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
npx @decantr/cli get theme {{THEME_STYLE}} # See seed colors, palette
|
|
342
|
+
npx @decantr/cli get recipe {{THEME_RECIPE}} # See decorators, effects
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
208
347
|
## Spatial Guidelines
|
|
209
348
|
|
|
210
349
|
### Personality to Density Mapping
|
|
@@ -341,7 +480,7 @@ These files contain tier-specific rules and checklists.
|
|
|
341
480
|
**"I don't know which pattern to use"**
|
|
342
481
|
1. Use `decantr_suggest_patterns` with a description
|
|
343
482
|
2. Or check the patterns in `.decantr/cache/patterns/`
|
|
344
|
-
3. Or search the registry with `decantr search <query>`
|
|
483
|
+
3. Or search the registry with `npx @decantr/cli search <query>`
|
|
345
484
|
|
|
346
485
|
---
|
|
347
486
|
|
|
@@ -366,7 +505,7 @@ When the user wants to change the design spec:
|
|
|
366
505
|
|
|
367
506
|
1. Read the current `decantr.essence.json`
|
|
368
507
|
2. Make the requested changes
|
|
369
|
-
3. Validate with `decantr validate`
|
|
508
|
+
3. Validate with `npx @decantr/cli validate`
|
|
370
509
|
4. Write the updated file
|
|
371
510
|
5. Regenerate `DECANTR.md` if structure changed significantly
|
|
372
511
|
|
|
@@ -40,7 +40,7 @@ Before generating code for a new page, add it to the essence:
|
|
|
40
40
|
Run validation to ensure the essence is valid:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
decantr validate
|
|
43
|
+
npx @decantr/cli validate
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
### 3. Then Generate
|
|
@@ -54,7 +54,7 @@ Before adding a page:
|
|
|
54
54
|
- [ ] The page ID is added to `structure[]` in essence
|
|
55
55
|
- [ ] The page has a `shell` defined
|
|
56
56
|
- [ ] The page has a `layout[]` with pattern IDs
|
|
57
|
-
- [ ] Validation passes (`decantr validate`)
|
|
57
|
+
- [ ] Validation passes (`npx @decantr/cli validate`)
|
|
58
58
|
|
|
59
59
|
During code generation:
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ During code generation:
|
|
|
65
65
|
|
|
66
66
|
After generation:
|
|
67
67
|
|
|
68
|
-
- [ ] Run `decantr validate`
|
|
68
|
+
- [ ] Run `npx @decantr/cli validate`
|
|
69
69
|
- [ ] Verify the page matches the theme
|
|
70
70
|
- [ ] Check that the recipe styles are applied
|
|
71
71
|
|
|
@@ -102,8 +102,8 @@ During modification:
|
|
|
102
102
|
|
|
103
103
|
After modification:
|
|
104
104
|
|
|
105
|
-
- [ ] Run `decantr validate`
|
|
106
|
-
- [ ] Run `decantr audit` to check drift
|
|
105
|
+
- [ ] Run `npx @decantr/cli validate`
|
|
106
|
+
- [ ] Run `npx @decantr/cli audit` to check drift
|
|
107
107
|
- [ ] Verify no warnings or errors
|
|
108
108
|
|
|
109
109
|
## Spacing Enforcement
|
|
@@ -41,7 +41,7 @@ During scaffolding:
|
|
|
41
41
|
|
|
42
42
|
After scaffolding:
|
|
43
43
|
|
|
44
|
-
- [ ] Run `decantr validate` to check the essence
|
|
44
|
+
- [ ] Run `npx @decantr/cli validate` to check the essence
|
|
45
45
|
- [ ] Verify each page renders correctly
|
|
46
46
|
- [ ] Check theme consistency across pages
|
|
47
47
|
|
|
@@ -56,7 +56,7 @@ After scaffolding is complete:
|
|
|
56
56
|
1. Run the development server
|
|
57
57
|
2. Verify all pages load
|
|
58
58
|
3. Check theme consistency
|
|
59
|
-
4. Run `decantr validate`
|
|
59
|
+
4. Run `npx @decantr/cli validate`
|
|
60
60
|
|
|
61
61
|
Once verified, subsequent changes will use **{{GUARD_MODE}}** enforcement mode.
|
|
62
62
|
|