Skip to content

A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.

Add QA Checks to generation/edit, insipred by Tolu's https://github.com/ToluVictor/canvas-apps-tools (#125)

McCall Saltzman7a268b8ea52b
diff --git a/plugins/canvas-apps/.claude-plugin/plugin.json b/plugins/canvas-apps/.claude-plugin/plugin.json
index de4ff6e25..841c5b7aa 100644
--- a/plugins/canvas-apps/.claude-plugin/plugin.json
+++ b/plugins/canvas-apps/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "canvas-apps",
- "version": "1.0.5",
+ "version": "1.0.6",
"description": "Build Power Apps Canvas Apps using the Canvas Authoring MCP server.",
"author": {
"name": "Microsoft",
diff --git a/plugins/canvas-apps/agents/canvas-app-planner.md b/plugins/canvas-apps/agents/canvas-app-planner.md
index 676ee38bf..215066888 100644
--- a/plugins/canvas-apps/agents/canvas-app-planner.md
+++ b/plugins/canvas-apps/agents/canvas-app-planner.md
@@ -83,7 +83,7 @@ Based on discovery, the user preferences passed in the prompt, and the user's re
- Which controls will drive each screen's layout
- What aesthetic direction fits the app's purpose
- How data will flow (data sources, collections, or mock data)
-- **Layout strategy** — default to **AutoLayout** (responsive) using `GroupContainer` with `Variant: Horizontal` or `Variant: Vertical`. Only use ManualLayout if the user explicitly requests pixel-perfect positioning or the app is a fixed-size desktop dashboard. Mobile and cross-device apps MUST use AutoLayout.
+- **Layout strategy** — default to **AutoLayout** (responsive) using `GroupContainer` with `Variant: AutoLayout` and `LayoutDirection: =LayoutDirection.Horizontal` or `=LayoutDirection.Vertical`, or if a grid-based layout is appropriate, `Variant: GridLayout`. Only use `Variant: ManualLayout` if the user explicitly requests pixel-perfect positioning or the app is a fixed-size desktop dashboard. Mobile and cross-device apps MUST use AutoLayout.
Enter plan mode (`EnterPlanMode`) and present the following to the user:
diff --git a/plugins/canvas-apps/agents/canvas-screen-builder.md b/plugins/canvas-apps/agents/canvas-screen-builder.md
index 376880fbb..d77b91cee 100644
--- a/plugins/canvas-apps/agents/canvas-screen-builder.md
+++ b/plugins/canvas-apps/agents/canvas-screen-builder.md
@@ -9,6 +9,7 @@ color: green
tools:
- Read
- Write
+ - Edit
- TaskCreate
- TaskUpdate
---
@@ -61,6 +62,18 @@ Follow the conventions from the plan document's TechnicalGuide Key Conventions s
Write the simplest working version of each formula. The compiler will catch syntax errors —
reserve your reasoning for logic correctness that the compiler cannot catch.
+## Step 3.5 — Self-QA
+
+After writing the file, run the runtime-anti-pattern checks that `compile_canvas` does not
+catch.
+
+1. Read `${CLAUDE_PLUGIN_ROOT}/references/QAChecks.md`
+2. Re-read the `.pa.yaml` file you just wrote
+3. Apply each check in order; for every issue found, fix it inline using `Edit`
+4. Track the count and a one-line description of every fix applied
+
+Do NOT call `compile_canvas` here — the orchestrating skill owns compilation.
+
## Step 4 — Return Result
Mark the task complete. Return a concise result to the orchestrating skill:
@@ -68,6 +81,8 @@ Mark the task complete. Return a concise result to the orchestrating skill:
```
Screen: [Screen Name]
File: [working directory]/[ScreenName].pa.yaml
+QA fixes applied: [N]
+ - [one-line description per fix, or "clean" if N=0]
Status: Written
```
diff --git a/plugins/canvas-apps/agents/canvas-screen-editor.md b/plugins/canvas-apps/agents/canvas-screen-editor.md
index 359fe1b83..1984743f8 100644
--- a/plugins/canvas-apps/agents/canvas-screen-editor.md
+++ b/plugins/canvas-apps/agents/canvas-screen-editor.md
@@ -77,6 +77,24 @@ specification exactly:
Write the simplest working version of each formula. The compiler will catch syntax errors —
reserve your reasoning for logic correctness that the compiler cannot catch.
+## Step 3.5 — Self-QA
+
+After applying your changes (Modify) or writing the new screen (Add), run the runtime-anti-pattern
+checks that `compile_canvas` does not catch.
+
+1. Read `${CLAUDE_PLUGIN_ROOT}/references/QAChecks.md`
+2. Re-read the `.pa.yaml` file you just edited or wrote
+3. Apply each check in order; for every issue found, fix it inline using `Edit`
+4. Track the count and a one-line description of every fix applied
+
+**Scope for Modify actions:** focus QA checks on controls and containers you changed or added.
+Do not rewrite pre-existing issues that are unrelated to this edit — the user did not ask for
+them. If a check matches a control you did not touch, skip it.
+
+**Scope for Add actions:** apply all checks to the full new screen, same as the builder.
+
+Do NOT call `compile_canvas` here — the orchestrating skill owns compilation.
+
## Step 4 — Return Result
Mark the task complete. Return a concise result to the orchestrating skill:
@@ -85,6 +103,8 @@ Mark the task complete. Return a concise result to the orchestrating skill:
Screen: [Screen Name]
Action: [Modify / Add]
File: [working directory]/[ScreenName].pa.yaml
+QA fixes applied: [N]
+ - [one-line description per fix, or "clean" if N=0]
Status: Done
Changes applied: [brief list of what was changed/added]
```
diff --git a/plugins/canvas-apps/references/QAChecks.md b/plugins/canvas-apps/references/QAChecks.md
new file mode 100644
index 000000000..ace2d2e30
--- /dev/null
+++ b/plugins/canvas-apps/references/QAChecks.md
@@ -0,0 +1,216 @@
+# Canvas App YAML — QA Self-Check Guide
+
+This guide lists runtime layout issues that `compile_canvas` does NOT catch. The
+compiler validates syntax and property names. It cannot tell you that your
+scrollable container will never scroll, or that a transparent overlay button
+will collapse its siblings to zero height.
+
+Agents that write `.pa.yaml` files MUST run these checks against their own
+output before returning, and fix every issue inline. Report the total number of
+fixes applied in the result summary.
+
+---
+
+## How to run the checks
+
+1. Read the `.pa.yaml` file you just wrote
+2. Apply each check below in order
+3. For every issue found: apply the fix directly using `Edit`
+4. Track the count and a one-line description of each fix
+5. Do NOT re-run `compile_canvas` here — the orchestrating skill does that
+
+All checks are safe: they tighten existing YAML, never delete semantic content.
+
+---
+
+## Check 1 — LayoutMinWidth / LayoutMinHeight on every GroupContainer
+
+**Problem:** Power Apps defaults `LayoutMinWidth` to 250 and `LayoutMinHeight` to
+100 on `GroupContainer`. In a sidebar, header, or narrow cell, these defaults
+silently push the container wider/taller than intended and clip siblings.
+
+**Detect:** For every control with `Control: GroupContainer`, check whether
+`LayoutMinWidth: =0` and `LayoutMinHeight: =0` are present in `Properties:`.
+
+**Fix:** Add either property if missing:
+
+```yaml
+LayoutMinWidth: =0
+LayoutMinHeight: =0
+```
+
+**Exception:** None. Always set both on every GroupContainer.
+
+---
+
+## Check 2 — AlignInContainer on every AutoLayout child
+
+**Problem:** Children of an AutoLayout container (any container that sets
+`LayoutDirection`) have unpredictable cross-axis alignment when
+`AlignInContainer` is omitted. PA picks a default that depends on control type.
+
+**Detect:** For every control, check whether its parent has a `LayoutDirection`
+property. If yes, check whether the child has `AlignInContainer` set. If not,
+it's missing.
+
+**Fix:** Add `AlignInContainer: =AlignInContainer.Stretch` to the child. This
+is the correct default for labels, inputs, buttons, and generic content — the
+child fills the parent's cross-axis dimension.
+
+```yaml
+AlignInContainer: =AlignInContainer.Stretch
+```
+
+**Exception:** If the child has an explicit smaller-than-parent cross-axis
+dimension (e.g., a 28px circular avatar inside a 44px horizontal row), use
+`AlignInContainer: =AlignInContainer.Center` instead, so the child keeps its
+natural size and is centered.
+
+---
+
+## Check 3 — SCROLL-TRAP (`FillPortions: =1` inside scroll container)
+
+**Problem:** When a container has `LayoutOverflowY: =LayoutOverflow.Scroll` and
+its direct child has `FillPortions: =1`, the child is pinned to the viewport
+height. Content that exceeds the viewport is clipped, not scrolled — the whole
+point of the scroll container is defeated.
+
+**Detect:** For every container with `LayoutOverflowY: =LayoutOverflow.Scroll`
+inspect its direct children. Flag any direct child that has `FillPortions: =1`.
+
+**Fix:** Change the child's `FillPortions` to `=0`.
+
+```yaml
+# Before:
+FillPortions: =1
+# After:
+FillPortions: =0
+```
+
+---
+
+## Check 4 — WRAP-MISSING (single-line label without `Wrap: =false`)
+
+**Problem:** Power Apps defaults `Wrap` to `true` on `Label` controls. A narrow
+nav item, breadcrumb, badge, or KPI value will wrap its text onto two lines and
+break the intended layout.
+
+**Detect:** For every `Label` (including `ModernText`), check whether
+`Wrap: =false` is set. Flag any label that looks like a single-line UI element:
+
+- Nav/menu item labels (inside a navigation gallery or sidebar)
+- Tab labels
+- Logo text labels
+- Column headers in tables or galleries
+- Status badges / pill text
+- KPI metric values and card titles
+- Breadcrumb text
+- Button-adjacent short descriptors
+
+**Fix:** Add `Wrap: =false` to the label's Properties.
+
+```yaml
+Wrap: =false
+```
+
+**Exception:** Do NOT add `Wrap: =false` to labels that intentionally display
+multi-line content — description paragraphs, body copy, notes fields, long
+comment text. These should keep the default wrapping behavior.
+
+---
+
+## Check 5 — NO-HEIGHT-TRAP (`FillPortions: =0` without explicit `Height`)
+
+**Problem:** When an AutoLayout child has `FillPortions: =0` (or `FillPortions`
+is absent, which defaults to 0) and no explicit `Height`, Power Apps defaults
+its height to 200px. This pushes surrounding controls around and produces
+inexplicable gaps or clipping.
+
+**Detect:** For every `GroupContainer` whose parent has `LayoutDirection`
+(AutoLayout child), check:
+- Is `FillPortions` absent or `=0`?
+- Is `Height` absent?
+- If both → flag it.
+
+**Fix:** Add an explicit `Height` formula that sums child heights + gaps +
+padding:
+
+```yaml
+Height: =PaddingTop + child1.Height + LayoutGap + child2.Height + PaddingBottom
+```
+
+If the children's heights are unknown at write time, use a safe static value
+(e.g., `Height: =44` for a single row, `=200` for a card panel) and note it in
+the fix log so the user can refine.
+
+**Exception:** The screen root container uses `Width: =Parent.Width` and
+`Height: =Parent.Height` — not an AutoLayout child. Do NOT flag it.
+
+Also do NOT flag controls where `FillPortions > 0` — PA computes the height
+proportionally and `Height` should be absent.
+
+---
+
+## Check 6 — TEXT-PADDING (ModernText, Label padding defaults to 5)
+
+**Problem:** `ModernText` and `Label` controls default `PaddingTop`, `PaddingBottom`,
+`PaddingLeft`, and `PaddingRight` to `5`. In most UI contexts (labels in a
+table row, card header text, inline metadata, KPI values), the 5px default is
+unintended and breaks alignment with adjacent controls or adds stray visual
+space in tight layouts.
+
+**Detect:** For every control with `Control: ModernText` or `Control: Label`, check whether all
+four padding properties — `PaddingTop`, `PaddingBottom`, `PaddingLeft`, and
+`PaddingRight` — are explicitly set in `Properties:`. Flag any that are
+absent.
+
+**Fix:** For each of the four properties that is absent, add it with value
+`=0`:
+
+```yaml
+PaddingTop: =0
+PaddingBottom: =0
+PaddingLeft: =0
+PaddingRight: =0
+```
+
+**Exception:** If the design explicitly requires internal padding on a
+`ModernText` (e.g., a status pill or badge where inset text is intended), set
+the intended non-zero value explicitly. The rule is **never leave any of the
+four padding properties absent on a `ModernText`** — always set all four so the
+PA default of 5 cannot creep in.
+
+---
+
+## Check 7 — FILLPORTIONS-HEIGHT-CONFLICT (both set on the same control)
+
+**Problem:** Setting both `FillPortions: =N` (where `N > 0`) and an explicit
+`Height: =value` on the same control within a vertical AutoLayout container confuses the layout engine.
+The container renders one size at design time and another at runtime.
+
+**Detect:** For every control, check whether it has both:
+- `FillPortions` with a value greater than 0, AND
+- An explicit `Height` (any non-formula numeric or a formula that doesn't
+ reference Parent)
+
+**Fix:** Remove the `Height` property. PA computes it from `FillPortions`
+against the parent's available space.
+
+---
+
+## Check 8 — FILLPORTIONS-WIDTH-CONFLICT (both set on the same control)
+
+**Problem:** Setting both `FillPortions: =N` (where `N > 0`) and an explicit
+`Width: =value` on the same control within a horizontal AutoLayout container
+confuses the layout engine. The container renders one size at design time and
+another at runtime.
+
+**Detect:** For every control, check whether it has both:
+- `FillPortions` with a value greater than 0, AND
+- An explicit `Width` (any non-formula numeric or a formula that doesn't
+ reference Parent)
+
+**Fix:** Remove the `Width` property. PA computes it from `FillPortions`
+against the parent's available space.
+
+---
\ No newline at end of file
diff --git a/plugins/canvas-apps/references/TechnicalGuide.md b/plugins/canvas-apps/references/TechnicalGuide.md
index 38e5c46e0..4eae9ef16 100644
--- a/plugins/canvas-apps/references/TechnicalGuide.md
+++ b/plugins/canvas-apps/references/TechnicalGuide.md
@@ -95,8 +95,8 @@ This applies anywhere a record literal appears inline: `Default`, `Selected`, `I
| Use Case | Control Type | Variant |
|----------|--------------|---------|
| Precise positioning | `GroupContainer` | `ManualLayout` |
-| Horizontal Responsive layout | `GroupContainer` | `Horizontal` with `LayoutDirection: =LayoutDirection.Horizontal` |
-| Vertical Responsive layout | `GroupContainer` | `Vertical` with `LayoutDirection: =LayoutDirection.Vertical` |
+| Horizontal Responsive layout | `GroupContainer` | `AutoLayout` with `LayoutDirection: =LayoutDirection.Horizontal` |
+| Vertical Responsive layout | `GroupContainer` | `AutoLayout` with `LayoutDirection: =LayoutDirection.Vertical` |
⚠️ **`GroupContainer` has no `OnSelect` — it cannot be clicked.** This is a common dead end when building card UI: the container lays out perfectly but tapping it does nothing.
diff --git a/plugins/canvas-apps/skills/generate-canvas-app/SKILL.md b/plugins/canvas-apps/skills/generate-canvas-app/SKILL.md
index 0aaacf310..fad548467 100644
--- a/plugins/canvas-apps/skills/generate-canvas-app/SKILL.md
+++ b/plugins/canvas-apps/skills/generate-canvas-app/SKILL.md
@@ -74,8 +74,6 @@ ones that need answers):
- **Phone users** → large touch targets, single-column, simplified navigation, AutoLayout (responsive), minimal typing.
- **Multi-device / unknown** → AutoLayout (responsive) required.
-**Layout strategy rule of thumb:** Default to **AutoLayout** (responsive) unless the user explicitly chose desktop-only or requested pixel-perfect positioning. AutoLayout uses `GroupContainer` with `Variant: Horizontal` or `Variant: Vertical` and `LayoutDirection`, which adapts to different screen sizes. ManualLayout uses fixed `X`/`Y`/`Width`/`Height` values that do not reflow.
-
---
## Phase 2 — Plan