{"id":"2dbce3cb-b7b1-4c50-ac50-36d04551a7a2","entityType":"agent","slug":"clawhub-luis1213899-psd-batch-export","name":"PSD Batch Export","canonicalUrl":"https://www.xpersona.co/agent/clawhub-luis1213899-psd-batch-export","canonicalPath":"/agent/clawhub-luis1213899-psd-batch-export","generatedAt":"2026-10-11T14:13:15.307Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":null},"description":"Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... Skill: PSD Batch Export Owner: luis1213899 Summary: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... Tags: ai:4.1.0, ai-design:3.2.0, analysis:3.2.0, batch:4.3.0, cached-bg:2.3.0, chinese:3.2.0, color:4.2.0, coupon:4.2.0, design:4.3.0, export:2.5.1, font-library:2.5.1, font-matching:2.5.0, invite:4.3.0, late","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s17dx8tkck6b2b3d3capmeyfmx84mj9a:psd-batch-export","sourceUrl":"https://clawhub.ai/luis1213899/psd-batch-export","homepage":"https://clawhub.ai/luis1213899/skills/psd-batch-export","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/luis1213899/psd-batch-export","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/luis1213899/skills/psd-batch-export","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":null},"stars":null,"forks":null,"downloads":1081,"packageName":null,"latestVersion":"4.4.2","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T11:05:03.465Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T11:05:03.533Z","lastCrawledAt":"2026-10-11T11:05:03.465Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T11:05:03.465Z","lastVerifiedAt":null,"highlights":[{"version":"4.4.2","createdAt":"2026-06-06T05:51:38.783Z","changelog":"v4.4.2: fix PSD text color inheritance by correctly parsing Photoshop text layer RGB values; default exports keep each PSD layer color and --color remains an explicit override.","fileCount":27,"zipByteSize":61445},{"version":"4.4.1","createdAt":"2026-06-06T05:39:05.626Z","changelog":"v4.4.1: default replacement text color to black for preview/export/verify while keeping --color override support.","fileCount":27,"zipByteSize":60994},{"version":"4.4.0","createdAt":"2026-06-06T05:27:40.469Z","changelog":"v4.4.0: add unified production CLI with diagnose/analyze/preview/export/verify/templates, structured JSON reports, strict mode, template catalog, tests, and Claude/Codex/OpenClaw compatibility.","fileCount":27,"zipByteSize":60667},{"version":"4.3.1","createdAt":"2026-06-04T18:08:39.156Z","changelog":"Fix Windows CLI Unicode output, align skill documentation with the 3-template workbench, add MIT license, and remove unused click dependency.","fileCount":19,"zipByteSize":55585},{"version":"4.3.0","createdAt":"2026-05-31T10:04:38.586Z","changelog":"v4.3: 重构模板系统 — 3款官方PSD模板(早安日签/科技邀请函/涂鸦招聘) + template_loader注册器 + ai_designer精简为模板工作台；移除合成模板代码(-730行)","fileCount":17,"zipByteSize":53911},{"version":"4.2.0","createdAt":"2026-05-31T09:45:36.714Z","changelog":"v4.2: 新增5种模板 — poster(海报)/nameplate(桌牌)/coupon(优惠券)/member_card(会员卡)/label(价签)；模板总数达到10种","fileCount":16,"zipByteSize":56531},{"version":"4.1.0","createdAt":"2026-05-31T09:40:41.768Z","changelog":"v4.1: 接入大模型 — design_llm.py 支持 OpenAI/Claude/兼容API 生成配色/布局/文案/设计评价；ai_designer.py 新增 --ai/--prompt/--evaluate 参数","fileCount":16,"zipByteSize":54665},{"version":"4.0.0","createdAt":"2026-05-31T09:34:15.880Z","changelog":"v4.0: 重大升级 — 新增 ai_designer(5类模板设计+8套配色)、color_tools(配色推荐/提取/对比度)、smart_layout(自适应排版)、psd_style_editor(样式编辑)；覆盖分析→修改→设计→配色→排版→验证全链路","fileCount":15,"zipByteSize":49429}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dx8tkck6b2b3d3capmeyfmx84mj9a:psd-batch-export","setupComplexity":"low","setupSteps":["Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T14:13:15.303Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-luis1213899-psd-batch-export/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":null},"readme":"Skill: PSD Batch Export\n\nOwner: luis1213899\n\nSummary: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,...\n\nTags: ai:4.1.0, ai-design:3.2.0, analysis:3.2.0, batch:4.3.0, cached-bg:2.3.0, chinese:3.2.0, color:4.2.0, coupon:4.2.0, design:4.3.0, export:2.5.1, font-library:2.5.1, font-matching:2.5.0, invite:4.3.0, latest:4.4.2, layer:4.2.0, layout:4.2.0, llm:4.3.0, member:4.2.0, modify:3.2.0, morning:4.3.0, ocr:4.3.0, poster:4.2.0, psd:4.3.0, recruit:4.3.0, style-detection:2.5.0, template:4.3.0, universal:2.5.1\n\nVersion history:\n\nv4.4.2 | 2026-06-06T05:51:38.783Z | user\n\nv4.4.2: fix PSD text color inheritance by correctly parsing Photoshop text layer RGB values; default exports keep each PSD layer color and --color remains an explicit override.\n\nv4.4.1 | 2026-06-06T05:39:05.626Z | user\n\nv4.4.1: default replacement text color to black for preview/export/verify while keeping --color override support.\n\nv4.4.0 | 2026-06-06T05:27:40.469Z | user\n\nv4.4.0: add unified production CLI with diagnose/analyze/preview/export/verify/templates, structured JSON reports, strict mode, template catalog, tests, and Claude/Codex/OpenClaw compatibility.\n\nv4.3.1 | 2026-06-04T18:08:39.156Z | user\n\nFix Windows CLI Unicode output, align skill documentation with the 3-template workbench, add MIT license, and remove unused click dependency.\n\nv4.3.0 | 2026-05-31T10:04:38.586Z | user\n\nv4.3: 重构模板系统 — 3款官方PSD模板(早安日签/科技邀请函/涂鸦招聘) + template_loader注册器 + ai_designer精简为模板工作台；移除合成模板代码(-730行)\n\nv4.2.0 | 2026-05-31T09:45:36.714Z | user\n\nv4.2: 新增5种模板 — poster(海报)/nameplate(桌牌)/coupon(优惠券)/member_card(会员卡)/label(价签)；模板总数达到10种\n\nv4.1.0 | 2026-05-31T09:40:41.768Z | user\n\nv4.1: 接入大模型 — design_llm.py 支持 OpenAI/Claude/兼容API 生成配色/布局/文案/设计评价；ai_designer.py 新增 --ai/--prompt/--evaluate 参数\n\nv4.0.0 | 2026-05-31T09:34:15.880Z | user\n\nv4.0: 重大升级 — 新增 ai_designer(5类模板设计+8套配色)、color_tools(配色推荐/提取/对比度)、smart_layout(自适应排版)、psd_style_editor(样式编辑)；覆盖分析→修改→设计→配色→排版→验证全链路\n\nv3.2.0 | 2026-05-31T09:26:27.584Z | user\n\nv3.2: 重新定位为PSD图层级智能引擎；新增核心能力地图、5类场景矩阵(分析/修改/批量/AI制图/混合)、AI智能制图工作流；README同步更新\n\nv3.1.1 | 2026-05-31T09:21:28.566Z | user\n\nfix: 路径改为相对路径，去除硬编码；README 版本号更新\n\nv3.1.0 | 2026-05-31T09:18:18.140Z | user\n\nv3.1: per-layer OCR, fuzzy scoring, pixel diff, CLI params\n\nv2.5.2 | 2026-05-26T18:33:00.860Z | user\n\nv2.5.2: Removed all hardcoded paths. Scripts use relative paths (__file__). SKILL.md uses ClawHub install + generic instructions.\n\nv2.5.1 | 2026-05-26T18:23:04.851Z | user\n\nv2.5.1: Added Baidu Pan font collection link. One-click font library setup. Updated README with direct download link.\n\nv2.5.0 | 2026-05-26T18:12:47.406Z | user\n\nv2.5: Built-in font library. fonts/ directory auto-scanned. download_fonts.py auto-downloader for open-source Chinese fonts. README with recommended fonts and links.\n\nv2.4.0 | 2026-05-26T18:08:22.042Z | user\n\nv2.4: Smart font matching engine. 3-tier match (exact/family/similar) with visual indicator. Shows which system font matches PSD font and confidence level. Clear 'NOT FOUND - use --font' guidance.\n\nv2.3.0 | 2026-05-26T18:05:33.062Z | user\n\nv2.3: Background pre-rendering cache for major perf boost. Cross-platform font discovery (Win/Mac/Linux). Streamlined batch flow with cached composite.\n\nv2.2.0 | 2026-05-26T17:57:43.133Z | user\n\nv2.2: Precise font/style detection. Reads FontSize (exact pt), FontFamily, FillColor, StrokeColor, Position from PSD engine dict. --show-styles flag. Integrated style preview in batch_from_excel dry-run.\n\nv2.1.0 | 2026-05-26T17:52:05.678Z | user\n\nv2.1: Smart column matching with confidence levels + warnings. Text capacity preview (max ASCII/CJK chars). --dry-run preview mode. Auto font discovery. Progress bar with percentage.\n\nv2.0.0 | 2026-05-26T17:40:18.243Z | user\n\nv2.0: Universal batch export. Any PSD + any Excel -> batch PNG. Auto column matching, auto font/color/size detection, unified batch_from_excel.py one-click workflow.\n\nv1.0.0 | 2026-05-26T17:30:10.738Z | user\n\nRenamed from psd-ticket-batch. PSD批量修改导出：Excel + PSD -> batch PNG.\n\nArchive index:\n\nArchive v4.4.2: 27 files, 61445 bytes\n\nFiles: agents/openai.yaml (348b), fonts/download_fonts.py (4205b), fonts/README.md (753b), LICENSE (1068b), README.md (3872b), references/runtime-compat.md (1790b), references/templates.json (4107b), requirements-dev.txt (14b), requirements.txt (84b), scripts/ai_designer.py (5245b), scripts/batch_from_excel.py (40790b), scripts/color_tools.py (12447b), scripts/console_utils.py (528b), scripts/design_llm.py (11445b), scripts/psd_batch.py (10141b), scripts/psd_core.py (14532b), scripts/psd_style_editor.py (8296b), scripts/psd_text_editor.py (9441b), scripts/random_check.py (12518b), scripts/render_psd_batch.py (11306b), scripts/smart_layout.py (10851b), scripts/template_loader.py (2481b), skill-card.md (2304b), SKILL.md (4420b), tests/test_cli.py (4754b), tests/test_text_editor.py (1547b), _meta.json (135b)\n\nFile v4.4.2:SKILL.md\n\n---\nname: psd-batch-export\ndescription: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches, validating results, checking fonts/OCR dependencies, and using built-in PSD templates for tickets, certificates, invitations, badges, posters, daily cards, and recruitment assets. Use whenever the user mentions PSD, Photoshop templates, layer text replacement, batch image generation, Excel-driven design output, PSD analysis, print-ready PNG export, or OpenClaw/Claude/Codex skill packaging for PSD automation.\nallowed-tools: [Read, Write, Edit, Bash]\n---\n\n# PSD Batch Export Skill\n\nUse this skill for production PSD batch generation. Resolve all paths relative to the directory containing this `SKILL.md`; do not rely on machine-specific absolute paths.\n\n## Preferred Entry Point\n\nUse the unified CLI first:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3\npython scripts/psd_batch.py verify \"out\" --samples 3\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\n```\n\nBuilt-in template IDs can be used instead of PSD paths: `morning`, `tech`, `doodle`.\n\n## Workflow\n\n1. Run `diagnose --json` before production work to check required Python packages, fonts, templates, optional OCR, and optional LLM configuration.\n2. Run `analyze` with the PSD and optional Excel/CSV data source. Review `layers`, `mapping`, `capacity_risks`, `fonts`, `warnings`, and `errors`.\n3. Run `preview` before full export. Check `out/dryrun_preview/` and the JSON report.\n4. Run `export` to generate `out/psd/`, `out/png/`, and `out/verify_report/report.json`. Replacement text keeps the original PSD text-layer color; pass `--color R G B` only when the user explicitly requests a uniform override.\n5. Run `verify` again when outputs are moved or inspected separately.\n\nUse `--strict` for production batches where low-confidence column matches, capacity overflow, or missing fonts should stop the run before export.\n\n## Stable Report Contract\n\nAll primary commands support `--json` and `--json-out <path>`. The report includes:\n\n- `status`: `ok` or `error`\n- `inputs`: PSD, data, output, or template inputs\n- `layers`: detected PSD text layer details\n- `mapping`: data-column to layer mapping with confidence\n- `capacity_risks`: text fields likely to truncate\n- `fonts`: available fonts and matching recommendations\n- `outputs`: generated directories, files, and verification report paths\n- `warnings`: non-fatal production risks\n- `errors`: fatal failures\n- `runtime_sec`: elapsed seconds\n\nExit codes are stable: `0` success, `1` input error, `2` dependency/PSD compatibility error, `3` export or verification failure, `4` unexpected error.\n\n## Legacy Entrypoints\n\nOlder scripts are kept for compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\" --dry-run\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/psd_text_editor.py \"in.psd\" \"out.psd\" \"图层名=新文本\"\n```\n\nPrefer `scripts/psd_batch.py` for new workflows because it provides structured reports and stable exit codes.\n\n## References\n\n- `references/templates.json`: built-in PSD template catalog and editable fields.\n- `references/runtime-compat.md`: Claude, Codex, OpenClaw, and ClawHub install/validation commands.\n\n## Verification\n\nRun these before publishing or sharing the skill:\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nFor Codex validation on Windows, run with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'; python C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py .\n```\n\nFor OpenClaw validation, install the local skill and then check visibility:\n\n```powershell\nopenclaw skills install . --global --force\nopenclaw skills check --json\n```\n\nDo not publish to ClawHub unless the user explicitly asks for a release.\n\nFile v4.4.2:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.4.2:README.md\n\n# PSD Batch Export\n\nProduction PSD batch workflow for analyzing Photoshop text layers, mapping Excel/CSV data, generating editable PSD plus PNG batches, and verifying outputs.\n\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.4-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n## Quick Start\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3 --json-out out/report.json\npython scripts/psd_batch.py verify \"out\" --samples 3 --json\n```\n\nBuilt-in templates:\n\n```powershell\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\npython scripts/psd_batch.py export morning --data \"data.xlsx\" --out \"out\"\n```\n\n## What It Does\n\n| Capability | Description |\n| --- | --- |\n| Layer analysis | Detects PSD text layers, text, font family, font size, fill color, bbox, and capacity risk. |\n| Data mapping | Maps Excel/CSV columns to PSD layers with confidence labels and optional `--strict` failure mode. |\n| Preview | Renders the first N rows to `out/dryrun_preview/` before full export. |\n| Batch export | Writes editable PSD files to `out/psd/` and print-ready PNG files to `out/png/`; replacement text keeps each PSD layer color unless `--color` is provided. |\n| Verification | Writes `out/verify_report/report.json` and optional OCR checks when Tesseract is configured. |\n| Template catalog | Reads built-in template metadata from `references/templates.json`. |\n| Runtime compatibility | Designed for Claude/ClawHub, Codex, and OpenClaw with one source folder. |\n\n## Stable CLI\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze <template.psd|template-id> [--data data.xlsx] [--sheet 0] [--json-out report.json]\npython scripts/psd_batch.py preview <template.psd|template-id> --data data.xlsx --out out --rows 3 [--color R G B]\npython scripts/psd_batch.py export <template.psd|template-id> --data data.xlsx --out out [--dpi 300] [--font font.ttf] [--color R G B] [--verify-samples 3] [--strict]\npython scripts/psd_batch.py verify out [--samples 3] [--color R G B] [--ocr]\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info <morning|tech|doodle>\n```\n\nExit codes:\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | Input or argument error |\n| 2 | Missing dependency or incompatible PSD |\n| 3 | Export or verification failure |\n| 4 | Unexpected failure |\n\n## Legacy Scripts\n\nThese remain available for backward compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/render_psd_batch.py \"psd_dir\" \"png_dir\"\n```\n\nUse `scripts/psd_batch.py` for new work because it provides structured JSON reports and stable exit codes.\n\n## Install\n\n```powershell\npip install -r requirements.txt\n```\n\nOptional test dependencies:\n\n```powershell\npip install -r requirements-dev.txt\n```\n\nFonts can be placed in `fonts/`; the renderer also scans system font directories.\n\n```powershell\npython fonts/download_fonts.py --list\n```\n\n## Verification\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nOpenClaw local install:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nClawHub publishing is intentionally manual. See `references/runtime-compat.md`.\n\nFile v4.4.2:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.4.2\",\n  \"publishedAt\": 1780725098783\n}\n\nFile v4.4.2:references/runtime-compat.md\n\n# Runtime Compatibility\n\nUse one source skill folder for Claude/ClawHub, Codex, and OpenClaw. Always resolve scripts relative to the folder that contains `SKILL.md`.\n\n## Claude / Claude Code\n\nInstall by keeping or copying the folder under:\n\n```powershell\n~/.claude/skills/psd-batch-export\n```\n\nRun:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\n```\n\n## Codex\n\nInstall by copying or syncing the same folder under:\n\n```powershell\n~/.codex/skills/psd-batch-export\n```\n\nValidate on Windows with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'\npython C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py C:\\Users\\26240\\.codex\\skills\\psd-batch-export\n```\n\nThe shared `SKILL.md` intentionally avoids Claude-only frontmatter such as `argument-hint` so the same file can pass Codex validation.\n\n## OpenClaw\n\nInstall the local folder into the shared OpenClaw managed skills directory:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nInspect:\n\n```powershell\nopenclaw skills info psd-batch-export\n```\n\n## ClawHub\n\nDo not publish automatically. When a release is requested, use an explicit version and changelog:\n\n```powershell\nclawhub --no-input skill publish \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --slug psd-batch-export --owner luis1213899 --version 4.4.0 --changelog \"v4.4.0: unified production CLI, structured reports, tests, and Claude/Codex/OpenClaw compatibility.\" --clawscan-note \"Local PSD processing skill. Optional network access is limited to user-triggered font downloads or optional LLM calls when API keys are configured.\"\nclawhub inspect psd-batch-export\n```\n\nNever include Git remote URLs or credentials in release notes, reports, or public logs.\n\nFile v4.4.2:references/templates.json\n\n{\n  \"morning\": {\n    \"name\": \"早安手绘风日签\",\n    \"slug\": \"morning_greeting\",\n    \"psd\": \"templates/morning_greeting/早安手绘风日签__2026-05-31+17_54_52.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"早安问候 / 日签打卡 / 励志海报\",\n    \"editable\": [\n      {\"layer\": \"图层14\", \"field\": \"文案1\", \"example\": \"热爱生活\", \"max_len\": 4},\n      {\"layer\": \"图层19\", \"field\": \"文案2\", \"example\": \"勇敢向前\", \"max_len\": 4},\n      {\"layer\": \"图层11\", \"field\": \"问候语1\", \"example\": \"(早安\", \"max_len\": 3},\n      {\"layer\": \"图层12\", \"field\": \"问候语2\", \"example\": \"你好）\", \"max_len\": 3},\n      {\"layer\": \"图层23\", \"field\": \"日期(年)\", \"example\": \"(2026)\", \"max_len\": 6},\n      {\"layer\": \"图层24\", \"field\": \"日期(月日)\", \"example\": \"(06/01)\", \"max_len\": 7},\n      {\"layer\": \"图层3\", \"field\": \"英文装饰1\", \"example\": \"ORNING\", \"max_len\": 6},\n      {\"layer\": \"图层4\", \"field\": \"英文装饰2\", \"example\": \"M\", \"max_len\": 1},\n      {\"layer\": \"图层8\", \"field\": \"英文装饰3\", \"example\": \"G\", \"max_len\": 1},\n      {\"layer\": \"图层9\", \"field\": \"英文装饰4\", \"example\": \"OOD\", \"max_len\": 3}\n    ],\n    \"fonts\": [\"AlexandriaFloral.otf\", \"AlibabaPuHuiTi-2-55-Regular.otf\", \"NanxGanbeiGothic.ttf\"]\n  },\n  \"tech\": {\n    \"name\": \"炫彩风科技邀请函\",\n    \"slug\": \"tech_invite\",\n    \"psd\": \"templates/tech_invite/炫彩风科技邀请函手机海报__2026-05-31+17_55_33.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"科技峰会 / 产品发布 / 行业交流会邀请函\",\n    \"editable\": [\n      {\"layer\": \"图层16\", \"field\": \"活动名称\", \"example\": \"第七届国际高新技术交流会\", \"max_len\": 20},\n      {\"layer\": \"图层3\", \"field\": \"标题\", \"example\": \"邀请函\", \"max_len\": 3},\n      {\"layer\": \"图层5\", \"field\": \"邀请语\", \"example\": \"诚邀各位嘉宾莅临\", \"max_len\": 10},\n      {\"layer\": \"图层7\", \"field\": \"主题标语\", \"example\": \"万物向新  局势而生\", \"max_len\": 14},\n      {\"layer\": \"图层13\", \"field\": \"星期\", \"example\": \"星期六\", \"max_len\": 3},\n      {\"layer\": \"图层11\", \"field\": \"日期\", \"example\": \"05.07\", \"max_len\": 5},\n      {\"layer\": \"图层12\", \"field\": \"时间\", \"example\": \"9:00-16:00\", \"max_len\": 12},\n      {\"layer\": \"图层9\", \"field\": \"地址\", \"example\": \"北京市朝阳区创客路66号\", \"max_len\": 20},\n      {\"layer\": \"图层15\", \"field\": \"英文标题\", \"example\": \"INTERNATIONAL HI-TECH FAIR\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"HuXiaoBo-NanShenTianTuan-2.ttf\", \"MrsSaintDelafield-Regular.ttf\", \"NewYork_4.otf\", \"NotoSansSC-Regular.ttf\", \"SourceHanSansCN-Regular.otf\"]\n  },\n  \"doodle\": {\n    \"name\": \"手绘涂鸦招聘海报\",\n    \"slug\": \"doodle_recruit\",\n    \"psd\": \"templates/doodle_recruit/手绘涂鸦招聘海报__2026-05-31+17_58_18.psd\",\n    \"size\": \"1284x2778 px\",\n    \"scene\": \"创意招聘 / 互联网公司 / 设计师岗位\",\n    \"editable\": [\n      {\"layer\": \"图层25\", \"field\": \"招聘标题\", \"example\": \"我们需要以下职位\", \"max_len\": 10},\n      {\"layer\": \"图层28\", \"field\": \"职位1名称\", \"example\": \"平面设计师\", \"max_len\": 6},\n      {\"layer\": \"图层29\", \"field\": \"职位1要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层30\", \"field\": \"职位2名称\", \"example\": \"UI设计师\", \"max_len\": 5},\n      {\"layer\": \"图层31\", \"field\": \"职位2要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层18\", \"field\": \"吸引标语1\", \"example\": \"钱多事少！\", \"max_len\": 6},\n      {\"layer\": \"图层17\", \"field\": \"吸引标语2\", \"example\": \"人才速来\", \"max_len\": 4},\n      {\"layer\": \"图层34\", \"field\": \"福利待遇\", \"example\": \"工作时间:周末双休，弹性上班时间\", \"max_len\": 30},\n      {\"layer\": \"图层35\", \"field\": \"投递邮箱\", \"example\": \"简历请投递至邮箱chuangkit6688@ckt.com\", \"max_len\": 40},\n      {\"layer\": \"图层36\", \"field\": \"公司地址\", \"example\": \"我们在：北京市朝阳区创客路66号\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"AlibabaPuHuiTi-2-55-Regular.otf\", \"Dream-Han-Serif-CNY.ttf\"]\n  }\n}\n\nFile v4.4.2:skill-card.md\n\n## Description:\n\nPSD Batch Export helps agents analyze Photoshop PSD text layers, map Excel or CSV rows to editable fields, preview changes, export editable PSD and PNG batches, and verify results.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[luis1213899](https://clawhub.ai/user/luis1213899)\n\n### License/Terms of Use:\n\nMIT\n\n## Use Case:\n\nDesign automation users, developers, and content operations teams use this skill to batch-generate PSD and PNG design assets from PSD templates and spreadsheet data while preserving editable text layers.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Optional AI and network helpers can expose API keys or design prompt data.\n\nMitigation: Use LLM features only with explicit provider selection, trusted endpoints, nonsensitive design content, and limited-scope API keys; run offline for sensitive projects.\n\nRisk: Legacy paths can write outside the chosen output folders.\n\nMitigation: Use fresh output directories, inspect preview and verification reports before production export, and avoid untrusted spreadsheet or JSON inputs.\n\nRisk: The skill performs local PSD and image processing and can optionally download fonts.\n\nMitigation: Install dependencies and fonts from trusted sources, run diagnostics before production use, and review generated files before distribution.\n\n## Reference(s):\n\n- [PSD Batch Export ClawHub page](https://clawhub.ai/luis1213899/skills/psd-batch-export)\n- [Template catalog](references/templates.json)\n- [Runtime compatibility](references/runtime-compat.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with inline shell commands and JSON report references.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guides local CLI workflows that create PSD, PNG, and JSON report files under user-selected output directories.]\n\n## Skill Version(s):\n\n4.4.2 (source: ClawHub release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v4.4.2:agents/openai.yaml\n\ninterface:\n  display_name: \"PSD Batch Export\"\n  short_description: \"Analyze PSD layers and generate verified PSD/PNG batches from data\"\n  default_prompt: \"Analyze this PSD template, map the data source to editable text layers, preview the first rows, export editable PSD and print-ready PNG files, and verify the outputs with a structured report.\"\n\nFile v4.4.2:LICENSE\n\nMIT License\n\nCopyright (c) 2026 luis1213899\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v4.4.2:requirements-dev.txt\n\npytest>=8.0.0\n\nFile v4.4.2:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\npytesseract>=0.3.10\n\nArchive v4.4.1: 27 files, 60994 bytes\n\nFiles: agents/openai.yaml (348b), fonts/download_fonts.py (4205b), fonts/README.md (753b), LICENSE (1068b), README.md (3863b), references/runtime-compat.md (1790b), references/templates.json (4107b), requirements-dev.txt (14b), requirements.txt (84b), scripts/ai_designer.py (5245b), scripts/batch_from_excel.py (40808b), scripts/color_tools.py (12447b), scripts/console_utils.py (528b), scripts/design_llm.py (11445b), scripts/psd_batch.py (10093b), scripts/psd_core.py (14519b), scripts/psd_style_editor.py (8296b), scripts/psd_text_editor.py (9441b), scripts/random_check.py (12518b), scripts/render_psd_batch.py (10583b), scripts/smart_layout.py (10851b), scripts/template_loader.py (2481b), skill-card.md (2848b), SKILL.md (4392b), tests/test_cli.py (3829b), tests/test_text_editor.py (1547b), _meta.json (135b)\n\nFile v4.4.1:SKILL.md\n\n---\nname: psd-batch-export\ndescription: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches, validating results, checking fonts/OCR dependencies, and using built-in PSD templates for tickets, certificates, invitations, badges, posters, daily cards, and recruitment assets. Use whenever the user mentions PSD, Photoshop templates, layer text replacement, batch image generation, Excel-driven design output, PSD analysis, print-ready PNG export, or OpenClaw/Claude/Codex skill packaging for PSD automation.\nallowed-tools: [Read, Write, Edit, Bash]\n---\n\n# PSD Batch Export Skill\n\nUse this skill for production PSD batch generation. Resolve all paths relative to the directory containing this `SKILL.md`; do not rely on machine-specific absolute paths.\n\n## Preferred Entry Point\n\nUse the unified CLI first:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3\npython scripts/psd_batch.py verify \"out\" --samples 3\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\n```\n\nBuilt-in template IDs can be used instead of PSD paths: `morning`, `tech`, `doodle`.\n\n## Workflow\n\n1. Run `diagnose --json` before production work to check required Python packages, fonts, templates, optional OCR, and optional LLM configuration.\n2. Run `analyze` with the PSD and optional Excel/CSV data source. Review `layers`, `mapping`, `capacity_risks`, `fonts`, `warnings`, and `errors`.\n3. Run `preview` before full export. Check `out/dryrun_preview/` and the JSON report.\n4. Run `export` to generate `out/psd/`, `out/png/`, and `out/verify_report/report.json`. Replacement text defaults to black (`0 0 0`); pass `--color R G B` only when the user requests another color.\n5. Run `verify` again when outputs are moved or inspected separately.\n\nUse `--strict` for production batches where low-confidence column matches, capacity overflow, or missing fonts should stop the run before export.\n\n## Stable Report Contract\n\nAll primary commands support `--json` and `--json-out <path>`. The report includes:\n\n- `status`: `ok` or `error`\n- `inputs`: PSD, data, output, or template inputs\n- `layers`: detected PSD text layer details\n- `mapping`: data-column to layer mapping with confidence\n- `capacity_risks`: text fields likely to truncate\n- `fonts`: available fonts and matching recommendations\n- `outputs`: generated directories, files, and verification report paths\n- `warnings`: non-fatal production risks\n- `errors`: fatal failures\n- `runtime_sec`: elapsed seconds\n\nExit codes are stable: `0` success, `1` input error, `2` dependency/PSD compatibility error, `3` export or verification failure, `4` unexpected error.\n\n## Legacy Entrypoints\n\nOlder scripts are kept for compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\" --dry-run\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/psd_text_editor.py \"in.psd\" \"out.psd\" \"图层名=新文本\"\n```\n\nPrefer `scripts/psd_batch.py` for new workflows because it provides structured reports and stable exit codes.\n\n## References\n\n- `references/templates.json`: built-in PSD template catalog and editable fields.\n- `references/runtime-compat.md`: Claude, Codex, OpenClaw, and ClawHub install/validation commands.\n\n## Verification\n\nRun these before publishing or sharing the skill:\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nFor Codex validation on Windows, run with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'; python C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py .\n```\n\nFor OpenClaw validation, install the local skill and then check visibility:\n\n```powershell\nopenclaw skills install . --global --force\nopenclaw skills check --json\n```\n\nDo not publish to ClawHub unless the user explicitly asks for a release.\n\nFile v4.4.1:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.4.1:README.md\n\n# PSD Batch Export\n\nProduction PSD batch workflow for analyzing Photoshop text layers, mapping Excel/CSV data, generating editable PSD plus PNG batches, and verifying outputs.\n\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.4-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n## Quick Start\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3 --json-out out/report.json\npython scripts/psd_batch.py verify \"out\" --samples 3 --json\n```\n\nBuilt-in templates:\n\n```powershell\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\npython scripts/psd_batch.py export morning --data \"data.xlsx\" --out \"out\"\n```\n\n## What It Does\n\n| Capability | Description |\n| --- | --- |\n| Layer analysis | Detects PSD text layers, text, font family, font size, fill color, bbox, and capacity risk. |\n| Data mapping | Maps Excel/CSV columns to PSD layers with confidence labels and optional `--strict` failure mode. |\n| Preview | Renders the first N rows to `out/dryrun_preview/` before full export. |\n| Batch export | Writes editable PSD files to `out/psd/` and print-ready PNG files to `out/png/`; replacement text defaults to black unless `--color` is provided. |\n| Verification | Writes `out/verify_report/report.json` and optional OCR checks when Tesseract is configured. |\n| Template catalog | Reads built-in template metadata from `references/templates.json`. |\n| Runtime compatibility | Designed for Claude/ClawHub, Codex, and OpenClaw with one source folder. |\n\n## Stable CLI\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze <template.psd|template-id> [--data data.xlsx] [--sheet 0] [--json-out report.json]\npython scripts/psd_batch.py preview <template.psd|template-id> --data data.xlsx --out out --rows 3 [--color 0 0 0]\npython scripts/psd_batch.py export <template.psd|template-id> --data data.xlsx --out out [--dpi 300] [--font font.ttf] [--color 0 0 0] [--verify-samples 3] [--strict]\npython scripts/psd_batch.py verify out [--samples 3] [--color 0 0 0] [--ocr]\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info <morning|tech|doodle>\n```\n\nExit codes:\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | Input or argument error |\n| 2 | Missing dependency or incompatible PSD |\n| 3 | Export or verification failure |\n| 4 | Unexpected failure |\n\n## Legacy Scripts\n\nThese remain available for backward compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/render_psd_batch.py \"psd_dir\" \"png_dir\"\n```\n\nUse `scripts/psd_batch.py` for new work because it provides structured JSON reports and stable exit codes.\n\n## Install\n\n```powershell\npip install -r requirements.txt\n```\n\nOptional test dependencies:\n\n```powershell\npip install -r requirements-dev.txt\n```\n\nFonts can be placed in `fonts/`; the renderer also scans system font directories.\n\n```powershell\npython fonts/download_fonts.py --list\n```\n\n## Verification\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nOpenClaw local install:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nClawHub publishing is intentionally manual. See `references/runtime-compat.md`.\n\nFile v4.4.1:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.4.1\",\n  \"publishedAt\": 1780724345626\n}\n\nFile v4.4.1:references/runtime-compat.md\n\n# Runtime Compatibility\n\nUse one source skill folder for Claude/ClawHub, Codex, and OpenClaw. Always resolve scripts relative to the folder that contains `SKILL.md`.\n\n## Claude / Claude Code\n\nInstall by keeping or copying the folder under:\n\n```powershell\n~/.claude/skills/psd-batch-export\n```\n\nRun:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\n```\n\n## Codex\n\nInstall by copying or syncing the same folder under:\n\n```powershell\n~/.codex/skills/psd-batch-export\n```\n\nValidate on Windows with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'\npython C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py C:\\Users\\26240\\.codex\\skills\\psd-batch-export\n```\n\nThe shared `SKILL.md` intentionally avoids Claude-only frontmatter such as `argument-hint` so the same file can pass Codex validation.\n\n## OpenClaw\n\nInstall the local folder into the shared OpenClaw managed skills directory:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nInspect:\n\n```powershell\nopenclaw skills info psd-batch-export\n```\n\n## ClawHub\n\nDo not publish automatically. When a release is requested, use an explicit version and changelog:\n\n```powershell\nclawhub --no-input skill publish \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --slug psd-batch-export --owner luis1213899 --version 4.4.0 --changelog \"v4.4.0: unified production CLI, structured reports, tests, and Claude/Codex/OpenClaw compatibility.\" --clawscan-note \"Local PSD processing skill. Optional network access is limited to user-triggered font downloads or optional LLM calls when API keys are configured.\"\nclawhub inspect psd-batch-export\n```\n\nNever include Git remote URLs or credentials in release notes, reports, or public logs.\n\nFile v4.4.1:references/templates.json\n\n{\n  \"morning\": {\n    \"name\": \"早安手绘风日签\",\n    \"slug\": \"morning_greeting\",\n    \"psd\": \"templates/morning_greeting/早安手绘风日签__2026-05-31+17_54_52.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"早安问候 / 日签打卡 / 励志海报\",\n    \"editable\": [\n      {\"layer\": \"图层14\", \"field\": \"文案1\", \"example\": \"热爱生活\", \"max_len\": 4},\n      {\"layer\": \"图层19\", \"field\": \"文案2\", \"example\": \"勇敢向前\", \"max_len\": 4},\n      {\"layer\": \"图层11\", \"field\": \"问候语1\", \"example\": \"(早安\", \"max_len\": 3},\n      {\"layer\": \"图层12\", \"field\": \"问候语2\", \"example\": \"你好）\", \"max_len\": 3},\n      {\"layer\": \"图层23\", \"field\": \"日期(年)\", \"example\": \"(2026)\", \"max_len\": 6},\n      {\"layer\": \"图层24\", \"field\": \"日期(月日)\", \"example\": \"(06/01)\", \"max_len\": 7},\n      {\"layer\": \"图层3\", \"field\": \"英文装饰1\", \"example\": \"ORNING\", \"max_len\": 6},\n      {\"layer\": \"图层4\", \"field\": \"英文装饰2\", \"example\": \"M\", \"max_len\": 1},\n      {\"layer\": \"图层8\", \"field\": \"英文装饰3\", \"example\": \"G\", \"max_len\": 1},\n      {\"layer\": \"图层9\", \"field\": \"英文装饰4\", \"example\": \"OOD\", \"max_len\": 3}\n    ],\n    \"fonts\": [\"AlexandriaFloral.otf\", \"AlibabaPuHuiTi-2-55-Regular.otf\", \"NanxGanbeiGothic.ttf\"]\n  },\n  \"tech\": {\n    \"name\": \"炫彩风科技邀请函\",\n    \"slug\": \"tech_invite\",\n    \"psd\": \"templates/tech_invite/炫彩风科技邀请函手机海报__2026-05-31+17_55_33.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"科技峰会 / 产品发布 / 行业交流会邀请函\",\n    \"editable\": [\n      {\"layer\": \"图层16\", \"field\": \"活动名称\", \"example\": \"第七届国际高新技术交流会\", \"max_len\": 20},\n      {\"layer\": \"图层3\", \"field\": \"标题\", \"example\": \"邀请函\", \"max_len\": 3},\n      {\"layer\": \"图层5\", \"field\": \"邀请语\", \"example\": \"诚邀各位嘉宾莅临\", \"max_len\": 10},\n      {\"layer\": \"图层7\", \"field\": \"主题标语\", \"example\": \"万物向新  局势而生\", \"max_len\": 14},\n      {\"layer\": \"图层13\", \"field\": \"星期\", \"example\": \"星期六\", \"max_len\": 3},\n      {\"layer\": \"图层11\", \"field\": \"日期\", \"example\": \"05.07\", \"max_len\": 5},\n      {\"layer\": \"图层12\", \"field\": \"时间\", \"example\": \"9:00-16:00\", \"max_len\": 12},\n      {\"layer\": \"图层9\", \"field\": \"地址\", \"example\": \"北京市朝阳区创客路66号\", \"max_len\": 20},\n      {\"layer\": \"图层15\", \"field\": \"英文标题\", \"example\": \"INTERNATIONAL HI-TECH FAIR\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"HuXiaoBo-NanShenTianTuan-2.ttf\", \"MrsSaintDelafield-Regular.ttf\", \"NewYork_4.otf\", \"NotoSansSC-Regular.ttf\", \"SourceHanSansCN-Regular.otf\"]\n  },\n  \"doodle\": {\n    \"name\": \"手绘涂鸦招聘海报\",\n    \"slug\": \"doodle_recruit\",\n    \"psd\": \"templates/doodle_recruit/手绘涂鸦招聘海报__2026-05-31+17_58_18.psd\",\n    \"size\": \"1284x2778 px\",\n    \"scene\": \"创意招聘 / 互联网公司 / 设计师岗位\",\n    \"editable\": [\n      {\"layer\": \"图层25\", \"field\": \"招聘标题\", \"example\": \"我们需要以下职位\", \"max_len\": 10},\n      {\"layer\": \"图层28\", \"field\": \"职位1名称\", \"example\": \"平面设计师\", \"max_len\": 6},\n      {\"layer\": \"图层29\", \"field\": \"职位1要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层30\", \"field\": \"职位2名称\", \"example\": \"UI设计师\", \"max_len\": 5},\n      {\"layer\": \"图层31\", \"field\": \"职位2要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层18\", \"field\": \"吸引标语1\", \"example\": \"钱多事少！\", \"max_len\": 6},\n      {\"layer\": \"图层17\", \"field\": \"吸引标语2\", \"example\": \"人才速来\", \"max_len\": 4},\n      {\"layer\": \"图层34\", \"field\": \"福利待遇\", \"example\": \"工作时间:周末双休，弹性上班时间\", \"max_len\": 30},\n      {\"layer\": \"图层35\", \"field\": \"投递邮箱\", \"example\": \"简历请投递至邮箱chuangkit6688@ckt.com\", \"max_len\": 40},\n      {\"layer\": \"图层36\", \"field\": \"公司地址\", \"example\": \"我们在：北京市朝阳区创客路66号\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"AlibabaPuHuiTi-2-55-Regular.otf\", \"Dream-Han-Serif-CNY.ttf\"]\n  }\n}\n\nFile v4.4.1:skill-card.md\n\n## Description: <br>\nProduction PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches, validating results, checking fonts/OCR dependencies, and using built-in PSD templates for tickets, certificates, invitations, badges, posters, daily cards, and recruitment assets. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDesigners, operations teams, and developers use this skill to turn Photoshop templates and spreadsheet rows into previewed, editable PSD files and print-ready PNG batches with structured verification reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Batch export writes PSD, PNG, preview, and verification files to local output paths. <br>\nMitigation: Review output paths before export and use preview mode before running a full batch. <br>\nRisk: Low-confidence layer mappings, capacity overflow, or missing fonts can create incorrect production assets. <br>\nMitigation: Use strict mode for production batches and review preview outputs and verification reports before sharing generated files. <br>\nRisk: Optional AI mode or custom LLM endpoints may send design context to configured providers. <br>\nMitigation: Avoid AI mode or custom LLM endpoints for confidential event, customer, or organization data unless the provider is trusted. <br>\nRisk: The font downloader can retrieve font files from listed external sources into the skill fonts directory. <br>\nMitigation: Run the font downloader only after confirming the listed sources and font license terms are acceptable. <br>\n\n\n## Reference(s): <br>\n- [ClawHub release page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [README](README.md) <br>\n- [Runtime Compatibility](references/runtime-compat.md) <br>\n- [Built-in Template Catalog](references/templates.json) <br>\n- [Fonts README](fonts/README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with shell commands and JSON report paths] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [The workflow can produce local PSD, PNG, preview, and verification report files when the agent executes the referenced CLI commands.] <br>\n\n## Skill Version(s): <br>\n4.4.1 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.4.1:agents/openai.yaml\n\ninterface:\n  display_name: \"PSD Batch Export\"\n  short_description: \"Analyze PSD layers and generate verified PSD/PNG batches from data\"\n  default_prompt: \"Analyze this PSD template, map the data source to editable text layers, preview the first rows, export editable PSD and print-ready PNG files, and verify the outputs with a structured report.\"\n\nFile v4.4.1:LICENSE\n\nMIT License\n\nCopyright (c) 2026 luis1213899\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v4.4.1:requirements-dev.txt\n\npytest>=8.0.0\n\nFile v4.4.1:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\npytesseract>=0.3.10\n\nArchive v4.4.0: 27 files, 60667 bytes\n\nFiles: agents/openai.yaml (348b), fonts/download_fonts.py (4205b), fonts/README.md (753b), LICENSE (1068b), README.md (3750b), references/runtime-compat.md (1790b), references/templates.json (4107b), requirements-dev.txt (14b), requirements.txt (84b), scripts/ai_designer.py (5245b), scripts/batch_from_excel.py (40707b), scripts/color_tools.py (12447b), scripts/console_utils.py (528b), scripts/design_llm.py (11445b), scripts/psd_batch.py (9855b), scripts/psd_core.py (14013b), scripts/psd_style_editor.py (8296b), scripts/psd_text_editor.py (9441b), scripts/random_check.py (12518b), scripts/render_psd_batch.py (10583b), scripts/smart_layout.py (10851b), scripts/template_loader.py (2481b), skill-card.md (2678b), SKILL.md (4282b), tests/test_cli.py (3715b), tests/test_text_editor.py (1547b), _meta.json (135b)\n\nFile v4.4.0:SKILL.md\n\n---\nname: psd-batch-export\ndescription: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches, validating results, checking fonts/OCR dependencies, and using built-in PSD templates for tickets, certificates, invitations, badges, posters, daily cards, and recruitment assets. Use whenever the user mentions PSD, Photoshop templates, layer text replacement, batch image generation, Excel-driven design output, PSD analysis, print-ready PNG export, or OpenClaw/Claude/Codex skill packaging for PSD automation.\nallowed-tools: [Read, Write, Edit, Bash]\n---\n\n# PSD Batch Export Skill\n\nUse this skill for production PSD batch generation. Resolve all paths relative to the directory containing this `SKILL.md`; do not rely on machine-specific absolute paths.\n\n## Preferred Entry Point\n\nUse the unified CLI first:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3\npython scripts/psd_batch.py verify \"out\" --samples 3\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\n```\n\nBuilt-in template IDs can be used instead of PSD paths: `morning`, `tech`, `doodle`.\n\n## Workflow\n\n1. Run `diagnose --json` before production work to check required Python packages, fonts, templates, optional OCR, and optional LLM configuration.\n2. Run `analyze` with the PSD and optional Excel/CSV data source. Review `layers`, `mapping`, `capacity_risks`, `fonts`, `warnings`, and `errors`.\n3. Run `preview` before full export. Check `out/dryrun_preview/` and the JSON report.\n4. Run `export` to generate `out/psd/`, `out/png/`, and `out/verify_report/report.json`.\n5. Run `verify` again when outputs are moved or inspected separately.\n\nUse `--strict` for production batches where low-confidence column matches, capacity overflow, or missing fonts should stop the run before export.\n\n## Stable Report Contract\n\nAll primary commands support `--json` and `--json-out <path>`. The report includes:\n\n- `status`: `ok` or `error`\n- `inputs`: PSD, data, output, or template inputs\n- `layers`: detected PSD text layer details\n- `mapping`: data-column to layer mapping with confidence\n- `capacity_risks`: text fields likely to truncate\n- `fonts`: available fonts and matching recommendations\n- `outputs`: generated directories, files, and verification report paths\n- `warnings`: non-fatal production risks\n- `errors`: fatal failures\n- `runtime_sec`: elapsed seconds\n\nExit codes are stable: `0` success, `1` input error, `2` dependency/PSD compatibility error, `3` export or verification failure, `4` unexpected error.\n\n## Legacy Entrypoints\n\nOlder scripts are kept for compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\" --dry-run\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/psd_text_editor.py \"in.psd\" \"out.psd\" \"图层名=新文本\"\n```\n\nPrefer `scripts/psd_batch.py` for new workflows because it provides structured reports and stable exit codes.\n\n## References\n\n- `references/templates.json`: built-in PSD template catalog and editable fields.\n- `references/runtime-compat.md`: Claude, Codex, OpenClaw, and ClawHub install/validation commands.\n\n## Verification\n\nRun these before publishing or sharing the skill:\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nFor Codex validation on Windows, run with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'; python C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py .\n```\n\nFor OpenClaw validation, install the local skill and then check visibility:\n\n```powershell\nopenclaw skills install . --global --force\nopenclaw skills check --json\n```\n\nDo not publish to ClawHub unless the user explicitly asks for a release.\n\nFile v4.4.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.4.0:README.md\n\n# PSD Batch Export\n\nProduction PSD batch workflow for analyzing Photoshop text layers, mapping Excel/CSV data, generating editable PSD plus PNG batches, and verifying outputs.\n\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.4-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n## Quick Start\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3 --json-out out/report.json\npython scripts/psd_batch.py verify \"out\" --samples 3 --json\n```\n\nBuilt-in templates:\n\n```powershell\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\npython scripts/psd_batch.py export morning --data \"data.xlsx\" --out \"out\"\n```\n\n## What It Does\n\n| Capability | Description |\n| --- | --- |\n| Layer analysis | Detects PSD text layers, text, font family, font size, fill color, bbox, and capacity risk. |\n| Data mapping | Maps Excel/CSV columns to PSD layers with confidence labels and optional `--strict` failure mode. |\n| Preview | Renders the first N rows to `out/dryrun_preview/` before full export. |\n| Batch export | Writes editable PSD files to `out/psd/` and print-ready PNG files to `out/png/`. |\n| Verification | Writes `out/verify_report/report.json` and optional OCR checks when Tesseract is configured. |\n| Template catalog | Reads built-in template metadata from `references/templates.json`. |\n| Runtime compatibility | Designed for Claude/ClawHub, Codex, and OpenClaw with one source folder. |\n\n## Stable CLI\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze <template.psd|template-id> [--data data.xlsx] [--sheet 0] [--json-out report.json]\npython scripts/psd_batch.py preview <template.psd|template-id> --data data.xlsx --out out --rows 3\npython scripts/psd_batch.py export <template.psd|template-id> --data data.xlsx --out out [--dpi 300] [--font font.ttf] [--verify-samples 3] [--strict]\npython scripts/psd_batch.py verify out [--samples 3] [--ocr]\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info <morning|tech|doodle>\n```\n\nExit codes:\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | Input or argument error |\n| 2 | Missing dependency or incompatible PSD |\n| 3 | Export or verification failure |\n| 4 | Unexpected failure |\n\n## Legacy Scripts\n\nThese remain available for backward compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/render_psd_batch.py \"psd_dir\" \"png_dir\"\n```\n\nUse `scripts/psd_batch.py` for new work because it provides structured JSON reports and stable exit codes.\n\n## Install\n\n```powershell\npip install -r requirements.txt\n```\n\nOptional test dependencies:\n\n```powershell\npip install -r requirements-dev.txt\n```\n\nFonts can be placed in `fonts/`; the renderer also scans system font directories.\n\n```powershell\npython fonts/download_fonts.py --list\n```\n\n## Verification\n\n```powershell\npython -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json\n```\n\nOpenClaw local install:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nClawHub publishing is intentionally manual. See `references/runtime-compat.md`.\n\nFile v4.4.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.4.0\",\n  \"publishedAt\": 1780723660469\n}\n\nFile v4.4.0:references/runtime-compat.md\n\n# Runtime Compatibility\n\nUse one source skill folder for Claude/ClawHub, Codex, and OpenClaw. Always resolve scripts relative to the folder that contains `SKILL.md`.\n\n## Claude / Claude Code\n\nInstall by keeping or copying the folder under:\n\n```powershell\n~/.claude/skills/psd-batch-export\n```\n\nRun:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\n```\n\n## Codex\n\nInstall by copying or syncing the same folder under:\n\n```powershell\n~/.codex/skills/psd-batch-export\n```\n\nValidate on Windows with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'\npython C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py C:\\Users\\26240\\.codex\\skills\\psd-batch-export\n```\n\nThe shared `SKILL.md` intentionally avoids Claude-only frontmatter such as `argument-hint` so the same file can pass Codex validation.\n\n## OpenClaw\n\nInstall the local folder into the shared OpenClaw managed skills directory:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nInspect:\n\n```powershell\nopenclaw skills info psd-batch-export\n```\n\n## ClawHub\n\nDo not publish automatically. When a release is requested, use an explicit version and changelog:\n\n```powershell\nclawhub --no-input skill publish \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --slug psd-batch-export --owner luis1213899 --version 4.4.0 --changelog \"v4.4.0: unified production CLI, structured reports, tests, and Claude/Codex/OpenClaw compatibility.\" --clawscan-note \"Local PSD processing skill. Optional network access is limited to user-triggered font downloads or optional LLM calls when API keys are configured.\"\nclawhub inspect psd-batch-export\n```\n\nNever include Git remote URLs or credentials in release notes, reports, or public logs.\n\nFile v4.4.0:references/templates.json\n\n{\n  \"morning\": {\n    \"name\": \"早安手绘风日签\",\n    \"slug\": \"morning_greeting\",\n    \"psd\": \"templates/morning_greeting/早安手绘风日签__2026-05-31+17_54_52.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"早安问候 / 日签打卡 / 励志海报\",\n    \"editable\": [\n      {\"layer\": \"图层14\", \"field\": \"文案1\", \"example\": \"热爱生活\", \"max_len\": 4},\n      {\"layer\": \"图层19\", \"field\": \"文案2\", \"example\": \"勇敢向前\", \"max_len\": 4},\n      {\"layer\": \"图层11\", \"field\": \"问候语1\", \"example\": \"(早安\", \"max_len\": 3},\n      {\"layer\": \"图层12\", \"field\": \"问候语2\", \"example\": \"你好）\", \"max_len\": 3},\n      {\"layer\": \"图层23\", \"field\": \"日期(年)\", \"example\": \"(2026)\", \"max_len\": 6},\n      {\"layer\": \"图层24\", \"field\": \"日期(月日)\", \"example\": \"(06/01)\", \"max_len\": 7},\n      {\"layer\": \"图层3\", \"field\": \"英文装饰1\", \"example\": \"ORNING\", \"max_len\": 6},\n      {\"layer\": \"图层4\", \"field\": \"英文装饰2\", \"example\": \"M\", \"max_len\": 1},\n      {\"layer\": \"图层8\", \"field\": \"英文装饰3\", \"example\": \"G\", \"max_len\": 1},\n      {\"layer\": \"图层9\", \"field\": \"英文装饰4\", \"example\": \"OOD\", \"max_len\": 3}\n    ],\n    \"fonts\": [\"AlexandriaFloral.otf\", \"AlibabaPuHuiTi-2-55-Regular.otf\", \"NanxGanbeiGothic.ttf\"]\n  },\n  \"tech\": {\n    \"name\": \"炫彩风科技邀请函\",\n    \"slug\": \"tech_invite\",\n    \"psd\": \"templates/tech_invite/炫彩风科技邀请函手机海报__2026-05-31+17_55_33.psd\",\n    \"size\": \"720x1280 px\",\n    \"scene\": \"科技峰会 / 产品发布 / 行业交流会邀请函\",\n    \"editable\": [\n      {\"layer\": \"图层16\", \"field\": \"活动名称\", \"example\": \"第七届国际高新技术交流会\", \"max_len\": 20},\n      {\"layer\": \"图层3\", \"field\": \"标题\", \"example\": \"邀请函\", \"max_len\": 3},\n      {\"layer\": \"图层5\", \"field\": \"邀请语\", \"example\": \"诚邀各位嘉宾莅临\", \"max_len\": 10},\n      {\"layer\": \"图层7\", \"field\": \"主题标语\", \"example\": \"万物向新  局势而生\", \"max_len\": 14},\n      {\"layer\": \"图层13\", \"field\": \"星期\", \"example\": \"星期六\", \"max_len\": 3},\n      {\"layer\": \"图层11\", \"field\": \"日期\", \"example\": \"05.07\", \"max_len\": 5},\n      {\"layer\": \"图层12\", \"field\": \"时间\", \"example\": \"9:00-16:00\", \"max_len\": 12},\n      {\"layer\": \"图层9\", \"field\": \"地址\", \"example\": \"北京市朝阳区创客路66号\", \"max_len\": 20},\n      {\"layer\": \"图层15\", \"field\": \"英文标题\", \"example\": \"INTERNATIONAL HI-TECH FAIR\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"HuXiaoBo-NanShenTianTuan-2.ttf\", \"MrsSaintDelafield-Regular.ttf\", \"NewYork_4.otf\", \"NotoSansSC-Regular.ttf\", \"SourceHanSansCN-Regular.otf\"]\n  },\n  \"doodle\": {\n    \"name\": \"手绘涂鸦招聘海报\",\n    \"slug\": \"doodle_recruit\",\n    \"psd\": \"templates/doodle_recruit/手绘涂鸦招聘海报__2026-05-31+17_58_18.psd\",\n    \"size\": \"1284x2778 px\",\n    \"scene\": \"创意招聘 / 互联网公司 / 设计师岗位\",\n    \"editable\": [\n      {\"layer\": \"图层25\", \"field\": \"招聘标题\", \"example\": \"我们需要以下职位\", \"max_len\": 10},\n      {\"layer\": \"图层28\", \"field\": \"职位1名称\", \"example\": \"平面设计师\", \"max_len\": 6},\n      {\"layer\": \"图层29\", \"field\": \"职位1要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层30\", \"field\": \"职位2名称\", \"example\": \"UI设计师\", \"max_len\": 5},\n      {\"layer\": \"图层31\", \"field\": \"职位2要求\", \"example\": \"（5年以上带团队经验）\", \"max_len\": 14},\n      {\"layer\": \"图层18\", \"field\": \"吸引标语1\", \"example\": \"钱多事少！\", \"max_len\": 6},\n      {\"layer\": \"图层17\", \"field\": \"吸引标语2\", \"example\": \"人才速来\", \"max_len\": 4},\n      {\"layer\": \"图层34\", \"field\": \"福利待遇\", \"example\": \"工作时间:周末双休，弹性上班时间\", \"max_len\": 30},\n      {\"layer\": \"图层35\", \"field\": \"投递邮箱\", \"example\": \"简历请投递至邮箱chuangkit6688@ckt.com\", \"max_len\": 40},\n      {\"layer\": \"图层36\", \"field\": \"公司地址\", \"example\": \"我们在：北京市朝阳区创客路66号\", \"max_len\": 30}\n    ],\n    \"fonts\": [\"AlibabaPuHuiTi-2-55-Regular.otf\", \"Dream-Han-Serif-CNY.ttf\"]\n  }\n}\n\nFile v4.4.0:skill-card.md\n\n## Description: <br>\nPsd Batch Export helps agents analyze Photoshop text layers, map Excel or CSV data to editable PSD fields, preview batches, export editable PSD and PNG files, and verify generated outputs. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and automation teams use this skill to turn PSD templates and tabular data into repeatable batch design exports with preflight analysis, previews, and verification reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill reads PSD and spreadsheet inputs and writes generated files to user-selected output folders. <br>\nMitigation: Run it only on intended project files and use a fresh output directory for each production batch. <br>\nRisk: Optional font downloads can use external sources, including a shared Baidu bundle documented in the artifact. <br>\nMitigation: Prefer official font sources and review font licenses before using generated assets commercially. <br>\nRisk: Optional LLM helpers may send design briefs, layout context, or copywriting prompts to the configured provider. <br>\nMitigation: Leave LLM credentials unset for private or sensitive design work unless provider processing is acceptable. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [Runtime Compatibility](references/runtime-compat.md) <br>\n- [Template Catalog](references/templates.json) <br>\n- [Font Installation Notes](fonts/README.md) <br>\n- [LXGW WenKai Font Release](https://github.com/lxgw/LxgwWenKai/releases/latest/download/LXGWWenKai-Regular.ttf) <br>\n- [Alibaba Fonts](https://fonts.alibabagroup.com) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Shell commands, Configuration, Guidance, JSON, Files] <br>\n**Output Format:** [Command-line workflow guidance with structured JSON reports and generated PSD, PNG, and verification files] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Supports optional strict-mode preflight checks, optional OCR verification, and optional LLM-assisted design helpers when provider credentials are configured.] <br>\n\n## Skill Version(s): <br>\n4.4.0 (source: ClawHub release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.4.0:agents/openai.yaml\n\ninterface:\n  display_name: \"PSD Batch Export\"\n  short_description: \"Analyze PSD layers and generate verified PSD/PNG batches from data\"\n  default_prompt: \"Analyze this PSD template, map the data source to editable text layers, preview the first rows, export editable PSD and print-ready PNG files, and verify the outputs with a structured report.\"\n\nFile v4.4.0:LICENSE\n\nMIT License\n\nCopyright (c) 2026 luis1213899\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v4.4.0:requirements-dev.txt\n\npytest>=8.0.0\n\nFile v4.4.0:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\npytesseract>=0.3.10\n\nArchive v4.3.1: 19 files, 55585 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), LICENSE (1068b), README.md (3341b), requirements.txt (84b), scripts/ai_designer.py (5245b), scripts/batch_from_excel.py (40707b), scripts/color_tools.py (12447b), scripts/console_utils.py (528b), scripts/design_llm.py (11445b), scripts/psd_style_editor.py (8296b), scripts/psd_text_editor.py (9441b), scripts/random_check.py (12518b), scripts/render_psd_batch.py (10583b), scripts/smart_layout.py (10851b), scripts/template_loader.py (6972b), skill-card.md (2663b), SKILL.md (15971b), _meta.json (135b)\n\nFile v4.3.1:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v4.3\n\n> **角色**: 你是 PSD 图层级处理专家。你能：解析 PSD 每个图层的全部信息 → 单层/批量修改文本 → 数据驱动批量生成 → 使用官方 PSD 模板工作台 → 智能配色推荐 → 自适应排版 → 印刷级渲染 → 像素+OCR 质量验证。\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD、样式查看 |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号、改样式 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **模板设计** | 做模板、设计门票、生成证书、做海报、设计工牌、AI做图、智能生成 |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n```\r\n┌──────────────────────────────────────────────────────────┐\r\n│                   PSD 图层级智能引擎 v4.3                  │\n├────────────────┬────────────────┬────────────────────────┤\r\n│   分析 & 诊断   │   修改 & 操作   │    生成 & 设计          │\r\n├────────────────┼────────────────┼────────────────────────┤\r\n│ • 图层结构解析  │ • 单层文本修改  │ • 数据驱动批量 PSD/PNG  │\r\n│ • 字体/字号检测 │ • 样式覆盖渲染  │ • 官方PSD模板(3款)      │\n│ • 颜色提取      │ • JSON配置批量  │ • 印刷级 PNG 渲染      │\r\n│ • bbox/位置     │ • 多图层同时编辑│ • 像素级验证抽查       │\r\n│ • 字符容量分析  │ • 字体选择/降级 │ • 分图层 OCR 校验      │\r\n│ • 列名智能匹配  │ • 颜色推荐      │ • 智能配色推荐         │\r\n│ • 样式详情导出  │ • 自适应排版    │ • 智能分析报告         │\r\n└────────────────┴────────────────┴────────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 有 Excel/CSV 数据源时执行 --analyze；仅 PSD 时直接用 psd-tools 读取图层\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选分图层OCR)\r\n\r\n官方模板快速启动:\r\n  ai_designer.py --use morning --data 日签文案.xlsx --output out/\r\n  ai_designer.py --use tech --data 嘉宾名单.xlsx\r\n  ai_designer.py --use doodle --data 招聘岗位.xlsx\r\n```\r\n\r\n### 🎨 模板设计场景 — \"用哪个模板好？\"\r\n```\r\n用户: 有什么模板？/ 帮我看看日签模板有哪些字段\r\n→ ai_designer.py --list         列出 3 款官方 PSD 模板\r\n→ ai_designer.py --info morning  查看可编辑字段+容量\r\n→ ai_designer.py --use tech --data 嘉宾.xlsx  一键批量生成\r\n\r\n3 款官方模板:\r\n  morning  早安手绘风日签 (720×1280)  — 早安问候/励志日签\r\n  tech     炫彩风科技邀请函 (720×1280) — 科技峰会/产品发布\r\n  doodle   手绘涂鸦招聘海报 (1284×2778) — 创意招聘\r\n\r\n→ 8套预设配色 + LLM 无限配色生成\r\n→ LLM 还可: 撰写文案(write_copy) / 评价设计(evaluate_design)\r\n→ 需配置: OPENAI_API_KEY 或 ANTHROPIC_API_KEY 环境变量\r\n```\r\n\r\n### 🎨 智能配色场景 — \"这个颜色搭配怎么样\"\r\n```\r\n用户: 门票用什么配色好？/ 帮我生成一组配色 / 这个文字颜色对比度够吗\r\n→ color_tools.py 场景推荐 + 调色板生成 + WCAG 对比度检查\r\n→ 支持: 互补/三角/类比/单色 4种和谐方案\r\n→ 支持从图片提取主色调\r\n```\r\n\r\n### 📐 排版计算场景 — \"这个模板能放多大的字\"\r\n```\r\n用户: 8个字用多大字号合适？/ 帮我算下这几个文字的排版\r\n→ smart_layout.py 自动计算最优字号和位置\r\n→ 4种预设(门票/证书/工牌/邀请函)\r\n→ 支持任意画布自定义排版\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `batch_from_excel.py --analyze`（有数据源时）或直接调用 `psd-tools`：\n\n```python\nfrom psd_tools import PSDImage\n\npsd = PSDImage.open(\"模板.psd\")\nlayers = [layer for layer in psd.descendants() if layer.kind == \"type\"]\nfor layer in layers:\n    print(layer.name, layer.text, layer.bbox)\n```\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（分析→匹配→预览→导出→验证→OCR） |\r\n| `ai_designer.py` | `scripts/ai_designer.py` | 官方 PSD 模板工作台（早安日签/科技邀请函/招聘海报） |\n| `color_tools.py` | `scripts/color_tools.py` | 配色提取/推荐/对比度检查/调色板生成 |\r\n| `smart_layout.py` | `scripts/smart_layout.py` | 自适应排版计算（字号/位置/换行） |\r\n| `psd_style_editor.py` | `scripts/psd_style_editor.py` | 样式编辑（查看/修改/JSON批量） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\n→ 如无证书 PSD，先准备可编辑文字图层的 PSD 模板\n```\r\n\r\n### F. 从零开始（无 PSD 模板）\r\n```\r\n→ 使用 3 款官方 PSD 模板快速开始，或先准备/设计可编辑文字图层的 PSD 模板\n```\r\n\r\n### G. 仅配色/排版咨询\r\n```\r\n→ color_tools.py --recommend ticket → 获取场景推荐配色\r\n→ smart_layout.py --preset certificate → 查看预设排版方案\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 4.3 | 2026-05-31 | 重构模板系统：3款官方PSD模板(日签/邀请函/招聘)+template_loader；ai_designer 改为模板工作台；移除合成模板代码 |\r\n| 4.1 | 2026-05-31 | 新增 design_llm.py（LLM设计适配层）+ ai_designer.py 重构支持 --ai/--prompt/--evaluate |\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v4.3.1:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.3.1:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.3-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号、颜色、bbox、字符容量 |\r\n| ✏️ 单层修改 | 二进制 Txt TEXT 替换 + 样式覆盖渲染 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，3级智能列匹配，双阶段 PSD+PNG |\r\n| 🎨 模板工作台 | 3款官方 PSD 模板（早安日签/科技邀请函/招聘海报）+ LLM 配色/文案建议 |\n| 🌈 智能配色 | 8套预设 + 自定义调色板 + WCAG 对比度检查 |\r\n| 📐 自适应排版 | 自动计算最优字号、位置、换行 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar |\r\n| 🖼️ 渲染输出 | 背景缓存优化，300 DPI 印刷级 |\r\n| ✅ 质量验证 | 像素比对 + 分图层OCR + 5级模糊打分 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册 v4.3)\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键全流程（分析/预览/导出/验证/OCR）\r\n    ├── ai_designer.py         # 官方模板工作台（3款 PSD 模板 + LLM 建议）\n    ├── color_tools.py         # 智能配色工具（推荐/提取/对比度）\r\n    ├── smart_layout.py        # 自适应排版引擎\r\n    ├── psd_style_editor.py    # 样式编辑器（查看/修改/批量）\r\n    ├── psd_text_editor.py     # PSD 二进制文本修改\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v4.3.1:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.3.1\",\n  \"publishedAt\": 1780596519156\n}\n\nFile v4.3.1:skill-card.md\n\n## Description: <br>\nPsd Batch Export helps agents analyze PSD text layers, edit text and styles, batch-generate PSD/PNG outputs from spreadsheet data, recommend colors and layout, and run export quality checks for PSD-based templates. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and operations teams use this skill to inspect PSD templates, map spreadsheet columns to editable text layers, preview changes, and batch-export print-ready or screen-ready PSD and PNG assets for tickets, certificates, invitations, badges, posters, and similar templates. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: PSD templates, spreadsheets, and image files may contain confidential designs or personal data. <br>\nMitigation: Run the skill only in project folders containing files approved for processing, and avoid optional LLM features for confidential inputs unless model-provider sharing is approved. <br>\nRisk: Batch export can create or replace many files when the output path is wrong. <br>\nMitigation: Use dry-run and preview steps first, then confirm the destination directory before running a full export. <br>\nRisk: Optional LLM design features require external API credentials and may send selected design context to the configured provider. <br>\nMitigation: Set provider API keys only when those features are needed, and use approved accounts and data-handling policies. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [README](artifact/README.md) <br>\n- [Font setup guide](artifact/fonts/README.md) <br>\n- [Tesseract OCR engine](https://github.com/UB-Mannheim/tesseract/releases) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with shell commands, Python snippets, analysis reports, mapping summaries, and file-output instructions] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May guide creation of PSD, PNG, JSON, and verification report files through bundled scripts.] <br>\n\n## Skill Version(s): <br>\n4.3.1 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.3.1:LICENSE\n\nMIT License\n\nCopyright (c) 2026 luis1213899\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\nFile v4.3.1:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\npytesseract>=0.3.10\n\nArchive v4.3.0: 17 files, 53911 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (3315b), requirements.txt (100b), scripts/ai_designer.py (5191b), scripts/batch_from_excel.py (40653b), scripts/color_tools.py (12388b), scripts/design_llm.py (11387b), scripts/psd_style_editor.py (8247b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), scripts/smart_layout.py (10791b), scripts/template_loader.py (6981b), skill-card.md (2374b), SKILL.md (15810b), _meta.json (135b)\n\nFile v4.3.0:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v4.1\r\n\r\n> **角色**: 你是 PSD 图层级处理专家。你能：解析 PSD 每个图层的全部信息 → 单层/批量修改文本 → 数据驱动批量生成 → 从零设计模板 → 智能配色推荐 → 自适应排版 → 印刷级渲染 → 像素+OCR 质量验证。\r\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD、样式查看 |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号、改样式 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **模板设计** | 做模板、设计门票、生成证书、做海报、设计工牌、AI做图、智能生成 |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n```\r\n┌──────────────────────────────────────────────────────────┐\r\n│                   PSD 图层级智能引擎 v4.0                  │\r\n├────────────────┬────────────────┬────────────────────────┤\r\n│   分析 & 诊断   │   修改 & 操作   │    生成 & 设计          │\r\n├────────────────┼────────────────┼────────────────────────┤\r\n│ • 图层结构解析  │ • 单层文本修改  │ • 数据驱动批量 PSD/PNG  │\r\n│ • 字体/字号检测 │ • 样式覆盖渲染  │ • 从零模板设计(5类型)   │\r\n│ • 颜色提取      │ • JSON配置批量  │ • 印刷级 PNG 渲染      │\r\n│ • bbox/位置     │ • 多图层同时编辑│ • 像素级验证抽查       │\r\n│ • 字符容量分析  │ • 字体选择/降级 │ • 分图层 OCR 校验      │\r\n│ • 列名智能匹配  │ • 颜色推荐      │ • 智能配色推荐         │\r\n│ • 样式详情导出  │ • 自适应排版    │ • 智能分析报告         │\r\n└────────────────┴────────────────┴────────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 执行 --analyze → 输出完整图层分析报告\r\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选分图层OCR)\r\n\r\n官方模板快速启动:\r\n  ai_designer.py --use morning --data 日签文案.xlsx --output out/\r\n  ai_designer.py --use tech --data 嘉宾名单.xlsx\r\n  ai_designer.py --use doodle --data 招聘岗位.xlsx\r\n```\r\n\r\n### 🎨 模板设计场景 — \"用哪个模板好？\"\r\n```\r\n用户: 有什么模板？/ 帮我看看日签模板有哪些字段\r\n→ ai_designer.py --list         列出 3 款官方 PSD 模板\r\n→ ai_designer.py --info morning  查看可编辑字段+容量\r\n→ ai_designer.py --use tech --data 嘉宾.xlsx  一键批量生成\r\n\r\n3 款官方模板:\r\n  morning  早安手绘风日签 (720×1280)  — 早安问候/励志日签\r\n  tech     炫彩风科技邀请函 (720×1280) — 科技峰会/产品发布\r\n  doodle   手绘涂鸦招聘海报 (1284×2778) — 创意招聘\r\n\r\n→ 8套预设配色 + LLM 无限配色生成\r\n→ LLM 还可: 撰写文案(write_copy) / 评价设计(evaluate_design)\r\n→ 需配置: OPENAI_API_KEY 或 ANTHROPIC_API_KEY 环境变量\r\n```\r\n\r\n### 🎨 智能配色场景 — \"这个颜色搭配怎么样\"\r\n```\r\n用户: 门票用什么配色好？/ 帮我生成一组配色 / 这个文字颜色对比度够吗\r\n→ color_tools.py 场景推荐 + 调色板生成 + WCAG 对比度检查\r\n→ 支持: 互补/三角/类比/单色 4种和谐方案\r\n→ 支持从图片提取主色调\r\n```\r\n\r\n### 📐 排版计算场景 — \"这个模板能放多大的字\"\r\n```\r\n用户: 8个字用多大字号合适？/ 帮我算下这几个文字的排版\r\n→ smart_layout.py 自动计算最优字号和位置\r\n→ 4种预设(门票/证书/工牌/邀请函)\r\n→ 支持任意画布自定义排版\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `psd_analyzer.py` 或直接调用 `psd-tools`：\r\n\r\n```python\r\nfrom psd_analyzer import PSDAnalyzer\r\nanalyzer = PSDAnalyzer(\"模板.psd\")\r\nanalyzer.print_structure()\r\nlayers = analyzer.get_text_layers()\r\n```\r\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（分析→匹配→预览→导出→验证→OCR） |\r\n| `ai_designer.py` | `scripts/ai_designer.py` | 从零模板设计（门票/证书/工牌/邀请函/号码牌） |\r\n| `color_tools.py` | `scripts/color_tools.py` | 配色提取/推荐/对比度检查/调色板生成 |\r\n| `smart_layout.py` | `scripts/smart_layout.py` | 自适应排版计算（字号/位置/换行） |\r\n| `psd_style_editor.py` | `scripts/psd_style_editor.py` | 样式编辑（查看/修改/JSON批量） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ ai_designer.py --type certificate 生成模板\r\n→ 或 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\r\n```\r\n\r\n### F. 从零开始（无 PSD 模板）\r\n```\r\n→ ai_designer.py 生成设计稿 → 可选：导入PSD继续编辑 → 或直接批量填充\r\n```\r\n\r\n### G. 仅配色/排版咨询\r\n```\r\n→ color_tools.py --recommend ticket → 获取场景推荐配色\r\n→ smart_layout.py --preset certificate → 查看预设排版方案\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 4.3 | 2026-05-31 | 重构模板系统：3款官方PSD模板(日签/邀请函/招聘)+template_loader；ai_designer 改为模板工作台；移除合成模板代码 |\r\n| 4.1 | 2026-05-31 | 新增 design_llm.py（LLM设计适配层）+ ai_designer.py 重构支持 --ai/--prompt/--evaluate |\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v4.3.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.3.0:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.0-blue)](https://clawhub.com/luis1213899/psd-batch-export)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号、颜色、bbox、字符容量 |\r\n| ✏️ 单层修改 | 二进制 Txt TEXT 替换 + 样式覆盖渲染 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，3级智能列匹配，双阶段 PSD+PNG |\r\n| 🎨 模板设计 | 5类模板从零生成(ticket/certificate/badge/invitation/number_card) |\r\n| 🌈 智能配色 | 8套预设 + 自定义调色板 + WCAG 对比度检查 |\r\n| 📐 自适应排版 | 自动计算最优字号、位置、换行 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar |\r\n| 🖼️ 渲染输出 | 背景缓存优化，300 DPI 印刷级 |\r\n| ✅ 质量验证 | 像素比对 + 分图层OCR + 5级模糊打分 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册 v4.0)\r\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键全流程（分析/预览/导出/验证/OCR）\r\n    ├── ai_designer.py         # 从零模板设计器（5类模板 + 8套配色）\r\n    ├── color_tools.py         # 智能配色工具（推荐/提取/对比度）\r\n    ├── smart_layout.py        # 自适应排版引擎\r\n    ├── psd_style_editor.py    # 样式编辑器（查看/修改/批量）\r\n    ├── psd_text_editor.py     # PSD 二进制文本修改\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v4.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.3.0\",\n  \"publishedAt\": 1780221878586\n}\n\nFile v4.3.0:skill-card.md\n\n## Description: <br>\nAnalyzes PSD layer structure and helps agents modify text, batch-generate PSD and PNG outputs from data, design templates, and verify rendered results. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDesigners, developers, and operations teams use this skill to inspect PSD templates, map spreadsheet data to text layers, generate editable PSD and print-ready PNG batches, and run pixel or OCR checks before delivery. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Ambiguous requests may trigger broad searches for PSD or XLSX files in the current workspace. <br>\nMitigation: Provide exact input and output paths and avoid broad triggers in sensitive workspaces. <br>\nRisk: Optional LLM-assisted design features can send prompts or design content to third-party model providers. <br>\nMitigation: Disable LLM features unless external processing is acceptable and required API keys are intentionally configured. <br>\nRisk: OCR verification reports may contain names, IDs, or other private text extracted from rendered designs. <br>\nMitigation: Treat verification reports as sensitive output and limit retention or sharing according to the data handled. <br>\n\n\n## Reference(s): <br>\n- [ClawHub Skill Page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [Tesseract OCR Releases](https://github.com/UB-Mannheim/tesseract/releases) <br>\n- [Alibaba Fonts](https://fonts.alibabagroup.com) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands and generated file paths] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May produce PSD and PNG batches plus JSON or Markdown verification reports when the agent runs the bundled scripts.] <br>\n\n## Skill Version(s): <br>\n4.3.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.3.0:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\r\nclick>=8.0.0\r\npytesseract>=0.3.10\n\nArchive v4.2.0: 16 files, 56531 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (3315b), requirements.txt (100b), scripts/ai_designer.py (29070b), scripts/batch_from_excel.py (40653b), scripts/color_tools.py (12388b), scripts/design_llm.py (11387b), scripts/psd_style_editor.py (8247b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), scripts/smart_layout.py (10791b), skill-card.md (2733b), SKILL.md (15450b), _meta.json (135b)\n\nFile v4.2.0:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v4.1\r\n\r\n> **角色**: 你是 PSD 图层级处理专家。你能：解析 PSD 每个图层的全部信息 → 单层/批量修改文本 → 数据驱动批量生成 → 从零设计模板 → 智能配色推荐 → 自适应排版 → 印刷级渲染 → 像素+OCR 质量验证。\r\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD、样式查看 |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号、改样式 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **模板设计** | 做模板、设计门票、生成证书、做海报、设计工牌、AI做图、智能生成 |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n```\r\n┌──────────────────────────────────────────────────────────┐\r\n│                   PSD 图层级智能引擎 v4.0                  │\r\n├────────────────┬────────────────┬────────────────────────┤\r\n│   分析 & 诊断   │   修改 & 操作   │    生成 & 设计          │\r\n├────────────────┼────────────────┼────────────────────────┤\r\n│ • 图层结构解析  │ • 单层文本修改  │ • 数据驱动批量 PSD/PNG  │\r\n│ • 字体/字号检测 │ • 样式覆盖渲染  │ • 从零模板设计(5类型)   │\r\n│ • 颜色提取      │ • JSON配置批量  │ • 印刷级 PNG 渲染      │\r\n│ • bbox/位置     │ • 多图层同时编辑│ • 像素级验证抽查       │\r\n│ • 字符容量分析  │ • 字体选择/降级 │ • 分图层 OCR 校验      │\r\n│ • 列名智能匹配  │ • 颜色推荐      │ • 智能配色推荐         │\r\n│ • 样式详情导出  │ • 自适应排版    │ • 智能分析报告         │\r\n└────────────────┴────────────────┴────────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 执行 --analyze → 输出完整图层分析报告\r\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选OCR)\r\n```\r\n\r\n### 🎨 模板设计场景 — \"帮我设计一个...\"\r\n```\r\n用户: 帮我做一个红色门票 / 设计一个证书 / 做个蓝色工牌\r\n→ ai_designer.py --type ticket --palette classic_red  (规则模式)\r\n→ ai_designer.py --type ticket --ai --prompt \"深海科技蓝\"  (LLM增强)\r\n→ 10种模板类型: ticket/certificate/badge/invitation/number_card/poster/nameplate/coupon/member_card/label\r\n→ 8套预设配色 + LLM 无限配色生成\r\n→ LLM 还可: 撰写文案(write_copy) / 评价设计(evaluate_design) / 推荐布局(suggest_layout)\r\n→ 需配置: OPENAI_API_KEY 或 ANTHROPIC_API_KEY 环境变量\r\n```\r\n\r\n### 🎨 智能配色场景 — \"这个颜色搭配怎么样\"\r\n```\r\n用户: 门票用什么配色好？/ 帮我生成一组配色 / 这个文字颜色对比度够吗\r\n→ color_tools.py 场景推荐 + 调色板生成 + WCAG 对比度检查\r\n→ 支持: 互补/三角/类比/单色 4种和谐方案\r\n→ 支持从图片提取主色调\r\n```\r\n\r\n### 📐 排版计算场景 — \"这个模板能放多大的字\"\r\n```\r\n用户: 8个字用多大字号合适？/ 帮我算下这几个文字的排版\r\n→ smart_layout.py 自动计算最优字号和位置\r\n→ 4种预设(门票/证书/工牌/邀请函)\r\n→ 支持任意画布自定义排版\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `psd_analyzer.py` 或直接调用 `psd-tools`：\r\n\r\n```python\r\nfrom psd_analyzer import PSDAnalyzer\r\nanalyzer = PSDAnalyzer(\"模板.psd\")\r\nanalyzer.print_structure()\r\nlayers = analyzer.get_text_layers()\r\n```\r\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（分析→匹配→预览→导出→验证→OCR） |\r\n| `ai_designer.py` | `scripts/ai_designer.py` | 从零模板设计（门票/证书/工牌/邀请函/号码牌） |\r\n| `color_tools.py` | `scripts/color_tools.py` | 配色提取/推荐/对比度检查/调色板生成 |\r\n| `smart_layout.py` | `scripts/smart_layout.py` | 自适应排版计算（字号/位置/换行） |\r\n| `psd_style_editor.py` | `scripts/psd_style_editor.py` | 样式编辑（查看/修改/JSON批量） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ ai_designer.py --type certificate 生成模板\r\n→ 或 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\r\n```\r\n\r\n### F. 从零开始（无 PSD 模板）\r\n```\r\n→ ai_designer.py 生成设计稿 → 可选：导入PSD继续编辑 → 或直接批量填充\r\n```\r\n\r\n### G. 仅配色/排版咨询\r\n```\r\n→ color_tools.py --recommend ticket → 获取场景推荐配色\r\n→ smart_layout.py --preset certificate → 查看预设排版方案\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 4.2 | 2026-05-31 | 新增 5 种模板：poster(海报)、nameplate(桌牌)、coupon(优惠券)、member_card(会员卡)、label(价签)；模板总数达到 10 种 |\r\n| 4.1 | 2026-05-31 | 新增 design_llm.py（LLM设计适配层）+ ai_designer.py 重构支持 --ai/--prompt/--evaluate |\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v4.2.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.2.0:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.0-blue)](https://clawhub.com/luis1213899/psd-batch-export)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号、颜色、bbox、字符容量 |\r\n| ✏️ 单层修改 | 二进制 Txt TEXT 替换 + 样式覆盖渲染 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，3级智能列匹配，双阶段 PSD+PNG |\r\n| 🎨 模板设计 | 5类模板从零生成(ticket/certificate/badge/invitation/number_card) |\r\n| 🌈 智能配色 | 8套预设 + 自定义调色板 + WCAG 对比度检查 |\r\n| 📐 自适应排版 | 自动计算最优字号、位置、换行 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar |\r\n| 🖼️ 渲染输出 | 背景缓存优化，300 DPI 印刷级 |\r\n| ✅ 质量验证 | 像素比对 + 分图层OCR + 5级模糊打分 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册 v4.0)\r\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键全流程（分析/预览/导出/验证/OCR）\r\n    ├── ai_designer.py         # 从零模板设计器（5类模板 + 8套配色）\r\n    ├── color_tools.py         # 智能配色工具（推荐/提取/对比度）\r\n    ├── smart_layout.py        # 自适应排版引擎\r\n    ├── psd_style_editor.py    # 样式编辑器（查看/修改/批量）\r\n    ├── psd_text_editor.py     # PSD 二进制文本修改\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v4.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.2.0\",\n  \"publishedAt\": 1780220736714\n}\n\nFile v4.2.0:skill-card.md\n\n## Description: <br>\nPSD batch export and design automation skill for analyzing PSD layers, editing text and styles, generating data-driven PSD/PNG outputs, creating templates, and validating rendered results. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDesigners, developers, and operations teams use this skill to inspect PSD templates, map spreadsheet data to text layers, batch-generate editable PSD files and print-ready PNGs, and optionally create template designs with rule-based or LLM-assisted tools. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Optional AI design mode can send design prompts or generated text outside local processing when API credentials are configured. <br>\nMitigation: Use AI mode only with approved providers and avoid confidential prompts unless the deployment environment permits that data flow. <br>\nRisk: OCR verification reports can contain extracted personal or business text from generated PSD/PNG outputs. <br>\nMitigation: Treat verification reports as sensitive generated data and store or share them under the same controls as the source spreadsheet and rendered assets. <br>\nRisk: Broad workspace searches for PSD, spreadsheet, or output files can expose unrelated project data. <br>\nMitigation: Provide explicit PSD, data source, and output paths for production use and avoid running broad discovery in sensitive workspaces. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [Artifact README](README.md) <br>\n- [Font setup notes](fonts/README.md) <br>\n- [Tesseract OCR releases](https://github.com/UB-Mannheim/tesseract/releases) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands, Python script usage, reports, JSON verification artifacts, PSD files, and PNG images.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May use local PSD, spreadsheet, font, rendered image, and OCR report files; optional AI design mode requires approved API credentials.] <br>\n\n## Skill Version(s): <br>\n4.2.0 (source: server release metadata, target metadata, and artifact version table) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.2.0:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\r\nclick>=8.0.0\r\npytesseract>=0.3.10\n\nArchive v4.1.0: 16 files, 54665 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (3315b), requirements.txt (100b), scripts/ai_designer.py (18553b), scripts/batch_from_excel.py (40653b), scripts/color_tools.py (12388b), scripts/design_llm.py (11387b), scripts/psd_style_editor.py (8247b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), scripts/smart_layout.py (10791b), skill-card.md (2770b), SKILL.md (15322b), _meta.json (135b)\n\nFile v4.1.0:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v4.1\r\n\r\n> **角色**: 你是 PSD 图层级处理专家。你能：解析 PSD 每个图层的全部信息 → 单层/批量修改文本 → 数据驱动批量生成 → 从零设计模板 → 智能配色推荐 → 自适应排版 → 印刷级渲染 → 像素+OCR 质量验证。\r\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD、样式查看 |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号、改样式 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **模板设计** | 做模板、设计门票、生成证书、做海报、设计工牌、AI做图、智能生成 |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n```\r\n┌──────────────────────────────────────────────────────────┐\r\n│                   PSD 图层级智能引擎 v4.0                  │\r\n├────────────────┬────────────────┬────────────────────────┤\r\n│   分析 & 诊断   │   修改 & 操作   │    生成 & 设计          │\r\n├────────────────┼────────────────┼────────────────────────┤\r\n│ • 图层结构解析  │ • 单层文本修改  │ • 数据驱动批量 PSD/PNG  │\r\n│ • 字体/字号检测 │ • 样式覆盖渲染  │ • 从零模板设计(5类型)   │\r\n│ • 颜色提取      │ • JSON配置批量  │ • 印刷级 PNG 渲染      │\r\n│ • bbox/位置     │ • 多图层同时编辑│ • 像素级验证抽查       │\r\n│ • 字符容量分析  │ • 字体选择/降级 │ • 分图层 OCR 校验      │\r\n│ • 列名智能匹配  │ • 颜色推荐      │ • 智能配色推荐         │\r\n│ • 样式详情导出  │ • 自适应排版    │ • 智能分析报告         │\r\n└────────────────┴────────────────┴────────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 执行 --analyze → 输出完整图层分析报告\r\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选OCR)\r\n```\r\n\r\n### 🎨 模板设计场景 — \"帮我设计一个...\"\r\n```\r\n用户: 帮我做一个红色门票 / 设计一个证书 / 做个蓝色工牌\r\n→ ai_designer.py --type ticket --palette classic_red  (规则模式)\r\n→ ai_designer.py --type ticket --ai --prompt \"深海科技蓝\"  (LLM增强)\r\n→ 5种模板类型: ticket/certificate/badge/invitation/number_card\r\n→ 8套预设配色 + LLM 无限配色生成\r\n→ LLM 还可: 撰写文案(write_copy) / 评价设计(evaluate_design) / 推荐布局(suggest_layout)\r\n→ 需配置: OPENAI_API_KEY 或 ANTHROPIC_API_KEY 环境变量\r\n```\r\n\r\n### 🎨 智能配色场景 — \"这个颜色搭配怎么样\"\r\n```\r\n用户: 门票用什么配色好？/ 帮我生成一组配色 / 这个文字颜色对比度够吗\r\n→ color_tools.py 场景推荐 + 调色板生成 + WCAG 对比度检查\r\n→ 支持: 互补/三角/类比/单色 4种和谐方案\r\n→ 支持从图片提取主色调\r\n```\r\n\r\n### 📐 排版计算场景 — \"这个模板能放多大的字\"\r\n```\r\n用户: 8个字用多大字号合适？/ 帮我算下这几个文字的排版\r\n→ smart_layout.py 自动计算最优字号和位置\r\n→ 4种预设(门票/证书/工牌/邀请函)\r\n→ 支持任意画布自定义排版\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `psd_analyzer.py` 或直接调用 `psd-tools`：\r\n\r\n```python\r\nfrom psd_analyzer import PSDAnalyzer\r\nanalyzer = PSDAnalyzer(\"模板.psd\")\r\nanalyzer.print_structure()\r\nlayers = analyzer.get_text_layers()\r\n```\r\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（分析→匹配→预览→导出→验证→OCR） |\r\n| `ai_designer.py` | `scripts/ai_designer.py` | 从零模板设计（门票/证书/工牌/邀请函/号码牌） |\r\n| `color_tools.py` | `scripts/color_tools.py` | 配色提取/推荐/对比度检查/调色板生成 |\r\n| `smart_layout.py` | `scripts/smart_layout.py` | 自适应排版计算（字号/位置/换行） |\r\n| `psd_style_editor.py` | `scripts/psd_style_editor.py` | 样式编辑（查看/修改/JSON批量） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ ai_designer.py --type certificate 生成模板\r\n→ 或 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\r\n```\r\n\r\n### F. 从零开始（无 PSD 模板）\r\n```\r\n→ ai_designer.py 生成设计稿 → 可选：导入PSD继续编辑 → 或直接批量填充\r\n```\r\n\r\n### G. 仅配色/排版咨询\r\n```\r\n→ color_tools.py --recommend ticket → 获取场景推荐配色\r\n→ smart_layout.py --preset certificate → 查看预设排版方案\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 4.1 | 2026-05-31 | 新增 design_llm.py（LLM设计适配层）+ ai_designer.py 重构支持 --ai/--prompt/--evaluate；支持 OpenAI/Claude 等多种模型生成配色、布局、文案、设计评价 |\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v4.1.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.1.0:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.0-blue)](https://clawhub.com/luis1213899/psd-batch-export)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号、颜色、bbox、字符容量 |\r\n| ✏️ 单层修改 | 二进制 Txt TEXT 替换 + 样式覆盖渲染 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，3级智能列匹配，双阶段 PSD+PNG |\r\n| 🎨 模板设计 | 5类模板从零生成(ticket/certificate/badge/invitation/number_card) |\r\n| 🌈 智能配色 | 8套预设 + 自定义调色板 + WCAG 对比度检查 |\r\n| 📐 自适应排版 | 自动计算最优字号、位置、换行 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar |\r\n| 🖼️ 渲染输出 | 背景缓存优化，300 DPI 印刷级 |\r\n| ✅ 质量验证 | 像素比对 + 分图层OCR + 5级模糊打分 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册 v4.0)\r\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键全流程（分析/预览/导出/验证/OCR）\r\n    ├── ai_designer.py         # 从零模板设计器（5类模板 + 8套配色）\r\n    ├── color_tools.py         # 智能配色工具（推荐/提取/对比度）\r\n    ├── smart_layout.py        # 自适应排版引擎\r\n    ├── psd_style_editor.py    # 样式编辑器（查看/修改/批量）\r\n    ├── psd_text_editor.py     # PSD 二进制文本修改\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v4.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.1.0\",\n  \"publishedAt\": 1780220441768\n}\n\nFile v4.1.0:skill-card.md\n\n## Description: <br>\nPSD layer-level intelligent engine for analyzing text, styles, positions, and capacity in PSD files, then modifying layers, replacing content in batches, designing with optional AI assistance, and generating data-driven outputs for tickets, certificates, invitations, badges, number cards, posters, and other PSD templates. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and operations teams use this skill to inspect PSD templates, map spreadsheet data to editable text layers, preview changes, export batches of PSD and PNG files, and optionally generate template designs, palettes, layouts, and copy with configured LLM providers. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The workflow reads PSD and Excel inputs and writes generated files, so an overly broad workspace search could process unintended files. <br>\nMitigation: Provide explicit file paths or approve only a narrow workspace search before running analysis, preview, or export steps. <br>\nRisk: Batch export can generate many modified PSD or PNG files from spreadsheet data. <br>\nMitigation: Review dry-run or preview output before full export and confirm output directories before writing generated files. <br>\nRisk: Optional LLM-assisted design features may send prompts or design context to the configured provider. <br>\nMitigation: Use LLM features only with data suitable for the configured provider, or rely on the rule-based fallback when sensitive inputs are involved. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [README.md](README.md) <br>\n- [fonts/README.md](fonts/README.md) <br>\n- [UB-Mannheim Tesseract releases](https://github.com/UB-Mannheim/tesseract/releases) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with inline shell commands, generated configuration, reports, and file-output instructions] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May guide creation or modification of PSD and PNG files; optional OCR verification can produce JSON or Markdown reports.] <br>\n\n## Skill Version(s): <br>\n4.1.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.1.0:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\r\nclick>=8.0.0\r\npytesseract>=0.3.10\n\nArchive v4.0.0: 15 files, 49429 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (3315b), requirements.txt (100b), scripts/ai_designer.py (15098b), scripts/batch_from_excel.py (40653b), scripts/color_tools.py (12388b), scripts/psd_style_editor.py (8247b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), scripts/smart_layout.py (10791b), skill-card.md (2418b), SKILL.md (15154b), _meta.json (135b)\n\nFile v4.0.0:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v4.0\r\n\r\n> **角色**: 你是 PSD 图层级处理专家。你能：解析 PSD 每个图层的全部信息 → 单层/批量修改文本 → 数据驱动批量生成 → 从零设计模板 → 智能配色推荐 → 自适应排版 → 印刷级渲染 → 像素+OCR 质量验证。\r\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD、样式查看 |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号、改样式 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **模板设计** | 做模板、设计门票、生成证书、做海报、设计工牌、AI做图、智能生成 |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n```\r\n┌──────────────────────────────────────────────────────────┐\r\n│                   PSD 图层级智能引擎 v4.0                  │\r\n├────────────────┬────────────────┬────────────────────────┤\r\n│   分析 & 诊断   │   修改 & 操作   │    生成 & 设计          │\r\n├────────────────┼────────────────┼────────────────────────┤\r\n│ • 图层结构解析  │ • 单层文本修改  │ • 数据驱动批量 PSD/PNG  │\r\n│ • 字体/字号检测 │ • 样式覆盖渲染  │ • 从零模板设计(5类型)   │\r\n│ • 颜色提取      │ • JSON配置批量  │ • 印刷级 PNG 渲染      │\r\n│ • bbox/位置     │ • 多图层同时编辑│ • 像素级验证抽查       │\r\n│ • 字符容量分析  │ • 字体选择/降级 │ • 分图层 OCR 校验      │\r\n│ • 列名智能匹配  │ • 颜色推荐      │ • 智能配色推荐         │\r\n│ • 样式详情导出  │ • 自适应排版    │ • 智能分析报告         │\r\n└────────────────┴────────────────┴────────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 执行 --analyze → 输出完整图层分析报告\r\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选OCR)\r\n```\r\n\r\n### 🎨 模板设计场景 — \"帮我设计一个...\"\r\n```\r\n用户: 帮我做一个红色门票 / 设计一个证书 / 做个蓝色工牌\r\n→ ai_designer.py 从零生成印刷级模板\r\n→ 5种类型: ticket/certificate/badge/invitation/number_card\r\n→ 8套配色方案，300 DPI 输出\r\n→ 用户可在此基础上继续用 PSD 或直接批量填充\r\n```\r\n\r\n### 🎨 智能配色场景 — \"这个颜色搭配怎么样\"\r\n```\r\n用户: 门票用什么配色好？/ 帮我生成一组配色 / 这个文字颜色对比度够吗\r\n→ color_tools.py 场景推荐 + 调色板生成 + WCAG 对比度检查\r\n→ 支持: 互补/三角/类比/单色 4种和谐方案\r\n→ 支持从图片提取主色调\r\n```\r\n\r\n### 📐 排版计算场景 — \"这个模板能放多大的字\"\r\n```\r\n用户: 8个字用多大字号合适？/ 帮我算下这几个文字的排版\r\n→ smart_layout.py 自动计算最优字号和位置\r\n→ 4种预设(门票/证书/工牌/邀请函)\r\n→ 支持任意画布自定义排版\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `psd_analyzer.py` 或直接调用 `psd-tools`：\r\n\r\n```python\r\nfrom psd_analyzer import PSDAnalyzer\r\nanalyzer = PSDAnalyzer(\"模板.psd\")\r\nanalyzer.print_structure()\r\nlayers = analyzer.get_text_layers()\r\n```\r\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（分析→匹配→预览→导出→验证→OCR） |\r\n| `ai_designer.py` | `scripts/ai_designer.py` | 从零模板设计（门票/证书/工牌/邀请函/号码牌） |\r\n| `color_tools.py` | `scripts/color_tools.py` | 配色提取/推荐/对比度检查/调色板生成 |\r\n| `smart_layout.py` | `scripts/smart_layout.py` | 自适应排版计算（字号/位置/换行） |\r\n| `psd_style_editor.py` | `scripts/psd_style_editor.py` | 样式编辑（查看/修改/JSON批量） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ ai_designer.py --type certificate 生成模板\r\n→ 或 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\r\n```\r\n\r\n### F. 从零开始（无 PSD 模板）\r\n```\r\n→ ai_designer.py 生成设计稿 → 可选：导入PSD继续编辑 → 或直接批量填充\r\n```\r\n\r\n### G. 仅配色/排版咨询\r\n```\r\n→ color_tools.py --recommend ticket → 获取场景推荐配色\r\n→ smart_layout.py --preset certificate → 查看预设排版方案\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 4.0 | 2026-05-31 | 重大升级：新增 ai_designer(5类模板设计)、color_tools(配色推荐/对比度)、smart_layout(自适应排版)、psd_style_editor(样式编辑) 四大工具；覆盖分析→修改→设计→配色→排版→验证 全链路 |\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v4.0.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v4.0.0:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.0-blue)](https://clawhub.com/luis1213899/psd-batch-export)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号、颜色、bbox、字符容量 |\r\n| ✏️ 单层修改 | 二进制 Txt TEXT 替换 + 样式覆盖渲染 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，3级智能列匹配，双阶段 PSD+PNG |\r\n| 🎨 模板设计 | 5类模板从零生成(ticket/certificate/badge/invitation/number_card) |\r\n| 🌈 智能配色 | 8套预设 + 自定义调色板 + WCAG 对比度检查 |\r\n| 📐 自适应排版 | 自动计算最优字号、位置、换行 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar |\r\n| 🖼️ 渲染输出 | 背景缓存优化，300 DPI 印刷级 |\r\n| ✅ 质量验证 | 像素比对 + 分图层OCR + 5级模糊打分 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册 v4.0)\r\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键全流程（分析/预览/导出/验证/OCR）\r\n    ├── ai_designer.py         # 从零模板设计器（5类模板 + 8套配色）\r\n    ├── color_tools.py         # 智能配色工具（推荐/提取/对比度）\r\n    ├── smart_layout.py        # 自适应排版引擎\r\n    ├── psd_style_editor.py    # 样式编辑器（查看/修改/批量）\r\n    ├── psd_text_editor.py     # PSD 二进制文本修改\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v4.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.0.0\",\n  \"publishedAt\": 1780220055880\n}\n\nFile v4.0.0:skill-card.md\n\n## Description: <br>\nPSD batch export helps an agent analyze PSD text layers, modify text and styles, generate PSD/PNG outputs from spreadsheet data, design simple templates, recommend colors, calculate layouts, and validate rendered results. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers, designers, and operations teams use this skill to inspect PSD templates, map spreadsheet data to text layers, preview changes, export batches of editable PSD and print-ready PNG files, and produce verification reports. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill has broad auto-activation and workspace search authority over PSD and Excel files before a specific user-selected target is required. <br>\nMitigation: Use explicit PSD, spreadsheet, and output paths; avoid broad workspace searches; and confirm selected targets before analysis or export. <br>\nRisk: Processing untrusted PSD or spreadsheet files and installing dependencies can expose local design documents or introduce dependency risk. <br>\nMitigation: Run dry-run or analyze mode first, use a separate output directory, and pin or audit dependencies before processing untrusted files. <br>\n\n\n## Reference(s): <br>\n- [ClawHub package page](https://clawhub.ai/luis1213899/psd-batch-export) <br>\n- [Tesseract OCR dependency](https://github.com/UB-Mannheim/tesseract/releases) <br>\n- [Font setup notes](fonts/README.md) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Code, Shell commands, Configuration, Guidance, Files] <br>\n**Output Format:** [Markdown guidance with shell commands, configuration snippets, local PSD/PNG exports, and JSON or Markdown verification reports.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Can produce local design files and reports; dry-run and analysis modes are recommended before export.] <br>\n\n## Skill Version(s): <br>\n4.0.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nFile v4.0.0:requirements.txt\n\nPillow>=9.0.0\r\npsd-tools>=1.9.0\r\nopenpyxl>=3.8.0\r\npandas>=1.3.0\r\nclick>=8.0.0\r\npytesseract>=0.3.10\n\nArchive v3.2.0: 11 files, 34666 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (3071b), requirements.txt (100b), scripts/batch_from_excel.py (40653b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), skill-card.md (2851b), SKILL.md (13387b), _meta.json (135b)\n\nFile v3.2.0:SKILL.md\n\n---\r\nname: psd-batch-export\r\ndescription: 'PSD图层级智能引擎 — 解析PSD每一图层的文本/样式/位置/容量，按需修改、批量替换、AI制图、数据驱动生成。通用于门票、证书、邀请函、工牌、号码牌、海报等任何PSD模板。触发词：PSD、图层、文本替换、批量生成、PSD分析、PSD修改、门票、证书、邀请函、AI制图。'\r\nargument-hint: '[PSD路径] [可选：Excel/数据源] [可选：输出目录]'\r\n---\r\n\r\n# PSD 图层级智能引擎 — AI 操作手册 v3.2\r\n\r\n> **角色**: 你是 PSD 图层级处理专家。你能读取 PSD 中每一个图层的全部信息（文本内容、字体、字号、颜色、位置坐标、字符容量），并据此执行：单层修改、全图层分析、数据驱动批量替换、AI 智能制图、样式迁移、容量优化等。\r\n\r\n---\r\n\r\n## 🎯 触发条件\r\n\r\n当用户提及以下任一意图时，自动激活此技能：\r\n\r\n| 类别 | 触发词 |\r\n|------|--------|\r\n| **分析/诊断** | PSD分析、图层信息、PSD结构、文字图层、字体检测、查看PSD、解析PSD |\r\n| **单层/局部修改** | 改文字、修改PSD、换字体、改颜色、替换图层文字、调整字号 |\r\n| **批量/数据驱动** | 批量生成、批量导出、PSD批量、Excel PSD、名单导入、数据驱动 |\r\n| **AI 制图** | AI做图、智能生成、自动排版、智能配色、AI PSD |\r\n| **业务场景** | 门票、证书、邀请函、工牌、号码牌、参会证、奖状、海报、录取通知书、抽签卡 |\r\n| **模糊意图** | \"帮我看下这个PSD\"、\"把名字换成这些\"、\"生成100张\"、\"这个模板能放多少字\" |\r\n\r\n---\r\n\r\n## 🧠 核心能力地图\r\n\r\n本技能围绕 PSD **图层** 这一最小操作单元，提供全链路能力：\r\n\r\n```\r\n┌─────────────────────────────────────────────────────┐\r\n│                  PSD 图层级智能引擎                    │\r\n├───────────────┬───────────────┬─────────────────────┤\r\n│  分析 & 诊断   │  修改 & 操作   │   生成 & 输出        │\r\n├───────────────┼───────────────┼─────────────────────┤\r\n│ • 图层结构解析 │ • 单层文本修改 │ • 数据驱动批量 PSD   │\r\n│ • 字体/字号检测│ • 字体替换     │ • 印刷级 PNG 渲染    │\r\n│ • 颜色提取     │ • 颜色调整     │ • 像素级验证抽查     │\r\n│ • 位置/bbox    │ • 字号缩放     │ • OCR 文本校验      │\r\n│ • 字符容量分析 │ • 样式迁移     │ • 智能分析报告       │\r\n│ • 列名智能匹配 │ • 批量文本替换 │ • 干燥运行预览       │\r\n└───────────────┴───────────────┴─────────────────────┘\r\n```\r\n\r\n---\r\n\r\n## 🎬 场景矩阵\r\n\r\n根据用户意图，自动选择最佳工作模式：\r\n\r\n### 🔍 分析场景 — \"帮我看看这个PSD\"\r\n```\r\n用户: 这个PSD里面有哪些文字？什么字体？能放多少字？\r\n→ 执行 --analyze → 输出完整图层分析报告\r\n→ 报告包含: 图层名、文本内容、字体族、字号、颜色、bbox坐标、字符容量\r\n→ 标注容量风险、字体缺失警告\r\n```\r\n\r\n### ✏️ 单层修改场景 — \"把标题改成XXX\"\r\n```\r\n用户: 把名字改成\"张三\"，学校改成\"清华大学\"\r\n→ 使用 psd_text_editor 精确定位 Txt TEXT 标记\r\n→ 二进制级替换，保持 PSD 结构完整\r\n→ 支持中英混排、自动截断超长文本\r\n```\r\n\r\n### 📊 批量数据驱动场景 — \"用这个Excel生成100张\"\r\n```\r\n用户: 这个名单.xlsx + 模板.psd → 每人一张\r\n→ 6阶段流水线: 收集→分析→匹配→预览→导出→验证\r\n→ 智能列匹配(精确/语义/位置三级)\r\n→ 双阶段输出: PSD(可再编辑) + PNG(印刷级300DPI)\r\n→ 导出后自动抽查(像素比对+可选OCR)\r\n```\r\n\r\n### 🎨 AI 智能制图场景 — \"帮我设计一个...\"\r\n```\r\n用户: 帮我做一个参会证模板 / 优化这个配色\r\n→ 分析现有PSD图层结构\r\n→ 基于设计规则推荐字体/颜色/布局\r\n→ 可调用Pillow/PIL直接生成设计稿\r\n→ 输出可编辑PSD + 预览PNG\r\n```\r\n\r\n### 🔄 复杂混合场景 — \"先分析，再改几个试试，最后批量出\"\r\n```\r\n用户: 先看看模板结构 → 改几个字预览 → 确认后全部导出\r\n→ --analyze → --dry-run → 完整导出\r\n→ 每阶段输出结果，等待用户确认后进入下一阶段\r\n```\r\n\r\n---\r\n\r\n## 🧠 系统化工作流（6 阶段）\r\n\r\n按以下顺序执行，每阶段完成后汇报发现，等待确认后再进入下一阶段。\r\n\r\n### Phase 1: 信息收集 `[GATHER]`\r\n\r\n**目标**: 确定输入和用户意图。\r\n\r\n```\r\n必需:  PSD 文件路径\r\n可选:  数据源（Excel / CSV / 手动列表 / 无）\r\n可选:  输出目录（默认 output/）\r\n可选:  操作模式（分析 / 修改 / 批量 / 混合）\r\n```\r\n\r\n**智能提问策略**:\r\n- 只给了 PSD → 询问意图：分析？修改？批量？\r\n- 给了 PSD + Excel → 默认批量模式，先分析再确认\r\n- 给了 PSD + 文字内容 → 单层/多层修改模式\r\n- 模糊描述（\"做个门票\"）→ 主动搜索工作区 PSD/Excel 文件，推荐匹配\r\n\r\n**文件搜索优先级**:\r\n1. 用户明确指定的路径\r\n2. 工作区 `*.psd` / `*.xlsx` 文件\r\n3. `psd-studio/backend/uploads/` 中的文件\r\n\r\n---\r\n\r\n### Phase 2: PSD 分析 `[ANALYZE]`\r\n\r\n**目标**: 理解 PSD 模板结构，提取所有可编辑元素。\r\n\r\n使用 `psd_analyzer.py` 或直接调用 `psd-tools`：\r\n\r\n```python\r\nfrom psd_analyzer import PSDAnalyzer\r\nanalyzer = PSDAnalyzer(\"模板.psd\")\r\nanalyzer.print_structure()\r\nlayers = analyzer.get_text_layers()\r\n```\r\n\r\n**必须输出以下分析报告**:\r\n\r\n```\r\n📋 PSD 分析报告\r\n═══════════════════════════════════════\r\n文件: 门票.psd\r\n尺寸: 1748×2480 px (300 DPI)\r\n文本图层: N 个\r\n\r\n  [1] \"姓名\"     位置(240,680)  字号48pt  色#FFF  字体:XXX\r\n  [2] \"学校\"     位置(240,820)  字号36pt  色#CCC  字体:XXX\r\n  ...\r\n\r\n智能提示:\r\n  ⚠ \"学校\"图层最大容纳14个中文字符\r\n  💡 建议使用 XXX 字体或系统黑体作为渲染字体\r\n```\r\n\r\n**⚠️ 容量分析**: 检测每个文本图层的字符容量，预判超长风险。\r\n\r\n---\r\n\r\n### Phase 3: 智能匹配 `[MATCH]`\r\n\r\n**目标**: 将 Excel 列自动映射到 PSD 文本图层。\r\n\r\n**三级匹配算法**:\r\n\r\n```\r\nL1 — 精确匹配 (high):   列名 == 图层名\r\nL2 — 语义匹配 (medium): 同义词库映射\r\nL3 — 位置匹配 (low):    按 PSD 图层顺序对应 Excel 列顺序\r\n```\r\n\r\n**同义词库**:\r\n```\r\n名字↔姓名↔Name↔名称\r\n学校↔School↔University↔院校\r\n赛区↔Division↔赛↔赛区名称\r\n编号↔ID↔No↔号码↔序号\r\n标题↔Title↔名称\r\n```\r\n\r\n**必须输出匹配报告**，标注置信度，让用户确认。\r\n\r\n---\r\n\r\n### Phase 4: 预览确认 `[PREVIEW]`\r\n\r\n**目标**: 用户在批量导出前看到效果。\r\n\r\n执行 dry-run:\r\n```bash\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --dry-run\r\n```\r\n\r\n展示前 3 行预览、字体匹配结果、预计输出数、预估耗时。\r\n\r\n---\r\n\r\n### Phase 5: 批量导出 `[EXPORT]`\r\n\r\n**目标**: 高效批量生成所有文件。\r\n\r\n**两阶段流水线**:\r\n```\r\nStep 1: 批量 PSD（文本替换）\r\n  Excel → [psd_text_editor] → N 个 PSD\r\n\r\nStep 2: 批量 PNG（背景缓存优化）\r\n  模板背景(1次) + N 个 PSD 文字 → N 个 PNG\r\n```\r\n\r\n**智能参数推荐**:\r\n| 场景 | 推荐参数 |\r\n|------|----------|\r\n| 中文为主 | `--font AlimamaShuHeiTi-Bold.ttf` |\r\n| 中英混排 | `--font NotoSansSC-Regular.ttf` |\r\n| 深色背景 | `--color 255 255 255` |\r\n| 浅色背景 | `--color 0 0 0` |\r\n| 长文本 | `--size` 比原字号小 4pt |\r\n| 打印 | `--dpi 300` |\r\n| 屏幕 | `--dpi 150` |\r\n\r\n---\r\n\r\n### Phase 6: 结果验证 `[VERIFY]`\r\n\r\n**自动检查**:\r\n1. 文件数 = Excel 行数?\r\n2. 有无 0 字节文件?\r\n3. 随机抽查 N 张：**像素比对**（重新渲染 PSD → PNG 后逐像素 diff）\r\n4. 可选 **分图层 OCR 校验**：按 PSD bbox 裁剪 → Tesseract PSM 7 → 5 级模糊打分比对\r\n\r\n**抽查参数**:\r\n```bash\r\n--verify-samples 5      # 抽查样本数（默认 3）\r\n--ocr                   # 启用 OCR 文本校验\r\n--ocr-lang chi_sim+eng  # Tesseract 语言（中英混合推荐 chi_sim+eng）\r\n--tesseract-cmd PATH    # tesseract 可执行路径\r\n--tessdata-dir PATH     # tessdata 目录（含 .traineddata 文件）\r\n```\r\n\r\n**OCR 模糊打分（5 级）**:\r\n| 级别 | 方法 | 得分 | 说明 |\r\n|------|------|------|------|\r\n| L1 | exact_full | 1.00 | 归一化后完全一致 |\r\n| L2 | substring | 0.95 | 期望文本是 OCR 结果的子串 |\r\n| L3 | tokens | 0.65–0.85 | Token 级重叠率打分 |\r\n| L4 | fuzzy | 0.60–0.99 | difflib 序列相似度 |\r\n| L5 | alnum | 0.60–0.75 | 仅字母数字的模糊匹配 |\r\n\r\n通过阈值：单字段 ≥ 0.6 且 平均分 ≥ 0.7。\r\n\r\n**输出验证报告**（`output/xxx/verify_report/`）:\r\n- `report.json` / `report.md` — 完整验证结果\r\n- `renders/` — 抽查重新渲染的 PNG\r\n- `diffs/` — 像素差异图（全黑=完全一致）\r\n\r\n---\r\n\r\n## 🧩 智能决策矩阵\r\n\r\n### 字体选择\r\n```\r\n1. PSD 原字体(已安装) → 使用原字体\r\n2. family match → 使用匹配字体\r\n3. 技能包 fonts/ → 使用自带字体\r\n4. 系统中文(微软雅黑/思源) → 降级使用\r\n5. PIL 默认 → ⚠️ 警告用户(不支持中文)\r\n```\r\n\r\n### 颜色/字号\r\n```\r\n未指定 → 从 PSD engine_dict 提取原始值\r\n文本长度 > 原容量×0.8 → 建议缩小字号\r\n```\r\n\r\n### 性能优化\r\n```\r\n<10行:  直接逐个渲染\r\n<100行: 背景预渲染 + 批量叠加\r\n≥100行: 背景预渲染 + 多进程(可选)\r\n```\r\n\r\n---\r\n\r\n## 📂 脚本索引\r\n\r\n所有脚本位于技能包 `scripts/` 目录下，路径相对于 SKILL.md 所在目录。\r\n\r\n| 脚本 | 相对路径 | 职责 |\r\n|------|----------|------|\r\n| `batch_from_excel.py` | `scripts/batch_from_excel.py` | 一键全流程（智能分析/预览/导出/验证/OCR） |\r\n| `psd_text_editor.py` | `scripts/psd_text_editor.py` | PSD 二进制文本修改 |\r\n| `render_psd_batch.py` | `scripts/render_psd_batch.py` | PSD→PNG 渲染引擎 |\r\n| `random_check.py` | `scripts/random_check.py` | 独立随机抽查工具（像素比对+OCR） |\r\n\r\n> 💡 运行方式：`python scripts/batch_from_excel.py 名单.xlsx 模板.psd output/`\r\n\r\n---\r\n\r\n## 🎬 常见场景\r\n\r\n### A. 门票/入场券\r\n```\r\n→ 搜索 *.psd → 分析 → 匹配 Excel → 预览 → 导出\r\n```\r\n\r\n### B. 邀请函\r\n```\r\n→ 邀请函.psd + 邀请函名单.xlsx → invite_batch.py（长名字支持）\r\n```\r\n\r\n### C. 号码牌\r\n```\r\n→ 纯编号(无需Excel) → generate_batch.py 或 number_card_tool.py\r\n```\r\n\r\n### D. 证书/奖状\r\n```\r\n→ 证书.psd + 学员名单.xlsx → 标准 6 阶段流程\r\n```\r\n\r\n### E. 用户只有 PSD 无 Excel\r\n```\r\n→ excel_generator.py 生成模板 → 交给用户填写 → 继续流程\r\n```\r\n\r\n---\r\n\r\n## ⚠️ 故障排除\r\n\r\n| 症状 | 原因 | 解决方案 |\r\n|------|------|----------|\r\n| 中文方框 | 字体不支持中文 | 安装中文字体或 `--font` 指定 |\r\n| 位置偏移 | bbox 计算偏差 | `--align center` 居中 |\r\n| 文字截断 | 超 PSD 文本容量 | 减小字号或缩短文本 |\r\n| PNG 模糊 | DPI 低 | `--dpi 300` |\r\n| psd-tools 报错 | PSD 版本不兼容 | PS 重新保存为\"最大兼容\" |\r\n| 原文残留 | topil() 含文字层 | 用 prerender_background() 跳过 type 层 |\r\n\r\n---\r\n\r\n## 🔧 依赖\r\n\r\n```\r\npsd-tools>=1.9.0    # PSD 读写\r\nPillow>=9.0.0       # 图片渲染\r\npandas>=1.0.0       # Excel 读取\r\nopenpyxl>=3.0.0     # Excel 写入\r\npytesseract>=0.3.10 # 可选：OCR 文本校验\r\n```\r\n\r\n**系统依赖（OCR 功能）**:\r\n\r\n1. 安装 Tesseract 引擎：[UB-Mannheim/tesseract](https://github.com/UB-Mannheim/tesseract/releases)\r\n2. 下载中文语言包 `chi_sim.traineddata` → 放入 tessdata 目录\r\n3. 运行时指定 `--ocr --ocr-lang chi_sim+eng --tesseract-cmd <path>`\r\n\r\n---\r\n\r\n## 📝 版本\r\n\r\n| 版本 | 日期 | 变更 |\r\n|------|------|------|\r\n| 3.2 | 2026-05-31 | 重新定位：从\"批量导出工具\"升级为\"PSD图层级智能引擎\"；新增核心能力地图、5类场景矩阵、AI制图场景、混合工作流 |\r\n| 3.1.1 | 2026-05-31 | 修复：脚本索引改为相对路径，去除硬编码绝对路径 |\r\n| 3.1 | 2026-05-31 | 分图层 OCR（PSD bbox 裁剪+PSM 7）、5 级模糊打分、像素比对抽查、`--verify-samples/--ocr/--ocr-lang/--tesseract-cmd/--tessdata-dir` CLI 参数、独立 `random_check.py` 工具 |\r\n| 3.0 | 2026-05-31 | 重构为 AI 操作手册：6 阶段系统化工作流、智能决策矩阵、场景模板、故障排除 |\r\n| 2.3 | 2026-05 | 背景预渲染缓存、跨平台字体、dry-run |\r\n| 2.0 | 2026-04 | 自动列匹配、语义匹配 |\r\n| 1.0 | 2026-03 | 初始版本 |\n\nFile v3.2.0:fonts/README.md\n\n# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```\n\nFile v3.2.0:README.md\n\n# PSD 图层级智能引擎\r\n\r\n> 解析 PSD 每一图层的文本/样式/位置/容量 → 分析 · 修改 · 批量 · AI制图 · 多场景输出\r\n\r\n[![ClawHub](https://img.shields.io/badge/ClawHub-v3.2-blue)](https://clawhub.com/luis1213899/psd-batch-export)\r\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\r\n\r\n## 一句话\r\n\r\n读取 PSD 每个图层的全部信息（文本、字体、字号、颜色、坐标、容量），按需执行分析诊断、单层修改、数据驱动批量替换、AI 智能制图，一键输出印刷级 PNG。\r\n\r\n## 快速开始\r\n\r\n```bash\r\n# 预览（零风险）\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd --dry-run\r\n\r\n# 导出\r\npython scripts/batch_from_excel.py 名单.xlsx 模板.psd output/ --color 0 0 0 --size 54\r\n```\r\n\r\n## 核心能力\r\n\r\n| 功能 | 说明 |\r\n|------|------|\r\n| 🔍 图层分析 | 自动识别字体族、字号(pt)、颜色(RGB/Hex)、bbox坐标、字符容量 |\r\n| ✏️ 单层修改 | 二进制定位 Txt TEXT，零损坏修改任意文本图层 |\r\n| 📊 批量生成 | Excel/CSV 数据驱动，智能列匹配(精确→语义→位置三级) |\r\n| 🎨 AI 制图 | 基于设计规则推荐字体/颜色/布局，Pillow 直接生成 |\r\n| 🔤 字体匹配 | 三级引擎：exact → family → similar，自动降级 |\r\n| 🖼️ PNG 渲染 | 背景缓存优化，PIL 居中重绘，300 DPI 印刷级输出 |\r\n| ✅ 导出验证 | 像素比对抽查 + 可选分图层 OCR 文本校验 + 5级模糊打分 |\r\n| 👁️ 干燥运行 | --analyze 分析 / --dry-run 预览，零风险确认 |\r\n\r\n## 安装\r\n\r\n```bash\r\n# ClawHub\r\nclawhub install luis1213899/psd-batch-export\r\n\r\n# 或直接使用\r\ngit clone https://github.com/luis1213899/psd-batch-export.git\r\npip install psd-tools Pillow pandas openpyxl\r\n```\r\n\r\n## 字体\r\n\r\n百度网盘合集：[下载](https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA) 提取码 `kxrv`\r\n\r\n```bash\r\npython fonts/download_fonts.py --all\r\n```\r\n\r\n## 适用场景\r\n\r\n**批量类**: 观赛门票 · 参会证 · 工牌 · 录取通知书 · 证书奖状 · 号码牌 · 邀请函 · 抽签卡\r\n\r\n**分析类**: PSD 模板审查 · 字体/颜色提取 · 容量评估 · 图层结构诊断\r\n\r\n**AI 制图类**: 智能配色 · 自动排版 · 模板设计辅助 · 样式迁移\r\n\r\n**专业类**: 印刷前检查 · 多语言文本适配 · 长文本截断预警 · 批量质量验证\r\n\r\n## 项目结构\r\n\r\n```\r\npsd-batch-export/\r\n├── SKILL.md                   # 技能入口 (AI 操作手册)\r\n├── README.md                  # 项目说明\r\n├── requirements.txt           # Python 依赖\r\n├── fonts/                     # 字体库\r\n│   ├── README.md\r\n│   └── download_fonts.py\r\n└── scripts/\r\n    ├── batch_from_excel.py    # 一键流程（分析/预览/导出/验证/OCR）\r\n    ├── psd_text_editor.py     # PSD 文本修改引擎\r\n    ├── render_psd_batch.py    # PSD → PNG 渲染引擎\r\n    └── random_check.py        # 独立抽查工具（像素比对+OCR）\r\n```\n\nFile v3.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"3.2.0\",\n  \"publishedAt\": 1780219587584\n}\n\nFile v3.2.0:skill-card.md\n\n## Description: <br>\nPSD layer-level automation skill that analyzes text, styles, positions, and capacity in PSD files, then helps modify layers, batch-replace text from data sources, generate PSD/PNG outputs, and validate exports. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[luis1213899](https://clawhub.ai/user/luis1213899) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDesign, operations, and developer users can use this skill to inspect PSD templates, map spreadsheet data to text layers, generate batches of editable PSD files and rendered PNGs, and run export checks for ticket, certificate, invitation, badge, poster, and similar template workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill may search workspace or upload folders for PSD and Excel files when prompts are vague. <br>\nMitigation: Provide exact PSD, XLSX or CSV paths and an explicit output directory before asking the agent to analyze, modify, or export files. <br>\nRisk: PSD templates, spreadsheets, generated reports, and rendered outputs may contain private names, IDs, event details, or design assets. <br>\nMitigation: Treat inputs and generated artifacts as sensitive, limit access to the intended files, and review reports before sharing them outside the working context. <br>\nRisk: Batch export and text\n\nArchive v3.1.1: 11 files, 32737 bytes\n\nFiles: fonts/download_fonts.py (4205b), fonts/README.md (753b), README.md (2322b), requirements.txt (100b), scripts/batch_from_excel.py (40653b), scripts/psd_text_editor.py (9382b), scripts/random_check.py (12458b), scripts/render_psd_batch.py (10526b), skill-card.md (2334b), SKILL.md (9278b), _meta.json (135b)","readmeExcerpt":"Skill: PSD Batch Export Owner: luis1213899 Summary: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... Tags: ai:4.1.0, ai-design:3.2.0, analysis:3.2.0, batch:4.3.0, cached-bg:2.3.0, chinese:3.2.0, color:4.2.0, coupon:4.2.0, design:4.3.0, export:2.5.1, font-library:2.5.1, font-matching:2.5.0, invite:4.3.0, late","codeSnippets":[],"executableExamples":[{"language":"powershell","snippet":"python scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3\npython scripts/psd_batch.py verify \"out\" --samples 3\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning"},{"language":"powershell","snippet":"python scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\" --dry-run\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scripts/smart_layout.py --preset certificate\npython scripts/psd_text_editor.py \"in.psd\" \"out.psd\" \"图层名=新文本\""},{"language":"powershell","snippet":"python -m compileall -q scripts\npython -m pytest -q\npython scripts/psd_batch.py diagnose --json"},{"language":"powershell","snippet":"$env:PYTHONUTF8='1'; python C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py ."},{"language":"powershell","snippet":"openclaw skills install . --global --force\nopenclaw skills check --json"},{"language":"text","snippet":"File v4.4.2:README.md\n\n# PSD Batch Export\n\nProduction PSD batch workflow for analyzing Photoshop text layers, mapping Excel/CSV data, generating editable PSD plus PNG batches, and verifying outputs.\n\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.4-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n## Quick Start"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: psd-batch-export\ndescription: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches, validating results, checking fonts/OCR dependencies, and using built-in PSD templates for tickets, certificates, invitations, badges, posters, daily cards, and recruitment assets. Use whenever the user mentions PSD, Photoshop templates, layer text replacement, batch image generation, Excel-driven design output, PSD analysis, print-ready PNG export, or OpenClaw/Claude/Codex skill packaging for PSD automation.\nallowed-tools: [Read, Write, Edit, Bash]\n---\n\n# PSD Batch Export Skill\n\nUse this skill for production PSD batch generation. Resolve all paths relative to the directory containing this `SKILL.md`; do not rely on machine-specific absolute paths.\n\n## Preferred Entry Point\n\nUse the unified CLI first:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3\npython scripts/psd_batch.py verify \"out\" --samples 3\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\n```\n\nBuilt-in template IDs can be used instead of PSD paths: `morning`, `tech`, `doodle`.\n\n## Workflow\n\n1. Run `diagnose --json` before production work to check required Python packages, fonts, templates, optional OCR, and optional LLM configuration.\n2. Run `analyze` with the PSD and optional Excel/CSV data source. Review `layers`, `mapping`, `capacity_risks`, `fonts`, `warnings`, and `errors`.\n3. Run `preview` before full export. Check `out/dryrun_preview/` and the JSON report.\n4. Run `export` to generate `out/psd/`, `out/png/`, and `out/verify_report/report.json`. Replacement text keeps the original PSD text-layer color; pass `--color R G B` only when the user explicitly requests a uniform override.\n5. Run `verify` again when outputs are moved or inspected separately.\n\nUse `--strict` for production batches where low-confidence column matches, capacity overflow, or missing fonts should stop the run before export.\n\n## Stable Report Contract\n\nAll primary commands support `--json` and `--json-out <path>`. The report includes:\n\n- `status`: `ok` or `error`\n- `inputs`: PSD, data, output, or template inputs\n- `layers`: detected PSD text layer details\n- `mapping`: data-column to layer mapping with confidence\n- `capacity_risks`: text fields likely to truncate\n- `fonts`: available fonts and matching recommendations\n- `outputs`: generated directories, files, and verification report paths\n- `warnings`: non-fatal production risks\n- `errors`: fatal failures\n- `runtime_sec`: elapsed seconds\n\nExit codes are stable: `0` success, `1` input error, `2` dependency/PSD compatibility erro"},{"path":"fonts/README.md","content":"# 字体库 — 推荐安装的中文字体\r\n\r\n将 .ttf/.otf 文件放入此目录，技能会自动扫描使用。\r\n\r\n## 一键获取字体\r\n\r\n**百度网盘（推荐）**：https://pan.baidu.com/s/16mr469ucSXcNpm-6GD_QeA 提取码: `kxrv`\r\n\r\n下载后解压到本目录即可。\r\n\r\n## 推荐免费商用字体\r\n\r\n| 字体 | 风格 | 来源 |\r\n|------|------|------|\r\n| 阿里妈妈数黑体 | 粗黑体 | 阿里巴巴普惠体 |\r\n| 阿里妈妈方圆体 | 圆体 | fonts.alibabagroup.com |\r\n| 思源黑体 | 标准黑体 | Adobe + Google |\r\n| 思源宋体 | 标准宋体 | Adobe + Google |\r\n| 霞鹜文楷 | 手写楷体 | LXGW WenKai |\r\n\r\n## 快速下载\r\n\r\n```bash\r\n# 使用内置脚本自动下载开源字体\r\npython fonts/download_fonts.py\r\n```"},{"path":"README.md","content":"# PSD Batch Export\n\nProduction PSD batch workflow for analyzing Photoshop text layers, mapping Excel/CSV data, generating editable PSD plus PNG batches, and verifying outputs.\n\n[![ClawHub](https://img.shields.io/badge/ClawHub-v4.4-blue)](https://clawhub.com/luis1213899/psd-batch-export)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n## Quick Start\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze \"template.psd\" --data \"data.xlsx\" --json-out report.json\npython scripts/psd_batch.py preview \"template.psd\" --data \"data.xlsx\" --out \"out\" --rows 3\npython scripts/psd_batch.py export \"template.psd\" --data \"data.xlsx\" --out \"out\" --dpi 300 --verify-samples 3 --json-out out/report.json\npython scripts/psd_batch.py verify \"out\" --samples 3 --json\n```\n\nBuilt-in templates:\n\n```powershell\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info morning\npython scripts/psd_batch.py export morning --data \"data.xlsx\" --out \"out\"\n```\n\n## What It Does\n\n| Capability | Description |\n| --- | --- |\n| Layer analysis | Detects PSD text layers, text, font family, font size, fill color, bbox, and capacity risk. |\n| Data mapping | Maps Excel/CSV columns to PSD layers with confidence labels and optional `--strict` failure mode. |\n| Preview | Renders the first N rows to `out/dryrun_preview/` before full export. |\n| Batch export | Writes editable PSD files to `out/psd/` and print-ready PNG files to `out/png/`; replacement text keeps each PSD layer color unless `--color` is provided. |\n| Verification | Writes `out/verify_report/report.json` and optional OCR checks when Tesseract is configured. |\n| Template catalog | Reads built-in template metadata from `references/templates.json`. |\n| Runtime compatibility | Designed for Claude/ClawHub, Codex, and OpenClaw with one source folder. |\n\n## Stable CLI\n\n```powershell\npython scripts/psd_batch.py diagnose --json\npython scripts/psd_batch.py analyze <template.psd|template-id> [--data data.xlsx] [--sheet 0] [--json-out report.json]\npython scripts/psd_batch.py preview <template.psd|template-id> --data data.xlsx --out out --rows 3 [--color R G B]\npython scripts/psd_batch.py export <template.psd|template-id> --data data.xlsx --out out [--dpi 300] [--font font.ttf] [--color R G B] [--verify-samples 3] [--strict]\npython scripts/psd_batch.py verify out [--samples 3] [--color R G B] [--ocr]\npython scripts/psd_batch.py templates list\npython scripts/psd_batch.py templates info <morning|tech|doodle>\n```\n\nExit codes:\n\n| Code | Meaning |\n| --- | --- |\n| 0 | Success |\n| 1 | Input or argument error |\n| 2 | Missing dependency or incompatible PSD |\n| 3 | Export or verification failure |\n| 4 | Unexpected failure |\n\n## Legacy Scripts\n\nThese remain available for backward compatibility:\n\n```powershell\npython scripts/batch_from_excel.py \"data.xlsx\" \"template.psd\" \"out\"\npython scripts/ai_designer.py --list\npython scripts/color_tools.py --recommend ticket\npython scr"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75g2sw7ssvtwkxyw4pce8t3d84mna2\",\n  \"slug\": \"psd-batch-export\",\n  \"version\": \"4.4.2\",\n  \"publishedAt\": 1780725098783\n}"},{"path":"references/runtime-compat.md","content":"# Runtime Compatibility\n\nUse one source skill folder for Claude/ClawHub, Codex, and OpenClaw. Always resolve scripts relative to the folder that contains `SKILL.md`.\n\n## Claude / Claude Code\n\nInstall by keeping or copying the folder under:\n\n```powershell\n~/.claude/skills/psd-batch-export\n```\n\nRun:\n\n```powershell\npython scripts/psd_batch.py diagnose --json\n```\n\n## Codex\n\nInstall by copying or syncing the same folder under:\n\n```powershell\n~/.codex/skills/psd-batch-export\n```\n\nValidate on Windows with UTF-8 mode:\n\n```powershell\n$env:PYTHONUTF8='1'\npython C:\\Users\\26240\\.codex\\skills\\.system\\skill-creator\\scripts\\quick_validate.py C:\\Users\\26240\\.codex\\skills\\psd-batch-export\n```\n\nThe shared `SKILL.md` intentionally avoids Claude-only frontmatter such as `argument-hint` so the same file can pass Codex validation.\n\n## OpenClaw\n\nInstall the local folder into the shared OpenClaw managed skills directory:\n\n```powershell\nopenclaw skills install \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --global --force\nopenclaw skills check --json\n```\n\nInspect:\n\n```powershell\nopenclaw skills info psd-batch-export\n```\n\n## ClawHub\n\nDo not publish automatically. When a release is requested, use an explicit version and changelog:\n\n```powershell\nclawhub --no-input skill publish \"C:\\Users\\26240\\.claude\\skills\\psd-batch-export\" --slug psd-batch-export --owner luis1213899 --version 4.4.0 --changelog \"v4.4.0: unified production CLI, structured reports, tests, and Claude/Codex/OpenClaw compatibility.\" --clawscan-note \"Local PSD processing skill. Optional network access is limited to user-triggered font downloads or optional LLM calls when API keys are configured.\"\nclawhub inspect psd-batch-export\n```\n\nNever include Git remote URLs or credentials in release notes, reports, or public logs."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... Skill: PSD Batch Export Owner: luis1213899 Summary: Production PSD batch workflow for analyzing PSD text layers, mapping Excel/CSV data to editable layers, previewing, exporting editable PSD plus PNG batches,... Tags: ai:4.1.0, ai-design:3.2.0, analysis:3.2.0, batch:4.3.0, cached-bg:2.3.0, chinese:3.2.0, color:4.2.0, coupon:4.2.0, design:4.3.0, export:2.5.1, font-library:2.5.1, font-matching:2.5.0, invite:4.3.0, late","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1205,"uniquenessScore":48,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T11:05:03.533Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T14:13:15.307Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}