@struq/skill 0.3.0 → 0.4.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.
Files changed (129) hide show
  1. package/README.md +22 -36
  2. package/package.json +3 -2
  3. package/skills/struq/SKILL.md +139 -307
  4. package/skills/struq/blocks/CATALOG.md +426 -0
  5. package/skills/struq/blocks/backgrounds/background-aurora.tsx +818 -0
  6. package/skills/struq/blocks/backgrounds/background-facets.tsx +1283 -0
  7. package/skills/struq/blocks/backgrounds/background-silk.tsx +906 -0
  8. package/skills/struq/blocks/catalog.json +1302 -0
  9. package/skills/struq/blocks/footers/footer-contact.tsx +789 -0
  10. package/skills/struq/blocks/footers/footer-reveal.tsx +313 -0
  11. package/skills/struq/blocks/headers/header-bar.tsx +652 -0
  12. package/skills/struq/blocks/headers/menu-curtain.tsx +790 -0
  13. package/skills/struq/blocks/heroes/hero-framed.tsx +627 -0
  14. package/skills/struq/blocks/heroes/hero-index.tsx +855 -0
  15. package/skills/struq/blocks/heroes/hero-poster.tsx +1086 -0
  16. package/skills/struq/blocks/heroes/hero-split.tsx +685 -0
  17. package/skills/struq/blocks/heroes/hero-still.tsx +862 -0
  18. package/skills/struq/{recipes/components/struq → blocks/kit}/Cursor.tsx +1 -1
  19. package/skills/struq/{recipes/components/struq → blocks/kit}/HeroCanvas.tsx +2 -2
  20. package/skills/struq/{recipes/components/struq → blocks/kit}/HorizontalGallery.tsx +2 -2
  21. package/skills/struq/{recipes/components/struq → blocks/kit}/MagneticButton.tsx +1 -1
  22. package/skills/struq/{recipes/components/struq → blocks/kit}/MediaFrame.tsx +2 -2
  23. package/skills/struq/{recipes/components/struq → blocks/kit}/PinnedZoom.tsx +14 -4
  24. package/skills/struq/{recipes/components/struq → blocks/kit}/Reveal.tsx +1 -1
  25. package/skills/struq/{recipes/components/struq → blocks/kit}/SmoothScroll.tsx +1 -1
  26. package/skills/struq/{recipes/components/struq → blocks/kit}/SplitHeadline.tsx +1 -1
  27. package/skills/struq/blocks/kit/blocks.css +2102 -0
  28. package/skills/struq/blocks/kit/images.ts +17 -0
  29. package/skills/struq/blocks/kit/photo-read.ts +102 -0
  30. package/skills/struq/blocks/page-transitions/page-transition-gate.tsx +706 -0
  31. package/skills/struq/blocks/page-transitions/page-transition-slices.tsx +469 -0
  32. package/skills/struq/blocks/page-transitions/page-transition-stack.tsx +583 -0
  33. package/skills/struq/blocks/preloaders/preloader-gate.tsx +358 -0
  34. package/skills/struq/blocks/preloaders/preloader-slices-uncovered.ts +50 -0
  35. package/skills/struq/blocks/preloaders/preloader-slices.tsx +289 -0
  36. package/skills/struq/blocks/preloaders/preloader-stack.tsx +367 -0
  37. package/skills/struq/blocks/preloaders/preloader-wordmark.tsx +568 -0
  38. package/skills/struq/blocks/sections/about-studio.tsx +436 -0
  39. package/skills/struq/blocks/sections/approach.tsx +661 -0
  40. package/skills/struq/blocks/sections/contact-form.tsx +664 -0
  41. package/skills/struq/blocks/sections/cta-closing.tsx +763 -0
  42. package/skills/struq/blocks/sections/fanned-cards.tsx +547 -0
  43. package/skills/struq/blocks/sections/film-strip.tsx +385 -0
  44. package/skills/struq/blocks/sections/grid-assembly.tsx +616 -0
  45. package/skills/struq/blocks/sections/hover-list.tsx +467 -0
  46. package/skills/struq/blocks/sections/image-trail.tsx +432 -0
  47. package/skills/struq/blocks/sections/manifesto.tsx +691 -0
  48. package/skills/struq/blocks/sections/panel-accordion.tsx +380 -0
  49. package/skills/struq/blocks/sections/reveals.tsx +416 -0
  50. package/skills/struq/blocks/sections/split-pair.tsx +670 -0
  51. package/skills/struq/blocks/sections/sticky-chapters.tsx +256 -0
  52. package/skills/struq/blocks/sections/velocity-type.tsx +269 -0
  53. package/skills/struq/{cinematic/showpieces/toonstuk-fill-rows.tsx → blocks/showpieces/fill-rows.tsx} +1 -1
  54. package/skills/struq/{cinematic/showpieces/toonstuk-hero-opener.tsx → blocks/showpieces/hero-opener.tsx} +5 -5
  55. package/skills/struq/{cinematic/showpieces/toonstuk-image-to-fullbleed.tsx → blocks/showpieces/image-to-fullbleed.tsx} +16 -5
  56. package/skills/struq/blocks/showpieces/manifesto-scrub.tsx +48 -0
  57. package/skills/struq/{cinematic/showpieces/toonstuk-panel-wipe.tsx → blocks/showpieces/panel-wipe.tsx} +2 -2
  58. package/skills/struq/{cinematic/showpieces/toonstuk-pixel-resolve.tsx → blocks/showpieces/pixel-resolve.tsx} +1 -1
  59. package/skills/struq/{cinematic/showpieces/toonstuk-project-stack.tsx → blocks/showpieces/project-stack.tsx} +2 -2
  60. package/skills/struq/blocks/showpieces/scrub-connector.tsx +307 -0
  61. package/skills/struq/{cinematic/showpieces/toonstuk-wordmark-finale.tsx → blocks/showpieces/wordmark-finale.tsx} +1 -1
  62. package/skills/struq/blocks/transitions/zoom-through.tsx +613 -0
  63. package/skills/struq/canon/canon.json +627 -0
  64. package/skills/struq/cinematic/README.md +7 -18
  65. package/skills/struq/cinematic/examples/code/nextjs/app/components/LenisRoot.tsx +1 -1
  66. package/skills/struq/cinematic/examples/code/shared/styles.css +1 -1
  67. package/skills/struq/cinematic/examples/code/vite/src/LenisRoot.tsx +1 -1
  68. package/skills/struq/cinematic/references/01-core-mental-model.md +1 -1
  69. package/skills/struq/cinematic/references/02-vocabulary.md +1 -1
  70. package/skills/struq/cinematic/references/07-stack-integration.md +2 -2
  71. package/skills/struq/recipes/app/fonts.ts +12 -22
  72. package/skills/struq/recipes/app/globals.css +34 -177
  73. package/skills/struq/recipes/app/layout.tsx +13 -11
  74. package/skills/struq/references/craft.md +77 -0
  75. package/skills/struq/references/iconography.md +28 -230
  76. package/skills/struq/references/stack-targets.md +23 -74
  77. package/skills/struq/references/tells.md +52 -0
  78. package/skills/struq/references/triage.md +6 -7
  79. package/skills/struq/scripts/blocks.mjs +156 -0
  80. package/skills/struq/scripts/canon.mjs +106 -281
  81. package/skills/struq/scripts/check.mjs +92 -126
  82. package/skills/struq/scripts/images.mjs +2 -2
  83. package/skills/struq/scripts/log.mjs +6 -23
  84. package/skills/struq/scripts/tokens.mjs +222 -0
  85. package/skills/struq/cinematic/showpieces/README.md +0 -18
  86. package/skills/struq/cinematic/showpieces/toonstuk-manifesto-scrub.tsx +0 -81
  87. package/skills/struq/cinematic/showpieces/toonstuk-scrub-connector.tsx +0 -78
  88. package/skills/struq/references/anti-patterns.md +0 -330
  89. package/skills/struq/references/baseline-prompt.md +0 -122
  90. package/skills/struq/references/brand.md +0 -143
  91. package/skills/struq/references/brief-router.md +0 -218
  92. package/skills/struq/references/composition.md +0 -190
  93. package/skills/struq/references/depth-parallax.md +0 -235
  94. package/skills/struq/references/direction.md +0 -188
  95. package/skills/struq/references/feel-layer.md +0 -107
  96. package/skills/struq/references/gsap-api.md +0 -293
  97. package/skills/struq/references/hero-scenes.md +0 -107
  98. package/skills/struq/references/imagery.md +0 -125
  99. package/skills/struq/references/loaders.md +0 -287
  100. package/skills/struq/references/micro-interactions.md +0 -270
  101. package/skills/struq/references/mobile-composition.md +0 -70
  102. package/skills/struq/references/nav-header.md +0 -296
  103. package/skills/struq/references/niche-packets.md +0 -338
  104. package/skills/struq/references/page-architecture.md +0 -134
  105. package/skills/struq/references/page-entrances.md +0 -198
  106. package/skills/struq/references/performance.md +0 -235
  107. package/skills/struq/references/pinning-scrub.md +0 -340
  108. package/skills/struq/references/pitfalls.md +0 -290
  109. package/skills/struq/references/route-transitions.md +0 -281
  110. package/skills/struq/references/scaling.md +0 -151
  111. package/skills/struq/references/scroll-reveals.md +0 -279
  112. package/skills/struq/references/sections.md +0 -141
  113. package/skills/struq/references/seo.md +0 -219
  114. package/skills/struq/references/setup.md +0 -397
  115. package/skills/struq/references/showcase.md +0 -87
  116. package/skills/struq/references/struq-imagery.md +0 -107
  117. package/skills/struq/references/svg-motion.md +0 -390
  118. package/skills/struq/references/transitions.md +0 -160
  119. package/skills/struq/references/typography.md +0 -720
  120. package/skills/struq/references/vibe-presets.md +0 -287
  121. package/skills/struq/references/webgl-r3f.md +0 -274
  122. package/skills/struq/references/webgl-scenes.md +0 -593
  123. package/skills/struq/scripts/font-names.mjs +0 -40
  124. package/skills/struq/scripts/recipes.mjs +0 -135
  125. /package/skills/struq/{recipes/lib → blocks/kit}/gsap.ts +0 -0
  126. /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/contours.ts +0 -0
  127. /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/dots.ts +0 -0
  128. /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/ripple.ts +0 -0
  129. /package/skills/struq/{recipes/components/struq → blocks/kit}/scenes/types.ts +0 -0
