协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
lov-mobile-adapt【开发与工程】Adapt an existing web project for mobile devices: fix overflow, add responsive layouts, convert to multi-level page navigation with back support, handle notch/Dynamic Island safe areas, fix 100vh browser chrome issues, and optimize touch targets. Trigger when user says "mobile adapt", "移动端适配", "responsive optimization", "手机适配", "fix mobile overflow",…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: lov-mobile-adapt description: > Adapt an existing web project for mobile devices: fix overflow, add responsive layouts, convert to multi-level page navigation with back support, handle notch/Dynamic Island safe areas, fix 100vh browser chrome issues, and optimize touch targets. Trigger when user says "mobile adapt", "移动端适配", "responsive optimization", "手机适配", "fix mobile overflow", "add safe area", "多级页面", "移动端布局", or mentions adapting a site for phones/tablets. license: MIT compatibility: > Requires Python 3.8+ (no external dependencies). Works with any web project: React, Vue, Next.js, Nuxt, Svelte, plain HTML/CSS. depends_on:
Scan and fix mobile adaptation issues in an existing web project: viewport configuration, overflow prevention, safe area handling, responsive breakpoints, 100vh pitfalls, touch targets, and multi-level page navigation.
You MUST follow these steps in order.
Resolve SKILL_DIR from the installed skill context before running the helper.
For manual execution, set it to the directory containing this SKILL.md.
Run the scanner to identify issues:
python3 "$SKILL_DIR/scripts/scan_mobile_issues.py" <project-path>
For JSON output (easier to process programmatically):
python3 "$SKILL_DIR/scripts/scan_mobile_issues.py" <project-path> --format json
Review the output. The scanner checks:
viewport-fit=coverIMPORTANT: Use AskUserQuestion to collect scope BEFORE making changes.
Present the scan results summary, then ask:
Question: "扫描发现 X 个问题。要修哪些类别?"
Options:
1. 全部修复 (Recommended) — fix all categories found
2. 只修布局和溢出 — overflow + responsive only
3. 只修导航 — convert to mobile stack navigation
4. 让我选具体类别 — pick specific categories
If the project has sidebar/tab navigation on desktop, also ask:
Question: "桌面端的侧边栏/tab 导航要改成移动端多级页面吗?"
Options:
1. 是,改成 push/pop 页面栈 (Recommended)
2. 改成底部 tab bar
3. 不改导航结构
Apply fixes in this priority order:
<meta name="viewport"> with viewport-fit=coveroverflow-x: hidden to html/bodyenv(safe-area-inset-*) to fixed/sticky elementsmax-width: 100%; height: autowhite-space: nowrap existsFor each fix, refer to references/mobile-patterns.md for the correct pattern.
When converting sidebar/panel navigation to mobile stack:
md: breakpoint and aboveSee references/mobile-patterns.md → "Multi-Level Page Navigation" for
implementation patterns per framework.
After all fixes:
| Argument | Default | Description |
|---|---|---|
project | (required) | Path to web project root |
--format | text | Output format: text or json |
| Problem | Fix |
|---|---|
| Missing viewport meta | <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> |
| 100vh overflow | height: 100dvh (with 100vh fallback) |
| Notch overlap | padding: env(safe-area-inset-top) on fixed elements |
| Horizontal overflow | overflow-x: hidden on body + max-width: 100% on media |
| iOS input zoom | font-size: 16px on inputs |
| Small touch targets | min-height: 44px; min-width: 44px |
| Pull-to-refresh conflict | overscroll-behavior-y: contain |
For detailed patterns see references/mobile-patterns.md.
运行前读取本 Skill 包的 skill.yaml,由宿主提供 skill-runtime/v1 上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
required: true 字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。context_id、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
task-specific(仅本次)还是 reusable(可跨任务复用)。task-specific 只修改当前任务,不改 Skill。reusable 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。reusable 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。