|
| 1 | +# Power Apps Plugin - Development Guidelines |
| 2 | + |
| 3 | +This file provides instructions for Claude Code when working on the Power Apps plugin specifically. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The Power Apps plugin helps users build and deploy Power Apps generative pages (genux pages) for model-driven apps. It provides an interactive workflow from requirements gathering through PAC CLI deployment, generating React 17 + TypeScript + Fluent UI V9 single-file components. |
| 8 | + |
| 9 | +This is a single-session workflow plugin — no memory bank is needed. Each `/genpage` invocation completes the full cycle: validate prerequisites, gather requirements, generate schema, produce code, and deploy. |
| 10 | + |
| 11 | +## Skills |
| 12 | + |
| 13 | +| Skill | Description | |
| 14 | +|-------|-------------| |
| 15 | +| `/genpage` | Build and deploy a generative page for a model-driven Power App | |
| 16 | + |
| 17 | +### Skill Structure |
| 18 | + |
| 19 | +``` |
| 20 | +skills/<skill-name>/ |
| 21 | +└── SKILL.md # Main skill workflow (links to shared/) |
| 22 | +
|
| 23 | +../../shared/ # Shared resources (references + samples) |
| 24 | +├── references/ |
| 25 | +│ ├── genux-rules-reference.md |
| 26 | +│ ├── pac-cli-reference.md |
| 27 | +│ └── troubleshooting.md |
| 28 | +└── samples/ # Example .tsx files |
| 29 | +``` |
| 30 | + |
| 31 | +### Skill Header Pattern |
| 32 | + |
| 33 | +```markdown |
| 34 | +--- |
| 35 | +name: genpage |
| 36 | +description: Does X for Y # Third person, specific, <160 chars |
| 37 | +user-invocable: true |
| 38 | +allowed-tools: [...] |
| 39 | +--- |
| 40 | + |
| 41 | +# Skill Title |
| 42 | +``` |
| 43 | + |
| 44 | +### Writing Clean Skills (Anti-Bloat Guidelines) |
| 45 | + |
| 46 | +Follow these rules to keep skills concise and effective: |
| 47 | + |
| 48 | +**DO:** |
| 49 | +- Keep SKILL.md under 500 lines total |
| 50 | +- Use short, descriptive `name` field (e.g., `genpage`) |
| 51 | +- Write descriptions in third person ("Creates X" not "This skill guides you through creating X") |
| 52 | +- Use numbered lists for workflows instead of ASCII diagrams |
| 53 | +- Trust Claude's intelligence - omit explanations of well-known concepts |
| 54 | +- Use progressive disclosure: SKILL.md for workflow, reference files for details |
| 55 | +- Link to shared references inline: `See [troubleshooting.md](../../shared/references/troubleshooting.md)` |
| 56 | + |
| 57 | +**DON'T:** |
| 58 | +- Start with "This skill/document guides/covers/describes..." (AI slop) |
| 59 | +- Include ASCII workflow diagrams (waste 50+ lines) |
| 60 | +- Duplicate content between summary and action sections |
| 61 | +- Explain obvious concepts Claude already knows |
| 62 | +- Add verbose tables for simple lists (use inline format instead) |
| 63 | +- Repeat the same information in multiple places |
| 64 | + |
| 65 | +## Key Concepts |
| 66 | + |
| 67 | +### Genux Pages |
| 68 | + |
| 69 | +Generative pages (genux) are React 17 + TypeScript single-file components that run inside model-driven Power Apps. They use Fluent UI V9 for styling and the DataAPI for Dataverse data access. Each page is a single `.tsx` file with `export default GeneratedComponent`. |
| 70 | + |
| 71 | +### Model-Driven Apps |
| 72 | + |
| 73 | +Power Apps model-driven apps are data-first applications built on Dataverse. Genux pages extend these apps with custom React-based UI pages deployed via PAC CLI. |
| 74 | + |
| 75 | +### DataAPI |
| 76 | + |
| 77 | +The DataAPI (`props.dataApi`) provides typed CRUD operations against Dataverse tables. It uses RuntimeTypes.ts (generated by `pac model genpage generate-types`) for type safety. Column names must be verified from the generated schema — never guessed. |
| 78 | + |
| 79 | +### RuntimeTypes |
| 80 | + |
| 81 | +TypeScript type definitions generated from Dataverse metadata. Contains entity types, enum registrations, and the `GeneratedComponentProps` interface. Generated via PAC CLI before code generation to ensure correct column names. |
| 82 | + |
| 83 | +## Testing Changes |
| 84 | + |
| 85 | +After modifying this plugin: |
| 86 | + |
| 87 | +1. Run `claude --debug` to see plugin loading details |
| 88 | +2. Test skill invocation with `/genpage` |
| 89 | +3. Verify tool restrictions work (should only allow pac, powershell, node commands) |
| 90 | +4. Test with both Dataverse entity pages and mock data pages |
0 commit comments