Prompt as Code | GPT Image 2 / 2.5 提示词与案例库,530+ 个案例、20+ 套工业级模板与可复用 Skills,新增 2.5 同提示词对比专区,附完整提示词与生成记录,持续更新。
JavaScript agentsai-image-generationchatgptdsh-plugingpt-image-2image-promptsprompt-as-codeprompt-engineeringskillsworkflow-automation
Add agent skill entry to website
freestylefly6b9e3a2a6f69
diff --git a/src/main.jsx b/src/main.jsxindex 1aa1465..6726ea5 100644--- a/src/main.jsx+++ b/src/main.jsx@@ -2,14 +2,18 @@ import React, { useEffect, useMemo, useState } from 'react';import { createRoot } from 'react-dom/client';import {ArrowUpRight,+ Bot,Check,Copy,Github,+ PackageCheck,Search,Sparkles,+ Terminal,WandSparkles} from 'lucide-react';import './styles.css';+import skillExampleImage from '../agents/skills/gpt-image-2-style-library/assets/city-life-system-map.png';const fallbackRepoUrl = 'https://github.com/freestylefly/awesome-gpt-image-2';@@ -18,6 +22,7 @@ const copy = {loading: 'Loading GPT-Image2 cases...',brand: 'GPT-Image2 Gallery',navCases: 'Cases',+ navSkill: 'Skill',navTemplates: 'Templates',eyebrow: 'Live GPT-Image2 prompt gallery',title: 'From viral images to reusable prompts.',@@ -36,6 +41,20 @@ const copy = {'Each template is distilled from real GPT-Image2 examples and includes structure, constraints, and pitfalls for production use.',templateKind: 'Prompt Template',openTemplate: 'Open Template',+ skillEyebrow: 'Agent skill',+ skillTitle: 'Bring the GPT-Image2 style library into Claude Code and Codex.',+ skillSubtitle:+ 'Install one skill, then let your agent choose templates, visual styles, scene tags, and pitfalls from the same library behind this site.',+ skillCommandLabel: 'Install for local agents',+ skillPromptLabel: 'Try this request',+ skillPrompt: 'Use gpt-image-2-style-library to create a city life system map.',+ skillCopyCommand: 'Copy command',+ skillOpenDocs: 'Open skill source',+ skillNpm: 'View npm package',+ skillCopied: 'Command copied',+ skillExampleAlt: 'City life system map generated with the GPT-Image2 style library skill',+ skillExampleCaption: 'Example output generated from the style-library skill.',+ skillStats: ['Claude Code ready', 'Codex ready', '20+ templates'],search: 'Search cases, sources, prompts...',category: 'Category',style: 'Style',@@ -52,6 +71,7 @@ const copy = {loading: '正在加载 GPT-Image2 案例...',brand: 'GPT-Image2 画廊',navCases: '案例',+ navSkill: '技能',navTemplates: '模板',eyebrow: '实时更新的 GPT-Image2 提示词画廊',title: '从爆款图片,到可复用 Prompt。',@@ -70,6 +90,20 @@ const copy = {'每套模板都从真实 GPT-Image2 案例里提炼,包含结构、约束和防坑经验,适合生产流程直接复用。',templateKind: '提示词模板',openTemplate: '打开模板',+ skillEyebrow: 'Agent Skill',+ skillTitle: '把 GPT-Image2 风格库装进 Claude Code 和 Codex。',+ skillSubtitle:+ '安装一个 skill,让 Agent 从本站同源的模板、风格、场景和防坑规则里自动选型,直接输出可复制的 GPT Image 2 prompt。',+ skillCommandLabel: '安装到本地 Agent',+ skillPromptLabel: '试试这个请求',+ skillPrompt: '用 gpt-image-2-style-library 技能生成城市生命系统图谱',+ skillCopyCommand: '复制命令',+ skillOpenDocs: '打开 skill 源码',+ skillNpm: '查看 npm 包',+ skillCopied: '命令已复制',+ skillExampleAlt: '使用 GPT-Image2 风格库 skill 生成的城市生命系统图谱',+ skillExampleCaption: '示例:用 gpt-image-2-style-library 生成“城市生命系统图谱”。',+ skillStats: ['Claude Code 可用', 'Codex 可用', '20+ 套模板'],search: '搜索案例、来源、Prompt...',category: '分类',style: '风格',@@ -165,23 +199,28 @@ function orderByLibrary(values, libraryItems = []) {});}+async function copyToClipboard(text) {+ if (navigator.clipboard?.writeText) {+ await navigator.clipboard.writeText(text);+ return;+ }++ const textarea = document.createElement('textarea');+ textarea.value = text;+ textarea.setAttribute('readonly', '');+ textarea.style.position = 'fixed';+ textarea.style.opacity = '0';+ document.body.appendChild(textarea);+ textarea.select();+ document.execCommand('copy');+ document.body.removeChild(textarea);+}+function useCopy() {const [copiedId, setCopiedId] = useState(null);async function copyPrompt(caseItem) {- if (navigator.clipboard?.writeText) {- await navigator.clipboard.writeText(caseItem.prompt);- } else {- const textarea = document.createElement('textarea');- textarea.value = caseItem.prompt;- textarea.setAttribute('readonly', '');- textarea.style.position = 'fixed';- textarea.style.opacity = '0';- document.body.appendChild(textarea);- textarea.select();- document.execCommand('copy');- document.body.removeChild(textarea);- }+ await copyToClipboard(caseItem.prompt);setCopiedId(caseItem.id);window.setTimeout(() => setCopiedId(null), 1600);}@@ -267,6 +306,79 @@ function LanguageSwitch({ language, setLanguage }) {);}+function SkillSection({ language, repoUrl }) {+ const t = copy[language];+ const [commandCopied, setCommandCopied] = useState(false);+ const installCommand =+ 'npx skills add freestylefly/awesome-gpt-image-2 --skill gpt-image-2-style-library --agent claude-code codex --global --yes --copy';+ const skillSourceUrl = `${repoUrl}/tree/main/agents/skills/gpt-image-2-style-library`;+ const npmUrl = 'https://www.npmjs.com/package/gpt-image-2-style-library';++ async function handleCopyCommand() {+ await copyToClipboard(installCommand);+ setCommandCopied(true);+ window.setTimeout(() => setCommandCopied(false), 1600);+ }++ return (+ <section className="skillSection" id="agent-skill">+ <div className="skillGrid">+ <div className="skillCopy">+ <span className="eyebrow">+ <Bot size={16} />+ {t.skillEyebrow}+ </span>+ <h2>{t.skillTitle}</h2>+ <p>{t.skillSubtitle}</p>+ <div className="skillStats">+ {t.skillStats.map((item, index) => {+ const icons = [Bot, Terminal, PackageCheck];+ const Icon = icons[index] || Check;+ return (+ <span key={item}>+ <Icon size={16} />+ {item}+ </span>+ );+ })}+ </div>+ <div className="skillCommand">+ <div className="skillCommandHeader">+ <strong>{t.skillCommandLabel}</strong>+ <button type="button" onClick={handleCopyCommand}>+ {commandCopied ? <Check size={16} /> : <Copy size={16} />}+ {commandCopied ? t.skillCopied : t.skillCopyCommand}+ </button>+ </div>+ <code>{installCommand}</code>+ </div>+ <div className="skillPrompt">+ <span>{t.skillPromptLabel}</span>+ <code>{t.skillPrompt}</code>+ </div>+ <div className="skillActions">+ <a href={skillSourceUrl} target="_blank" rel="noreferrer">+ <Github size={18} />+ {t.skillOpenDocs}+ </a>+ <a href={npmUrl} target="_blank" rel="noreferrer">+ <PackageCheck size={18} />+ {t.skillNpm}+ </a>+ </div>+ </div>+ <figure className="skillPreview">+ <img src={skillExampleImage} alt={t.skillExampleAlt} loading="lazy" />+ <figcaption>+ <Sparkles size={15} />+ {t.skillExampleCaption}+ </figcaption>+ </figure>+ </div>+ </section>+ );+}+function TemplateSection({ language, styleLibrary }) {const t = copy[language];const repoDocsUrl = `${styleLibrary.repository || fallbackRepoUrl}/blob/main/${styleLibrary.templateDocument}`;@@ -405,6 +517,15 @@ function App() {document.documentElement.lang = language === 'zh' ? 'zh-CN' : 'en';}, [language]);+ useEffect(() => {+ if (!siteData || !styleLibrary || !window.location.hash) return;+ const target = document.getElementById(window.location.hash.slice(1));+ if (!target) return;+ window.requestAnimationFrame(() => {+ target.scrollIntoView({ block: 'start' });+ });+ }, [siteData, styleLibrary]);+const hotCases = useMemo(() => {if (!siteData) return [];return [...siteData.cases]@@ -463,6 +584,7 @@ function App() {</a><div className="topbarControls"><nav>+ <a href="#agent-skill">{t.navSkill}</a><a href="#templates">{t.navTemplates}</a><a href="#gallery">{t.navCases}</a><a href={repoUrl} target="_blank" rel="noreferrer">@@ -490,6 +612,8 @@ function App() {))}</section>+ <SkillSection language={language} repoUrl={repoUrl} />+<TemplateSection language={language} styleLibrary={styleLibrary} /><section className="gallerySection" id="gallery">diff --git a/src/styles.css b/src/styles.cssindex 92d4b5b..63d43a0 100644--- a/src/styles.css+++ b/src/styles.css@@ -72,6 +72,9 @@ button {.eyebrow,.heroActions a,.metrics span,+.skillSection,+.skillCommand,+.skillPrompt,.searchBox,.filterPanel,.resultBar,@@ -402,6 +405,207 @@ button {font-weight: 800;}+.skillSection {+ position: relative;+ width: min(1180px, calc(100% - 32px));+ margin: 0 auto 84px;+ overflow: hidden;+ border-radius: 8px;+ padding: 24px;+ scroll-margin-top: 92px;+}++.skillSection::before {+ position: absolute;+ inset: 0;+ background:+ radial-gradient(circle at 18% 18%, rgba(66, 230, 255, 0.18), transparent 34%),+ radial-gradient(circle at 84% 20%, rgba(120, 255, 185, 0.14), transparent 36%),+ linear-gradient(135deg, rgba(10, 18, 36, 0.94), rgba(8, 13, 27, 0.82));+ content: "";+}++.skillSection::after {+ position: absolute;+ inset: 0;+ background-image:+ linear-gradient(rgba(255, 255, 255, 0.052) 1px, transparent 1px),+ linear-gradient(90deg, rgba(255, 255, 255, 0.052) 1px, transparent 1px);+ background-size: 46px 46px;+ content: "";+ opacity: 0.22;+ pointer-events: none;+}++.skillGrid {+ position: relative;+ z-index: 1;+ display: grid;+ grid-template-columns: minmax(0, 0.78fr) minmax(360px, 1fr);+ gap: 26px;+ align-items: center;+}++.skillCopy h2 {+ max-width: 720px;+ margin: 16px 0 14px;+ font-size: clamp(32px, 4.8vw, 56px);+ line-height: 1.05;+ letter-spacing: 0;+}++.skillCopy p {+ max-width: 680px;+ margin: 0;+ color: #b9c6d8;+ line-height: 1.72;+}++.skillStats {+ display: flex;+ flex-wrap: wrap;+ gap: 8px;+ margin-top: 20px;+}++.skillStats span {+ display: inline-flex;+ align-items: center;+ gap: 7px;+ min-height: 34px;+ border: 1px solid rgba(120, 255, 185, 0.22);+ border-radius: 999px;+ padding: 0 11px;+ background: rgba(120, 255, 185, 0.08);+ color: #d8ffe4;+ font-size: 13px;+ font-weight: 800;+}++.skillCommand {+ margin-top: 22px;+ overflow: hidden;+ border-radius: 8px;+}++.skillCommandHeader {+ display: flex;+ align-items: center;+ justify-content: space-between;+ gap: 12px;+ min-height: 46px;+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);+ padding: 0 12px;+}++.skillCommandHeader strong {+ color: #eaf3ff;+}++.skillCommandHeader button {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 7px;+ min-height: 34px;+ border: 1px solid rgba(103, 232, 249, 0.42);+ border-radius: 7px;+ padding: 0 10px;+ background: rgba(103, 232, 249, 0.12);+ color: #d8fbff;+ font-weight: 800;+}++.skillCommand code,+.skillPrompt code {+ display: block;+ color: #dff8ff;+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;+ line-height: 1.55;+ white-space: pre-wrap;+ overflow-wrap: anywhere;+}++.skillCommand code {+ padding: 14px;+ color: #c8ffb8;+ font-size: 13px;+}++.skillPrompt {+ display: grid;+ gap: 8px;+ margin-top: 12px;+ border-radius: 8px;+ padding: 12px 14px;+}++.skillPrompt span {+ color: #7feaff;+ font-size: 12px;+ font-weight: 900;+ text-transform: uppercase;+}++.skillActions {+ display: flex;+ flex-wrap: wrap;+ gap: 10px;+ margin-top: 18px;+}++.skillActions a {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ min-height: 44px;+ border: 1px solid rgba(255, 255, 255, 0.12);+ border-radius: 8px;+ padding: 0 14px;+ background: rgba(255, 255, 255, 0.075);+ color: #ffffff;+ font-weight: 800;+}++.skillActions a:hover {+ border-color: rgba(120, 255, 185, 0.74);+ background: rgba(120, 255, 185, 0.14);+}++.skillPreview {+ position: relative;+ margin: 0;+ overflow: hidden;+ border: 1px solid rgba(255, 255, 255, 0.13);+ border-radius: 8px;+ background: rgba(5, 10, 20, 0.64);+ box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);+}++.skillPreview img {+ display: block;+ width: 100%;+ aspect-ratio: 1882 / 964;+ object-fit: cover;+}++.skillPreview figcaption {+ display: flex;+ align-items: center;+ gap: 8px;+ border-top: 1px solid rgba(255, 255, 255, 0.1);+ padding: 12px 14px;+ color: #b9c6d8;+ font-size: 13px;+ line-height: 1.45;+}++.skillPreview figcaption svg {+ flex: 0 0 auto;+ color: #78ffb9;+}+.gallerySection {width: min(1180px, calc(100% - 32px));margin: 0 auto;@@ -838,6 +1042,10 @@ button {grid-template-columns: repeat(4, minmax(0, 1fr));}+ .skillGrid {+ grid-template-columns: 1fr;+ }+.templateGrid {grid-template-columns: repeat(2, minmax(0, 1fr));}@@ -895,6 +1103,7 @@ button {}.hotStrip,+ .skillSection,.gallerySection {width: min(100% - 24px, 1180px);}@@ -904,6 +1113,26 @@ button {margin-bottom: 58px;}+ .skillSection {+ margin-bottom: 58px;+ padding: 16px;+ }++ .skillCopy h2 {+ font-size: 34px;+ }++ .skillCommandHeader {+ align-items: flex-start;+ flex-direction: column;+ padding: 12px;+ }++ .skillCommandHeader button,+ .skillActions a {+ width: 100%;+ }+.templateSection {width: min(100% - 24px, 1180px);margin-bottom: 58px;