gemini-designer 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -9,6 +9,7 @@ import { loginCommand } from './commands/login.js';
9
9
  import { doctorCommand } from './commands/doctor.js';
10
10
  import { linksCommand } from './commands/links.js';
11
11
  import { uninstallCommand } from './commands/uninstall.js';
12
+ import { agentsMdCommand } from './commands/agents-md.js';
12
13
  import { VERSION } from './version.js';
13
14
  const program = new Command();
14
15
  program
@@ -20,5 +21,6 @@ program.addCommand(loginCommand);
20
21
  program.addCommand(doctorCommand);
21
22
  program.addCommand(linksCommand);
22
23
  program.addCommand(uninstallCommand);
24
+ program.addCommand(agentsMdCommand);
23
25
  program.parse();
24
26
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,iBAAiB,CAAC;KACvB,WAAW,CAAC,8CAA8C,CAAC;KAC3D,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,YAAY,CAA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AGENTS.md section that teaches agents how to use Gemini Designer MCP tools effectively.
4
+ */
5
+ import { Command } from 'commander';
6
+ export declare const agentsMdCommand: Command;
7
+ //# sourceMappingURL=agents-md.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-md.d.ts","sourceRoot":"","sources":["../../src/commands/agents-md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2EpC,eAAO,MAAM,eAAe,SA0BxB,CAAC"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * agents-md command
3
+ * Print (or install) a drop-in AGENTS.md section that teaches agents how to use Gemini Designer MCP tools effectively.
4
+ */
5
+ import { Command } from 'commander';
6
+ import * as fs from 'node:fs';
7
+ import * as path from 'node:path';
8
+ import chalk from 'chalk';
9
+ const BEGIN = '<!-- gemini-designer:agents-md:begin -->';
10
+ const END = '<!-- gemini-designer:agents-md:end -->';
11
+ function getAgentsMdSection() {
12
+ return [
13
+ BEGIN,
14
+ '# Gemini Designer MCP — Agent Workflow Rules',
15
+ '',
16
+ '## Golden rules',
17
+ '- Prefer Gemini Designer MCP tools for UI work; avoid hand-writing large UI blobs unless explicitly requested.',
18
+ '- Default to: 1 generation pass + (optional) 1 targeted modify pass. Do not loop endlessly.',
19
+ '- Always maintain WCAG AA, keyboard navigation, and strong :focus-visible states.',
20
+ '- Avoid generic layouts (cookie-cutter SaaS grids) and generic gradients.',
21
+ '',
22
+ '## Recommended workflows',
23
+ '',
24
+ '### A) New page / new component (highest quality, lowest back-and-forth)',
25
+ '1) (Optional) detect_ui_stack(projectRoot) to learn framework/styling conventions.',
26
+ '2) generate_vibes(vibeCount=3..5) and pick ONE vibe.',
27
+ '3) create_ui(...) or snippet_ui(...), pass the vibe JSON as vibe=... and keep requirements explicit.',
28
+ '4) If polish is needed: ONE modify_ui pass (surgical edits).',
29
+ '',
30
+ '### B) Tight iteration on existing UI (no re-generation)',
31
+ '1) modify_ui(targetFile, instruction, preserveLogic=true, returnDiff=true).',
32
+ '2) If diff looks good: modify_ui(..., applyChanges=true).',
33
+ '',
34
+ '### C) Screenshot → design breakdown → implementation',
35
+ '1) analyze_screenshot_ui(imagePath, outputFormat=json).',
36
+ '2) create_ui/snippet_ui to implement the extracted structure.',
37
+ '3) modify_ui to refine alignment/spacing/accessibility.',
38
+ '',
39
+ '### D) Repo refactor / consistency',
40
+ '- catalog_components to discover existing exports to reuse.',
41
+ '- analyze_tokens to extract tokens from CSS/SCSS.',
42
+ '- sync_design_tokens to normalize/convert tokens (css-vars/scss-vars/tailwind/tokens-studio/style-dictionary).',
43
+ '',
44
+ '### E) Architecture planning (before implementation)',
45
+ '1) scaffold_project(name, pages, features) to get a structured plan.',
46
+ '2) Implement pages/components via create_ui/snippet_ui.',
47
+ '',
48
+ '## High-signal request template (copy/paste)',
49
+ 'Purpose: <what this UI is for>',
50
+ 'Audience: <who uses it>',
51
+ 'Required content: <bullets of exact elements that must exist>',
52
+ 'Constraints:',
53
+ '- WCAG AA',
54
+ '- Mobile-first responsive',
55
+ '- Strong :focus-visible states',
56
+ '- Avoid generic “SaaS card grids” + generic gradients',
57
+ 'Design direction: <ONE clear aesthetic (editorial | brutalist | art-deco | luxury | playful)>',
58
+ '',
59
+ 'Tip: For marketing pages, explicitly list required sections (hero, how-it-works, examples, testimonials, pricing, CTA).',
60
+ END,
61
+ '',
62
+ ].join('\n');
63
+ }
64
+ function upsertSection(existing, section) {
65
+ if (existing.includes(BEGIN) && existing.includes(END)) {
66
+ const start = existing.indexOf(BEGIN);
67
+ const end = existing.indexOf(END);
68
+ if (start !== -1 && end !== -1 && end >= start) {
69
+ const after = existing.slice(end + END.length);
70
+ return `${existing.slice(0, start)}${section}${after.replace(/^\n+/, '\n')}`;
71
+ }
72
+ }
73
+ const trimmed = existing.replace(/\s+$/, '');
74
+ return `${trimmed}\n\n${section}`;
75
+ }
76
+ export const agentsMdCommand = new Command('agents-md')
77
+ .description('Print or install a drop-in AGENTS.md section for best Gemini Designer MCP results')
78
+ .option('-f, --file <path>', 'Target file to write to', 'AGENTS.md')
79
+ .option('--install', 'Install/update the section in the target file (append if missing)')
80
+ .action(async (options) => {
81
+ const section = getAgentsMdSection();
82
+ if (!options.install) {
83
+ process.stdout.write(`${section}\n`);
84
+ return;
85
+ }
86
+ const target = path.resolve(process.cwd(), String(options.file || 'AGENTS.md'));
87
+ let existing = '';
88
+ if (fs.existsSync(target)) {
89
+ existing = fs.readFileSync(target, 'utf8');
90
+ }
91
+ const next = upsertSection(existing, section);
92
+ fs.mkdirSync(path.dirname(target), { recursive: true });
93
+ fs.writeFileSync(target, next, 'utf8');
94
+ console.log(chalk.green(`✓ Updated ${path.relative(process.cwd(), target)}`));
95
+ console.log(chalk.gray('Tip: If you already have repo instructions, keep them — this section is additive.'));
96
+ });
97
+ //# sourceMappingURL=agents-md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agents-md.js","sourceRoot":"","sources":["../../src/commands/agents-md.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,KAAK,GAAG,0CAA0C,CAAC;AACzD,MAAM,GAAG,GAAG,wCAAwC,CAAC;AAErD,SAAS,kBAAkB;IACzB,OAAO;QACL,KAAK;QACL,8CAA8C;QAC9C,EAAE;QACF,iBAAiB;QACjB,gHAAgH;QAChH,6FAA6F;QAC7F,mFAAmF;QACnF,2EAA2E;QAC3E,EAAE;QACF,0BAA0B;QAC1B,EAAE;QACF,0EAA0E;QAC1E,oFAAoF;QACpF,sDAAsD;QACtD,sGAAsG;QACtG,8DAA8D;QAC9D,EAAE;QACF,0DAA0D;QAC1D,6EAA6E;QAC7E,2DAA2D;QAC3D,EAAE;QACF,uDAAuD;QACvD,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AAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemini-designer",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "CLI installer for Gemini Designer MCP server",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",
package/src/cli.ts CHANGED
@@ -10,6 +10,7 @@ import { loginCommand } from './commands/login.js';
10
10
  import { doctorCommand } from './commands/doctor.js';
