Vela Dev
Use this skill when working on Xiaomi Vela JS wearable quick apps.
What this skill is for
- Create a new Vela quick app from scratch
- Edit existing
.uxpages - Fix build errors from
npx aiot build - Adapt UI for Xiaomi Band / Watch screens
- Package an
.rpkfor delivery
Workflow
- Identify whether the user wants a new app or edits to an existing Vela project.
- If new, scaffold the minimum required files:
src/manifest.jsonsrc/app.uxsrc/config-watch.json- at least one page like
src/pages/<name>/index.ux
- Prefer a single-page app with internal state switching unless the app clearly benefits from router-based multi-page navigation.
- Build with:
cd <project> && npx aiot build
- If build fails, inspect the exact error and patch surgically.
- Only send/package the
.rpkafter a successful build.
Xiaomi Band / Vela constraints
Read references/vela-notes.md when you need practical constraints and common fixes.
Important defaults:
- Xiaomi Band 10 uses a 212x520 跑道屏 style layout.
- Frontend apps should feel foreground-first: quick open, quick action, quick exit.
- Avoid overstuffed home screens. Prefer vertical lists/cards.
- Symbol glyph buttons like
↺⏸▶⏭may not render reliably on device; prefer plain Chinese text. - When in doubt, choose larger touch targets and fewer simultaneous actions.
Build/debug loop
After each meaningful edit:
- Run
npx aiot build - If needed, filter logs with grep for
success|error|Error - Fix the reported file/line first before changing anything else
Common failure classes are documented in references/vela-notes.md.
Event/style rules
Read references/ux-gotchas.md when build errors point to template/event/CSS issues.
Key reminders:
- Vela event handlers are strict; avoid unsupported template expression forms in
onclick - Broken CSS blocks can produce
UxLoader/Unexpected } - Prefer simple, explicit structure over clever templating
Project template
If the user asks for a fresh app, copy or adapt files from assets/template/.
Deliverables
Typical successful output includes:
- working project folder
- successful
npx aiot build - generated
.rpkpath fromdist/
When to read extra files
- For practical Vela constraints and prior lessons: read
references/vela-notes.md - For template/event/style pitfalls: read
references/ux-gotchas.md - For official documentation entry points and what to consult: read
references/docs-map.md - For a reusable end-to-end implementation/debug loop: read
references/dev-workflow.md - For fresh project scaffolding: inspect
assets/template/
Documentation-backed behavior
When you need authoritative confirmation:
- Start with
references/docs-map.md - Open the matching official doc page
- Apply the smallest viable change
- Rebuild immediately
Prefer official docs for:
- component capability questions
- feature API availability
- project structure uncertainty
- framework/lifecycle questions
Prefer local reference notes for:
- previously observed build pitfalls
- Band 10-specific practical constraints
- project patterns that already worked here