Communitygithub.com

umairmsm/wp-design

WordPress 设计的第二阶段:确定设计方向、制作静态 HTML/CSS 原型,生成设计令牌,获得所有者签字确认,并使用自托管字体,最后将批准的外观移植为可替换的 WordPress 皮肤。用于“设计站点”、“新外观”、“重新设计”、“更改颜色或字体”、“制作新皮肤”、“将原型移植到 WordPress”等场景。

wp-design 是什么?

这个技能(Stage 2: Design)是 wp-site-kit 构建流程的第二阶段,专注于将 WordPress 站点的外观从概念推进到可交付的、获得所有者批准的视觉设计。它要求生成一份设计方向文档(`DESIGN_DIRECTION.md`),包含北极星目标、受众、竞争规避原则以及不可妥协的要求,并最多提供两到三个方向作为小型情绪板或主页模型。接着,在 `static/` 目录下构建纯 HTML/CSS 原型,其 `css/tokens.css` 必须与主题 `skins/default/tokens.css` 中的令牌名称一致,所有组件仅使用这些令牌,以确保设计令牌化且与底层逻辑解耦。技能强制从开始就贯彻无障碍标准,包括对比度 ≥4.5:1、可见焦点、单一 H1、跳过导航、键盘路径以及尊重 `prefers-reduced-motion`,并通过 axe 扩展检查原型。之后获得所有者签字确认,记录批准日期并保存所有截屏(手机 375px 和笔记本 1440px)。最后,实现自托管字体(仅 `.woff2`,子集化,预加载首屏字体),并将令牌和组件 CSS 移植到 WordPress 皮肤中,形成可切换、可替换的视觉层,而核心数据与标记合约保持不变。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/umairmsm/wp-site-kit/tree/HEAD/skills/wp-design

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

阶段 2:设计

目标:所有者已批准在手机和笔记本电脑上看到的外观。该外观以令牌的形式编写,因此可以复制为 WordPress 皮肤,且以后替换时不会丢失功能。

步骤

  1. 方向。 填写项目的 docs/DESIGN_DIRECTION.md:北极星目标、受众、绝对不能看起来像什么(竞争对手、模板)以及不可妥协的要求。最多提供两到三个方向,以小型情绪板或主页模型的形式呈现,而非完整站点。
  2. 在 static/ 中制作原型。 纯 HTML 和 CSS。css/tokens.css 使用与主题 skins/default/tokens.css 相同的名称。组件仅使用令牌。真实结构(页眉、主页、卡片、表单、页脚),占位内容,无价格和政策文本。
  3. 从一开始就实现无障碍:
    • 文本对比度 ≥ 4.5:1;
    • 可见焦点;
    • 一个 H1;
    • 跳过链接;
    • 键盘路径;
    • 尊重 prefers-reduced-motion。 在展示原型之前,使用 axe(浏览器扩展)检查原型。
  4. 所有者审查。 每页在手机(375 px)和笔记本电脑(1440 px)宽度下的截屏。将批准日期记录在 DESIGN_DIRECTION.md 中,并将截屏保存到 docs/design/。
  5. 字体: 自托管 .woff2 文件,子集化为所需语言,检查许可证,并预加载一两个首屏字体(命名为 *-preload.woff2)。任何地方都不请求 Google Fonts。
  6. 移植到 WordPress(references/design-system.md):
    • 将令牌复制到皮肤中;
    • 将组件 CSS 移动到 skin.css;
    • 使用核心的渲染函数布局模板;
    • 仅在标记必须不同的位置添加皮肤部分覆盖。 外观改变;核心的数据和标记合约不变。
  7. 后续重新设计 即为新皮肤:将 skins/default 复制为 skins/<name>,更改令牌,使用 ?skin=<name>(管理员)预览,并在批准后通过 <prefix>_skin 选项切换。

关卡(在 SITE_STATUS.md 中勾选)

  • DESIGN_DIRECTION.md 已编写;所有者批准已记录并附有截屏
  • 令牌已定义;组件仅使用令牌
  • 字体已自托管;0 次对 Google Fonts 的请求

经验教训

  • 当业务伙伴发送自己的重新设计时,锁定的设计发生了变化。因为外观是皮肤,切换保留了所有功能。将每个设计都构建为皮肤,即使是第一个。
  • 不要复制竞争对手的调色板、字体配对或布局。所有者会注意到,而访客不会记住你。
  • 用于尝试想法的仅测试皮肤(dev-*)从不在生产环境中显示。
  • 如果安装了 frontend-design 或 design-motion-principles 技能,请使用它们来确定方向和运动效果。

Individual skills in this repo

This repo contains 7 individual skills — each has its own dedicated page.

umairmsm/wp-build

Stage 3 of a wp-site-kit WordPress build - local DDEV site, the core must-use plugin (modules), the presentation-only child theme with skins, the content model (custom post types, meta, WP_Query, render functions), and the enquiry pipeline that saves leads before forwarding. Use when building or changing features, templates, content types, forms or plugin modules on a wp-site-kit site.

umairmsm/wp-content

Stage 4 of a wp-site-kit WordPress build - real copy and photos. Content truth (facts only from the owner), AI drafts and owner approval, claims audits, banned words and fake proof, legal pages, the photo pipeline (dedupe, real-only, EXIF strip, WebP sizes, alt text, AI image register), and recorded content changes. Use for "write the copy", "add photos", "the owner sent new photos", "check for duplicates", "update prices or text on the live site", "legal pages".

umairmsm/wp-kickoff

Stage 1 of a wp-site-kit WordPress build. Use when starting a new WordPress website or taking over or rebuilding an existing one - discovery brief, stack decision, creating the project with bin/wp-site-new, locked decisions, private repo and credentials inventory. Triggers - "new WordPress site", "start a client website", "rebuild this site", "take over this WordPress site".

umairmsm/wp-operate

Stage 8 of a wp-site-kit WordPress build and everything after launch - backups with an off-machine copy, restore drills, the disaster-recovery runbook, credentials inventory, update policy, alerts, and working from more than one machine (bridge file, workstation doctor, encrypted state bundle, rescuing unpushed work). Use for "backup", "restore", "move to a new machine/server", "update plugins", "what if the server dies", "work from the cloud box", "set up a second machine".

umairmsm/wp-seo

Stage 5 of a wp-site-kit WordPress build - titles and descriptions, canonical URLs, one schema owner and JSON-LD, sitemaps, robots.txt and llms.txt, AI crawler access, redirects (301 vs 302), legacy URL maps, Search Console, and adding languages one pilot at a time with Polylang (hreflang, .po/.mo strings, native review). Use for "SEO", "schema", "redirect", "old URLs", "translate the site", "add French/Spanish", "hreflang", "canonical".

umairmsm/wp-ship

Stage 7 of a wp-site-kit WordPress build - staging behind Cloudflare Access, server hardening, safe deploys from a commit (scripts/deploy-safe.sh), database content changes, the launch audit, DNS cutover without breaking a running business, and the first week after launch. Use for "deploy", "set up staging", "go live", "launch", "cutover", "move DNS", "harden the server".

umairmsm/wp-site

Start here for any WordPress website built with wp-site-kit, from an empty folder to a live site. Use when someone says "build a WordPress site", "new website for a client", "where are we on the site", "what is next before launch", or asks to continue a site project. Finds the current stage from SITE_STATUS.md, applies the hard rules, and hands over to the right stage skill.

相关技能