text-card
Original:🇨🇳 Chinese
Translated
Use this when you need to create text card images. It includes generating card HTML and calling the underlying HTML-to-image capability to output the final image. Suitable for scenarios such as WeChat Official Account long article covers, Xiaohongshu/Xiaolvshu graphic covers, etc.
16installs
Added on
NPX Install
npx skill4agent add hanfangyuan4396/text-card-skills text-cardTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Text Card
Use this Skill when the task is to create text card images. Suitable for:
- WeChat Official Account long article push cover images
- Xiaohongshu graphic cover images (also applicable to Xiaolvshu and WeChat Official Account graphic covers, same size)
By default, priority is given to copying and modifying based on existing templates or examples, do not generate from scratch.
Workflow
- Confirm the cover platform: If the user does not explicitly specify whether to make a "WeChat Official Account cover" or "Xiaohongshu cover", you must first ask the user to choose, and do not make assumptions without permission.
- Collect card copy and basic style information.
- Select the appropriate template directory according to the scenario, read under the directory to understand variables, copy constraints and example styles.
USAGE.md - Generate three options for selection: When making, randomly select different templates or match the same template with three different color schemes, generate three options, let the user choose before outputting the final image. If the user has clearly specified the template and color, skip this step and generate directly.
- If the user does not explicitly require other styles or structures, directly reuse the example HTML closest to the requirements under , replace the copy and make a small number of necessary adjustments; only generate from scratch when the example is obviously not suitable.
references/ - Ensure that there is a clear card container in the final HTML, it is recommended to use .
id="card" - Call the underlying Skill to render the image, and check the output result.
html-to-image-render - If the user does not specify a style, and the first version is generated based on the example template, actively ask whether you need to continue to adjust the color, typography, font size, white space or decoration details when delivering.
Important Requirements
- When there are reusable complete examples under , and the user does not explicitly require instructions such as "change a style", "redesign", "do not refer to templates", etc., you must directly modify based on the reference example closest to the requirements, and do not redo the layout by yourself.
references/ - Modify based on reference examples, only these changes are made by default: replace copy, fine-tune font size, line spacing, color, add or remove a very small number of decorations or emojis, to ensure that the content can be stably placed in the original layout.
- It is allowed not to directly reuse the reference example only in the following cases: the reference example cannot accommodate the target copy, the structure is obviously mismatched with the task type, or the user explicitly requires a new visual style.
- If you decide not to reuse the reference example, you must clearly explain the reason first.
Current Templates
| Directory | Applicable Scenarios | Size |
|---|---|---|
| Xiaohongshu/Xiaolvshu quoted golden sentence card, opinion card, cover image | 1080×1440 (3:4) |
| WeChat Official Account push cover image (large character newspaper style) | 2680×800 (3.35:1) |
| WeChat Official Account push cover image (grid background + highlight color bar) | 2680×800 (3.35:1) |
| WeChat Official Account push cover image (color block splicing + bubble label) | 2680×800 (3.35:1) |
Each template directory contains: (variable placeholder version), (color matching example), (variable description, copy constraints, example styles, etc.). Read the corresponding before using the template.
template.htmlexample-*.htmlUSAGE.mdUSAGE.mdCoding Conventions
- Output a single card layout by default, and place the core content in the container.
#card - Use inline or
styleto avoid relying on external style files.<style> - Clearly set background, font size, line height and padding.
- By default, priority is given to maintaining a solid color background and clear typography, do not actively add complex gradients, halos or large-area decorations; only add them when the user explicitly requires a stronger visual style.
- If remote images, Logos, fonts are required, reserve sufficient loading waiting time for the underlying rendering.
Notes
- Rendering method, command parameters and viewport settings, uniformly refer to the Skill.
html-to-image-render - If the user does not specify the image save location, save it to in the current working directory by default.
text-card-images/ - If does not exist, create this directory before rendering.
text-card-images/ - The output image file extension should be consistent with .
--image-type - If the underlying rendering reports that does not exist, first check whether
element_idactually exists in the HTML.id="card"