Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

docs(skills): the web-design skill takes the generic techniques from the Z.ai Code prompt (#698)

Yaowei Zhengc36c5f0cc51b
diff --git a/changelog/unreleased/2026-09-11-web-design-skill-tips.md b/changelog/unreleased/2026-09-11-web-design-skill-tips.md
new file mode 100644
index 00000000..e1600058
--- /dev/null
+++ b/changelog/unreleased/2026-09-11-web-design-skill-tips.md
@@ -0,0 +1,30 @@
+# The web-design skill ships the frontend first, bounds long lists and confirms actions with toasts
+
+- **Date:** 2026-09-11
+- **Type:** feature
+- **Scope:** `plugins`
+- **PR:** [#698](https://github.com/Prism-Shadow/penguin-harness/pull/698)
+
+[中文版](2026-09-11-web-design-skill-tips.zh.md)
+
+The `web-design` skill in the `software-development` plugin gained the generic techniques from the
+published Z.ai Code prompt — everything in it that is not tied to that product's own SDK, stack or
+image tools. The plugin version moved to `2026.09.11.1`.
+
+## Details
+
+- Before you start: for a full-stack request, build the frontend first against mocked data so the
+ user sees the result early, then the backend; when no stack is named, pick one and state it —
+ SQLite or `localStorage` for persistence, process memory for caching, no Redis or MySQL a
+ one-line request did not ask for.
+- Ship complete: mobile-first styles (the phone layout is the base, `min-width` queries add
+ columns); semantic landmarks and an `.sr-only` utility alongside `alt` and `aria-label`; after
+ each coding pass, read the tail of the dev server log and the browser console and fix every error
+ before presenting the page.
+- Components: cards in one grid share padding and stretch to equal height; three new recipes —
+ a bounded, thin-scrollbar box for any list that can grow, skeleton blocks for regions that load
+ (dots and spinners stay for actions), and a toast for confirming user actions, never a browser
+ `alert()`.
+- Motion: every clickable element has a hover state and `cursor: pointer`.
+- Chat layout: deltas stream over SSE or a WebSocket, never polling; loading states name skeletons
+ for regions.
diff --git a/changelog/unreleased/2026-09-11-web-design-skill-tips.zh.md b/changelog/unreleased/2026-09-11-web-design-skill-tips.zh.md
new file mode 100644
index 00000000..4e5986b7
--- /dev/null
+++ b/changelog/unreleased/2026-09-11-web-design-skill-tips.zh.md
@@ -0,0 +1,18 @@
+# web-design Skill 先出前端、给长列表设边界、用 toast 确认操作
+
+- **Date:** 2026-09-11
+- **Type:** feature
+- **Scope:** `plugins`
+- **PR:** [#698](https://github.com/Prism-Shadow/penguin-harness/pull/698)
+
+[English](2026-09-11-web-design-skill-tips.md)
+
+`software-development` 插件里的 `web-design` Skill 吸收了公开的 Z.ai Code 提示词中的通用技巧——凡与该产品自家 SDK、技术栈和图片工具无关的部分。插件版本升至 `2026.09.11.1`。
+
+## 细节
+
+- Before you start:全栈需求先用假数据把前端做出来让用户尽早看到结果,再补后端;用户没指定技术栈时自行选定并说明——持久化用 SQLite 或 `localStorage`,缓存用进程内存,不引入一句话需求没要的 Redis、MySQL 之类基础设施。
+- Ship complete:移动优先(手机布局是基线,`min-width` 媒体查询再加列);语义化地标元素与 `.sr-only` 工具类,与 `alt`、`aria-label` 并列;每轮编码后读 dev server 日志的尾部与浏览器控制台,修完所有错误再展示页面。
+- Components:同一网格里的卡片共享内边距并拉伸到等高;新增三个配方——可增长的列表放进带细滚动条的定高容器、区域加载用骨架块(点与 spinner 留给动作)、用户操作以 toast 确认,绝不用浏览器 `alert()`。
+- Motion:所有可点击元素都有 hover 态与 `cursor: pointer`。
+- 聊天布局:增量经 SSE 或 WebSocket 流式送达,绝不轮询;加载态点名区域用骨架。
diff --git a/plugins/software-development/plugin.json b/plugins/software-development/plugin.json
index edfd0138..20d40ffa 100644
--- a/plugins/software-development/plugin.json
+++ b/plugins/software-development/plugin.json
@@ -3,6 +3,6 @@
"description_zh": "端到端的软件开发——面向真实任务的软件工程实践准则,加上生成网页与应用界面的 Penguin 视觉规范。",
"short_description": "Engineering practice and web UI defaults in one plugin.",
"short_description_zh": "软件工程实践与网页视觉规范合一。",
- "version": "2026.09.02.1",
+ "version": "2026.09.11.1",
"category": "software-development"
}
diff --git a/plugins/software-development/skills/web-design/SKILL.md b/plugins/software-development/skills/web-design/SKILL.md
index a64b494f..cd8a40f6 100644
--- a/plugins/software-development/skills/web-design/SKILL.md
+++ b/plugins/software-development/skills/web-design/SKILL.md
@@ -11,6 +11,8 @@ Default visual language for every web page or frontend you generate, distilled f
If the user's message only invokes this skill (e.g. "use web-design skill") without a concrete page or interface to build, ask what they want to build. When a concrete build is already requested (an app UI, a landing page, a RAG chat interface), do **not** ask about styling — colors, fonts, spacing, radii and layout are all decided by the defaults below; the only question ever worth asking is *what to build*, never *how it should look*. Route by request shape: conversational or docs-QA → the chat/RAG layout; product or marketing → the page layout; tool-like apps → a sticky nav + panels composed from the components.
+Build order and stack are decided the same way. For a full-stack request, build the frontend first against mocked data so the user sees the result early, then the backend behind it. When no stack is named, pick one and state it instead of asking: persistence in a single SQLite file or `localStorage`, caching in process memory — never Redis, MySQL or other infrastructure a one-line request did not ask for.
+
Non-negotiable for ANY text input that sends on Enter: **never send while an IME composition is in progress** (check `event.isComposing`, falling back to `event.keyCode === 229`, on keydown). For Chinese/Japanese/Korean input methods, that Enter only confirms the composed text — auto-sending on it fires half-typed messages. Details in the composer recipe below.
## Ship complete
@@ -18,11 +20,12 @@ Non-negotiable for ANY text input that sends on Enter: **never send while an IME
Every delivery, even from a one-line request, includes all of this unasked:
- `<html lang>` matching the UI language; `<meta name="viewport" content="width=device-width, initial-scale=1">`; a real `<title>`.
-- Dark mode wired and persisted when using the default language (the paper theme is light-only); single column under 640px; no horizontal scroll.
+- Dark mode wired and persisted when using the default language (the paper theme is light-only). Mobile-first: base styles are the single-column phone layout and `min-width` queries add columns from 640px; no horizontal scroll.
- Every async surface has designed loading, empty, error and success states — never a blank region or a silent failure.
- A working keyboard path: visible `:focus-visible`, Esc closes overlays (focus returning to the trigger), Enter submits (IME-safe as above).
-- `alt` text on images, `aria-label` on icon-only buttons; tap targets ≥ 40px.
+- Semantic landmarks (`header`, `nav`, `main`, `section`, `article`, `footer`) instead of div soup; `alt` text on images, `aria-label` on icon-only buttons, an `.sr-only` utility for text meant only for screen readers; tap targets ≥ 40px.
- Zero external requests: system fonts, inline or local CSS/JS, inline SVG icons — no CDN, no icon font, no analytics.
+- Checked before it is shown: after each coding pass, read the tail of the dev server log (never the whole file) and the browser console, and fix every error before presenting the page.
## Design tokens
@@ -74,16 +77,19 @@ Write the page's UI copy in the language the user's request was made in — a Ch
- **Primary button** — `background: var(--accent-bg); color: var(--accent-fg); border-radius: 6px; padding: 6px 12px; font-size: 14px; font-weight: 500;` hover: `opacity: .9`. Large CTA variant: height 44px, radius 8px, padding 0 20px.
- **Secondary button** — white/`--surface` bg, `1px solid var(--control-border)`, same paddings; hover swaps bg to `--gray-100`/dark `#1f1f1f`.
-- **Card** — `border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 24px;` hover changes **only the border color** (one step darker) — no lift, shadow or scale.
+- **Card** — `border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 24px;` hover changes **only the border color** (one step darker) — no lift, shadow or scale. Cards in one grid share the same padding and stretch to equal height.
- **Input / textarea** — `border: 1px solid var(--control-border); border-radius: 6px; padding: 8px 12px;` focus: border one step darker + `box-shadow: 0 0 0 2px rgb(156 163 175 / .3)`; no default outline stacking.
- **Pill chip** — `border-radius: 9999px; border: 1px solid var(--border); padding: 4px 10px; font-size: 12px; color: var(--fg-muted);` hover: bg `--gray-50`. Brand-tinted variant: `--brand-50` bg, `--brand-700` text.
- **Sticky nav** — `height: 56px; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px);` logo 28px + product name 15px semibold.
- **Code block** — `--gray-50`/dark `--surface` bg card with a bordered header row (mono 12px label + copy button), body mono 13px.
+- **Long list** — any list, log or table that can grow lives in a bounded box: `max-height: 24rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--control-border) transparent;` — the page never scrolls because of it.
+- **Skeleton** — a content region that is loading shows gray blocks in the shape of the content (`--gray-100`/dark `#1f1f1f`, radius 6px, soft opacity pulse); dots and spinners are for actions, skeletons for regions.
+- **Toast** — confirmation of a user action (saved, copied, deleted): fixed bottom-right (bottom-center on mobile), `--surface` bg, `1px solid var(--border)`, radius 8px, padding 10px 14px, 13px, `role="status" aria-live="polite"`; rises in, auto-dismisses after 3–4 s, newest at the bottom. Never a browser `alert()`.
- **Focus** — `:focus-visible { outline: 3px solid rgb(107 114 128 / .4); outline-offset: 2px; }`.
## Motion
-One easing everywhere: `var(--ease)`, durations 120–280ms. Entrances rise in (`translateY(10px)` + fade, 280ms, stagger siblings by 40ms); overlays fade (120ms); hover feedback is **color-only** (`transition: color, background-color, border-color 150ms`) — never transform on hover. Always include:
+One easing everywhere: `var(--ease)`, durations 120–280ms. Entrances rise in (`translateY(10px)` + fade, 280ms, stagger siblings by 40ms); overlays fade (120ms); every clickable element has a hover state and `cursor: pointer`; hover feedback is **color-only** (`transition: color, background-color, border-color 150ms`) — never transform on hover. Always include:
```css
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@@ -115,13 +121,13 @@ The default shape for a generated conversational or docs-QA app:
- **Shell** — centered column, `max-width: 48rem`, `padding: 0 16px`; sticky nav on top with the app name; message list grows, composer pinned at the bottom. A docs-QA app whose index is worth showing may add a left **knowledge panel** (grid `310px 1fr` under the nav; panel-toned bg `--gray-50` / paper `--panel`, 1px right border): kicker, display title, one-paragraph description, an index-status block of label-vs-mono-value rows (docs, chunks, last synced, a LIVE dot), and a one-line pipeline (`corpus → retrieval → cited answer`); the chat pane keeps its own centered column. On mobile the panel hides behind an ⓘ button in the nav and drops down fixed beneath it.
- **Empty state** — a vertically centered composition: uppercase eyebrow (brand / `--accent-deep`) → title with at most one accent word → one-line subtitle in `--fg-muted`, over the theme flourish (default: dot-grid backdrop `background-image: radial-gradient(rgb(26 115 232 / .14) 1px, transparent 1px); background-size: 22px 22px;` faded out with a bottom mask; paper: the orbit medallion) — the only decorative flourish allowed. Below it, 3–4 example questions the app can genuinely answer, as pill chips or as a 2-column grid (1-column mobile) of numbered cards — mono `01` in accent, the question at 13px, a `↗` corner affordance; hover tints the border (paper may also lift 2px). Clicking one fills and submits the composer.
-- **Messages** — user messages right-aligned in a `--gray-100`/dark `#1f1f1f` rounded bubble (radius 12px, padding 8px 14px, max-width 85%); assistant messages plain on the page background, no bubble. Stream deltas into the assistant message as they arrive with a 1-character pulsing cursor. Prefer a plain-text output contract over a Markdown pipeline: when the app controls its model's prompt, instruct plain-text answers and style them directly (escape → blank-line paragraphs → decorate `[n]` markers); build a Markdown renderer only when the output format isn't yours to set, and then escape HTML in the model text before your own transforms — never inject it raw. Retrieval-backed answers may open with a small status line above the text — breathing dot + "已检索 N 个相关片段" / "N sources matched", 11px in `--live`/`--fg-faint` — so evidence visibly precedes prose.
+- **Messages** — user messages right-aligned in a `--gray-100`/dark `#1f1f1f` rounded bubble (radius 12px, padding 8px 14px, max-width 85%); assistant messages plain on the page background, no bubble. Stream deltas into the assistant message as they arrive (over SSE or a WebSocket, never polling) with a 1-character pulsing cursor. Prefer a plain-text output contract over a Markdown pipeline: when the app controls its model's prompt, instruct plain-text answers and style them directly (escape → blank-line paragraphs → decorate `[n]` markers); build a Markdown renderer only when the output format isn't yours to set, and then escape HTML in the model text before your own transforms — never inject it raw. Retrieval-backed answers may open with a small status line above the text — breathing dot + "已检索 N 个相关片段" / "N sources matched", 11px in `--live`/`--fg-faint` — so evidence visibly precedes prose.
- **Thinking** — reasoning models may stream a chain of thought before the answer. Give it its own collapsible block above the answer text: a header row ("思考过程" / "Thinking" + chevron + elapsed seconds) over 13px `--fg-muted` content behind a hairline left border, expanded while it streams, auto-collapsed the moment the first answer delta arrives (reopenable). Never restyle thinking as answer prose and never cite from it; when the model emits none, no placeholder space appears.
- **Citations** — inline `[n]` markers render as small raised accent superscripts (mono, ~10px). After the answer, either surface works, but it must reveal both the **verbatim original text block** and a link to the full source — a citation that is only a label or only a link is not enough: (a) a wrapped row of brand-tinted pill chips `[1] path — heading` opening a popover/panel on click; or (b) an **accordion of source cards** under the answer — each row a tinted numbered circle + doc title + section + `+/−` chevron, expanding to the verbatim excerpt as a mono blockquote (accent left border, max-height ≈150px, scrollable) plus the source link.
- **Composer** — a bordered card (radius 12px; paper: 4–5px with the warm shadow) holding a borderless textarea and a footer row: kbd hints on the left (`Enter` send · `Shift+Enter` newline, 11px muted, hidden on mobile), the primary send button on the right (paper: circular accent icon button); Enter sends, Shift+Enter for newline; disable while streaming. A short gradient from transparent into the page bg eases the list into the composer zone; below it, one 10–11px muted disclaimer line says what answers are based on. **Never send while an IME composition is in progress**: on keydown, ignore Enter when `event.isComposing` (or `event.keyCode === 229`) — for CJK input methods that Enter only confirms the composed text, and auto-sending on it fires half-typed messages.
- **Attachments** (when the app accepts images) — a paperclip button plus paste and drag-drop onto the composer; queued images preview above the textarea as 48px rounded thumbnails with a hover `×`; send attaches and clears the queue. In sent user messages, thumbnails render at max-height ~160px, radius 8px, click to view full size.
-- **States** — loading: three pulsing dots in `--fg-faint`; error: 13px `#b91c1c` text on `#fef2f2` (dark: `#f87171` on `#450a0a`) in a rounded box with a retry affordance. Never leave a silent failure.
+- **States** — loading: three pulsing dots in `--fg-faint` for the pending answer, skeletons for regions that load; error: 13px `#b91c1c` text on `#fef2f2` (dark: `#f87171` on `#450a0a`) in a rounded box with a retry affordance. Never leave a silent failure.
## Page layout (marketing / landing)
-Content width `max-width: 72rem`, gutters 16–24px; section rhythm `padding: 64–96px 0`; section header = uppercase 14px semibold brand-colored eyebrow → title → one-line subtitle in `--fg-muted`, then a card grid (`gap: 20px`, 2–3 columns, collapsing to one on mobile). Hero: centered, logo + name, headline with at most one brand-colored word, CTA pair (primary + secondary). Responsive by default: single column under 640px, tap targets ≥ 40px, no horizontal scroll.
+Content width `max-width: 72rem`, gutters 16–24px; section rhythm `padding: 64–96px 0`; section header = uppercase 14px semibold brand-colored eyebrow → title → one-line subtitle in `--fg-muted`, then a card grid (`gap: 20px`, 2–3 columns, collapsing to one on mobile). Hero: centered, logo + name, headline with at most one brand-colored word, CTA pair (primary + secondary). Responsive by default: the single column is the base and a `min-width: 640px` query adds the grid, tap targets ≥ 40px, no horizontal scroll.