11
11
  import { linksCommand } from './commands/links.js';
12
12
  import { uninstallCommand } from './commands/uninstall.js';
13
+ import { agentsMdCommand } from './commands/agents-md.js';
13
14
  import { VERSION } from './version.js';
14
15
 
15
16
  const program = new Command();
@@ -24,5 +25,6 @@ program.addCommand(loginCommand);
24
25
  program.addCommand(doctorCommand);
25
26
  program.addCommand(linksCommand);
26
27
  program.addCommand(uninstallCommand);
28
+ program.addCommand(agentsMdCommand);
27
29
 
28
30
  program.parse();
@@ -0,0 +1,108 @@
1
+ /**
2
+ * agents-md command
3
+ * Print (or install) a drop-in AGENTS.md section that teaches agents how to use Gemini Designer MCP tools effectively.
4
+ */
5
+
6
+ import { Command } from 'commander';
7
+ import * as fs from 'node:fs';
8
+ import * as path from 'node:path';
9
+ import chalk from 'chalk';
10
+
11
+ const BEGIN = '<!-- gemini-designer:agents-md:begin -->';
12
+ const END = '<!-- gemini-designer:agents-md:end -->';
13
+
14
+ function getAgentsMdSection(): string {
15
+ return [
16
+ BEGIN,
17
+ '# Gemini Designer MCP — Agent Workflow Rules',
18
+ '',
19
+ '## Golden rules',
20
+ '- Prefer Gemini Designer MCP tools for UI work; avoid hand-writing large UI blobs unless explicitly requested.',
21
+ '- Default to: 1 generation pass + (optional) 1 targeted modify pass. Do not loop endlessly.',
22
+ '- Always maintain WCAG AA, keyboard navigation, and strong :focus-visible states.',
23
+ '- Avoid generic layouts (cookie-cutter SaaS grids) and generic gradients.',
24
+ '',
25
+ '## Recommended workflows',
26
+ '',
27
+ '### A) New page / new component (highest quality, lowest back-and-forth)',
28
+ '1) (Optional) detect_ui_stack(projectRoot) to learn framework/styling conventions.',
29
+ '2) generate_vibes(vibeCount=3..5) and pick ONE vibe.',
30
+ '3) create_ui(...) or snippet_ui(...), pass the vibe JSON as vibe=... and keep requirements explicit.',
31
+ '4) If polish is needed: ONE modify_ui pass (surgical edits).',
32
+ '',
33
+ '### B) Tight iteration on existing UI (no re-generation)',
34
+ '1) modify_ui(targetFile, instruction, preserveLogic=true, returnDiff=true).',
35
+ '2) If diff looks good: modify_ui(..., applyChanges=true).',
36
+ '',
37
+ '### C) Screenshot → design breakdown → implementation',
38
+ '1) analyze_screenshot_ui(imagePath, outputFormat=json).',
39
+ '2) create_ui/snippet_ui to implement the extracted structure.',
40
+ '3) modify_ui to refine alignment/spacing/accessibility.',
41
+ '',
42
+ '### D) Repo refactor / consistency',
43
+ '- catalog_components to discover existing exports to reuse.',
44
+ '- analyze_tokens to extract tokens from CSS/SCSS.',
45
+ '- sync_design_tokens to normalize/convert tokens (css-vars/scss-vars/tailwind/tokens-studio/style-dictionary).',
46
+ '',
47
+ '### E) Architecture planning (before implementation)',
48
+ '1) scaffold_project(name, pages, features) to get a structured plan.',
49
+ '2) Implement pages/components via create_ui/snippet_ui.',
50
+ '',
51
+ '## High-signal request template (copy/paste)',
52
+ 'Purpose: <what this UI is for>',
53
+ 'Audience: <who uses it>',
54
+ 'Required content: <bullets of exact elements that must exist>',
55
+ 'Constraints:',
56
+ '- WCAG AA',
57
+ '- Mobile-first responsive',
58
+ '- Strong :focus-visible states',
59
+ '- Avoid generic “SaaS card grids” + generic gradients',
60
+ 'Design direction: <ONE clear aesthetic (editorial | brutalist | art-deco | luxury | playful)>',
61
+ '',
62
+ 'Tip: For marketing pages, explicitly list required sections (hero, how-it-works, examples, testimonials, pricing, CTA).',
63
+ END,
64
+ '',
65
+ ].join('\n');
66
+ }
67
+
68
+ function upsertSection(existing: string, section: string): string {
69
+ if (existing.includes(BEGIN) && existing.includes(END)) {
70
+ const start = existing.indexOf(BEGIN);
71
+ const end = existing.indexOf(END);
72
+ if (start !== -1 && end !== -1 && end >= start) {
73
+ const after = existing.slice(end + END.length);
74
+ return `${existing.slice(0, start)}${section}${after.replace(/^\n+/, '\n')}`;
75
+ }
76
+ }
77
+ const trimmed = existing.replace(/\s+$/, '');
78
+ return `${trimmed}\n\n${section}`;
79
+ }
80
+
81
+ export const agentsMdCommand = new Command('agents-md')
82
+ .description('Print or install a drop-in AGENTS.md section for best Gemini Designer MCP results')
83
+ .option('-f, --file <path>', 'Target file to write to', 'AGENTS.md')
84
+ .option('--install', 'Install/update the section in the target file (append if missing)')
85
+ .action(async (options) => {
86
+ const section = getAgentsMdSection();
87
+
88
+ if (!options.install) {
89
+ process.stdout.write(`${section}\n`);
90
+ return;
91
+ }
92
+
93
+ const target = path.resolve(process.cwd(), String(options.file || 'AGENTS.md'));
94
+ let existing = '';
95
+ if (fs.existsSync(target)) {
96
+ existing = fs.readFileSync(target, 'utf8');
97
+ }
98
+
99
+ const next = upsertSection(existing, section);
100
+ fs.mkdirSync(path.dirname(target), { recursive: true });
101
+ fs.writeFileSync(target, next, 'utf8');
102
+
103
+ console.log(chalk.green(`✓ Updated ${path.relative(process.cwd(), target)}`));
104
+ console.log(
105
+ chalk.gray('Tip: If you already have repo instructions, keep them — this section is additive.')
106
+ );
107
+ });
108
+