@mthanh/vespercli 2.2.1 → 2.3.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/README.md +3 -2
- package/assets/CATALOG.md +9 -2
- package/assets/claude/.claude-plugin/marketplace.json +9 -9
- package/assets/claude/.claude-plugin/plugin.json +1 -1
- package/assets/claude/agents/code-planner.md +1 -1
- package/assets/claude/agents/code-reviewer.md +1 -1
- package/assets/claude/agents/code-tester.md +1 -1
- package/assets/claude/agents/copywriter.md +1 -1
- package/assets/claude/agents/feature-wrap-document.md +1 -1
- package/assets/claude/agents/janitor.md +1 -1
- package/assets/claude/agents/modernization.md +1 -1
- package/assets/claude/agents/principal-software-engineer.md +1 -1
- package/assets/claude/agents/refine-issue.md +1 -1
- package/assets/claude/agents/se-system-architecture-reviewer.md +1 -1
- package/assets/claude/agents/se-technical-writer.md +1 -1
- package/assets/claude/agents/skill-creator.md +1 -1
- package/assets/claude/agents/task-researcher.md +1 -1
- package/assets/claude/agents/technical-product-manager.md +1 -1
- package/assets/claude/agents/vision-analyst.md +1 -1
- package/assets/claude/agents/vitest.md +1 -1
- package/assets/claude/agents/workspace-learner.md +2 -2
- package/assets/claude/packs/backend/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/backend/agents/firebase-developer.md +1 -1
- package/assets/claude/packs/backend/agents/nodejs-express-developer.md +1 -1
- package/assets/claude/packs/docs/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/frontend/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/frontend/agents/expert-nextjs-developer.md +1 -1
- package/assets/claude/packs/frontend/agents/expert-react-frontend-engineer.md +1 -1
- package/assets/claude/packs/frontend/agents/jest-react-component-analyzer.md +1 -1
- package/assets/claude/packs/frontend/agents/jest-react-scenario-scanner.md +1 -1
- package/assets/claude/packs/frontend/agents/jest-react-test-generator.md +1 -1
- package/assets/claude/packs/frontend/agents/jest-react-test-planner.md +1 -1
- package/assets/claude/packs/frontend/skills/design-taste-frontend/LICENSE +21 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/SKILL.md +529 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/UPSTREAM.json +7 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/app.css +216 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/base.css +105 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/base.js +37 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/charts.js +617 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/scenes/stage.css +28 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/assets/scenes/stage.js +133 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/evals/evals.json +76 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/app.json +1327 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/directions.json +1078 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/heroes.json +1086 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/motions.json +92 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/palettes.json +1485 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/photos.json +7240 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/sections.json +4429 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/sites.json +8350 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/library/type.json +2024 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/app-screens.md +1199 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/colour.md +141 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/copy.md +177 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/critique.md +182 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/imagery.md +791 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/layout.md +292 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/motion.md +980 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/research.md +356 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/scenes.md +174 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/tells.md +115 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/references/type.md +170 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/assets.mjs +865 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/draw.mjs +584 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/inspect.mjs +303 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/lib/app-draw.mjs +203 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/lib/cdp.mjs +248 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/lib/probe.mjs +909 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/lib/rules.mjs +243 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/lint.mjs +119 -0
- package/assets/claude/packs/frontend/skills/design-taste-frontend/scripts/scenes.mjs +124 -0
- package/assets/claude/packs/graphify/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/integrations/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/playwright/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/playwright/agents/playwright-component-analyzer.md +1 -1
- package/assets/claude/packs/playwright/agents/playwright-scenario-scanner.md +1 -1
- package/assets/claude/packs/playwright/agents/playwright-test-generator.md +1 -1
- package/assets/claude/packs/playwright/agents/playwright-test-planner.md +1 -1
- package/assets/claude/packs/playwright/agents/playwright-tester.md +1 -1
- package/assets/claude/packs/polyglot/.claude-plugin/plugin.json +1 -1
- package/assets/claude/packs/styles/.claude-plugin/plugin.json +1 -1
- package/assets/copilot/agents/code-planner.agent.md +1 -1
- package/assets/copilot/agents/code-reviewer.agent.md +1 -1
- package/assets/copilot/agents/code-tester.agent.md +1 -1
- package/assets/copilot/agents/copywriter.agent.md +1 -1
- package/assets/copilot/agents/feature-wrap-document.agent.md +1 -1
- package/assets/copilot/agents/janitor.agent.md +1 -1
- package/assets/copilot/agents/modernization.agent.md +1 -1
- package/assets/copilot/agents/principal-software-engineer.agent.md +1 -1
- package/assets/copilot/agents/refine-issue.agent.md +1 -1
- package/assets/copilot/agents/se-system-architecture-reviewer.agent.md +1 -1
- package/assets/copilot/agents/se-technical-writer.agent.md +1 -1
- package/assets/copilot/agents/skill-creator.agent.md +1 -1
- package/assets/copilot/agents/task-researcher.agent.md +1 -1
- package/assets/copilot/agents/technical-product-manager.agent.md +1 -1
- package/assets/copilot/agents/vision-analyst.agent.md +1 -1
- package/assets/copilot/agents/vitest.agent.md +1 -1
- package/assets/copilot/agents/workspace-learner.agent.md +2 -2
- package/assets/copilot/packs/backend/agents/firebase-developer.agent.md +1 -1
- package/assets/copilot/packs/backend/agents/nodejs-express-developer.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/expert-nextjs-developer.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/expert-react-frontend-engineer.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/jest-react-component-analyzer.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/jest-react-scenario-scanner.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/jest-react-test-generator.agent.md +1 -1
- package/assets/copilot/packs/frontend/agents/jest-react-test-planner.agent.md +1 -1
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/LICENSE +21 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/SKILL.md +529 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/UPSTREAM.json +7 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/app.css +216 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/base.css +105 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/base.js +37 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/charts.js +617 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/scenes/stage.css +28 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/assets/scenes/stage.js +133 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/evals/evals.json +76 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/app.json +1327 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/directions.json +1078 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/heroes.json +1086 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/motions.json +92 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/palettes.json +1485 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/photos.json +7240 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/sections.json +4429 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/sites.json +8350 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/library/type.json +2024 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/app-screens.md +1199 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/colour.md +141 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/copy.md +177 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/critique.md +182 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/imagery.md +791 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/layout.md +292 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/motion.md +980 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/research.md +356 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/scenes.md +174 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/tells.md +115 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/references/type.md +170 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/assets.mjs +865 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/draw.mjs +584 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/inspect.mjs +303 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/lib/app-draw.mjs +203 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/lib/cdp.mjs +248 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/lib/probe.mjs +909 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/lib/rules.mjs +243 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/lint.mjs +119 -0
- package/assets/copilot/packs/frontend/skills/design-taste-frontend/scripts/scenes.mjs +124 -0
- package/assets/copilot/packs/playwright/agents/playwright-component-analyzer.agent.md +1 -1
- package/assets/copilot/packs/playwright/agents/playwright-scenario-scanner.agent.md +1 -1
- package/assets/copilot/packs/playwright/agents/playwright-test-generator.agent.md +1 -1
- package/assets/copilot/packs/playwright/agents/playwright-test-planner.agent.md +1 -1
- package/assets/copilot/packs/playwright/agents/playwright-tester.agent.md +1 -1
- package/assets/manifest.json +2 -0
- package/dist/cli.min.js +102 -102
- package/package.json +1 -1
- package/scripts/__snapshots__/generate-claude-assets.test.js.snap +1 -1
- package/scripts/generate-claude-assets.strict.test.js +1 -1
- package/scripts/generate-claude-assets.test.js +6 -6
- package/scripts/packs-layout.test.js +2 -1
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// tasteskill / draw — deal an art direction from the research library.
|
|
3
|
+
//
|
|
4
|
+
// The script chooses, not the model: a model asked to pick a direction returns the category
|
|
5
|
+
// default every time. The draw is random within what fits the brief, and it remembers recent
|
|
6
|
+
// draws so consecutive projects do not look alike.
|
|
7
|
+
//
|
|
8
|
+
// node draw.mjs --sector <sector> --brief "one line" [--sections hero,showcase,pricing,footer]
|
|
9
|
+
// [--tone quiet|bold|warm|technical|playful|luxury|editorial]
|
|
10
|
+
// [--have photography,product-photo,product-ui,illustration,video] assets you really have
|
|
11
|
+
// [--keep palette,type] the brand already fixes these; draw the rest
|
|
12
|
+
// [--avoid id,id] [--seed N] [--out DIR]
|
|
13
|
+
// [--options 3] show three dealt directions to choose from, write nothing
|
|
14
|
+
// [--direction <id>] deal the full sheet for the chosen direction
|
|
15
|
+
// node draw.mjs --show reprint the saved direction sheet
|
|
16
|
+
// node draw.mjs --redraw hero|type|palette|photos|scenes|section:<role>|direction re-deal one slot
|
|
17
|
+
// node draw.mjs --list sectors|directions|roles|tones|scenes
|
|
18
|
+
// node draw.mjs --site <id> print one studied reference site in full
|
|
19
|
+
// node draw.mjs --app --kind <kind> ... deal a style for an app screen instead (see lib/app-draw.mjs)
|
|
20
|
+
//
|
|
21
|
+
// Zero dependencies. Node 18+.
|
|
22
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
23
|
+
import { dirname, join, resolve } from 'node:path';
|
|
24
|
+
import { fileURLToPath } from 'node:url';
|
|
25
|
+
import { randomInt } from 'node:crypto';
|
|
26
|
+
import { homedir } from 'node:os';
|
|
27
|
+
|
|
28
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
const LIB = join(HERE, '..', 'library');
|
|
30
|
+
const ASSETS_PATH = join(HERE, 'assets.mjs').split('\\').join('/');
|
|
31
|
+
const ASSETS_CMD = `node ${/\s/.test(ASSETS_PATH) ? `"${ASSETS_PATH}"` : ASSETS_PATH}`;
|
|
32
|
+
const load = (name) => JSON.parse(readFileSync(join(LIB, name + '.json'), 'utf8'));
|
|
33
|
+
|
|
34
|
+
const argv = process.argv.slice(2);
|
|
35
|
+
const opt = (name, def) => { const i = argv.indexOf('--' + name); if (i === -1) return def; const v = argv[i + 1]; return v === undefined || v.startsWith('--') ? true : v; };
|
|
36
|
+
const list = (v) => (typeof v === 'string' ? v.split(',').map((s) => s.trim()).filter(Boolean) : []);
|
|
37
|
+
const outDir = resolve(String(opt('out', '.taste-skill')));
|
|
38
|
+
const sheetPath = join(outDir, 'direction.json');
|
|
39
|
+
|
|
40
|
+
const SECTORS = ['saas', 'dev-tool', 'ai-product', 'consumer-app', 'finance', 'agency', 'studio-portfolio', 'personal-portfolio', 'ecommerce', 'physical-product', 'fashion', 'hospitality', 'restaurant', 'real-estate', 'architecture', 'event', 'health', 'education', 'nonprofit', 'culture', 'music', 'other'];
|
|
41
|
+
const TONES = ['quiet', 'bold', 'warm', 'technical', 'playful', 'luxury', 'editorial'];
|
|
42
|
+
const DEFAULT_SECTIONS = {
|
|
43
|
+
saas: ['hero', 'showcase', 'features', 'how-it-works', 'testimonial', 'pricing', 'faq', 'cta', 'footer'],
|
|
44
|
+
'dev-tool': ['hero', 'showcase', 'features', 'how-it-works', 'pricing', 'faq', 'cta', 'footer'],
|
|
45
|
+
'ai-product': ['hero', 'showcase', 'features', 'how-it-works', 'testimonial', 'pricing', 'cta', 'footer'],
|
|
46
|
+
'consumer-app': ['hero', 'showcase', 'features', 'testimonial', 'cta', 'footer'],
|
|
47
|
+
finance: ['hero', 'showcase', 'features', 'stats', 'testimonial', 'faq', 'cta', 'footer'],
|
|
48
|
+
agency: ['hero', 'intro', 'work', 'services', 'about', 'cta', 'footer'],
|
|
49
|
+
'studio-portfolio': ['hero', 'work', 'intro', 'services', 'about', 'cta', 'footer'],
|
|
50
|
+
'personal-portfolio': ['hero', 'work', 'about', 'cta', 'footer'],
|
|
51
|
+
ecommerce: ['hero', 'gallery', 'features', 'intro', 'testimonial', 'cta', 'footer'],
|
|
52
|
+
'physical-product': ['hero', 'showcase', 'features', 'gallery', 'intro', 'pricing', 'cta', 'footer'],
|
|
53
|
+
fashion: ['hero', 'gallery', 'intro', 'work', 'cta', 'footer'],
|
|
54
|
+
hospitality: ['hero', 'intro', 'gallery', 'features', 'list', 'contact', 'footer'],
|
|
55
|
+
restaurant: ['hero', 'intro', 'list', 'gallery', 'contact', 'footer'],
|
|
56
|
+
'real-estate': ['hero', 'intro', 'gallery', 'features', 'stats', 'contact', 'footer'],
|
|
57
|
+
architecture: ['hero', 'work', 'intro', 'about', 'contact', 'footer'],
|
|
58
|
+
event: ['hero', 'intro', 'list', 'features', 'pricing', 'faq', 'cta', 'footer'],
|
|
59
|
+
health: ['hero', 'intro', 'features', 'how-it-works', 'testimonial', 'faq', 'cta', 'footer'],
|
|
60
|
+
education: ['hero', 'intro', 'features', 'how-it-works', 'testimonial', 'pricing', 'faq', 'cta', 'footer'],
|
|
61
|
+
nonprofit: ['hero', 'intro', 'stats', 'features', 'about', 'cta', 'footer'],
|
|
62
|
+
culture: ['hero', 'intro', 'gallery', 'list', 'about', 'cta', 'footer'],
|
|
63
|
+
music: ['hero', 'list', 'gallery', 'about', 'cta', 'footer'],
|
|
64
|
+
other: ['hero', 'intro', 'features', 'showcase', 'cta', 'footer'],
|
|
65
|
+
};
|
|
66
|
+
// requested role names → the role vocabulary used by library/sections.json
|
|
67
|
+
const ROLE_ALIAS = { features: 'features', feature: 'features', benefits: 'features', services: 'features', showcase: 'showcase', product: 'showcase', demo: 'showcase', 'how-it-works': 'how-it-works', how: 'how-it-works', process: 'how-it-works', steps: 'how-it-works', testimonial: 'testimonial', testimonials: 'testimonial', quotes: 'testimonial', proof: 'proof', logos: 'proof', press: 'proof', stats: 'stats', numbers: 'stats', pricing: 'pricing', plans: 'pricing', faq: 'faq', cta: 'cta', footer: 'footer', intro: 'intro', manifesto: 'intro', about: 'about', team: 'about', work: 'work', projects: 'work', index: 'work', 'case-studies': 'work', gallery: 'gallery', images: 'gallery', list: 'list', menu: 'list', schedule: 'list', lineup: 'list', 'line-up': 'list', speakers: 'list', agenda: 'list', programme: 'list', program: 'list', timetable: 'list', rooms: 'list', tickets: 'pricing', price: 'pricing', contact: 'contact', booking: 'contact', newsletter: 'contact', signup: 'contact' };
|
|
68
|
+
|
|
69
|
+
// App screens (dashboards, admin, settings) have their own library and sheet: scripts/lib/app-draw.mjs.
|
|
70
|
+
const savedKind = (() => { try { return JSON.parse(readFileSync(sheetPath, 'utf8')).kind; } catch { return null; } })();
|
|
71
|
+
if (opt('app') || ((opt('show') || opt('redraw')) && savedKind === 'app')) await import('./lib/app-draw.mjs');
|
|
72
|
+
|
|
73
|
+
if (opt('list')) {
|
|
74
|
+
const what = opt('list');
|
|
75
|
+
if (what === 'sectors') console.log(SECTORS.join('\n'));
|
|
76
|
+
else if (what === 'tones') console.log(TONES.join('\n'));
|
|
77
|
+
else if (what === 'roles') console.log([...new Set(Object.values(ROLE_ALIAS))].join('\n'));
|
|
78
|
+
else if (what === 'scenes') { const all = existsSync(join(LIB, 'scenes.json')) ? load('scenes') : []; for (const sc of all) console.log(`${sc.id.padEnd(34)} ${sc.name} — ${sc.family}; ${sc.summary.split(/(?<=\.)\s/)[0]}`); if (!all.length) console.log('No scene library yet.'); }
|
|
79
|
+
else for (const d of load('directions')) console.log(`${d.id.padEnd(30)} ${d.name} — ${d.sectors.join(', ')}`);
|
|
80
|
+
process.exit(0);
|
|
81
|
+
}
|
|
82
|
+
if (opt('photos')) {
|
|
83
|
+
const lib = load('photos'); const q = String(opt('photos'));
|
|
84
|
+
const line = (ph) => `- https://picsum.photos/id/${ph.id}/1600/1000 — ${ph.alt} · ${ph.tone} tone · ${(ph.colours || []).join(', ')}${ph.mono ? ' · black-and-white' : ''}${ph.calm && ph.calm !== 'none' ? ` · calm area: ${ph.calm}` : ''} · photo: ${ph.by}`;
|
|
85
|
+
if (q === 'list' || q === 'true') { for (const [id, set] of Object.entries(lib.sets)) console.log(`${id.padEnd(22)} ${String(set.photos.length).padStart(3)} photos — ${set.note}`); }
|
|
86
|
+
else if (lib.sets[q]) { console.log(`# ${lib.sets[q].title} — ${lib.sets[q].note}`); for (const ph of lib.sets[q].photos) console.log(line(ph)); }
|
|
87
|
+
else { // free-text search across all descriptions
|
|
88
|
+
const words = q.toLowerCase().split(/[^a-z]+/).filter((w) => w.length >= 3);
|
|
89
|
+
const hits = Object.values(lib.sets).flatMap((s) => s.photos).filter((ph) => words.some((w) => (ph.alt + ' ' + (ph.colours || []).join(' ')).toLowerCase().includes(w)));
|
|
90
|
+
if (!hits.length) console.log('No photograph matches. `--photos list` shows the sets.'); else for (const ph of hits.slice(0, 24)) console.log(line(ph));
|
|
91
|
+
}
|
|
92
|
+
console.log('\nPath numbers are width/height; add ?grayscale to desaturate. Photographs are atmosphere, never a stand-in for a specific product or person.');
|
|
93
|
+
process.exit(0);
|
|
94
|
+
}
|
|
95
|
+
if (opt('site')) {
|
|
96
|
+
const s = load('sites').find((x) => x.id === opt('site') || x.name.toLowerCase() === String(opt('site')).toLowerCase());
|
|
97
|
+
if (!s) { console.error('No studied site with that id. Ids appear in the direction sheet under "Real references".'); process.exit(2); }
|
|
98
|
+
console.log(siteCard(s, true)); process.exit(0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ---------- randomness (seedable) ----------
|
|
102
|
+
let seed = opt('seed') !== undefined && opt('seed') !== true ? Number(opt('seed')) : randomInt(1, 2 ** 31 - 1);
|
|
103
|
+
const startSeed = seed;
|
|
104
|
+
const rnd = () => { seed |= 0; seed = (seed + 0x6d2b79f5) | 0; let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };
|
|
105
|
+
const pick = (arr) => arr[Math.floor(rnd() * arr.length)];
|
|
106
|
+
const shuffle = (arr) => { const a = [...arr]; for (let i = a.length - 1; i > 0; i--) { const j = Math.floor(rnd() * (i + 1)); [a[i], a[j]] = [a[j], a[i]]; } return a; };
|
|
107
|
+
// prefer items not used recently, without ever emptying the pool
|
|
108
|
+
const fresh = (pool, recent) => { const f = pool.filter((x) => !recent.includes(x.id)); return f.length ? f : pool; };
|
|
109
|
+
|
|
110
|
+
// ---------- history (project + user level) ----------
|
|
111
|
+
const userHist = process.env.TASTE_SKILL_HISTORY || join(homedir(), '.taste-skill', 'history.json');
|
|
112
|
+
const readHist = () => { for (const p of [userHist]) { try { return JSON.parse(readFileSync(p, 'utf8')); } catch {} } return []; };
|
|
113
|
+
const writeHist = (entry) => { try { mkdirSync(dirname(userHist), { recursive: true }); const h = readHist(); h.unshift(entry); writeFileSync(userHist, JSON.stringify(h.slice(0, 24), null, 1)); } catch {} };
|
|
114
|
+
|
|
115
|
+
// ---------- show / redraw ----------
|
|
116
|
+
const saved = existsSync(sheetPath) ? JSON.parse(readFileSync(sheetPath, 'utf8')) : null;
|
|
117
|
+
if (opt('show')) {
|
|
118
|
+
if (!saved) { console.error('No saved direction. Run a draw first.'); process.exit(2); }
|
|
119
|
+
console.log(render(saved)); process.exit(0);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const L = { directions: load('directions'), heroes: load('heroes'), sections: load('sections'), type: load('type'), palettes: load('palettes'), photos: load('photos'), sites: load('sites'), motions: load('motions'), scenes: existsSync(join(LIB, 'scenes.json')) ? load('scenes') : [] };
|
|
123
|
+
const hist = readHist();
|
|
124
|
+
const recent = (key, n) => hist.slice(0, n).map((h) => h[key]).filter(Boolean);
|
|
125
|
+
|
|
126
|
+
let sheet;
|
|
127
|
+
if (opt('alternatives')) {
|
|
128
|
+
// The other blueprints of one role that suit the saved direction: for when the dealt one cannot hold
|
|
129
|
+
// the real content (it assumes three plans and there is one; it needs five quotes and there are none).
|
|
130
|
+
if (!saved) { console.error('Run a draw first.'); process.exit(2); }
|
|
131
|
+
const role = ROLE_ALIAS[String(opt('alternatives'))] || String(opt('alternatives'));
|
|
132
|
+
const dir = L.directions.find((d) => d.id === saved.direction.id);
|
|
133
|
+
const current = saved.sections.find((s) => s.role === role)?.id;
|
|
134
|
+
const pool = sectionPool(dir, role, saved.input);
|
|
135
|
+
if (!pool.length) { console.error('No blueprints for role ' + role + '. Roles: --list roles'); process.exit(2); }
|
|
136
|
+
const line = (s) => `- \`${s.id}\`${s.id === current ? ' (dealt)' : ''} — **${s.name}** (${s.shape}). ${s.blueprint.split(/(?<=\.)\s/).slice(0, 2).join(' ')}\n`;
|
|
137
|
+
console.log(`# ${role}: blueprints that suit "${dir.name}"\n`);
|
|
138
|
+
for (const s of pool) console.log(line(s));
|
|
139
|
+
const software = imageryMode(saved.input) === 'interface';
|
|
140
|
+
const others = L.sections.filter((s) => s.role === role && !pool.includes(s) && (software || !softwareOnly(s)) && (s.needs || []).every((n) => saved.input.have.includes(n) || (n === 'product-ui' && software)));
|
|
141
|
+
if (others.length) {
|
|
142
|
+
console.log(`# Other ${role} blueprints (written for other directions; if one fits the content better, take its geometry and set it in this direction's type, colour and manner)\n`);
|
|
143
|
+
for (const s of others) console.log(line(s));
|
|
144
|
+
}
|
|
145
|
+
console.log(`Choose by what the content really is (how many plans, quotes, items exist), then: node draw.mjs --redraw section:${role}=<id> and say why in your report.`);
|
|
146
|
+
process.exit(0);
|
|
147
|
+
}
|
|
148
|
+
if (opt('redraw')) {
|
|
149
|
+
if (!saved) { console.error('Nothing to redraw. Run a draw first.'); process.exit(2); }
|
|
150
|
+
sheet = saved; sheet.redraws = (sheet.redraws || 0) + 1; // the sheet keeps its original seed; slot redraws are counted
|
|
151
|
+
const what = String(opt('redraw'));
|
|
152
|
+
const dir = L.directions.find((d) => d.id === sheet.direction.id);
|
|
153
|
+
if (what === 'direction') sheet = deal({ ...sheet.input, direction: null, avoid: [...(sheet.input.avoid || []), sheet.direction.id] }, sheet.redraws);
|
|
154
|
+
else if (what === 'hero') sheet.hero = dealHero(dir, sheet.input, [sheet.hero?.id]);
|
|
155
|
+
else if (what === 'type') sheet.type = dealType(dir, [sheet.type?.id]);
|
|
156
|
+
else if (what === 'palette') sheet.palette = dealPalette(dir, sheet.input, [sheet.palette?.id]);
|
|
157
|
+
else if (what === 'photos') sheet.photos = dealPhotos(dir, sheet.input);
|
|
158
|
+
else if (what === 'scenes') sheet.scenes = dealScenes(dir, sheet.input, (sheet.scenes || []).map((x) => x.id));
|
|
159
|
+
else if (what.startsWith('section:')) {
|
|
160
|
+
// section:<role> re-deals at random; section:<role>=<id> takes a named alternative (see --alternatives)
|
|
161
|
+
const [roleRaw, wanted] = what.slice(8).split('=');
|
|
162
|
+
const role = ROLE_ALIAS[roleRaw] || roleRaw;
|
|
163
|
+
const i = sheet.sections.findIndex((s) => s.role === role);
|
|
164
|
+
if (i === -1) { console.error('No section with role ' + role + ' in this sheet.'); process.exit(2); }
|
|
165
|
+
const used = sheet.sections.map((s) => s.id);
|
|
166
|
+
if (wanted) {
|
|
167
|
+
// a blueprint written for another role may be borrowed when its geometry fits the content better
|
|
168
|
+
const chosen = L.sections.find((s) => s.id === wanted);
|
|
169
|
+
if (!chosen) { console.error(`No blueprint with id ${wanted}. List them with --alternatives <role>.`); process.exit(2); }
|
|
170
|
+
sheet.sections[i] = chosen.role === role ? chosen : { ...chosen, role, name: `${chosen.name} (borrowed from ${chosen.role})` };
|
|
171
|
+
} else sheet.sections[i] = dealSection(dir, role, used, sheet.sections[i - 1]?.shape, sheet.sections[i + 1]?.shape, sheet.input) || sheet.sections[i];
|
|
172
|
+
} else { console.error('Unknown slot. Use hero, type, palette, photos, scenes, section:<role>, section:<role>=<id> or direction.'); process.exit(2); }
|
|
173
|
+
} else {
|
|
174
|
+
const sector = String(opt('sector', ''));
|
|
175
|
+
if (!SECTORS.includes(sector)) {
|
|
176
|
+
console.error(`--sector is required. One of:\n ${SECTORS.join(', ')}\nPick the closest; use "other" only when nothing fits.`);
|
|
177
|
+
process.exit(2);
|
|
178
|
+
}
|
|
179
|
+
const requested = list(opt('sections'));
|
|
180
|
+
const input = {
|
|
181
|
+
brief: typeof opt('brief') === 'string' ? opt('brief') : '', sector,
|
|
182
|
+
tone: TONES.includes(opt('tone')) ? opt('tone') : null,
|
|
183
|
+
have: list(opt('have')), keep: list(opt('keep')), avoid: list(opt('avoid')),
|
|
184
|
+
sections: (requested.length ? requested : DEFAULT_SECTIONS[sector]).map((r) => ROLE_ALIAS[r] || r).filter((r) => r !== 'hero'),
|
|
185
|
+
direction: typeof opt('direction') === 'string' ? opt('direction') : null,
|
|
186
|
+
};
|
|
187
|
+
if (input.direction && !L.directions.some((d) => d.id === input.direction)) { console.error(`No direction with id ${input.direction}. List them with --list directions.`); process.exit(2); }
|
|
188
|
+
if (opt('options')) {
|
|
189
|
+
const n = Math.max(2, Math.min(5, Number(opt('options')) || 3));
|
|
190
|
+
const options = dealOptions(input, n);
|
|
191
|
+
console.log(`# ${n} directions dealt for this brief\n`);
|
|
192
|
+
console.log('Choose the one whose way of composing can best carry an idea from your inventory (SKILL.md steps 1 and 4), not the');
|
|
193
|
+
console.log('most familiar one. Then deal it in full with the same command plus `--direction <id>` (and without --options).\n');
|
|
194
|
+
for (const d of options) {
|
|
195
|
+
console.log(`## \`${d.id}\` — ${d.name}`);
|
|
196
|
+
console.log(`Idea engine: ${d.idea.split(/(?<=\.)\s/).slice(0, 2).join(' ')}`);
|
|
197
|
+
console.log(`Composition: ${d.composition.split(/(?<=\.)\s/).slice(0, 2).join(' ')}`);
|
|
198
|
+
if (d.needsPictures) console.log('Needs: many pictures. Without photographs of its own, each is a real picture of the subject\'s world found with scripts/assets.mjs, or a drawing you make.');
|
|
199
|
+
console.log('');
|
|
200
|
+
}
|
|
201
|
+
process.exit(0);
|
|
202
|
+
}
|
|
203
|
+
sheet = deal(input, 0);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
mkdirSync(outDir, { recursive: true });
|
|
207
|
+
writeFileSync(sheetPath, JSON.stringify(sheet, null, 1));
|
|
208
|
+
if (!opt('redraw') || String(opt('redraw')) === 'direction') writeHist({ at: sheet.at, direction: sheet.direction.id, type: sheet.type?.id, palette: sheet.palette?.id, hero: sheet.hero?.id, sector: sheet.input.sector, scenes: (sheet.scenes || []).map((x) => x.id) });
|
|
209
|
+
console.log(render(sheet));
|
|
210
|
+
|
|
211
|
+
// ---------- dealing ----------
|
|
212
|
+
// What kind of pictures this build can honestly have. It decides which blueprints are dealt and how the
|
|
213
|
+
// sheet tells the agent to fill picture slots.
|
|
214
|
+
function imageryMode(input) {
|
|
215
|
+
if (input.have.includes('product-photo') || input.have.includes('photography')) return 'own';
|
|
216
|
+
if (['saas', 'dev-tool', 'ai-product', 'consumer-app', 'finance'].includes(input.sector)) return 'interface';
|
|
217
|
+
if (['physical-product', 'ecommerce'].includes(input.sector)) return 'no-product-photo';
|
|
218
|
+
return 'atmosphere';
|
|
219
|
+
}
|
|
220
|
+
function pictureLed(x) { return (x.tags || []).includes('photo-led') || (x.tags || []).includes('object-led'); }
|
|
221
|
+
function worksWithoutPictures(x) { return !pictureLed(x) || (x.tags || []).some((t) => ['ui-led', 'type-led', 'colour-field'].includes(t)); }
|
|
222
|
+
|
|
223
|
+
// The directions that suit this brief and the assets it really has.
|
|
224
|
+
function directionPool(input) {
|
|
225
|
+
const has = (need) => input.have.includes(need) || need === 'photography'; // the photo library covers photography
|
|
226
|
+
let pool = L.directions.filter((d) => (d.sectors.includes(input.sector) || d.sectors.includes('*')) && !input.avoid.includes(d.id));
|
|
227
|
+
const feasible = pool.filter((d) => (d.needs || []).every(has));
|
|
228
|
+
if (feasible.length) pool = feasible;
|
|
229
|
+
// directions built on photographs of the subject are not dealt when the subject cannot be photographed honestly
|
|
230
|
+
const mode = imageryMode(input);
|
|
231
|
+
if (mode === 'interface' || mode === 'no-product-photo') { const plain = pool.filter((d) => !d.needsPictures); if (plain.length >= 3) pool = plain; }
|
|
232
|
+
if (input.tone) { const toned = pool.filter((d) => (d.tones || []).includes(input.tone)); if (toned.length >= 2) pool = toned; }
|
|
233
|
+
if (!pool.length) pool = L.directions.filter((d) => !input.avoid.includes(d.id));
|
|
234
|
+
return pool;
|
|
235
|
+
}
|
|
236
|
+
// Three directions dealt at random from the pool, for the builder to choose the one that carries its idea.
|
|
237
|
+
function dealOptions(input, n) {
|
|
238
|
+
const pool = directionPool(input); const out = [];
|
|
239
|
+
let rest = fresh(pool, recent('direction', Math.min(5, pool.length - n)));
|
|
240
|
+
while (out.length < n && pool.length > out.length) {
|
|
241
|
+
if (!rest.length) rest = pool.filter((d) => !out.includes(d));
|
|
242
|
+
const d = pick(rest); out.push(d); rest = rest.filter((x) => x !== d);
|
|
243
|
+
}
|
|
244
|
+
return out;
|
|
245
|
+
}
|
|
246
|
+
function deal(input, redraws) {
|
|
247
|
+
const pool = directionPool(input);
|
|
248
|
+
const forced = input.direction ? L.directions.find((d) => d.id === input.direction) : null;
|
|
249
|
+
const dir = forced || pick(fresh(pool, recent('direction', Math.min(5, pool.length - 1))));
|
|
250
|
+
const s = { version: 1, at: new Date().toISOString(), seed: startSeed, redraws, input, imagery: imageryMode(input), allow: dir.allow || [], direction: dir };
|
|
251
|
+
s.hero = dealHero(dir, input, []);
|
|
252
|
+
s.type = input.keep.includes('type') ? null : dealType(dir, []);
|
|
253
|
+
s.palette = input.keep.includes('palette') ? null : dealPalette(dir, input, []);
|
|
254
|
+
s.photos = dealPhotos(dir, input);
|
|
255
|
+
s.motion = L.motions.find((m) => m.id === (s.hero?.motion || dir.motion)) || L.motions.find((m) => m.id === dir.motion) || null;
|
|
256
|
+
s.sections = [];
|
|
257
|
+
for (const role of input.sections) {
|
|
258
|
+
const sec = dealSection(dir, role, s.sections.map((x) => x.id), s.sections.at(-1)?.shape, null, input);
|
|
259
|
+
if (sec) s.sections.push(sec); else s.sections.push({ id: null, role, shape: null, name: role, blueprint: null });
|
|
260
|
+
}
|
|
261
|
+
s.references = dealReferences(dir, input);
|
|
262
|
+
s.scenes = dealScenes(dir, input, []);
|
|
263
|
+
return s;
|
|
264
|
+
}
|
|
265
|
+
// The page's big scroll moments (references/scenes.md): two or three tested scenes from different
|
|
266
|
+
// families, each placed on a section of the argument it can carry. Expressive sectors and tones get three.
|
|
267
|
+
function dealScenes(dir, input, exclude) {
|
|
268
|
+
if (!L.scenes.length) return [];
|
|
269
|
+
const has = (need) => input.have.includes(need) || need === 'photography';
|
|
270
|
+
const fits = (sc) => !exclude.includes(sc.id) && (sc.sectors || ['*']).some((x) => x === '*' || x === input.sector) && (sc.needs || []).every(has);
|
|
271
|
+
let pool = L.scenes.filter(fits);
|
|
272
|
+
if (pool.length < 2) pool = L.scenes.filter((sc) => !exclude.includes(sc.id) && (sc.needs || []).every(has));
|
|
273
|
+
if (!pool.length) return [];
|
|
274
|
+
const loud = ['agency', 'studio-portfolio', 'personal-portfolio', 'fashion', 'culture', 'music', 'event', 'architecture', 'physical-product', 'real-estate', 'hospitality'].includes(input.sector) || ['bold', 'playful', 'luxury', 'editorial'].includes(input.tone);
|
|
275
|
+
const quiet = ['quiet', 'technical'].includes(input.tone);
|
|
276
|
+
const n = Math.min(pool.length, quiet ? 2 : loud ? 3 : 2);
|
|
277
|
+
const recentIds = hist.slice(0, 4).flatMap((h) => h.scenes || []);
|
|
278
|
+
let rest = fresh(pool, recentIds);
|
|
279
|
+
const out = []; const families = new Set(); const usedRoles = new Set();
|
|
280
|
+
while (out.length < n) {
|
|
281
|
+
let cands = rest.filter((sc) => !families.has(sc.family) && !(sc.position === 'opening' && out.some((o) => o.position === 'opening')) && !(sc.position === 'closing' && out.some((o) => o.position === 'closing')));
|
|
282
|
+
if (!cands.length) cands = pool.filter((sc) => !out.includes(sc) && !families.has(sc.family));
|
|
283
|
+
if (!cands.length) break;
|
|
284
|
+
const sc = pick(cands); out.push(sc); families.add(sc.family); rest = rest.filter((x) => x !== sc);
|
|
285
|
+
}
|
|
286
|
+
// the section each scene carries: the first role of the argument it suits that no other scene has taken
|
|
287
|
+
const roles = ['hero', ...input.sections];
|
|
288
|
+
return out.map((sc) => {
|
|
289
|
+
const role = sc.position === 'opening' ? 'hero' : roles.find((r) => (sc.roles || []).includes(r) && !usedRoles.has(r) && r !== 'hero') || null;
|
|
290
|
+
if (role) usedRoles.add(role);
|
|
291
|
+
return { ...sc, carries: role };
|
|
292
|
+
}).sort((a, b) => (a.carries ? roles.indexOf(a.carries) : 99) - (b.carries ? roles.indexOf(b.carries) : 99));
|
|
293
|
+
}
|
|
294
|
+
function dealHero(dir, input, exclude) {
|
|
295
|
+
// the direction's own list, and any hero written for this direction since (the October 2026 study added some)
|
|
296
|
+
let pool = L.heroes.filter((h) => (dir.heroes || []).includes(h.id) || (h.directions || []).includes(dir.id));
|
|
297
|
+
if (!pool.length) pool = L.heroes;
|
|
298
|
+
if (imageryMode(input) !== 'interface' && !input.have.includes('product-ui')) { const plain = pool.filter((h) => !softwareOnly(h)); if (plain.length) pool = plain; }
|
|
299
|
+
const ok = pool.filter((h) => !exclude.includes(h.id) && (h.needs || []).every((n) => n === 'photography' || input.have.includes(n)));
|
|
300
|
+
return pick(fresh(ok.length ? ok : pool.filter((h) => !exclude.includes(h.id)).length ? pool.filter((h) => !exclude.includes(h.id)) : pool, recent('hero', 3)));
|
|
301
|
+
}
|
|
302
|
+
function dealType(dir, exclude) {
|
|
303
|
+
let pool = L.type.filter((t) => (dir.type || []).includes(t.id) || (dir.typeClasses || []).includes(t.class));
|
|
304
|
+
if (!pool.length) pool = L.type;
|
|
305
|
+
const p = pool.filter((t) => !exclude.includes(t.id));
|
|
306
|
+
return pick(fresh(p.length ? p : pool, recent('type', Math.min(6, pool.length - 1))));
|
|
307
|
+
}
|
|
308
|
+
function dealPalette(dir, input, exclude) {
|
|
309
|
+
let pool = L.palettes.filter((p) => (dir.palettes || []).includes(p.id) || (p.tags || []).some((t) => (dir.paletteTags || []).includes(t)));
|
|
310
|
+
if (!pool.length) pool = L.palettes;
|
|
311
|
+
const p = pool.filter((x) => !exclude.includes(x.id));
|
|
312
|
+
return pick(fresh(p.length ? p : pool, recent('palette', Math.min(6, pool.length - 1))));
|
|
313
|
+
}
|
|
314
|
+
function dealPhotos(dir, input) {
|
|
315
|
+
if (dir.photos === false) return null; // image-free directions
|
|
316
|
+
const words = briefWords(input.brief);
|
|
317
|
+
const mode = imageryMode(input);
|
|
318
|
+
const SOFT_SETS = ['architecture', 'fog-and-quiet', 'sky-and-space', 'texture', 'water'];
|
|
319
|
+
// subject first (sector + words of the brief), then the direction's preferred tone
|
|
320
|
+
const scored = Object.entries(L.photos.sets).map(([id, set]) => {
|
|
321
|
+
let score = (set.sectors || []).includes(input.sector) ? 3 : 0;
|
|
322
|
+
if ((set.primary || []).includes(input.sector)) score += 5;
|
|
323
|
+
// rooms and tables would be taken for this very house: for places to stay, deal the surroundings instead
|
|
324
|
+
if (mode === 'atmosphere' && ['hospitality', 'real-estate'].includes(input.sector) && id === 'interior-and-table') score -= 6;
|
|
325
|
+
score += words.filter((w) => (set.keywords || []).some((k) => k === w || (k.length >= 5 && w.startsWith(k)) || (w.length >= 5 && k.startsWith(w)))).length * 4;
|
|
326
|
+
score += set.photos.filter((ph) => words.some((w) => ph.alt.toLowerCase().includes(w))).length;
|
|
327
|
+
if (dir.photoTone) score += set.photos.filter((ph) => ph.tone === dir.photoTone).length / set.photos.length;
|
|
328
|
+
return { id, set, score };
|
|
329
|
+
}).filter((x) => x.score > 0 && x.set.photos.length >= 5 && (mode !== 'interface' || SOFT_SETS.includes(x.id))).sort((a, b) => b.score - a.score);
|
|
330
|
+
if (!scored.length) return null;
|
|
331
|
+
// one set, so the photographs share a subject and a light; choose among the best-fitting few
|
|
332
|
+
const top = scored.filter((x) => x.score >= scored[0].score * 0.6).slice(0, 4);
|
|
333
|
+
const chosen = pick(top);
|
|
334
|
+
let pool = chosen.set.photos;
|
|
335
|
+
if (dir.photoTone) { const toned = pool.filter((ph) => ph.tone === dir.photoTone || ph.tone === 'mid'); if (toned.length >= 6) pool = toned; }
|
|
336
|
+
// Without product photographs, a picture of the same kind of thing would pass for the product: deal
|
|
337
|
+
// those last and mark them. Otherwise a picture that matches the brief is the better atmosphere.
|
|
338
|
+
const things = words.filter((w) => w.length >= 5);
|
|
339
|
+
const matches = (ph) => things.some((w) => ph.alt.toLowerCase().includes(w));
|
|
340
|
+
const bonus = mode === 'no-product-photo' ? -2 : 2;
|
|
341
|
+
const ranked = shuffle(pool).sort((a, b) => (b.quality + (matches(b) ? bonus : 0)) - (a.quality + (matches(a) ? bonus : 0)))
|
|
342
|
+
.map((ph) => (mode === 'no-product-photo' && matches(ph) ? { ...ph, lookalike: true } : ph));
|
|
343
|
+
return { set: chosen.id, title: chosen.set.title, note: chosen.set.note, treatment: dir.photoTreatment || null, others: scored.filter((x) => x.id !== chosen.id).slice(0, 4).map((x) => x.id), photos: ranked.slice(0, mode === 'interface' ? 4 : 8) };
|
|
344
|
+
}
|
|
345
|
+
function briefStop() {
|
|
346
|
+
return new Set(['with', 'that', 'this', 'from', 'page', 'site', 'website', 'landing', 'their', 'they', 'have', 'will', 'your', 'about', 'into', 'make', 'build', 'create', 'design', 'small', 'based', 'called', 'named', 'which', 'where', 'what', 'need', 'want', 'like', 'also', 'some', 'very', 'more', 'most', 'just', 'than', 'then', 'them', 'and', 'the', 'for', 'one', 'hand', 'handmade', 'made', 'batch', 'ship', 'ships', 'week', 'within', 'across', 'euro', 'euros', 'cost', 'price', 'open', 'only', 'each', 'every', 'there', 'images', 'photos', 'photograph', 'static', 'html']);
|
|
347
|
+
}
|
|
348
|
+
function briefWords(brief) {
|
|
349
|
+
const stop = briefStop();
|
|
350
|
+
return [...new Set(String(brief || '').toLowerCase().split(/[^a-z]+/).filter((w) => w.length >= 4 && !stop.has(w)).map((w) => w.replace(/(ies|es|s)$/, '')))].filter((w) => w.length >= 4);
|
|
351
|
+
}
|
|
352
|
+
// First queries for scripts/assets.mjs, built from the brief: the place in old postcards and maps, then the
|
|
353
|
+
// subject itself. In testing "<place> postcard" and "<place> old map" found archival material far more
|
|
354
|
+
// reliably than a place and a year. A start only: the better queries come from the builder's inventory.
|
|
355
|
+
function assetQueries(input) {
|
|
356
|
+
const brief = String(input.brief || '');
|
|
357
|
+
const notPlace = /^(?:january|february|march|april|may|june|july|august|september|october|november|december|monday|tuesday|wednesday|thursday|friday|saturday|sunday)s?$/i;
|
|
358
|
+
const placeRe = /(?:^|[\s,(])(?:in|at|near|from|on|above|below|beside|outside|off|over)\s+(\p{Lu}[\p{L}'’-]*(?:\s+(?:\p{Lu}[\p{L}'’-]*|de|da|do|dos|das|di|del|van|von|der|den))*)/gu;
|
|
359
|
+
const place = [...brief.matchAll(placeRe)].map((m) => m[1].trim()).find((p) => !notPlace.test(p.split(/\s+/)[0]));
|
|
360
|
+
const stop = briefStop();
|
|
361
|
+
const generic = new Set(['seat', 'seats', 'room', 'rooms', 'minute', 'minutes', 'hour', 'hours', 'night', 'nights', 'year', 'years', 'people', 'family', 'local', 'short', 'best', 'making', 'selling', 'serving', 'offering', 'business', 'company', 'brand', 'shop', 'store', 'studio', 'service', 'services', 'dinner', 'lunch', 'breakfast', 'included', 'online', 'modern']);
|
|
362
|
+
// the subject: the last plain words of the first noun phrase ("a 38-seat Italian restaurant in ..." gives "restaurant")
|
|
363
|
+
const words = brief.split(/\s+/).filter(Boolean); const phrase = [];
|
|
364
|
+
for (let k = words.findIndex((w) => /^an?$/i.test(w)) + 1; k < words.length; k++) {
|
|
365
|
+
if (/^(?:in|at|on|for|from|with|near|above|below|by|that|which|who|of|and|to)$/i.test(words[k])) break;
|
|
366
|
+
phrase.push(words[k].replace(/[,.;:()!?]+$/, ''));
|
|
367
|
+
if (/[,.;:()!?]$/.test(words[k])) break;
|
|
368
|
+
}
|
|
369
|
+
const plain = phrase.filter((w) => /^\p{Ll}{3,}$/u.test(w) && !stop.has(w) && !generic.has(w));
|
|
370
|
+
const subject = plain.slice(-2).join(' ') || (input.sector !== 'other' ? input.sector.replace(/-/g, ' ') : null);
|
|
371
|
+
const out = [];
|
|
372
|
+
if (place) out.push(`${place.toLowerCase()} postcard`, `${place.toLowerCase()} old map`);
|
|
373
|
+
if (subject) out.push(subject.toLowerCase());
|
|
374
|
+
return [...new Set(out)];
|
|
375
|
+
}
|
|
376
|
+
// Blueprints written for showing software (an interface fragment is their picture).
|
|
377
|
+
function softwareOnly(x) { return (x.directions || [])[0] === 'product-performs' || (x.tags || []).includes('ui-led') || /data-ui|interface fragment/i.test(x.blueprint || ''); }
|
|
378
|
+
// Blueprints were measured on real sites and carry that site's sizes, greys, faces, colours and corners.
|
|
379
|
+
// This lists, for one blueprint, exactly where it disagrees with the house rules and the dealt system,
|
|
380
|
+
// so the builder does not have to work it out section by section.
|
|
381
|
+
function adjustments(bp, s) {
|
|
382
|
+
const text = [bp.blueprint, bp.mobile, bp.headline].filter(Boolean).join(' ');
|
|
383
|
+
const notes = [];
|
|
384
|
+
const sizes = (re) => [...new Set([...text.matchAll(re)].map((m) => m[1] + 'px'))];
|
|
385
|
+
const notSpacing = String.raw`(?!\s*(?:gaps?|gutters?|margins?|padding|radius|corners?|apart|from|inset|offset|high|tall|wide|thick|square|borders?|stroke|rules?|line\b|dots?|circles?|bars?|of|between|beneath|below|above|under|down|up|across|deep|left|right|in\b|to\b|and\b|each))`;
|
|
386
|
+
const tiny = sizes(new RegExp(String.raw`(?<!(?:radius|radii|gap|margin|padding|inset|offset)[:\s]{0,3}(?:of\s)?)\b(9|10|11|12)(?:\.\d)?px\b` + notSpacing, 'g'));
|
|
387
|
+
if (tiny.length) notes.push(`It sets text at ${tiny.join(', ')}: use your small step (13px or more) instead.`);
|
|
388
|
+
const running = sizes(/\b(14|15)px\s*(?:paragraphs?|body|text|descriptions?|copy|sentences?|answers?)/gi);
|
|
389
|
+
if (running.length) notes.push(`It sets running text at ${running.join(', ')}: paragraphs use your body step (16px or more).`);
|
|
390
|
+
if (/\d{1,2}% (?:opacity|black|ink|grey|gray|white)|opacity:? ?0?\.\d|\b(?:rest|others?|remaining)\b[^.;]{0,25}\b(?:at|to) \d{1,2}%(?! (?:of|width|wide))|full (?:ink|white|strength)[^.;]{0,60}\bat \d{1,2}%(?! (?:of|width|wide))/i.test(text)) notes.push('It fades text: anything a visitor reads, inactive items of a list included, is `--ink` or `--muted` at full strength (contrast 4.5:1 or more). The active item is told apart by `--ink` against `--muted`, weight or the accent, not by fading the rest.');
|
|
391
|
+
if (/\d+px (?:corner )?radius|radius (?:of )?\d+px|\brounded\b|\bpill/i.test(text)) notes.push('It names its own corners: use the one radius of this page (square unless the direction says otherwise) and one button shape.');
|
|
392
|
+
if (/\b(?:serif|sans-serif|condensed|grotesk|italic|monospace|mono|all caps|uppercase|capitals|script)\b/i.test(text)) notes.push(s.type ? `It names a kind of typeface: use the dealt faces (display ${s.type.display.family}, text ${s.type.text.family}) and their settings; capitals only where the type system sets them.` : 'It names a kind of typeface: use the brand faces.');
|
|
393
|
+
const colours = [...new Set([...text.matchAll(/\b(green|red|blue|yellow|orange|pink|purple|teal|navy|cream|beige|brown|grey|gray|white|black)\b(?)/gi)].map((m) => m[1].toLowerCase()))];
|
|
394
|
+
if (colours.length) notes.push(`It names colours (${colours.join(', ')}): map them onto this palette's roles (ground \`--bg\`, panels \`--surface\` and the fields, text \`--ink\`/\`--muted\`, the accent \`--accent\` on the primary action only).`);
|
|
395
|
+
if (/(?<!\b(?:no|without|never|not|nor) (?:a |any )?)\b(?:rule|rules|hairline|border|borders|divider|underline|thin line|1px line)\b/i.test(text)) notes.push('It draws lines or borders: keep them only inside a table, a form or a `data-ui` fragment; elsewhere separate with space or a change of ground.');
|
|
396
|
+
if (/shadow|glow/i.test(text)) notes.push('It mentions a shadow: only on something open above the page (a menu, a dialog), never on a resting element.');
|
|
397
|
+
const bigSentence = [...text.matchAll(/\b(?:sentence|statement|paragraph|quotation|quote)\b[^.;]{0,40}?\b(?:at|to)\s+(?:clamp\(\s*\d+(?:\.\d+)?px,\s*)?(\d+(?:\.\d+)?)(px|vw)/gi)].some((m) => (m[2] === 'px' && +m[1] > 36) || (m[2] === 'vw' && +m[1] > 2.6));
|
|
398
|
+
if (bigSentence) notes.push('It sets a sentence large over several lines: jurors read that as a long headline. Either cut it to a two-line headline at display size, or keep it a statement at 36px or less on three lines (24px, four lines on a phone).');
|
|
399
|
+
if (/(?:sticky|pinned|pins?\b|stays? (?:fixed|put|in place))/i.test(text) && /\b(?:three|four|five|six) (?:to (?:four|five|six) )?(?:viewports|screens)\b|\b[3-6]00svh\b/i.test(text)) notes.push('It pins something for three screens or more: hold a pin for two or three screens at most, give every screen under it its own content, and let nothing pass over the pinned words (the inspector checks all three).');
|
|
400
|
+
if (/mix-blend-mode:\s*(?:difference|exclusion)/i.test(text)) notes.push('It blends text with `difference`: over anything but black, white or grey that gives random hues. Use a solid ink chosen for each ground instead.');
|
|
401
|
+
if (/tops? of the (?:letters|word|name|wordmark)|(?:letters|wordmark|name|word)\b[^.;]{0,30}\b(?:sliced|cut|cropped|clipped)[^.;]{0,20}\btop/i.test(text)) notes.push('It crops letters along their top: the inspector fails that (jurors read it as broken). Crop at the bottom edge or a side instead.');
|
|
402
|
+
if (bp.archetype && /single action[^.;]{0,40}?\b(?:text link|underlined (?:text )?link)/i.test(text)) notes.push('Its action is a text link: the primary action on the first screen is a real button (filled or solid-bordered, 44px or taller), placed where the blueprint puts the link. A second action may stay a link.');
|
|
403
|
+
if (s.type?.class === 'condensed-heavy' && /\d+(?:\.\d+)?vw/.test(text)) notes.push('Its vw sizes assume a face of normal width: with this condensed display face, size the words to fill the measure the blueprint gives them instead of copying the vw value.');
|
|
404
|
+
if (/\b0[1-9]\b(?![:.,]\d)|numbered|index number/i.test(text)) notes.push('It numbers things 01, 02: drop the numbers unless they are real data (a price, a date, a count).');
|
|
405
|
+
return notes;
|
|
406
|
+
}
|
|
407
|
+
// Every blueprint of a role that suits this direction and this build's real assets.
|
|
408
|
+
function sectionPool(dir, role, input) {
|
|
409
|
+
let pool = L.sections.filter((s) => s.role === role);
|
|
410
|
+
if (!pool.length) return [];
|
|
411
|
+
const mode = imageryMode(input);
|
|
412
|
+
const feasible = pool.filter((s) => (s.needs || []).every((n) => n === 'photography' || input.have.includes(n) || (n === 'product-ui' && mode === 'interface')));
|
|
413
|
+
if (feasible.length) pool = feasible;
|
|
414
|
+
if (mode !== 'interface' && !input.have.includes('product-ui')) { const plain = pool.filter((s) => !softwareOnly(s)); if (plain.length) pool = plain; }
|
|
415
|
+
if (mode === 'interface' || mode === 'no-product-photo') {
|
|
416
|
+
// prefer compositions that do not hang on a photograph of the thing
|
|
417
|
+
const honest = pool.filter((s) => (mode === 'interface' ? worksWithoutPictures(s) : !(s.tags || []).includes('object-led') || worksWithoutPictures(s)));
|
|
418
|
+
if (honest.length >= 2) pool = honest;
|
|
419
|
+
}
|
|
420
|
+
const byDirection = pool.filter((s) => (s.directions || []).includes(dir.id));
|
|
421
|
+
if (byDirection.length) return byDirection;
|
|
422
|
+
const byTag = pool.filter((s) => (s.tags || []).some((t) => (dir.sectionTags || []).includes(t)));
|
|
423
|
+
return byTag.length ? byTag : pool;
|
|
424
|
+
}
|
|
425
|
+
function dealSection(dir, role, usedIds, prevShape, nextShape, input) {
|
|
426
|
+
let pool = sectionPool(dir, role, input);
|
|
427
|
+
if (!pool.length) return null;
|
|
428
|
+
if (imageryMode(input) === 'interface') { const ui = pool.filter((s) => (s.tags || []).includes('ui-led')); if (ui.length >= 2 && rnd() < 0.6) pool = ui; }
|
|
429
|
+
const unused = pool.filter((s) => !usedIds.includes(s.id)); if (unused.length) pool = unused;
|
|
430
|
+
const varied = pool.filter((s) => s.shape !== prevShape && s.shape !== nextShape); if (varied.length) pool = varied;
|
|
431
|
+
return pick(pool);
|
|
432
|
+
}
|
|
433
|
+
function dealReferences(dir, input) {
|
|
434
|
+
const named = (dir.seenIn || []).map((n) => L.sites.find((s) => s.id === n || s.name === n)).filter(Boolean);
|
|
435
|
+
// the October 2026 panel scored on a lower scale (its top band starts at 7.5, the first panel's at about 7.6)
|
|
436
|
+
const good = (s, a, b) => s.score >= (s.panel === '2026-10' ? b : a);
|
|
437
|
+
const sameKind = L.sites.filter((s) => s.kind === input.sector && good(s, 7.2, 7.3) && !named.includes(s));
|
|
438
|
+
const out = [...shuffle(named).slice(0, 2), ...shuffle(sameKind).slice(0, 1)];
|
|
439
|
+
return out.length ? out : shuffle(L.sites.filter((s) => good(s, 7.6, 7.5))).slice(0, 2);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// ---------- rendering ----------
|
|
443
|
+
function siteCard(s, full) {
|
|
444
|
+
const lines = [`- **${s.name}** (${s.source}, studied score ${s.score}) \`${s.id}\``, ` Idea: ${s.idea}`, ` Hero: ${s.hero}`];
|
|
445
|
+
if (full) {
|
|
446
|
+
lines.push(` Type: ${s.type}`, ` Colour: ${s.colour}`, ` Imagery: ${s.imagery}`, ` Layout: ${s.layout}`);
|
|
447
|
+
if (s.media) lines.push(` Pictures and footage: ${s.media}`);
|
|
448
|
+
if (s.motion) lines.push(` Motion: ${s.motion}`);
|
|
449
|
+
for (const sec of s.sections || []) lines.push(` Section (${sec.role}): ${sec.description}`);
|
|
450
|
+
for (const t of s.steal || []) lines.push(` Worth taking: ${t}`);
|
|
451
|
+
lines.push(` URL: ${s.url}`);
|
|
452
|
+
} else if (s.steal?.[0]) lines.push(` Worth taking: ${s.steal[0]}`);
|
|
453
|
+
return lines.join('\n');
|
|
454
|
+
}
|
|
455
|
+
function render(s) {
|
|
456
|
+
const d = s.direction; const o = [];
|
|
457
|
+
const p = (x = '') => o.push(x);
|
|
458
|
+
p(`# DIRECTION SHEET — ${d.name}`);
|
|
459
|
+
p(`seed ${s.seed} · drawn ${s.at.slice(0, 10)}${s.redraws ? ` · redraws: ${s.redraws}` : ''} · sector ${s.input.sector}${s.input.tone ? ' · tone ' + s.input.tone : ''}`);
|
|
460
|
+
if (s.input.brief) p(`Brief: ${s.input.brief}`);
|
|
461
|
+
p();
|
|
462
|
+
p('| | |'); p('| --- | --- |');
|
|
463
|
+
p(`| Direction | ${d.name} |`);
|
|
464
|
+
p(`| Hero | ${s.hero.name} |`);
|
|
465
|
+
p(`| Type | ${s.type ? s.type.name : 'kept from the brand'} |`);
|
|
466
|
+
p(`| Colour | ${s.palette ? s.palette.name : 'kept from the brand'} |`);
|
|
467
|
+
p(`| Sections | ${s.sections.map((x) => x.role + (x.name && x.name !== x.role ? ' (' + x.name + ')' : '')).join(' → ')} |`);
|
|
468
|
+
p(`| Motion | ${s.motion ? s.motion.name : '—'} |`);
|
|
469
|
+
p(`| Photographs | ${s.photos ? 'the "' + (s.photos.title || s.photos.set) + '" set, as atmosphere' : 'none'} |`);
|
|
470
|
+
p();
|
|
471
|
+
p('This is the direction for this build. Adopt it. Do not blend it with the layout you would have made anyway,');
|
|
472
|
+
p('and do not redraw because it is unfamiliar: unfamiliar is the point. Redraw a slot only when it conflicts');
|
|
473
|
+
p('with a stated brand constraint or needs an asset that does not exist, and say why in your report.');
|
|
474
|
+
p();
|
|
475
|
+
p('The parts of this sheet were written separately and will disagree in small ways. Settle every disagreement in this order:');
|
|
476
|
+
p('**house rules** (including type no smaller than 13px and body text of 16px or more) → **the direction** (the idea, the composition habits, where the');
|
|
477
|
+
p('one accent goes) → **the type system and the palette** (which face does which job, the five size steps, which colour is the ground and where the');
|
|
478
|
+
p('accent goes) → **the hero blueprint** → **the section blueprints**. Under each blueprint below, "Adjusted for this page" lists where it disagrees.');
|
|
479
|
+
p('In practice: take geometry from blueprints (columns, proportions, what sits where) and take everything else from above them. Map every size a');
|
|
480
|
+
p('blueprint names onto one of your five type steps instead of adding a sixth. Use one button shape, one corner radius and one pair of page margins on');
|
|
481
|
+
p('the whole page, whatever individual blueprints say. If a blueprint names a kind of typeface (a light serif, a heavy grotesk), use the dealt face.');
|
|
482
|
+
p();
|
|
483
|
+
p('## 1. The idea'); p(d.idea); p();
|
|
484
|
+
p('Before anything else, write one sentence in your notes: "On this page, <the subject\'s own material> becomes <the device>."');
|
|
485
|
+
p('Fill the first blank from your inventory of what only this client has (its name and what it means, its street, its numbers, its');
|
|
486
|
+
p('constraint), then put the nearest competitor in the sentence: if it still works, the idea is the category\'s, not the client\'s.');
|
|
487
|
+
p('Then name the one live thing the visitor can do on the page (SKILL.md step 4).'); p();
|
|
488
|
+
p('## 2. Composition'); p(d.composition); p();
|
|
489
|
+
if (s.type) {
|
|
490
|
+
const t = s.type;
|
|
491
|
+
p(`## 3. Type — ${t.name}`); p(t.note);
|
|
492
|
+
p('```html'); for (const l of [...new Set([t.display.css, t.text.css].filter(Boolean))]) p(l); p('```');
|
|
493
|
+
p(`- Display: **${t.display.family}** — ${t.display.settings}`);
|
|
494
|
+
p(`- Text: **${t.text.family}** — ${t.text.settings}`);
|
|
495
|
+
if (t.scale) { p('```css'); p(':root {'); for (const [k, v] of Object.entries(t.scale)) p(` --${k}: ${v};`); p('}'); p('```'); }
|
|
496
|
+
if (d.typography) p(d.typography);
|
|
497
|
+
p('The direction decides sizes and how many of them; the type system decides how this face is set. Where the two give different tracking or leading, use the values of the type system: they are tuned to this face.');
|
|
498
|
+
p('The display size itself comes from the hero blueprint below.');
|
|
499
|
+
p();
|
|
500
|
+
} else { p('## 3. Type'); p('Kept from the brand. ' + (d.typography || '')); p(); }
|
|
501
|
+
if (s.palette) {
|
|
502
|
+
const c = s.palette;
|
|
503
|
+
p(`## 4. Colour — ${c.name}`); p('```css'); p(':root {');
|
|
504
|
+
for (const k of ['bg', 'surface', 'ink', 'muted', 'accent', 'accentInk']) if (c[k]) p(` --${k.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase())}: ${c[k]};`);
|
|
505
|
+
(c.fields || []).forEach((f, i) => p(` --field-${i + 1}: ${f.bg};${f.ink ? ` --field-${i + 1}-ink: ${f.ink};` : ''}`));
|
|
506
|
+
p('}'); p('```'); p(c.note); if (d.colour) p(d.colour); p();
|
|
507
|
+
} else { p('## 4. Colour'); p('Kept from the brand. ' + (d.colour || '')); p(); }
|
|
508
|
+
p('## 5. Imagery');
|
|
509
|
+
// where to look for real pictures of the subject's world, with first queries built from the brief
|
|
510
|
+
const qs = assetQueries(s.input);
|
|
511
|
+
const find = qs.length
|
|
512
|
+
? `\`${ASSETS_CMD} "${qs[0]}"\`${qs.length > 1 ? `, then ${qs.slice(1).map((q) => `"${q}"`).join(' and ')}` : ''}, then queries from your inventory (its street, its materials, its trade's tools and history)`
|
|
513
|
+
: `\`${ASSETS_CMD} "<a place, material or object from your inventory>"\``;
|
|
514
|
+
const MODE = {
|
|
515
|
+
interface: '**This subject is software and there are no screenshots, so its pictures are its own interface.** Wherever this sheet says photograph, image or object, build a believable fragment of the product in HTML at real size (real labels, numbers that add up, one item hovered or selected) by the app-screen rules (references/app-screens.md: deal its style once with `node <skill>/scripts/draw.mjs --app --kind <kind> --keep palette,type --out .taste-skill/app`, and build it with assets/app.css and assets/charts.js), put the attribute `data-ui` on its root, and crop or scale it the way the blueprint treats a photograph: a full-bleed close crop, a tile, the fixed half of a split. Where a fragment makes no sense, use a flat colour field with type on it. Never a fake dashboard of grey bars, never a device frame. If the product works on something physical (ships, plants, buildings, a city), one real picture of that world can carry a section: find it with `' + ASSETS_CMD + ' "<that world>"`, download it with `--get`, credit it on the page, and never let it pass for the product or its customers.',
|
|
516
|
+
'no-product-photo': '**There are no photographs of the product and none can be faked.** Wherever this sheet calls for a picture of the object, draw the object: its pieces as flat shapes in inline SVG, large, in one graphic language and in the colours that make it worth buying (a glaze, a finish, a material), never grey placeholders (references/imagery.md §8). **Around the object, use real pictures of its world** from the open collections: its material up close, its town in old postcards, its craft in engravings, a museum piece of the same kind, never one a visitor could take for the product itself (references/imagery.md §3). Start with ' + find + '. Download what you use with `--get` and credit every one on the page (`--credits` prints the footer line). Type at scale and full colour fields carry the rest; the dealt photographs only where they plainly do not pretend to be the product. In your report, say that product photography is needed and which drawings it will replace, and list every found picture with its source and licence.',
|
|
517
|
+
atmosphere: '**The project has no photographs of its own yet.** First choice: **real pictures of the subject\'s world from the open collections**: its city and street in old postcards and photographs, an old map of the neighbourhood, its materials up close, its trade in engravings, museum objects of its kind (references/imagery.md §3). Start with ' + find + '. Download what you use into the project with `--get` and credit every one on the page (`--credits` prints the footer line). They show the world around the client, never the client\'s own room, dish, product, person or team. Second, for what no honest picture exists of: draw the subject\'s own things in code, large, in one flat graphic language and the palette\'s real colours (its tiles, its windows, its objects; references/imagery.md §8). Third: the dealt photographs, only where an honestly generic picture fits (the sea, the weather, a material), never one a visitor could take for the thing itself and never an unrelated scene. One treatment for all of them. If this direction is built on photographs, plan the set before building (four to six pictures of one family) and reuse them at different crops and scales instead of finding or drawing a new picture for every slot; keep drawings as `<symbol>` + `<use>` or generate them with a small script so the page stays light. List every found picture (with its source and licence), every dealt photograph and every drawing that stands in for photography in your report.',
|
|
518
|
+
own: '**Use the images that belong to the project in every picture slot.** For slots they cannot fill, real pictures of the subject\'s world from the open collections come next (start with ' + find + '; credit them on the page), then the dealt photographs.',
|
|
519
|
+
};
|
|
520
|
+
p(MODE[s.imagery || 'atmosphere']); p(); p(d.imagery);
|
|
521
|
+
p(); p('**Floor (the inspector checks it):** at least four real pictures on the page, usually six to twelve; SVG drawings do not count. One moving picture where an honest clip exists: `node <skill>/scripts/assets.mjs --video "<query>"`, used as a muted loop with a poster frame. Whatever this direction says about pictures, it is carried out with real ones.');
|
|
522
|
+
if (s.photos) {
|
|
523
|
+
p();
|
|
524
|
+
p(s.imagery === 'interface' ? `Optional atmosphere, two at most, from the "${s.photos.title || s.photos.set}" set (${s.photos.note}). The page does not need them.` : `Photographs dealt for this build, from the "${s.photos.title || s.photos.set}" set (${s.photos.note})`);
|
|
525
|
+
p('Order of preference for imagery: (1) the project\'s own photographs and product shots; (2) images you generate, if an image tool is');
|
|
526
|
+
p('available; (3) real pictures of the subject\'s world found in the open collections (assets.mjs, downloaded and credited on the page);');
|
|
527
|
+
p('(4) drawings of the subject in code; (5) these. They are real photographs (Unsplash licence, served by picsum.photos) of places, light and');
|
|
528
|
+
p('texture. They are atmosphere, never a stand-in for a specific product, dish, person or interface. List the ones you use in your report so');
|
|
529
|
+
p('they can be replaced.');
|
|
530
|
+
if (s.photos.treatment) p(`Treatment: ${s.photos.treatment}`);
|
|
531
|
+
for (const ph of s.photos.photos) p(`- \`https://picsum.photos/id/${ph.id}/1600/1000\` — ${ph.alt} · ${ph.tone} tone · ${(ph.colours || []).join(', ')}${ph.mono ? ' · black-and-white' : ''}${ph.lookalike ? ' · **could be taken for the product: never use it as the product**' : ''}${ph.calm && ph.calm !== 'none' ? ` · calm area: ${ph.calm}` : ''} · native ${ph.ratio >= 1.15 ? 'landscape' : ph.ratio <= 0.87 ? 'portrait' : 'square'} · photo: ${ph.by}`);
|
|
532
|
+
p('The last two path numbers are width and height: request the exact crop you render (`/1200/1500` for a 4:5 portrait, `/2400/1350` for a hero) and');
|
|
533
|
+
p('add `?grayscale` to desaturate. ' + (s.imagery === 'interface' ? 'Use at most two.' : 'Use three to six of them, not all eight.') + ' Always set `width`, `height`, `alt` and `loading="lazy"` (not on the hero image).');
|
|
534
|
+
if (s.photos.others?.length) p(`Other sets that fit this brief: ${s.photos.others.join(', ')} — \`node draw.mjs --photos <set>\` prints one in full; \`--photos list\` shows all sets. Taking photographs from another set is your call and is not a redraw; keep them to one light and one treatment.`);
|
|
535
|
+
} else if (d.photos === false) {
|
|
536
|
+
p(); p('This direction does not lead with photographs; it still carries the picture floor below, with real pictures placed where the direction allows them.');
|
|
537
|
+
}
|
|
538
|
+
p();
|
|
539
|
+
const adjust = (bp) => { const n = adjustments(bp, s); if (n.length) { p(); p('Adjusted for this page:'); for (const x of n) p(`- ${x}`); } };
|
|
540
|
+
p(`## 6. Hero — ${s.hero.name}`); p(s.hero.blueprint); p(); p(`On a phone: ${s.hero.mobile}`); if (s.hero.headline) p(`Headline: ${s.hero.headline}`); adjust(s.hero); p();
|
|
541
|
+
p('## 7. Sections, in order');
|
|
542
|
+
p('Each is a composition to rebuild with this project\'s content. Keep the geometry; change the subject. Re-order or drop a');
|
|
543
|
+
p('section when the argument of the page needs it (see references/copy.md), never to fall back to a card grid.');
|
|
544
|
+
s.sections.forEach((sec, i) => {
|
|
545
|
+
p();
|
|
546
|
+
if (!sec.blueprint) { p(`### ${i + 1}. ${sec.role}`); p('No blueprint in the library for this role. Compose it from the direction above, using a layout shape not used by its neighbours.'); return; }
|
|
547
|
+
p(`### ${i + 1}. ${sec.role} — ${sec.name} (${sec.shape})`); p(sec.blueprint); if (sec.mobile) p(`On a phone: ${sec.mobile}`); adjust(sec);
|
|
548
|
+
});
|
|
549
|
+
p();
|
|
550
|
+
if (s.motion) { p(`## 8. Motion — ${s.motion.name}`); p(s.motion.description); p('This is the signature move, the one loud moment. Around it the page still needs the rest of the motion layer (SKILL.md step 9): an entrance for the parts of every section, feedback on every control, and one moving picture. The inspector fails a page that barely moves. Recipes: references/motion.md.'); p(); }
|
|
551
|
+
if (s.scenes?.length) {
|
|
552
|
+
p('## 9. Scroll scenes');
|
|
553
|
+
p(`The page's big moments: ${s.scenes.length} scroll scenes, tested and ready to fill. They are part of the composition, so build them in step 6 with the section they carry, not as a motion afterthought. Each runs on the shared stage (assets/scenes/stage.js and stage.css, with GSAP and Lenis from the pinned CDN lines in stage.js) and ships its own finished composition for reduced motion and for phones that rest. How to put one on a page, fill it and check it: references/scenes.md. Check them with \`node <skill>/scripts/scenes.mjs <page>\` and look at every sheet.`);
|
|
554
|
+
for (const sc of s.scenes) {
|
|
555
|
+
p();
|
|
556
|
+
p(`### ${sc.name} (\`${sc.id}\`)${sc.carries ? ` — carries the ${sc.carries === 'hero' ? 'first screen' : sc.carries + ' section'}` : ' — a transition between two sections'}`);
|
|
557
|
+
p(sc.summary);
|
|
558
|
+
if (sc.place) p(`Where: ${sc.place}`);
|
|
559
|
+
if (sc.content) p(`Content: ${sc.content}`);
|
|
560
|
+
if (sc.options) p(`Options (data-options): ${sc.options}`);
|
|
561
|
+
p(`Files: \`<skill>/assets/scenes/${sc.id}.js\` and \`${sc.id}.css\`; a working example: \`<skill>/assets/scenes/demo/${sc.id}.html\`.${sc.phone ? ' On a phone: ' + sc.phone : ''}`);
|
|
562
|
+
}
|
|
563
|
+
p();
|
|
564
|
+
p('Leave a quiet section between two scenes so each one lands. A scene whose content you cannot fill honestly is redrawn (`--redraw scenes`), never faked.');
|
|
565
|
+
p();
|
|
566
|
+
}
|
|
567
|
+
if (d.richness) { p('## 10. Where the richness comes from'); p(d.richness); p(); }
|
|
568
|
+
if (d.pitfalls) { p('## 11. How this direction goes wrong'); p(d.pitfalls); p(); }
|
|
569
|
+
if (s.references?.length) {
|
|
570
|
+
p('## 12. Real references');
|
|
571
|
+
p('Studied sites that work this way. Take the principle, never the specifics: no names, copy, images or signature assets of theirs.');
|
|
572
|
+
for (const r of s.references) p(siteCard(r, false));
|
|
573
|
+
p('Full notes on any of them: `node draw.mjs --site <id>`.'); p();
|
|
574
|
+
}
|
|
575
|
+
p('## Always');
|
|
576
|
+
p('Headlines two lines or fewer at every width. No eyebrow labels, no monospace, no 01/02/03, no thin rules, no gradients, no shadows at rest,');
|
|
577
|
+
p('no cream-and-terracotta, no violet. The frame: one h1 on the first screen that says what this is, equal outer margins, no');
|
|
578
|
+
p('section huddled on one side with the other half empty, no blank stretch over half a screen, a heading on every section.');
|
|
579
|
+
p('`inspect.mjs` measures all of it.');
|
|
580
|
+
if (s.allow?.length) p(`This direction is allowed: ${s.allow.join(', ')} (the inspector reads this from the saved sheet).`);
|
|
581
|
+
p();
|
|
582
|
+
p(`Saved to ${sheetPath.split('\\').join('/')} · reprint with \`node draw.mjs --show\``);
|
|
583
|
+
return o.join('\n');
|
|
584
|
+
}
|