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 plan mode support (#6)

Priyanshu Agrawal134c744bab8f
diff --git a/README.md b/README.md
index 23ab8a65c..68752098f 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,7 @@ To develop and test plugins locally, follow these steps:
1. Launch Claude Code with plugin path:
```bash
- claude --plugin-dir /path/to/power-platform-claude-plugin/plugins/power-pages
+ claude --plugin-dir /path/to/power-platform-claude-plugins/plugins/power-pages
```
## Documentation
diff --git a/plugins/power-pages/shared/planning-policy.md b/plugins/power-pages/shared/planning-policy.md
index de4f27ef7..f6b112c32 100644
--- a/plugins/power-pages/shared/planning-policy.md
+++ b/plugins/power-pages/shared/planning-policy.md
@@ -14,12 +14,12 @@
## How to Plan
-1. **Enter Plan Mode**: Use the `EnterPlanMode` tool before writing any code
+1. **Enter Plan Mode**: Use the `/plan` command before writing any code
2. **Explore**: Read relevant files and understand the current implementation
3. **Design**: Create a clear implementation approach
4. **Present**: Show the plan to the user for approval
5. **Wait**: Do not proceed until the user approves
-6. **Exit**: Use `ExitPlanMode` when ready to implement
+6. **Exit**: Use `ExitPlanMode` tool when ready to implement
## When Planning is NOT Required
diff --git a/plugins/power-pages/shared/shared-instructions.md b/plugins/power-pages/shared/shared-instructions.md
index 550c8bf73..bc572cd87 100644
--- a/plugins/power-pages/shared/shared-instructions.md
+++ b/plugins/power-pages/shared/shared-instructions.md
@@ -13,9 +13,9 @@ All skills reference this single file. When new shared instructions are added, u
Before implementing major changes, Claude MUST enter plan mode first. This ensures user approval before significant work begins.
**Key Points:**
-- Use `EnterPlanMode` tool before writing code for new features or multi-file changes
+- Use `/plan` command to enter plan mode before writing code for new features or multi-file changes
- Present plan for user approval
-- Exit plan mode with `ExitPlanMode` when approved
+- Exit plan mode with `ExitPlanMode` tool when approved
---
diff --git a/plugins/power-pages/skills/create-site/SKILL.md b/plugins/power-pages/skills/create-site/SKILL.md
index 4c5dabdbc..ccae145c5 100644
--- a/plugins/power-pages/skills/create-site/SKILL.md
+++ b/plugins/power-pages/skills/create-site/SKILL.md
@@ -2,7 +2,7 @@
name: creating-power-pages-site
description: Creates Power Pages code sites (SPAs) using React, Angular, Vue, or Astro. Use when creating sites, portals, building websites, scaffolding projects, uploading to Power Pages, or activating sites.
user-invocable: true
-allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task"]
+allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task", "ExitPlanMode"]
model: opus
---
@@ -14,7 +14,7 @@ model: opus
## Workflow
-1. **Gather Requirements** → Ask framework, features, design preferences
+1. **Plan** → Gather requirements, enter plan mode, get approval
2. **Create Site** → Use frontend-design skill, configure for Power Pages
3. **Preview & Approve** → User reviews site locally before upload
4. **Check Prerequisites** → Verify PAC CLI and Azure CLI
@@ -23,16 +23,33 @@ model: opus
---
-## Step 1: Gather Requirements
+## Step 1: Plan
+
+### 1.1 Gather Requirements
Use `AskUserQuestion` to ask:
1. Site purpose and target audience
-2. Framework: React (recommended), Angular, Vue, or Astro
-3. Features: landing page, forms, auth, data display
-4. Design preferences
+2. Audience type: internal or external
+3. Framework: React (recommended), Angular, Vue, or Astro
+4. Features: landing page, forms, auth, data display
+5. Design preferences
**Constraint**: Only static SPA frameworks. NOT supported: Next.js, Nuxt.js, Remix, SvelteKit, Liquid.
+### 1.2 Enter Plan Mode
+
+Use `/plan` command to enter plan mode and create an implementation plan covering:
+- Project structure and folder layout
+- Components to be created
+- Pages and routing approach
+- Styling approach (CSS modules, Tailwind, etc.)
+- Power Pages configuration (`powerpages.config.json`)
+- Build and deployment steps
+
+### 1.3 Get Approval
+
+Present the plan to the user. Use `ExitPlanMode` only after user approves. If user requests changes, update the plan and present again.
+
---
## Step 2: Create the Site
diff --git a/plugins/power-pages/skills/setup-auth/SKILL.md b/plugins/power-pages/skills/setup-auth/SKILL.md
index f5ac9596f..022ced632 100644
--- a/plugins/power-pages/skills/setup-auth/SKILL.md
+++ b/plugins/power-pages/skills/setup-auth/SKILL.md
@@ -2,7 +2,7 @@
name: setting-up-authentication
description: Configures authentication (login/logout) and role-based authorization for Power Pages. Use when setting up user login, Azure AD/Entra ID auth, logout, role-based access control, route protection, or conditional UI based on roles.
user-invocable: true
-allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task"]
+allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task", "ExitPlanMode"]
model: opus
---
@@ -14,7 +14,7 @@ model: opus
## Workflow
-1. **Check Prerequisites** → Verify `/setup-webapi` completed, site uploaded
+1. **Plan** → Check prerequisites, gather requirements, design auth approach, get approval
2. **Create Auth Service** → Login/logout methods, user info retrieval
3. **Create Authorization Utils** → Role checking, conditional rendering
4. **Create Auth UI** → Login/logout button, user profile
@@ -23,7 +23,9 @@ model: opus
---
-## Step 1: Check Prerequisites
+## Step 1: Plan
+
+### 1.1 Check Prerequisites
Read `memory-bank.md` for project context. Requires:
- Site uploaded to Power Pages (`/_layout/tokenhtml` endpoint needed)
@@ -31,10 +33,25 @@ Read `memory-bank.md` for project context. Requires:
If `/setup-webapi` not completed, tell user to run it first.
+### 1.2 Gather Requirements
+
Use `AskUserQuestion`:
- Which features? (Login/Logout only, User profile, Role-based content, All)
- Which roles need conditional UI? (None, Admin sections, Member content, Multiple)
+### 1.3 Enter Plan Mode
+
+Use `/plan` command to enter plan mode and create an implementation plan covering:
+- Files to create (`authService.ts`, `authorization.ts`, type definitions)
+- Auth UI components (login button, user profile display)
+- Role-based UI requirements (which components need role checks)
+- Site settings to configure
+- Testing approach
+
+### 1.4 Get Approval
+
+Present the plan to the user. Use `ExitPlanMode` only after user approves. If user requests changes, update the plan and present again.
+
---
## Step 2: Create Auth Service
diff --git a/plugins/power-pages/skills/setup-dataverse/SKILL.md b/plugins/power-pages/skills/setup-dataverse/SKILL.md
index 1200c1cbd..a00de4c1e 100644
--- a/plugins/power-pages/skills/setup-dataverse/SKILL.md
+++ b/plugins/power-pages/skills/setup-dataverse/SKILL.md
@@ -2,7 +2,7 @@
name: setting-up-dataverse-tables
description: Creates Dataverse tables, columns, and relationships for Power Pages. Use when creating tables, defining schema, setting up entity relationships, or lookup fields.
user-invocable: true
-allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task"]
+allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task", "ExitPlanMode"]
model: opus
---
@@ -16,22 +16,21 @@ Tables are created in **topological order** (referenced tables first) to maintai
## Workflow
-1. **Check Context** → Read memory bank, get project path
-2. **Analyze Site** → Identify data patterns from components
-3. **Build Dependency Graph** → Determine creation order
-4. **Setup API Auth** → Get token and publisher prefix
-5. **Review Existing Tables** → Reuse, extend, or create new
-6. **Create Tables** → In dependency order with relationships
+1. **Plan** → Check context, analyze site, design schema, get approval
+2. **Setup API Auth** → Get token and publisher prefix
+3. **Review Existing Tables** → Reuse, extend, or create new
+4. **Create Tables** → In dependency order with relationships
+5. **Upload** → Create skill tracking setting and upload
---
-## Step 1: Check Context
+## Step 1: Plan
-Read `memory-bank.md`. If continuing from `/create-site`, proceed. Otherwise ask for project path or suggest `/create-site` first.
+### 1.1 Check Context
----
+Read `memory-bank.md`. If continuing from `/create-site`, proceed. Otherwise ask for project path or suggest `/create-site` first.
-## Step 2: Analyze Site
+### 1.2 Analyze Site
Read `powerpages.config.json` and scan components for data patterns:
@@ -53,20 +52,29 @@ Read `powerpages.config.json` and scan components for data patterns:
The `contact` table is already integrated with Power Pages authentication - portal users are linked to Contact records. Extend it with custom columns if needed rather than creating a separate user table.
-Design ER model, classify into tiers (TIER 0 = reference tables, TIER 1 = primary entities, etc.), present to user.
-
----
-
-## Step 3: Build Dependency Graph
+### 1.3 Build Dependency Graph
Topologically sort tables. Rules:
- No circular dependencies
- All referenced tables exist
- Self-references: create table first, add lookup after
+### 1.4 Enter Plan Mode
+
+Use `/plan` command to enter plan mode and create an implementation plan covering:
+- ER model with all tables, columns, and relationships
+- Tier classification (TIER 0 = reference tables, TIER 1 = primary entities, etc.)
+- Creation order based on dependency graph
+- Which existing tables will be reused vs. created
+- Columns and data types for each table
+
+### 1.5 Get Approval
+
+Present the plan (including ER diagram) to the user. Use `ExitPlanMode` only after user approves. If user requests changes, update the plan and present again.
+
---
-## Step 4: Setup API Auth
+## Step 2: Setup API Auth
```powershell
az account show
@@ -80,7 +88,7 @@ $publisherPrefix = $api.PublisherPrefix # Use for all schema names
---
-## Step 5: Review Existing Tables
+## Step 3: Review Existing Tables
**ALWAYS query existing tables first before recommending creation:**
@@ -117,7 +125,7 @@ $tableMap["category"].Source # "Reused", "Extended", or "Created"
---
-## Step 6: Create Tables
+## Step 4: Create Tables
**Present the plan and get explicit confirmation before creating:**
@@ -141,7 +149,7 @@ Options:
---
-## Step 7: Create Skill Tracking Setting and Upload
+## Step 5: Create Skill Tracking Setting and Upload
Create `Site/AI/SetupDataverse` site setting to track skill usage:
diff --git a/plugins/power-pages/skills/setup-webapi/SKILL.md b/plugins/power-pages/skills/setup-webapi/SKILL.md
index ac4864d1f..29b399fa7 100644
--- a/plugins/power-pages/skills/setup-webapi/SKILL.md
+++ b/plugins/power-pages/skills/setup-webapi/SKILL.md
@@ -2,7 +2,7 @@
name: setting-up-web-api
description: Configures Web API access, table permissions, web roles, and site settings for Power Pages. Use when setting up table permissions, entity permissions, CRUD access, or site settings for Web API.
user-invocable: true
-allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task"]
+allowed-tools: ["Read", "Write", "Grep", "Glob", "Bash", "TodoWrite", "AskUserQuestion", "Skill", "Task", "ExitPlanMode"]
model: opus
---
@@ -14,7 +14,7 @@ model: opus
## Workflow
-1. **Check Context** → Read memory bank, get table name mapping from `/setup-dataverse`
+1. **Plan** → Check context, design permissions strategy, get approval
2. **Create Site Settings** → `Webapi/{table}/enabled` and `fields` for each table
3. **Create Web Roles** → Verify/create Anonymous, Authenticated, custom roles
4. **Create Table Permissions** → Link to web roles with appropriate scope
@@ -22,12 +22,30 @@ model: opus
---
-## Step 1: Check Context
+## Step 1: Plan
+
+### 1.1 Check Context
Read `memory-bank.md`. **Critical**: Get the **Table Name Mapping** - use actual logical names (may differ from `{prefix}_tablename` for reused tables).
If continuing from `/setup-dataverse`, list tables to configure. Otherwise ask for project path and tables.
+### 1.2 Enter Plan Mode
+
+Use `/plan` command to enter plan mode and create an implementation plan covering:
+- Tables requiring Web API access
+- Permissions matrix (which roles get which CRUD operations on which tables)
+- Web roles to create or verify
+- Site settings to create
+- Security considerations (scope: Global vs Self)
+
+### 1.3 Get Approval
+
+Present the permissions plan to the user as a table showing:
+- Table name → Web role → Permissions (Read/Create/Write/Delete) → Scope
+
+Use `ExitPlanMode` only after user approves. If user requests changes, update the plan and present again.
+
---
## Step 2: Create Site Settings