codex-visual-web-builder 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # codex-visual-web-builder
2
+
3
+ Installs the `$visual-web-builder` Codex skill.
4
+
5
+ This skill combines image generation with image-first frontend implementation:
6
+
7
+ - generate or edit raster images and visual references
8
+ - create section-by-section website references
9
+ - analyze typography, layout, spacing, colors, components, and image treatment
10
+ - implement the frontend from those references
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ npx codex-visual-web-builder
16
+ ```
17
+
18
+ If the skill already exists:
19
+
20
+ ```bash
21
+ npx codex-visual-web-builder --force
22
+ ```
23
+
24
+ ## Use
25
+
26
+ After installing, invoke it in Codex:
27
+
28
+ ```text
29
+ Use $visual-web-builder to create a premium landing page for a boutique gym.
30
+ Generate visual references first, analyze them, then implement the site.
31
+ ```
32
+
33
+ Useful prompt details:
34
+
35
+ - brand or project name
36
+ - target audience
37
+ - page goal
38
+ - style direction
39
+ - sections needed
40
+ - required copy
41
+ - target stack or current project
42
+
43
+ ## Example
44
+
45
+ ```text
46
+ Use $visual-web-builder to build a 5-section landing page.
47
+
48
+ Brand: Forma Studio
49
+ Business: pilates boutique studio in Milan
50
+ Goal: book trial classes
51
+ Style: premium, calm, editorial, light mode
52
+ Sections: hero, class types, instructors, testimonials, booking CTA
53
+ Output: implement in the current React project
54
+ ```
package/bin/install.js ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require("fs");
4
+ const os = require("os");
5
+ const path = require("path");
6
+
7
+ function usage() {
8
+ console.log(`Install the Visual Web Builder Codex skill.
9
+
10
+ Usage:
11
+ npx codex-visual-web-builder
12
+ npx codex-visual-web-builder --force
13
+ npx codex-visual-web-builder --target /path/to/.codex/skills
14
+
15
+ Options:
16
+ --force Replace an existing visual-web-builder skill.
17
+ --dry-run Print the target path without writing files.
18
+ --target <dir> Install into a specific skills directory.
19
+ --help Show this help.
20
+ `);
21
+ }
22
+
23
+ function parseArgs(argv) {
24
+ const args = { force: false, dryRun: false, target: null };
25
+
26
+ for (let i = 0; i < argv.length; i += 1) {
27
+ const arg = argv[i];
28
+ if (arg === "--force") {
29
+ args.force = true;
30
+ } else if (arg === "--dry-run") {
31
+ args.dryRun = true;
32
+ } else if (arg === "--target") {
33
+ const value = argv[i + 1];
34
+ if (!value) {
35
+ throw new Error("--target requires a directory path.");
36
+ }
37
+ args.target = value;
38
+ i += 1;
39
+ } else if (arg === "--help" || arg === "-h") {
40
+ args.help = true;
41
+ } else {
42
+ throw new Error(`Unknown option: ${arg}`);
43
+ }
44
+ }
45
+
46
+ return args;
47
+ }
48
+
49
+ function defaultSkillsDir() {
50
+ const codexHome = process.env.CODEX_HOME || path.join(os.homedir(), ".codex");
51
+ return path.join(codexHome, "skills");
52
+ }
53
+
54
+ function copySkill(source, destination, force) {
55
+ if (fs.existsSync(destination)) {
56
+ if (!force) {
57
+ throw new Error(
58
+ `Skill already exists at ${destination}. Re-run with --force to replace it.`
59
+ );
60
+ }
61
+ fs.rmSync(destination, { recursive: true, force: true });
62
+ }
63
+
64
+ fs.mkdirSync(path.dirname(destination), { recursive: true });
65
+ fs.cpSync(source, destination, { recursive: true });
66
+ }
67
+
68
+ function main() {
69
+ const args = parseArgs(process.argv.slice(2));
70
+ if (args.help) {
71
+ usage();
72
+ return;
73
+ }
74
+
75
+ const packageRoot = path.resolve(__dirname, "..");
76
+ const source = path.join(packageRoot, "skill");
77
+ const skillsDir = path.resolve(args.target || defaultSkillsDir());
78
+ const destination = path.join(skillsDir, "visual-web-builder");
79
+
80
+ if (args.dryRun) {
81
+ console.log(`Would install Visual Web Builder to: ${destination}`);
82
+ return;
83
+ }
84
+
85
+ copySkill(source, destination, args.force);
86
+ console.log(`Installed Visual Web Builder Codex skill to: ${destination}`);
87
+ console.log("Invoke it with: $visual-web-builder");
88
+ }
89
+
90
+ try {
91
+ main();
92
+ } catch (error) {
93
+ console.error(`Error: ${error.message}`);
94
+ process.exit(1);
95
+ }
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "codex-visual-web-builder",
3
+ "version": "1.0.0",
4
+ "description": "Install the Visual Web Builder Codex skill, combining image generation with image-first frontend implementation.",
5
+ "license": "MIT",
6
+ "type": "commonjs",
7
+ "bin": {
8
+ "codex-visual-web-builder": "bin/install.js",
9
+ "visual-web-builder": "bin/install.js"
10
+ },
11
+ "files": [
12
+ "bin",
13
+ "skill",
14
+ "README.md"
15
+ ],
16
+ "keywords": [
17
+ "codex",
18
+ "codex-skill",
19
+ "imagegen",
20
+ "image-to-code",
21
+ "frontend",
22
+ "web-design"
23
+ ],
24
+ "engines": {
25
+ "node": ">=18"
26
+ }
27
+ }
package/skill/SKILL.md ADDED
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: visual-web-builder
3
+ description: Use this combined Codex skill when a task needs AI image generation or image editing plus frontend implementation from those generated visuals. It orchestrates the system imagegen workflow for raster assets, mockups, edits, transparent cutouts, and image prompts, then applies the image-to-code workflow for visually important websites, hero sections, landing pages, product pages, portfolios, redesigns, and premium frontend implementation. Use when the user wants one renamed skill that combines $imagegen and $image-to-code into a single visual website builder.
4
+ ---
5
+
6
+ # Visual Web Builder
7
+
8
+ ## Purpose
9
+
10
+ This is an orchestrator skill that combines two existing skills without duplicating their full instructions:
11
+
12
+ - `imagegen`: generate or edit raster images, visual references, transparent cutouts, UI mockups, product shots, and project-bound assets.
13
+ - `image-to-code`: generate website section references first, analyze them deeply, then implement the frontend faithfully.
14
+
15
+ Use this skill when the user wants a single workflow that starts with AI-generated visuals and ends with usable code.
16
+
17
+ ## Source Skills
18
+
19
+ Load the source skill details only when needed:
20
+
21
+ - Image generation source: `references/imagegen.md`
22
+ - Image-to-code source: `references/image-to-code.md`
23
+
24
+ Do not copy large sections from those files into context unless the task requires their exact rules. Prefer reading only the relevant portions.
25
+
26
+ ## Trigger
27
+
28
+ Use this skill for:
29
+
30
+ - visual website creation where image generation should happen before coding
31
+ - landing pages, hero sections, product pages, portfolios, editorial pages, and startup sites
32
+ - redesigns where the final frontend should closely match generated design references
33
+ - tasks that need both generated bitmap assets and frontend integration
34
+ - user requests that explicitly mention combining `$imagegen` and `$image-to-code`
35
+
36
+ Do not use this skill for:
37
+
38
+ - pure bug fixes or backend work
39
+ - deterministic SVG/icon edits that are better done directly in code
40
+ - simple image generation with no code output, unless the user explicitly asks for the combined skill
41
+
42
+ ## Workflow
43
+
44
+ 1. Classify the task:
45
+ - `asset-only`: generate or edit images, no implementation.
46
+ - `visual-to-code`: generate design references, analyze them, implement frontend.
47
+ - `asset-plus-code`: generate project assets, save them into the workspace, and wire them into code.
48
+ 2. For all image work, follow the `imagegen` skill rules:
49
+ - use built-in `image_gen` by default
50
+ - use CLI fallback only when explicitly requested or confirmed
51
+ - handle transparency with chroma-key removal first unless true native transparency is confirmed
52
+ - save project-bound assets inside the workspace and report final paths
53
+ 3. For visually important frontend work, follow the `image-to-code` sequence:
54
+ - generate visual reference images first
55
+ - prefer one large readable image per section
56
+ - generate fresh detail images when text, spacing, buttons, or components are unclear
57
+ - deeply analyze typography, colors, spacing, layout, image treatment, and component logic
58
+ - implement the frontend only after analysis
59
+ 4. Preserve the generated design during implementation:
60
+ - do not drift into generic templates
61
+ - keep the hero clean, spacious, and readable
62
+ - avoid nested cards, giant section wrappers, fake technical pills, and decorative micro-UI clutter
63
+ - use real project assets instead of leaving references under `$CODEX_HOME/generated_images`
64
+ 5. Verify:
65
+ - run the app or open the static page when appropriate
66
+ - use browser inspection/screenshots for local frontend work when available
67
+ - confirm images render from workspace paths
68
+ - report any tests or visual checks performed
69
+
70
+ ## Prompt Handling
71
+
72
+ When generating website references, produce prompts that include:
73
+
74
+ - section name and intended use
75
+ - visual direction and brand mood
76
+ - layout, typography, spacing, and component constraints
77
+ - image treatment and asset requirements
78
+ - exact text when the user provides it
79
+ - constraints to avoid unreadable tiny text, overstuffed heroes, nested card structures, and generic AI-gradient styling
80
+
81
+ When generating standalone assets, use the `imagegen` shared prompt schema and taxonomy from the source skill.
82
+
83
+ ## Output Discipline
84
+
85
+ For final responses, include:
86
+
87
+ - generated asset paths if files were saved
88
+ - implemented file paths if code changed
89
+ - local preview URL when a dev server was started
90
+ - verification performed
91
+
92
+ Keep the explanation concise. The value of this skill is the executed workflow, not a long written design brief.
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "Visual Web Builder"
3
+ short_description: "Generate visuals, then build faithful frontend"
4
+ default_prompt: "Use $visual-web-builder to generate section references first, analyze them, and implement a polished landing page."
5
+
6
+ policy:
7
+ allow_implicit_invocation: true