dreative 0.5.1 → 0.5.3
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/README.md +49 -27
- package/dist/cli/audit.js +206 -0
- package/dist/cli/audit.test.js +79 -0
- package/dist/cli/docsCheck.js +163 -0
- package/dist/cli/docsCheck.test.js +8 -0
- package/dist/cli/index.js +45 -9
- package/dist/server/preview.js +73 -73
- package/dist/server/store.js +11 -0
- package/dist/shared/artifacts.js +220 -0
- package/dist/shared/design.js +45 -24
- package/dist/shared/ruleSystem.js +220 -0
- package/dist/shared/ruleSystem.test.js +262 -0
- package/dist/shared/skillSystem.js +173 -0
- package/dist/shared/skillSystem.test.js +110 -0
- package/dist/ui/assets/{index--vztc_MR.js → index-CKwmbx2j.js} +13 -13
- package/dist/ui/index.html +12 -12
- package/package.json +5 -3
- package/skill/dreative/DESIGN.md +144 -108
- package/skill/dreative/PLAN.md +285 -116
- package/skill/dreative/SKILL.md +237 -144
- package/skill/dreative/frameworks/nextjs.md +13 -0
- package/skill/dreative/frameworks/react-vite.md +12 -0
- package/skill/dreative/frameworks/styling.md +14 -0
- package/skill/dreative/frameworks/sveltekit.md +10 -0
- package/skill/dreative/frameworks/vue-nuxt.md +12 -0
- package/skill/dreative/recipes/3d-recipes.md +44 -0
- package/skill/dreative/recipes/cinematic-recipes.md +19 -0
- package/skill/dreative/recipes/immersive-recipes.md +18 -0
- package/skill/dreative/recipes/media-recipes.md +60 -0
- package/skill/dreative/recipes/motion-recipes.md +68 -0
- package/skill/dreative/references/ARTIFACTS.md +196 -0
- package/skill/dreative/references/REFLEX_FONTS.json +44 -0
- package/skill/dreative/references/RULES.json +186 -0
- package/skill/dreative/references/SKILL_CONTRACT.md +30 -0
- package/skill/dreative/references/TIERS.md +44 -0
- package/skill/dreative/schemas/plan.schema.json +309 -0
- package/skill/dreative/schemas/verify.schema.json +75 -0
- package/skill/dreative/skills/3d.md +94 -267
- package/skill/dreative/skills/cinematic.md +56 -232
- package/skill/dreative/skills/experimental.md +108 -95
- package/skill/dreative/skills/immersive.md +61 -223
- package/skill/dreative/skills/interaction.md +9 -1
- package/skill/dreative/skills/media.md +149 -564
- package/skill/dreative/skills/mobile.md +129 -117
- package/skill/dreative/skills/motion.md +126 -256
- package/skill/dreative/skills/refined.md +116 -102
- package/skill/dreative/skills/ux.md +155 -144
- package/dist/server/ai.js +0 -177
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { detectSpecialistSkills, resolveAmbitionTier, resolveSkillDependencies, routeSkillsAcrossPages } from "./skillSystem.js";
|
|
4
|
+
import { validatePlan, validatePreservationManifest, validateVerificationReport } from "./artifacts.js";
|
|
5
|
+
test("detects every previously un-routed specialist family", () => {
|
|
6
|
+
assert.deepEqual(detectSpecialistSkills(["experimental mobile-first gallery with generated video"]), [
|
|
7
|
+
"mobile",
|
|
8
|
+
"media",
|
|
9
|
+
"experimental",
|
|
10
|
+
]);
|
|
11
|
+
});
|
|
12
|
+
test("resolves universal and transitive skill dependencies", () => {
|
|
13
|
+
assert.deepEqual(resolveSkillDependencies(["cinematic"]), ["ux", "mobile", "motion", "interaction", "media", "cinematic"]);
|
|
14
|
+
});
|
|
15
|
+
test("resolves ambition without forcing award tier", () => {
|
|
16
|
+
assert.equal(resolveAmbitionTier({ variance: 3, motion: 2, aesthetic: "trust" }), "solid");
|
|
17
|
+
assert.equal(resolveAmbitionTier({ variance: 7, motion: 7 }), "expressive");
|
|
18
|
+
assert.equal(resolveAmbitionTier({ variance: 7, motion: 7, texts: ["Awwwards immersive world"] }), "award");
|
|
19
|
+
});
|
|
20
|
+
test("hybrid routing honors page pins and never activates unselected suggestions", () => {
|
|
21
|
+
const routed = routeSkillsAcrossPages({
|
|
22
|
+
pages: [
|
|
23
|
+
{ id: "home", texts: ["cinematic hero with a video loop and 3d globe"] },
|
|
24
|
+
{ id: "shop", texts: ["clean ecommerce catalog"] },
|
|
25
|
+
],
|
|
26
|
+
selected: ["cinematic", "refined"],
|
|
27
|
+
assignments: { shop: ["refined"] },
|
|
28
|
+
});
|
|
29
|
+
assert.ok(routed.byPage.shop.includes("refined"));
|
|
30
|
+
assert.ok(routed.byPage.home.includes("cinematic"));
|
|
31
|
+
assert.ok(routed.byPage.home.includes("motion"));
|
|
32
|
+
assert.ok(!routed.byPage.home.includes("3d"));
|
|
33
|
+
assert.ok(!routed.byPage.shop.includes("3d"));
|
|
34
|
+
assert.ok(routed.suggestions.home.includes("3d"));
|
|
35
|
+
});
|
|
36
|
+
test("select all covers all skills across the build without putting all on every page", () => {
|
|
37
|
+
const all = ["ux", "mobile", "refined", "motion", "interaction", "media", "3d", "immersive", "cinematic", "experimental"];
|
|
38
|
+
const routed = routeSkillsAcrossPages({
|
|
39
|
+
pages: [
|
|
40
|
+
{ id: "home", texts: ["cinematic immersive hero"] },
|
|
41
|
+
{ id: "product", texts: ["3d product"] },
|
|
42
|
+
{ id: "about", texts: ["experimental editorial"] },
|
|
43
|
+
],
|
|
44
|
+
selected: [...all],
|
|
45
|
+
});
|
|
46
|
+
const used = new Set(Object.values(routed.byPage).flat());
|
|
47
|
+
assert.deepEqual([...all].filter((skill) => !used.has(skill)), []);
|
|
48
|
+
assert.ok(Object.values(routed.byPage).some((skills) => skills.length < all.length));
|
|
49
|
+
});
|
|
50
|
+
test("routing can be disabled while waiting for explicit page assignments", () => {
|
|
51
|
+
const routed = routeSkillsAcrossPages({
|
|
52
|
+
pages: [{ id: "home", texts: ["animated landing page"] }],
|
|
53
|
+
selected: ["motion"],
|
|
54
|
+
autoRouteUnassigned: false,
|
|
55
|
+
});
|
|
56
|
+
assert.deepEqual(routed.unassigned, ["motion"]);
|
|
57
|
+
assert.deepEqual(routed.byPage.home, ["ux", "mobile"]);
|
|
58
|
+
});
|
|
59
|
+
test("plan validator rejects unfinished sections", () => {
|
|
60
|
+
const errors = validatePlan({
|
|
61
|
+
version: 2,
|
|
62
|
+
request: "Redesign",
|
|
63
|
+
createdAt: new Date().toISOString(),
|
|
64
|
+
tier: "premium",
|
|
65
|
+
depth: "restructure",
|
|
66
|
+
skills: ["ux", "mobile"],
|
|
67
|
+
skillPolicy: { mode: "hybrid", global: ["ux", "mobile"], routingApproved: true, userAssignments: [] },
|
|
68
|
+
designRead: { register: "editorial", concept: "signal", signature: "rail" },
|
|
69
|
+
preservationManifest: ".dreative/preservation.json",
|
|
70
|
+
decisionLedger: ".dreative/ledger.json",
|
|
71
|
+
pages: [
|
|
72
|
+
{
|
|
73
|
+
id: "home",
|
|
74
|
+
name: "Home",
|
|
75
|
+
skills: ["ux", "mobile"],
|
|
76
|
+
sections: [
|
|
77
|
+
{
|
|
78
|
+
id: "hero",
|
|
79
|
+
name: "Hero",
|
|
80
|
+
layoutFamily: "split",
|
|
81
|
+
skills: ["ux", "mobile"],
|
|
82
|
+
interactions: [],
|
|
83
|
+
mobile: "stack",
|
|
84
|
+
fallback: "static",
|
|
85
|
+
verification: ["Headline visible"],
|
|
86
|
+
assets: [],
|
|
87
|
+
status: "planned",
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
assert.ok(errors.some((error) => error.includes("still planned")));
|
|
94
|
+
});
|
|
95
|
+
test("preservation validator requires reasons for intentional changes", () => {
|
|
96
|
+
const errors = validatePreservationManifest({
|
|
97
|
+
version: 1,
|
|
98
|
+
createdAt: new Date().toISOString(),
|
|
99
|
+
items: [{ id: "cta", kind: "link", file: "src/App.tsx", needle: "/buy", purpose: "Purchase", intentionallyChanged: true }],
|
|
100
|
+
});
|
|
101
|
+
assert.ok(errors.some((error) => error.includes("changeReason")));
|
|
102
|
+
});
|
|
103
|
+
test("verification rejects text-only self-reporting", () => {
|
|
104
|
+
const errors = validateVerificationReport({
|
|
105
|
+
version: 1,
|
|
106
|
+
generatedAt: new Date().toISOString(),
|
|
107
|
+
evidence: [{ id: "mobile", criterion: "Works at 390px", status: "pass", evidence: "Tested at 390px" }],
|
|
108
|
+
});
|
|
109
|
+
assert.ok(errors.some((error) => error.includes("proof")));
|
|
110
|
+
});
|