Skip to content

Commit b139170

Browse files
author
Akshay Maloo
authored
Add power-apps plugin with genpage skill for generative pages (#11)
Adds a new power-apps plugin that builds and deploys Power Apps generative pages (genux) for model-driven apps using React 17, TypeScript, and Fluent UI V9 via PAC CLI. Plugin structure: - Claude Code skill (SKILL.md) with /genpage command - GitHub Copilot instructions (copilot-instructions.md) - Shared references (code-gen rules, PAC CLI, troubleshooting) - 8 sample .tsx files for common page patterns - Project-level settings for auto-allowed Bash commands
1 parent 156aa93 commit b139170

19 files changed

Lines changed: 2599 additions & 0 deletions

.claude-plugin/marketplace.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@
3333
}
3434
}
3535
}
36+
},
37+
{
38+
"name": "power-apps",
39+
"description": "Build and deploy Power Apps generative pages for model-driven apps.",
40+
"version": "1.0.0",
41+
"author": {
42+
"name": "Microsoft"
43+
},
44+
"source": "./plugins/power-apps",
45+
"category": "development",
46+
"strict": false
3647
}
3748
]
3849
}

.claude/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(pac *)",
5+
"Bash(node *)",
6+
"Bash(dotnet *)",
7+
"Bash(powershell *)",
8+
"Read",
9+
"Write",
10+
"Edit"
11+
]
12+
}
13+
}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ Create and deploy Power Pages sites using modern development approaches.
3333

3434
**Currently supported**: Code Sites (SPAs) with React, Angular, Vue, or Astro
3535

36+
### Power Apps (`plugins/power-apps`)
37+
38+
Build and deploy Power Apps generative pages for model-driven apps.
39+
40+
**Stack**: React + TypeScript + Fluent, deployed via PAC CLI
41+
3642
## Installation
3743

3844
### Add from GitHub Marketplace
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "power-apps",
3+
"version": "1.0.0",
4+
"description": "Build and deploy Power Apps generative pages for model-driven apps.",
5+
"author": {
6+
"name": "Microsoft",
7+
"url": "https://www.microsoft.com"
8+
},
9+
"homepage": "https://github.com/microsoft/power-platform-claude-plugins/",
10+
"repository": "https://github.com/microsoft/power-platform-claude-plugins/",
11+
"license": "MIT",
12+
"keywords": [
13+
"power-apps",
14+
"generative-pages",
15+
"genux",
16+
"genpage",
17+
"react",
18+
"fluent-ui",
19+
"dataverse",
20+
"pac-cli",
21+
"model-driven"
22+
]
23+
}

plugins/power-apps/AGENTS.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Build Generative Page
2+
3+
Read and follow the instructions in `${CLAUDE_PLUGIN_ROOT}/skills/genpage/SKILL.md`.
4+
5+
**Important**:
6+
7+
- Do not announce steps - just execute them
8+
- Validate prerequisites (Node.js, PAC CLI) before proceeding
9+
- Generate RuntimeTypes.ts schema BEFORE writing any code for Dataverse pages
10+
- NEVER guess column names - always verify from generated schema
11+
- Ask user which app to deploy to - never assume a default
12+
- Use PAC CLI for all deployment operations

0 commit comments

Comments
 (0)