gooseworks-ai/goose-skills / skills/video/create-chatgpt-mockup
create-chatgpt-mockup
VerifiedRender pixel-accurate ChatGPT mobile (iOS) screen mockups in light mode from a thread JSON. Supports user text bubbles, user image attachments, assistant markdown prose, citation chips, the OpenAI spiral logo, the Apps-SDK GPT chip in the composer, and three header styles (model-tag, plain title, "Get Plus"). Fixed 9:16 viewport. Outputs HTML + PNG.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.9 KB |
| examples/01-sunscreen-image.json | config | 467 B |
| examples/02-sleep-apnea-long.json | config | 1.1 KB |
| examples/03-poem-iphone-mac.json | config | 1007 B |
| examples/04-empty-typing.json | config | 258 B |
| examples/05-seatfinch-gpt-chip.json | config | 596 B |
| examples/06-short-howto.json | config | 750 B |
| examples/assets/sunscreen-sky.svg | other | 3.1 KB |
| generate.js | script | 16.3 KB |
| package.json | manifest | 348 B |
| render.js | script | 3.0 KB |
| screenshot.js | script | 2.5 KB |
| skill.meta.json | config | 136 B |
| templates/chat.css | other | 16.6 KB |
| templates/icons.js | script | 11.5 KB |
| tests/expected-output.md | markdown | 2.8 KB |
| tests/human-test.md | markdown | 1.8 KB |
| tests/run-all.shexecutable | script | 414 B |
| tests/sample-input.md | markdown | 1.8 KB |
| tests/smoke-test.md | markdown | 796 B |
render.js
View on GitHub#!/usr/bin/env node
/**
* render.js — entry point for create-chatgpt-mockup.
*
* node render.js --thread examples/text-qa.json
* node render.js --thread my-thread.json --output ./exports --name my-mockup
*/
const fs = require('fs');
const path = require('path');
const { renderHTML } = require('./generate');
const { capture } = require('./screenshot');
function parseArgs(argv) {
const args = {};
for (let i = 2; i < argv.length; i++) {
const a = argv[i];
switch (a) {
case '--thread': args.thread = argv[++i]; break;
case '--output': args.output = argv[++i]; break;
case '--name': args.name = argv[++i]; break;
case '-h':
case '--help': args.help = true; break;
default: break;
}
}
return args;
}
const HELP = `
create-chatgpt-mockup — render a pixel-accurate ChatGPT mobile screen.
Usage:
node render.js --thread <path.json> [--name slug] [--output dir]
Output:
<output>/<YYYY-MM-DD>-<slug>/index.html + screenshot.png + thread.json
Default <output> is ./chatgpt-mockup-exports/ in the cwd.
`;
function slugify(s) {
return (s || 'mockup')
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/(^-|-$)/g, '')
.slice(0, 40) || 'mockup';
}
function pickFirstUserText(thread) {
const t = (thread.messages || []).find(m => m.type === 'user-text');
return t ? t.text : null;
}
async function main() {
const args = parseArgs(process.argv);
if (args.help) { console.log(HELP); return; }
if (!args.thread) { console.error(HELP); process.exit(1); }
const threadPath = path.resolve(args.thread);
if (!fs.existsSync(threadPath)) {
console.error(`Thread file not found: ${threadPath}`);
process.exit(1);
}
const thread = JSON.parse(fs.readFileSync(threadPath, 'utf-8'));
// Resolve any relative image src in messages against the thread.json's dir,
// so examples can ship with sibling `assets/` folders.
const threadDir = path.dirname(threadPath);
for (const m of (thread.messages || [])) {
if (m.type === 'user-image' && m.src && !/^([a-z]+:|\/)/i.test(m.src)) {
m.src = `file://${path.resolve(threadDir, m.src)}`;
}
}
const today = new Date().toISOString().slice(0, 10);
const slug = slugify(args.name || pickFirstUserText(thread) || 'mockup');
const outDir = args.output
? path.resolve(args.output, `${today}-${slug}`)
: path.resolve(process.cwd(), 'chatgpt-mockup-exports', `${today}-${slug}`);
fs.mkdirSync(outDir, { recursive: true });
const htmlPath = path.join(outDir, 'index.html');
const pngPath = path.join(outDir, 'screenshot.png');
const html = renderHTML(thread);
fs.writeFileSync(htmlPath, html);
console.log(`HTML → ${htmlPath}`);
await capture({ input: htmlPath, output: pngPath, fontDelay: 600 });
fs.copyFileSync(threadPath, path.join(outDir, 'thread.json'));
console.log(`\n✓ ${pngPath}`);
}
main().catch(err => {
console.error('Render failed:', err.message);
console.error(err.stack);
process.exit(1);
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |