Preface¶
When building content or image-generation skills in DeepSeek Harness (DSH), after files are written to disk there is often still one question to answer: whether this image can be posted to a specified platform, and which requirement it falls short on. Platform errors often only say “does not meet requirements” without telling you how many pixels are missing; AI image-generation default sizes (e.g. 1024×1024) also often fail to reach the minimum width for channels like Xiaohongshu (RED). Another kind of problem is more hidden: the dpi metadata looks compliant, but the actual print width computed by the formula is still insufficient—changing the dpi number does not add pixels.
The following introduces the community plugin publish-size-check (maintainer Stephen-pc): it compares the geometric requirements of a target platform against a built-in spec library, and outputs whether the image can be published, which item fails, and an actionable remediation conclusion. The decision logic lives in a Python script; on the DSH side, the same SKILL.md is mounted via the skill provider, so the command line and DSH share one set of checks.
What Is This¶
publish-size-check is positioned as a “publish size check”: against target-platform specifications, it checks whether an image can be posted and which parameter fails. Its implementation emphasizes zero dependencies (the Python side uses only the standard library, with no Pillow), read-only handling of the original file, and deterministic results; it only checks geometric parameters, not content compliance, copyright, QR codes, etc.
The spec library covers 10 platforms / 20 slots / 46 parseable names (including WeChat Official Account, Xiaohongshu, Bilibili, Zhihu, Weibo, Douyin, WeChat Channels, academic submission, print delivery, client delivery, etc.). Platform names support id, Chinese name, aliases, and fuzzy matching (e.g. 红书 → Xiaohongshu). Each spec entry carries a three-level confidence marker in the data: verified (cross-corroborated), community (community consensus), experience (experience-based, needs review).
Core Features¶
Single Image vs. Platform Spec¶
For a specified file, it reads pixel dimensions, aspect ratio, dpi, file size, and format and other geometry-related items, and compares them against the target slot’s requirements. Output is classified into three levels: [X] error, [!] warning, [i] info; each entry carries a concrete fix, and a one-sentence action conclusion is given, e.g. “Not salvageable: insufficient pixels, must re-export from the source file at a larger size (upscaling is ineffective)” or “Salvageable: just convert the format”.
dpi and Actual Print Width¶
Besides pixel width and height, it applies pixels ÷ dpi × 25.4 = actual print width (mm) to determine whether print-related requirements are met, avoiding cases where “the dpi field passes but the printed size is insufficient” being mistakenly allowed.
Multi-Image Sequences and Group-Level Consistency¶
When ≥2 files are passed at once, in addition to per-file checks it adds a “is the whole group uniform” test: for example, when sizes are not uniform it will point out the one image that differs from the majority, instead of vaguely saying “multiple images are inconsistent”.
As a Skill in DSH¶
After installation the skill name is publish-check. Triggering works the same as an Agent Skill in the repo: when the user provides files and asks about publish sizes, whether it will look blurry, what size a platform requires, whether the dpi is enough, etc.; or when an image-generation workflow writes files to disk and the context mentions a publish platform, it can perform a parasitic self-check according to the protocol in SKILL.md—if it passes, mention it briefly; if there are problems, expand on them and suggest re-exporting per spec.
When the host runs a check, the actual command is performed by scripts/spec.py; DSH’s lib/index.js only mounts the skill to ctx.skills, and on get() handles the {skill_base} placeholder and dsh’s resourceBase convention, so that the model sees an executable relative path, e.g.:
python scripts/spec.py --check cover.png --target 小红书
Installation and Activation¶
In an environment where DeepSeek Harness is already installed, add the plugin following the dsh installation method given in the repo README (web profile example):
dsh plugin --profile web add github:Stephen-pc/publish-size-check
Once installed, publish-check will appear in the skills directory; the trigger method is the same as directly copying SKILL.md into a local skills directory; the plugin form facilitates future upgrades and team distribution via configuration. The npm package declares engines.node as >=18; running spec.py requires Python 3.8+ on the local machine, and the script itself installs no third-party Python packages.
The plugin runs with the permissions of the current dsh process. Before installing, it is recommended to review the source code and the MIT license on GitHub to confirm that the spec library and invocation method match your environment. Community directory page: skillhub.cn plugin page (an independent community site, with no official affiliation to DeepSeek / High-Flyer).
It can also be installed via the one-click installation flow on dsh-market (the list is included in awesome-dsh-plugin); it points to the same repository as the GitHub source above.
Typical Usage¶
The following examples come from the project README and can be run from the package root after cloning or installation (when guided by the skill inside DSH, the working directory should align with the package’s resourceBase).
View a platform’s requirements:
python scripts/spec.py --spec 小红书
Check a single image and specify the platform:
python scripts/spec.py --check cover.png --target 小红书
Without specifying a platform, scan all social-media-related slots:
python scripts/spec.py --check cover.png
Multiple images and JSON output:
python scripts/spec.py --check 1.png 2.png 3.png --target 小红书
python scripts/spec.py --check cover.png --target 小红书 --json
List the platforms included in the spec library:
python scripts/spec.py --list
One-click demo of five typical scenarios:
python demo.py
If the project is installed as a Python package, the entry command publish-size-check is also available; a custom spec library can be pointed to a local JSON via the environment variable PUBLISH_SIZE_CHECK_SPEC.
Plugin package self-check (verifying dsh wiring and paths):
node tools/dsh-selftest.mjs
Use Cases and Boundaries¶
Suitable for: pre-publication self-checks of size/dpi/ratio/size/format for self-media and multi-platform posting; verification of geometric parameters before academic or print delivery; automatic or on-demand health checks after image generation in a DSH workflow, reducing back-and-forth where content is only rejected by the platform after being posted.
Not suitable for: content review, infringement, contact information, industry qualifications, etc.—the tool explicitly lists these “not checked” items in the README, and the scope is deliberately narrowed to maintain zero dependencies and determinism.
The maintainer’s README gives an example: the common AI image size 1024×1024 fails when submitted as a square cover for Xiaohongshu because the width is below 1080px; such conclusions rely on the built-in references/platforms.json, where verified entries require a source, and other levels should be judged against your actual publishing channels.
Closing¶
publish-size-check converges “can it be posted, which item falls short, and what to do now” into a single reproducible check command and a skill-trigger protocol; the DSH side only does thin wiring, and the decision always lands in scripts/spec.py. For spec details or secondary development, refer to the repository documentation and source code.
- Community directory: https://www.skillhub.cn/plugins/Stephen-pc/publish-size-check
- GitHub: https://github.com/Stephen-pc/publish-size-check