@@ -1,135 +0,0 @@
1
- #!/usr/bin/env node
2
- // Struq recipes: copy the tested cinematic components into a Next.js App Router project.
3
- //
4
- // node <skill-dir>/scripts/recipes.mjs run from the project root
5
- // node <skill-dir>/scripts/recipes.mjs --dir ./my-site
6
- // node <skill-dir>/scripts/recipes.mjs --force overwrite recipe files you already have
7
- // node <skill-dir>/scripts/recipes.mjs --no-install skip the npm install of missing packages
8
- //
9
- // Copies lib/gsap.ts and components/struq/* (SmoothScroll, SplitHeadline, Reveal, MediaFrame,
10
- // HorizontalGallery, PinnedZoom, HeroCanvas with three scenes, MagneticButton, Cursor).
11
- // On a fresh scaffold it also replaces app/globals.css, app/layout.tsx and adds app/fonts.ts with
12
- // the Struq versions, and removes the starter SVGs. A layout or stylesheet you already wrote is
13
- // never overwritten: the script tells you what to merge instead.
14
- // Then it installs whatever is missing of gsap, @gsap/react, lenis, three and @types/three.
15
- import { spawnSync } from "node:child_process";
16
- import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs";
17
- import { dirname, join, relative, resolve } from "node:path";
18
- import { fileURLToPath } from "node:url";
19
- import { appendLog } from "./log.mjs";
20
-
21
- const here = dirname(fileURLToPath(import.meta.url));
22
- const RECIPES = join(here, "..", "recipes");
23
- const args = process.argv.slice(2);
24
- const flagValue = (name) => {
25
- const i = args.indexOf(name);
26
- return i >= 0 ? args[i + 1] : undefined;
27
- };
28
- const root = resolve(flagValue("--dir") ?? process.cwd());
29
- const force = args.includes("--force");
30
- const install = !args.includes("--no-install");
31
-
32
- const pkgPath = join(root, "package.json");
33
- if (!existsSync(pkgPath)) {
34
- console.error(`FAIL no package.json in ${root}. Scaffold first: npx create-next-app@latest . --ts --tailwind --app --eslint --yes`);
35
- process.exit(2);
36
- }
37
- const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
38
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
39
- if (!deps.next) {
40
- console.error("FAIL this is not a Next.js project. The recipes target Next.js App Router; for Vite read references/stack-targets.md.");
41
- process.exit(2);
42
- }
43
-
44
- const src = existsSync(join(root, "src", "app")) ? "src" : "";
45
- const appDir = join(root, src, "app");
46
- const at = (...p) => join(root, src, ...p);
47
-
48
- function walk(dir) {
49
- return readdirSync(dir).flatMap((name) => {
50
- const full = join(dir, name);
51
- return statSync(full).isDirectory() ? walk(full) : [full];
52
- });
53
- }
54
-
55
- const copied = [];
56
- const kept = [];
57
- function place(from, to, { overwrite = force } = {}) {
58
- if (existsSync(to) && !overwrite) {
59
- kept.push(relative(root, to));
60
- return;
61
- }
62
- mkdirSync(dirname(to), { recursive: true });
63
- copyFileSync(from, to);
64
- copied.push(relative(root, to));
65
- }
66
-
67
- // 1. The components and the GSAP registry: always ours.
68
- place(join(RECIPES, "lib", "gsap.ts"), at("lib", "gsap.ts"));
69
- for (const file of walk(join(RECIPES, "components", "struq"))) {
70
- place(file, at("components", "struq", relative(join(RECIPES, "components", "struq"), file)));
71
- }
72
- // The cinematic showpieces (toonstuk-*), one file per showpiece, named by its stable slug.
73
- const SHOWPIECES = join(here, "..", "cinematic", "showpieces");
74
- for (const file of walk(SHOWPIECES).filter((f) => f.endsWith(".tsx"))) {
75
- place(file, at("components", "struq", "showpieces", relative(SHOWPIECES, file)));
76
- }
77
-
78
- // 2. The app shell: only over a starter file, never over work.
79
- const notes = [];
80
- const read = (p) => (existsSync(p) ? readFileSync(p, "utf8") : "");
81
- const layoutPath = join(appDir, "layout.tsx");
82
- const layout = read(layoutPath);
83
- if (!layout || /Create Next App|Geist/.test(layout) || force) {
84
- place(join(RECIPES, "app", "layout.tsx"), layoutPath, { overwrite: true });
85
- } else if (!layout.includes("SmoothScroll")) {
86
- notes.push("app/layout.tsx is your own: wrap {children} in <SmoothScroll>, add <Cursor />, the `js` class script and the font variables (see the recipe in recipes/app/layout.tsx).");
87
- }
88
- const cssPath = join(appDir, "globals.css");
89
- const css = read(cssPath);
90
- if (!css || (!css.includes("STRUQ TOKENS") && /--background|--foreground|Arial|prefers-color-scheme/.test(css)) || force) {
91
- place(join(RECIPES, "app", "globals.css"), cssPath, { overwrite: true });
92
- } else if (!css.includes("STRUQ TOKENS")) {
93
- notes.push("app/globals.css is your own: merge the STRUQ TOKENS block, the @theme roles and the STRUQ MOTION GATE from recipes/app/globals.css.");
94
- }
95
- place(join(RECIPES, "app", "fonts.ts"), join(appDir, "fonts.ts"));
96
-
97
- for (const starter of ["next.svg", "vercel.svg", "file.svg", "globe.svg", "window.svg"]) {
98
- const p = join(root, "public", starter);
99
- if (existsSync(p)) rmSync(p);
100
- }
101
-
102
- // 3. The alias every recipe imports through.
103
- const tsconfig = read(join(root, "tsconfig.json"));
104
- if (tsconfig && !tsconfig.includes('"@/*"')) {
105
- notes.push('tsconfig.json has no "@/*" path alias: add "paths": { "@/*": ["./' + (src ? "src/" : "") + '*"] } under compilerOptions.');
106
- }
107
-
108
- // 4. Packages.
109
- const need = ["gsap", "@gsap/react", "lenis", "three"].filter((d) => !deps[d]);
110
- const needDev = ["@types/three"].filter((d) => !deps[d]);
111
- const run = (list, dev) => {
112
- if (!list.length) return true;
113
- const cmd = `npm install ${dev ? "-D " : ""}${list.join(" ")}`;
114
- if (!install) {
115
- notes.push(`Run: ${cmd}`);
116
- return true;
117
- }
118
- console.log(`> ${cmd}`);
119
- const r = spawnSync(cmd, { cwd: root, stdio: "inherit", shell: true });
120
- if (r.status !== 0) notes.push(`The install failed. Run it yourself: ${cmd}`);
121
- return r.status === 0;
122
- };
123
- run(need, false);
124
- run(needDev, true);
125
-
126
- console.log(`\nCopied ${copied.length} file(s):`);
127
- for (const f of copied) console.log(` ${f}`);
128
- if (kept.length) console.log(`Kept ${kept.length} existing file(s) (use --force to replace): ${kept.join(", ")}`);
129
- for (const n of notes) console.log(`NOTE ${n}`);
130
- console.log("\nNext: set the palette in globals.css (STRUQ TOKENS), the two faces in app/fonts.ts, the title in app/layout.tsx.");
131
- appendLog(root, "Step 3 Recipes", [
132
- `recipes.mjs copied ${copied.length} file(s), kept ${kept.length}.`,
133
- ...(notes.length ? [`Notes: ${notes.join(" ")}`] : []),
134
- ]);
135
- console.log("OK recipes ready");