Design Engineering
Orchestrate design-heavy frontend work that requires iteration, technical decisions, and validation. This skill is about the process — how to research, plan, build, validate, and refine — not the aesthetics (use frontend-design for that).
When to Use
- - Visual work that will take multiple iterations to get right
- Choosing between technical approaches (Canvas vs SVG vs CSS, etc.)
- Coordinating sub-agents on parallel design/engineering tasks
- Refining an implementation based on user feedback
- Any frontend work where "build it and ship" isn't enough
Scope & Safety
- - All file operations stay within the user's project directory — no absolute paths outside the project root
- Sub-agents operate within the project scope defined by the orchestrator and must not access files outside it
- Sub-agent outputs (file writes, research findings) are confined to the project working directory
- No credentials or external services are required
- Playwright (when used for screenshots) connects only to
localhost dev servers — never to external URLs - No data is exfiltrated or transmitted to external endpoints; all work is local
The Iteration Loop
Every design-engineering task follows this cycle:
CODEBLOCK0
1. Research Phase
Before touching code, understand the problem space. Spawn 2-3 research sub-agents in parallel with different lenses:
- - Inspiration/reference — find examples of what we're trying to achieve
- Technical approaches — what tools/techniques solve this class of problem
- Constraints — performance, browser support, accessibility, progressive enhancement
Research agents should write findings to files within the project's working directory so context is preserved across iterations.
2. Plan Phase
Synthesize research into a concrete plan. Present to user for approval before executing. The plan should include:
- - Architecture decision with rationale (not just "use X" but "use X because Y fails at Z")
- Layer/component breakdown
- What gets removed, what gets added, what stays
- Pre-mortem: "what would cause this to fail?"
- Estimated sub-agent tasks
- Horizon estimate: Count estimated steps across all sub-agents. If > 40 steps total, decompose into sub-phases of ≤ 20 steps. If 20–40 steps, insert a midpoint quality checkpoint (screenshot + integration check before proceeding). Under 20 steps, execute directly. This prevents quality collapse on complex design tasks.
3. Execute Phase
Dispatch sub-agents with focused, context-minimal tasks. Key rules in
references/subagent-patterns.md.
4. Validate Phase
After sub-agents complete, the orchestrator MUST validate. Build check is necessary but not sufficient. Check integration points — see
references/validation-checklist.md.
5. Feedback → Refine
Ship to user for review. Expect 2-5 iterations on visual work. Each iteration:
- 1. Screenshot the live result (use Playwright if available)
- Identify specific issues from feedback
- Make targeted fixes (don't rebuild from scratch each time)
- Validate and redeploy
Technical Decision Framework
When choosing between rendering approaches, read references/rendering-decisions.md. Quick heuristic:
| Need | Use |
|---|
| Static decorative pattern | CSS background-image with SVG data URI |
| <100 authored animated elements |
Inline SVG + CSS animations |
| Procedural generation, >100 elements, full-page coverage | Canvas 2D |
| 3D, heavy particle systems, post-processing | Three.js/WebGL (last resort — heavy) |
Progressive Enhancement Stack
Every visual enhancement must degrade gracefully:
- 1. CSS baseline (always works, no JS)
- JS-enhanced layer fades in on top
- INLINECODE6 → skip animations entirely
- Low-end device detection → reduce complexity
- Light/dark theme awareness
Glass-Panel Pattern
For content floating over animated backgrounds:
.card {
background: color-mix(in srgb, var(--bg-card) 50-60%, transparent);
backdrop-filter: blur(8-12px);
-webkit-backdrop-filter: blur(8-12px);
}
Lets animation show through while keeping text readable. Adjust blur and opacity based on background intensity.
References
- -
references/subagent-patterns.md — How to dispatch and validate sub-agent work - INLINECODE8 — Post-execution checks that catch integration bugs
- INLINECODE9 — Canvas vs SVG vs CSS decision guide with production lessons
设计工程
统筹需要迭代、技术决策和验证的设计密集型前端工作。这项技能关注的是流程——如何研究、规划、构建、验证和优化——而非美学(美学方面请使用frontend-design)。
使用场景
- - 需要多次迭代才能达到理想效果的视觉工作
- 在技术方案之间做选择(Canvas vs SVG vs CSS等)
- 协调子代理处理并行设计/工程任务
- 根据用户反馈优化实现方案
- 任何构建即发布不足以满足需求的前端工作
范围与安全
- - 所有文件操作限定在用户项目目录内——不得使用项目根目录之外的绝对路径
- 子代理在编排器定义的项目范围内操作,不得访问项目外文件
- 子代理输出(文件写入、研究发现)限定在项目工作目录内
- 无需凭证或外部服务
- Playwright(用于截图时)仅连接localhost开发服务器——绝不连接外部URL
- 不会向外部端点泄露或传输数据;所有工作均在本地完成
迭代循环
每项设计工程任务遵循以下循环:
研究 → 规划 → 审批 → 执行 → 验证 → 反馈 → 优化
1. 研究阶段
在接触代码之前,先理解问题空间。并行启动2-3个研究子代理,从不同视角切入:
- - 灵感/参考——寻找我们试图实现的目标的示例
- 技术方案——哪些工具/技术能解决这类问题
- 约束条件——性能、浏览器支持、可访问性、渐进增强
研究代理应将发现写入项目工作目录内的文件,以便在迭代过程中保留上下文。
2. 规划阶段
将研究成果综合为具体计划。在执行前提交用户审批。计划应包括:
- - 架构决策及理由(不仅是使用X,而是使用X因为Y在Z方面失败)
- 层级/组件分解
- 哪些被移除、哪些被添加、哪些保持不变
- 事前分析:什么会导致失败?
- 预估子代理任务
- 工作量预估: 统计所有子代理的预估步骤。如果总步骤超过40步,分解为不超过20步的子阶段。如果在20-40步之间,插入一个中期质量检查点(截图+集成检查后再继续)。20步以下直接执行。这可以防止复杂设计任务中的质量崩溃。
3. 执行阶段
分配子代理执行聚焦、上下文精简的任务。关键规则见references/subagent-patterns.md。
4. 验证阶段
子代理完成后,编排器必须进行验证。构建检查是必要但不充分的。检查集成点——见references/validation-checklist.md。
5. 反馈 → 优化
提交给用户审查。视觉工作预计需要2-5次迭代。每次迭代:
- 1. 对实时结果截图(如可用,使用Playwright)
- 根据反馈识别具体问题
- 进行针对性修复(不要每次都从头重建)
- 验证并重新部署
技术决策框架
在选择渲染方案时,请阅读references/rendering-decisions.md。快速启发式指南:
| 需求 | 使用方案 |
|---|
| 静态装饰图案 | 使用SVG数据URI的CSS background-image |
| 少于100个手写动画元素 |
内联SVG + CSS动画 |
| 程序化生成、超过100个元素、全页面覆盖 | Canvas 2D |
| 3D、重型粒子系统、后期处理 | Three.js/WebGL(最后手段——较重) |
渐进增强栈
每个视觉增强必须优雅降级:
- 1. CSS基线(始终有效,无需JS)
- JS增强层在其上淡入
- prefers-reduced-motion → 完全跳过动画
- 低端设备检测 → 降低复杂度
- 亮/暗主题感知
玻璃面板模式
用于浮动在动画背景上的内容:
css
.card {
background: color-mix(in srgb, var(--bg-card) 50-60%, transparent);
backdrop-filter: blur(8-12px);
-webkit-backdrop-filter: blur(8-12px);
}
让动画透过显示,同时保持文本可读。根据背景强度调整模糊和透明度。
参考文档
- - references/subagent-patterns.md — 如何分配和验证子代理工作
- references/validation-checklist.md — 执行后检查,捕获集成错误
- references/rendering-decisions.md — Canvas vs SVG vs CSS决策指南及生产实践