HTML / Image → Power Apps Canvas YAML
Turn a mockup into a .pa.yaml that pastes cleanly into Studio ("Paste code" on a blank
screen). Work the steps in order, use only catalogued controls, never improvise schema.
Paths are relative to this skill's folder: ${CLAUDE_SKILL_DIR}, or run from that folder.
The workflow (in order)
Three branches. App already exists — first
python3 ${CLAUDE_SKILL_DIR}/scripts/app_inventory.py <src>, then
extend-existing-app.md alongside these steps.
Data-bound — data-binding.md; none of it is
confirmed, so hand over the matching assets/test-snippets/.
mock-ui folder (sitemap.json + screens) — read
from-mock-ui.md first: one file per screen.
- Read
references/controls.yaml — the catalog of what
works. Fresh each time; the user may have added entries since.
confirmed-controls.md is the same facts in prose,
plus gotchas and the paste-error table.
- Pick pattern(s) from
assets/patterns/ — lint-clean snippets
from the examples. Read only what you need:
screen-shell, sidebar-nav-item, top-bar, card-container, section-header,
form-field-text, form-field-dropdown, tile-grid-cell, badge, divider,
avatar-row, footer-nav, two-column-split.
- Apply
references/layout-mapping.md for absolute
X/Y/Width/Height: canvas size and scale, Tailwind→px, flex/grid arithmetic,
nesting, screen Height.
- Only if the patterns don't cover it, read a slice of an example, via the line
ranges in
assets/examples/INDEX.md, never a whole one.
- Write the full
.pa.yaml from the templates below. Tag anything unconfirmed.
- Lint:
python3 ${CLAUDE_SKILL_DIR}/scripts/pa_lint.py <file>. Never hand over a
file with an L0/L1 error. Report every L2/L3 warning verbatim as the UNVERIFIED list,
with the snippets the linter generates. L2.unverified-control-type and L2.candidate-control-type get
identical treatment — Microsoft's control-id enum is not evidence.
- Hand over the whole file plus those snippets, read back the Studio result, fix
only what broke.
- If Studio confirms something new, record it in
controls.yaml and
confirmed-controls.md. With a real export, harvest instead of guessing —
references/harvesting.md.
Control picker
Only these are confirmed. Anything else: rule 8.
| Mockup element |
Control |
Notes |
| Text / heading / label |
Label@2.5.1 |
No prefix. |
| Button, and every nav item |
Classic/Button@2.2.0 |
Nav must be Button (clickable), never Label. |
| Card / panel / box with children |
GroupContainer@1.5.0 + Variant: ManualLayout |
Nested Children:. Only control with confirmed Radius* + border + fill. |
| Bar / divider / badge / indicator |
Rectangle@2.3.0 |
Universal properties only; Radius* NOT verified. |
| Image / avatar / logo |
Image@2.2.3 |
Only Image + geometry verified. |
| Icon needing a color |
Classic/Icon@2.5.0 |
Not plain Icon — that can't take Color. |
| Single-line text field |
Classic/TextInput@2.3.2 |
Default, HintText, Size, border, Radius*. |
| Dropdown / select |
Classic/DropDown@2.3.1 |
Items: =["a","b"], Items.Value: =Value. No Radius*. |
| Radio group |
Classic/Radio@2.3.0 |
Only Items confirmed; no bundled example. |
Everything in controls.yaml's unattempted_controls (Gallery, Toggle, DatePicker,
DataTable…) is unverified — paste-test with assets/test-snippets/ first.
Templates
You always need these two.
# 1. Screen wrapper — never a bare control
Screens:
MyScreen: # letters/digits/_ only
Properties:
Fill: =RGBA(244, 244, 246, 1)
# Height: =2232 # ONLY if content runs past the viewport
Children:
- # ... controls ...
# 2. Container (card / panel) — the only control with children
- grpCard:
Control: GroupContainer@1.5.0
Variant: ManualLayout # required, or child X/Y are ignored
Properties:
Fill: =RGBA(255, 255, 255, 1)
BorderColor: =RGBA(193, 198, 215, 1)
BorderThickness: =1
X: =304 # plus Y / Width / Height
RadiusTopLeft: =0 # plus the other three
Children: # child X/Y are relative to the container
- # ... nested controls ...
Rules while writing
- Full wrapper always.
Screens: -> <name> -> Properties/Children. Never a bare control.
- Every value starts with
=. Text: ="hi", X: =0, Fill: =RGBA(...).
- Block-style
Properties only. {X: =0, Fill: =RGBA(...)} breaks on the RGBA commas.
- Real nesting = a real nested
Children: key. Visual overlap in Studio does NOT nest.
- Nav items are
Classic/Button@2.2.0, never Label, however plain the mockup looks.
- Only catalogued controls/properties in the main file. Anything else gets tagged and tested.
- Real
Navigate() only to a screen here, in the sitemap or the app. Any other link gets one named after it: Navigate('Requests', ScreenTransition.None) # placeholder - no such screen. Never =false.
- Tag anything you're unsure of inline:
# UNVERIFIED — <why you guessed>, and
separately hand over the isolated snippet pa_lint.py generates for it, labeled
"paste-test this one first." If it has no confirmed Power Fx equivalent
(impossible_css in controls.yaml), say so and offer the closest real substitute
(a thin Rectangle for a left border). Never drop it silently or fake a property.
Example-file defaults, to override with the mockup's real values: font
=Font.'Segoe UI'; bold =FontWeight.Bold (confirmed on Label only); screen bg
=RGBA(244, 244, 246, 1); cards =RGBA(255, 255, 255, 1); body text
=RGBA(65, 71, 84, 1); headings =RGBA(24, 28, 35, 1); borders
=RGBA(193, 198, 215, 1). Read hover/pressed colors from the CSS, never a screenshot.
Hand-off
handoff.md is the contract; then read back.
- Send the entire file; snippets in separate, labeled blocks.
- Classify the report first.
PA1001/PA2108 block the whole paste (must fix);
PA2105/PA2106 are version warnings Studio auto-substitutes: leave them.
- On a screenshot, compare point-by-point (position, color, size, font, border,
radius) and name the differences, never "looks close." Fix only what's broken.
- Never read a property's absence from an export as "does not support."
- Next:
create-list (lists the screens use), create-flow (flows they call).
Pre-send checklist
1---2name: create-app3description: >-4 Converts an HTML/CSS mockup (Google Stitch, v0, Figma export), a UI screenshot, or a5 mock-ui folder into Power Apps Canvas source (.pa.yaml, schema v3.0), one file per6 screen, for "Paste code" in Studio. Use when someone shares an HTML mockup, UI7 screenshot, wireframe or design export and wants a Power Apps screen, or asks to8 "convert this to pa.yaml", "make this a Power Apps screen", or "turn this design9 into code I can paste into Power Apps", even without the term ".pa.yaml". Also to10 fix a .pa.yaml that failed to paste (PA1001 / PA2108), or to add a screen to an11 existing app. Not for drawing a mockup (mock-ui), lists or flows.12metadata:13 source: https://skillmd.com/skills/ykunakorn/create-app14---1516# HTML / Image → Power Apps Canvas YAML1718Turn a mockup into a `.pa.yaml` that pastes cleanly into Studio ("Paste code" on a blank19screen). Work the steps in order, use only catalogued controls, never improvise schema.20Paths are relative to this skill's folder: `${CLAUDE_SKILL_DIR}`, or run from that folder.2122## The workflow (in order)2324Three branches. **App already exists** — first25`python3 ${CLAUDE_SKILL_DIR}/scripts/app_inventory.py <src>`, then26[`extend-existing-app.md`](references/extend-existing-app.md) alongside these steps.27**Data-bound** — [`data-binding.md`](references/data-binding.md); none of it is28confirmed, so hand over the matching [`assets/test-snippets/`](assets/test-snippets/).29**`mock-ui` folder** (`sitemap.json` + screens) — read30[`from-mock-ui.md`](references/from-mock-ui.md) first: one file per screen.31321. **Read [`references/controls.yaml`](references/controls.yaml)** — the catalog of what33 works. Fresh each time; the user may have added entries since.34 [`confirmed-controls.md`](references/confirmed-controls.md) is the same facts in prose,35 plus gotchas and the paste-error table.362. **Pick pattern(s) from [`assets/patterns/`](assets/patterns/)** — lint-clean snippets37 from the examples. Read only what you need:38 `screen-shell`, `sidebar-nav-item`, `top-bar`, `card-container`, `section-header`,39 `form-field-text`, `form-field-dropdown`, `tile-grid-cell`, `badge`, `divider`,40 `avatar-row`, `footer-nav`, `two-column-split`.413. **Apply [`references/layout-mapping.md`](references/layout-mapping.md)** for absolute42 `X`/`Y`/`Width`/`Height`: canvas size and scale, Tailwind→px, flex/grid arithmetic,43 nesting, screen `Height`.444. **Only if the patterns don't cover it, read a *slice*** of an example, via the line45 ranges in [`assets/examples/INDEX.md`](assets/examples/INDEX.md), never a whole one.465. **Write the full `.pa.yaml`** from the templates below. Tag anything unconfirmed.476. **Lint: `python3 ${CLAUDE_SKILL_DIR}/scripts/pa_lint.py <file>`.** Never hand over a48 file with an L0/L1 error. Report every L2/L3 warning verbatim as the UNVERIFIED list,49 with the snippets the linter generates. `L2.unverified-control-type` and `L2.candidate-control-type` get50 identical treatment — Microsoft's control-id enum is not evidence.517. **Hand over the whole file** plus those snippets, **read back the Studio result**, fix52 only what broke.538. **If Studio confirms something new**, record it in `controls.yaml` *and*54 `confirmed-controls.md`. With a real export, harvest instead of guessing —55 [`references/harvesting.md`](references/harvesting.md).5657## Control picker5859Only these are confirmed. Anything else: rule 8.6061| Mockup element | Control | Notes |62|---|---|---|63| Text / heading / label | `Label@2.5.1` | No prefix. |64| Button, **and every nav item** | `Classic/Button@2.2.0` | Nav must be Button (clickable), never Label. |65| Card / panel / box with children | `GroupContainer@1.5.0` + `Variant: ManualLayout` | Nested `Children:`. Only control with confirmed `Radius*` + border + fill. |66| Bar / divider / badge / indicator | `Rectangle@2.3.0` | Universal properties only; `Radius*` NOT verified. |67| Image / avatar / logo | `Image@2.2.3` | Only `Image` + geometry verified. |68| Icon needing a color | `Classic/Icon@2.5.0` | Not plain `Icon` — that can't take `Color`. |69| Single-line text field | `Classic/TextInput@2.3.2` | `Default`, `HintText`, `Size`, border, `Radius*`. |70| Dropdown / select | `Classic/DropDown@2.3.1` | `Items: =["a","b"]`, `Items.Value: =Value`. No `Radius*`. |71| Radio group | `Classic/Radio@2.3.0` | Only `Items` confirmed; no bundled example. |7273Everything in `controls.yaml`'s `unattempted_controls` (Gallery, Toggle, DatePicker,74DataTable…) is **unverified** — paste-test with `assets/test-snippets/` first.7576## Templates7778You always need these two.7980```yaml81# 1. Screen wrapper — never a bare control82Screens:83 MyScreen: # letters/digits/_ only84 Properties:85 Fill: =RGBA(244, 244, 246, 1)86 # Height: =2232 # ONLY if content runs past the viewport87 Children:88 - # ... controls ...89```9091```yaml92# 2. Container (card / panel) — the only control with children93- grpCard:94 Control: GroupContainer@1.5.095 Variant: ManualLayout # required, or child X/Y are ignored96 Properties:97 Fill: =RGBA(255, 255, 255, 1)98 BorderColor: =RGBA(193, 198, 215, 1)99 BorderThickness: =1100 X: =304 # plus Y / Width / Height101 RadiusTopLeft: =0 # plus the other three102 Children: # child X/Y are relative to the container103 - # ... nested controls ...104```105106## Rules while writing1071081. **Full wrapper always.** `Screens: -> <name> -> Properties/Children`. Never a bare control.1092. **Every value starts with `=`.** `Text: ="hi"`, `X: =0`, `Fill: =RGBA(...)`.1103. **Block-style `Properties` only.** `{X: =0, Fill: =RGBA(...)}` breaks on the RGBA commas.1114. **Real nesting = a real nested `Children:` key.** Visual overlap in Studio does NOT nest.1125. **Nav items are `Classic/Button@2.2.0`**, never `Label`, however plain the mockup looks.1136. **Only catalogued controls/properties in the main file.** Anything else gets tagged and tested.1147. **Real `Navigate()` only to a screen here, in the sitemap or the app.** Any other link gets one named after it: `Navigate('Requests', ScreenTransition.None) # placeholder - no such screen`. Never `=false`.1158. **Tag anything you're unsure of** inline: `# UNVERIFIED — <why you guessed>`, and116 **separately** hand over the isolated snippet `pa_lint.py` generates for it, labeled117 "paste-test this one first." If it has no confirmed Power Fx equivalent118 (`impossible_css` in `controls.yaml`), say so and offer the closest real substitute119 (a thin `Rectangle` for a left border). Never drop it silently or fake a property.120121Example-file defaults, to override with the mockup's real values: font122`=Font.'Segoe UI'`; bold `=FontWeight.Bold` (confirmed on `Label` only); screen bg123`=RGBA(244, 244, 246, 1)`; cards `=RGBA(255, 255, 255, 1)`; body text124`=RGBA(65, 71, 84, 1)`; headings `=RGBA(24, 28, 35, 1)`; borders125`=RGBA(193, 198, 215, 1)`. Read hover/pressed colors from the CSS, never a screenshot.126127## Hand-off128129[`handoff.md`](references/shared/handoff.md) is the contract; then read back.130131- **Send the entire file**; snippets in separate, labeled blocks.132- **Classify the report first.** `PA1001`/`PA2108` block the whole paste (must fix);133 `PA2105`/`PA2106` are version warnings Studio auto-substitutes: leave them.134- **On a screenshot,** compare point-by-point (position, color, size, font, border,135 radius) and name the differences, never "looks close." Fix only what's broken.136- **Never read a property's absence from an export as "does not support."**137- **Next:** `create-list` (lists the screens use), `create-flow` (flows they call).138139## Pre-send checklist140141- [ ] `pa_lint.py` run; **zero L0/L1 errors** remain142- [ ] Rules 1–7 hold: full wrapper, `=` values, block-style, real `Children:` under143 `ManualLayout`, nav Buttons, `Navigate()` targets exist or are commented144- [ ] Every control type/version catalogued, or tagged `# UNVERIFIED` + given a snippet145- [ ] Rows close, nothing exceeds the canvas width, screen `Height` set if content runs146 past the viewport147- [ ] Unconfirmed items flagged; impossible ones called out with a substitute