agentleFS
korchard333korchard333/claude-power-platform-community/.claude/skills/code-apps/SKILL.md

code-apps

Skill46 starsChanged 8 months agoMITView on GitHub

Power Apps Code Apps Development (React + TypeScript + Vite). Use when: building Code Apps, three-layer architecture, PAC CLI workflow, Zustand state management, TanStack Query, shadcn/ui components, router basename, provider stack, form patterns, Dataverse integration from React.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Not handling loading, error, and empty states in presentation components

    line 69

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: Power Apps Code Apps Development

When to Use

Trigger when building, debugging, or reviewing Code Apps — React + TypeScript + Vite applications running inside Power Apps.


Tech Stack Reference

LayerTechnologyNotes
LanguageTypeScript (strict mode)Primary language for all code
UI FrameworkReact 18/19Functional components only
Build ToolVite + @microsoft/power-apps pluginDev server + Power Apps integration
StylingTailwind CSS + shadcn/uiStarter template default
Styling (alt)Fluent UI v9 (@fluentui/react-components)Microsoft-branded enterprise apps — see fluent-ui.md
Client StateZustandCross-component state
Server StateTanStack Query v5Caching, background refresh, mutations
RoutingReact Router v6With basename normalization
TablesTanStack TableSorting, filtering, pagination
ChartsRechartsData visualization
NotificationsSonnerToast notifications
TestingPlaywrightE2E testing
CLIPAC CLI + @microsoft/power-apps npmScaffolding, data sources, deployment

Three-Layer Architecture

Layer 1: Presentation (components/) — Props in, callbacks out. ZERO service imports.
Layer 2: Business Logic (hooks/)    — TanStack Query + Zustand. ONLY layer calling services.
Layer 3: Data Access (generated/)   — PAC CLI auto-generated. NEVER manually edit.

⚠️ REQUIRED: Load Sub-Files Before Implementation

SKILL.md is a summary only — it is NOT sufficient for implementation.

The detailed content (complete payloads, XML templates, working examples, edge-case handling) lives in sub-files in the same directory as this SKILL.md. Before writing any code, you MUST use read_file on the sub-files relevant to your task:

  • Architecture & Critical Patterns — Three-layer pattern, project structure, auth model, env var access, router basename, provider stack, lookup handling
  • CLI Workflow — npm CLI (preview, becoming primary), PAC CLI commands, connector discovery (Wave 1 2026), agent.md, scaffold, init, data sources, build, deploy
  • State Management — Zustand stores for client state, TanStack Query for server state, caching patterns
  • Form Patterns — Create/edit hook pattern, component pattern, page composition, validation
  • Power Automate Integration — Triggering flows via Custom API or Dataverse record trigger
  • Fluent UI V9 — FluentProvider setup, theme customization (BrandVariants, dark/light mode), design tokens, makeStyles patterns, component patterns (forms, DataGrid, Dialog, layout), responsive design with Fluent
  • Performance & Localization — Performance checklist, error handling, language detection, translation dictionary, RTL layout, date/currency formatting

Anti-Patterns

  • Importing generated services directly in components (violates three-layer rule)
  • Embedding secrets in Code App source (published code is publicly accessible)
  • Skipping router basename normalization (breaks navigation in Power Apps host)
  • Using window.fetch directly instead of generated services (bypasses auth and connectors)
  • Hardcoding display text in JSX instead of using translation dictionary
  • Using Intl.NumberFormat with hardcoded currency codes (user's currency comes from usersettings)
  • Fetching all columns from Dataverse (always use $select)
  • Eager $expand on large lookup tables (resolve on-demand instead)
  • Manual auto-numbering in plugins when Dataverse auto-number columns exist
  • Not handling loading, error, and empty states in presentation components
  • Using React.useEffect for data fetching instead of TanStack Query
  • Storing server state in Zustand (use TanStack Query for anything from an API)

Related Skills

  • dataverse-web-api — Code Apps consume Dataverse via generated services built on Web API
  • dataverse — Schema design that Code App queries target
  • testing — Code App testing with Vitest/Jest + Playwright
  • power-automate — Integration patterns for triggering flows from Code Apps
  • accessibility-ux — WCAG 2.2 AA compliance for Code App components

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.