by linbei0
Local-first AI e-commerce image suite generator for individual sellers. Pi Agent storyboards, 25 templates + reusable suites, product-truth pixel protection, OpenAI-compatible & Gemini image providers, AI layering (PNG/PSD), review, edit, and ZIP export. Self-hosted.
# Add to your Claude Code skills
git clone https://github.com/linbei0/EcomGenSee how EcomGen compares with popular alternatives.
EcomGen is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by linbei0. Local-first AI e-commerce image suite generator for individual sellers. Pi Agent storyboards, 25 templates + reusable suites, product-truth pixel protection, OpenAI-compatible & Gemini image providers, AI layering (PNG/PSD), review, edit, and ZIP export. Self-hosted. It has 100 GitHub stars.
EcomGen's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/linbei0/EcomGen" and add it to your Claude Code skills directory (see the Installation section above).
EcomGen is primarily written in TypeScript. It is open-source under linbei0 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh EcomGen against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
简体中文 | English
EcomGen 是面向个人卖家的本地优先电商 AI 套图工作台。它把商品事实、商品素材、目标市场和平台要求整理成可审核的分镜,再由 Worker 调用兼容 OpenAI 的图像 Provider 生成、编辑、审核、分层并导出整套图片。
| 项目入口 | 商品配置 |
|---|---|
![]() |
![]() |
| 分镜确认 | 生成结果 |
|---|---|
![]() |
![]() |
AI 智能规划、手动选择 和 套图,并支持"最近配置"快照一键复用历史规划参数。ecom-details-image 模板目录,覆盖主图、场景图、信息图、包装、对比、社媒等场景,并支持导入自定义模板。PRODUCT_TRUTH、包装图和参考图;PIXEL_PROTECTED 模式要求使用当前项目的商品真值素材。compiledPrompt、生成快照和任务状态。manifest.json。flowchart LR
A[商品事实与素材] --> B[创建项目]
B --> C[选择规划模式: AI / 手动 / 套图]
C --> D[Pi Agent 生成分镜与最终 Prompt]
D --> E[用户编辑并确认]
E --> F[Worker 调用生图或分割 Provider]
F --> G[审核、编辑与 AI 分层]
G --> H[ZIP 导出与 manifest]
API 负责校验、持久化和入队;Pi Agent 负责理解业务规则并生成最终 Prompt;Worker 只做取消、资源、状态和参数检查,然后把最终 Prompt 原样交给 Provider。SSE 只用于通知前端重新查询状态,REST 是状态真相。
| 路由 | 页面 | 用途 |
|---|---|---|
/ |
项目画廊 | 新建、归档、恢复和删除项目,进入套图工坊、资产库与设置 |
/projects/:id |
项目工作台 | 配置 → 分镜 → 结果三阶段,完成素材、规划、生图、编辑、分层与导出 |
/library |
全局资产库 | 跨项目管理全部素材、生成结果和分层文件 |
/suite-forge |
套图工坊 | 上传爆款套图,反向工程为可复用套图模板 |
| 层 | 技术 |
|---|---|
| Web | React 19、Vite、Ant Design、TanStack Query、Motion、openapi-fetch、ag-psd、fflate |
| API | Fastify 5、TypeBox、SQLite(better-sqlite3)、SSE、multipart、Sharp |
| Worker | BullMQ、Redis、Sharp、Archiver、ag-psd |
| Agent | @earendil-works/pi-agent-core、@earendil-works/pi-ai |
| 工程 | TypeScript ESM、pnpm workspace、Vitest、OpenAPI 3.1 |
11.19.0)ECOMGEN_MASTER_KEY/images/generations 与 /images/edits 的 Base URL 和模型 ID。https://generativelanguage.googleapis.com/v1beta,模型 ID 填 gemini-2.5-flash-image,生图 API 类型选择 gemini。该适配器使用 Gemini generateContent 的原生图像响应,参考图以内联图片发送;Gemini 不支持 OpenAI 式蒙版,因此局部蒙版编辑和画布外扩会按能力检查显式拒绝。corepack enable
pnpm install
复制根目录示例文件:
cp .env.example .env
生成主密钥(不要提交 .env):
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
将输出写入 .env 的 ECOMGEN_MASTER_KEY。默认配置使用 ./data 保存 SQLite、上传素材、生成结果和导出文件,使用 redis://127.0.0.1:6379 连接 Redis。Web 端可按需在 apps/web/.env 中设置:
VITE_API_BASE_URL=http://127.0.0.1:8787/api/v1
先确保 Redis 已启动,然后在三个终端分别运行:
pnpm dev:api
pnpm dev:worker
pnpm dev:web
默认地址:
http://127.0.0.1:5173)http://127.0.0.1:8787openapi.yaml也可以使用根脚本一次启动 API、Worker 和 Web:
pnpm dev
Docker Compose 会启动 Redis、API 和 Worker,并将业务数据保存到命名卷。API 会同时托管 Web 页面(apps/web/dist),因此只需暴露一个端口。先在根目录创建 .env,至少设置 ECOMGEN_MASTER_KEY,再运行:
docker compose up -d --build
启动后访问 http://127.0.0.1:8787 即是完整工作台。部署在 VPS 或远程服务器时,用 http://<服务器IP>:8787 直接访问(建议前置 Nginx/Caddy 反代并配置 HTTPS)。查看日志或停止服务:
docker compose logs -f api worker
docker compose down
前后端分开部署(Web 托管在别处)时,VITE_API_BASE_URL 是构建期变量:在 pnpm --filter @ecomgen/web build 前设置为可从浏览器访问的 API 地址(如 http://<服务器IP>:8787/api/v1),构建后无法修改。不设置时默认走同源相对路径 /api/v1(本地开发由 Vite 代理转发)。
pnpm build # 构建全部 workspace 包
pnpm test # 运行全部 Vitest 测试
pnpm test:e2e:mock # 运行 Mock API/Worker 完整链路验收
pnpm verify-contracts # 校验 OpenAPI 契约与生成物一致性
pnpm lint:openapi # 只校验 OpenAPI 契约
按包运行:
pnpm --filter @ecomgen/web test
pnpm --filter @ecomgen/agent test -- --run
pnpm --filter @ecomgen/worker build
apps/
api/ Fastify API、上传、Provider 配置和 SSE
web/ React + Vite 桌面优先工作台
worker/ BullMQ 消费者、Pi 规划、生图、编辑、分层和 ZIP 导出
packages/
agent/ Pi Agent 规划与 Prompt 改写适配器
contracts/ 跨应用领域类型与 TypeBox 契约真相源
core/ SQLite、文件存储、密钥加密和请求指纹
ecom-skill/ 内置电商模板目录与执行画像
ecom-suite/ 套图目录、类目分类与内置套图
ecom-suite-forge/ 套图工坊技能、系统提示与反推工作流
jobs/ Redis、BullMQ 和事件总线
providers/ OpenAI-compatible / Gemini / 分割 Provider 适配器
docs/ 产品设计和原型材料
openapi.yaml API 契约(生成视图)
packages/contracts/src 中对应 TypeBox schema,然后运行 pnpm gen:openapi 和 pnpm --filter @ecomgen/web gen:api;openapi.yaml、openapi/schemas.generated.yaml 与 Web 类型文件均为生成物。promptInstruction 是可编辑的最终 Prompt。ecom-skill 模板校验;未知模板 ID、缺少 PRODUCT_TRUTH 或 Provider 能力不足时必须显式失败。manifest.json 或提交记录。更完整的运行时不变量和扩展规则见 ARCHITECTURE.md。Pi Agent 的工具边界见 packages/agent/README.md,Worker 执行语义见 apps/worker/README.md,套图工坊的上游来源见 packages/ecom-suite-forge/UPSTREAM.md。
感谢 Pi 提供 Agent 能力,以及 liangdabiao/ecom-details-image 提供电商图片模板与视觉规范。
同时感谢 LINUX DO 社区和各位佬友在开发过程中的支持与反馈。
上游模板已固定版本并内置于 packages/ecom-skill,来源和改造边界见 packages/ecom-skill/UPSTREAM.md。