← 返回 Skills 市场
100
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install generate-wenyan-theme
功能描述
AI-ready skill to design and generate highly customized CSS themes for WeChat Official Accounts.
使用说明 (SKILL.md)
微信公众号自定义主题 CSS 生成器 (WeChat CSS Theme Generator)
这是一个专门为 AI Agent 设计的技能,用于根据用户的自然语言需求,生成符合微信公众号排版规范的、高度定制化的 CSS 样式表。此技能仅负责生成 CSS 代码并保存为本地文件。
核心能力
- 自然语言转 CSS:理解用户的视觉需求(如“赛博朋克风”、“带可爱表情的引用块”、“深色代码块”),并转换为精确的 CSS 代码。
- 微信排版规范适配:严格遵循
#wenyan命名空间约束,确保生成的样式能完美注入并生效于微信公众号的 DOM 结构中。 - 高级排版特效:支持利用伪元素 (
::before,::after)、渐变背景 (linear-gradient)、内联 SVG/Base64 图片等高级 CSS 特性实现复杂视觉效果。
AI Agent 指令指南:CSS 生成规范
Agent 在生成 CSS 代码时,必须 遵循以下严格的规则和约束:
1. 强制命名空间约束 (最重要!)
所有生成的 CSS 选择器 必须 以 #wenyan 开头,中间用空格隔开。任何缺少 #wenyan 前缀的样式都将失效。
- ✅ 正确:
#wenyan h1 { color: red; } - ❌ 错误:
h1 { color: red; }
2. 字体与字号建议
- 字体族 (font-family):严禁主动设置
font-family。应当保持默认以适配微信公众号编辑器的系统字体。 - 字号 (font-size):建议设定合理的范围(如
12px - 18px),以避免排版溢出或阅读困难。
3. 支持的 CSS 属性速查字典
| 目标元素 | 对应的 CSS 选择器 | 常用定制属性示例 |
|---|---|---|
| 全局默认样式 | #wenyan |
background-image, line-height, color |
| 各级标题 (H1-H6) | #wenyan h1 到 #wenyan h6 |
font-size, text-align, border-bottom, margin |
| 标题文字本身 | #wenyan h1 span |
color, font-weight, background (实现文字高亮) |
| 标题装饰 (前后缀) | #wenyan h1::before |
content, display, width, height, background-image |
| 段落文本 | #wenyan p |
text-indent, letter-spacing, color |
| 引用块整体 | #wenyan blockquote |
border-left, background-color, padding |
| 代码块外层容器 | #wenyan pre |
background-color, border-radius, padding, overflow-x: auto |
| 代码块内部内容 | #wenyan pre code |
color |
| 分割线 | #wenyan hr |
border, border-top-style, border-color |
| 超链接 | #wenyan a |
color, text-decoration, border-bottom |
4. 外部资源引用限制 (🚨 极易出错)
- 禁止本地路径:严禁使用
url("./bg.png")等本地路径。 - 合法引入方式:
- Data URI (推荐):
url("data:image/svg+xml;utf8,\x3Csvg>...\x3C/svg>") - HTTPS 地址:
url(https://example.com/bg.jpg)
- Data URI (推荐):
- 禁止 Web 字体:不支持
@font-face。只能使用本地系统字体。
参考模板 (default.css)
在生成新的主题时,请参考以下 wenyan-cli 的默认样式结构:
/* 全局属性 */
#wenyan {
line-height: 1.75;
font-size: 16px;
}
/* 全局子元素属性 */
/* 支持分组 */
#wenyan h1,
#wenyan h2,
#wenyan h3,
#wenyan h4,
#wenyan h5,
#wenyan h6,
#wenyan p {
margin: 1em 0;
}
/* 一级标题 */
#wenyan h1 {
text-align: center;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
font-size: 1.5em;
}
/* 二级标题 */
#wenyan h2 {
text-align: center;
font-size: 1.2em;
border-bottom: 1px solid #f7f7f7;
font-weight: bold;
}
/* 列表 */
#wenyan > ul,
#wenyan > ol {
padding-left: 1rem;
}
#wenyan ul,
#wenyan ol {
margin-left: 1rem;
font-size: 0.9rem;
}
/* 图片 */
#wenyan img {
max-width: 100%;
height: auto;
margin: 0 auto;
display: block;
}
/* 表格 */
#wenyan table {
border-collapse: collapse;
margin: 1.4em auto;
max-width: 100%;
table-layout: fixed;
text-align: left;
overflow: auto;
display: table;
}
/* 引用块 */
#wenyan blockquote {
background: #afb8c133;
border-left: 0.5em solid #ccc;
margin: 1.5em 0;
padding: 0.5em 10px;
font-style: italic;
font-size: 0.9em;
}
/* 行内代码 */
#wenyan p code {
color: #ff502c;
padding: 4px 6px;
font-size: 0.78em;
}
/* 代码块外围 */
#wenyan pre {
border-radius: 5px;
line-height: 2;
margin: 1em 0.5em;
padding: .5em;
box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px;
font-size: 12px;
}
/* 代码块 */
#wenyan pre code {
display: block;
overflow-x: auto;
margin: .5em;
padding: 0;
}
/* 分割线 */
#wenyan hr {
border: none;
border-top: 1px solid #ddd;
margin-top: 2em;
margin-bottom: 2em;
}
/* 链接 */
#wenyan a {
word-wrap: break-word;
color: #0069c2;
}
自动化工作流示例 (Agent 执行步骤)
- 分析需求:提取关键词(如:深色、科技风),确定主色调。
- 生成 CSS:严格按照命名空间约束,生成完整的 CSS 代码。
- 保存文件:将生成的 CSS 内容写入当前目录的本地文件(如
theme.css)。 - 后续引导:提示用户使用
apply-wechat-custom-theme技能进行测试渲染或发布。
安全使用建议
This skill appears coherent and low-risk: it only generates CSS and writes it to a local file. Before installing/using it, (1) confirm you are comfortable with the agent writing files to your current directory and inspect the generated theme.css before uploading to WeChat; (2) be aware data URIs or embedded Base64 images can make files large — verify any external HTTPS resources are trustworthy; (3) the skill references a 'wenyan-cli' and another skill for applying themes — those are not included here, so review any follow-up tools before using them; and (4) because this is instruction-only, the static scanner produced no findings (expected)—lack of findings does not guarantee safety, so manually review generated CSS and file operations.
功能分析
Type: OpenClaw Skill
Name: generate-wenyan-theme
Version: 1.0.0
The skill is a legitimate tool designed to guide an AI agent in generating CSS themes for WeChat Official Accounts. It contains specific formatting constraints (e.g., the #wenyan namespace) and safety guidelines (e.g., prohibiting local file paths and web fonts) to ensure compatibility and security within the target environment. No malicious code, data exfiltration, or harmful prompt injection attempts were found in SKILL.md or _meta.json.
能力评估
Purpose & Capability
Name/description match the runtime instructions: the SKILL.md describes generating WeChat-specific CSS and saving it locally. Nothing requested (no env vars, binaries, or installs) is disproportionate to that purpose.
Instruction Scope
Instructions are narrowly scoped to: parse user intent, generate CSS constrained to the '#wenyan' namespace, and save a local file (e.g., theme.css). This is appropriate, but the agent will write files to the current directory — users should expect that and inspect outputs. The doc references another skill ('apply-wechat-custom-theme') but does not require any cross-skill credentials.
Install Mechanism
No install spec or code is present (instruction-only). That minimizes install-time risk; nothing is downloaded or written by an installer.
Credentials
The skill requests no environment variables, credentials, or config paths. All required capabilities (generate CSS, save file) are possible without secrets, so the lack of requested credentials is proportionate.
Persistence & Privilege
always is false and disable-model-invocation is default; the skill does not request elevated or persistent privileges and does not modify other skills or system settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install generate-wenyan-theme - 安装完成后,直接呼叫该 Skill 的名称或使用
/generate-wenyan-theme触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the WeChat Official Account custom CSS theme generator skill.
- Enables AI-driven generation of highly customized, namespace-compliant CSS themes for WeChat using natural language input.
- Ensures all generated CSS strictly uses the `#wenyan` prefix for full compatibility with WeChat's DOM structure.
- Supports advanced effects such as pseudo-elements, gradients, and inline SVG/Base64 backgrounds.
- Enforces best practices: no custom fonts, safe external resource linking, and guided font size ranges.
- Includes a detailed reference and CSS template for easier and more accurate theme creation.
元数据
常见问题
微信公众号自定义主题生成器 是什么?
AI-ready skill to design and generate highly customized CSS themes for WeChat Official Accounts. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。
如何安装 微信公众号自定义主题生成器?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install generate-wenyan-theme」即可一键安装,无需额外配置。
微信公众号自定义主题生成器 是免费的吗?
是的,微信公众号自定义主题生成器 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
微信公众号自定义主题生成器 支持哪些平台?
微信公众号自定义主题生成器 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 微信公众号自定义主题生成器?
由 Lei(@caol64)开发并维护,当前版本 v1.0.0。
推荐 Skills