Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 2.43 KB

File metadata and controls

44 lines (33 loc) · 2.43 KB

AGENTS.md — Development Guidelines

This file governs how AI coding agents (Claude Code, GitHub Copilot CLI) should work within this plugin repository.

Repository purpose

This plugin provides skills, commands, and resources for building Power Apps Code Apps — React/Vue/TypeScript SPAs hosted on the Power Platform. It follows the microsoft/power-platform-skills marketplace pattern.

Structure

plugins/code-apps/
├── .claude-plugin/plugin.json   # Plugin manifest
├── skills/                      # Knowledge context files (markdown)
├── commands/                    # Slash command definitions (markdown)
├── resources/                   # Supporting reference docs
├── shared/                      # Shared utilities and templates
└── github/                      # GitHub Copilot CLI instructions

Coding principles

  1. Skills are knowledge, commands are actions. Skills explain concepts and patterns. Commands instruct the agent to take specific steps.
  2. DRY. Shared patterns (e.g. pac auth flow, Vite config) live in shared/ and are referenced by commands — not duplicated.
  3. Always use the latest SDK. Reference @microsoft/power-apps ^1.0.3 or higher. Never reference deprecated initialize() or PCF APIs.
  4. Commands must be safe. Commands that run pac code push or modify environments must confirm with the user first.
  5. Keep skills up to date. The npm-based CLI (@microsoft/power-apps v1.0.4+) is replacing pac code commands. Skills must reflect both paths during transition.

What agents must NEVER do

  • Call initialize() from @microsoft/power-apps/app — it was removed in SDK v1.0
  • Use context.webAPI, context.parameters, or Xrm.WebApi — these are PCF APIs, not Code Apps APIs
  • Generate code that embeds a Code App inside a Model-Driven App — not supported
  • Pin to React 19 — SDK requires React 18.2.0 exactly
  • Skip the pac code run middleware in the dev script — it handles auth and connection proxying
  • Assume Code Apps are enabled in an environment — they must be enabled by an admin first

Pull request checklist

  • All new patterns tested against a real Power Platform developer environment
  • No PCF API references (context.webAPI, Xrm, etc.)
  • SDK version references updated to latest
  • Both pac code CLI and new npm CLI paths documented where applicable
  • Gotchas updated if new limitation discovered