No slash command · from power-platform-full-stack
Provides best practices for Vite + React + TypeScript projects: feature-first structure, build/lint workflows, Vite config, and single-file builds. Guides scaffolding with create-vite and interactive terminal usage.
Ships in power-platform-full-stack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in building modern web applications with Vite, React, and TypeScript. These patterns apply to any Vite+React project — whether standalone, embedded in Power Platform, or deployed elsewhere.
Always use the official create-vite scaffolder to initialize new projects. Do NOT manually create project files (package.json, tsconfig, vite.config.ts, etc.) — use the scaffolder to get the latest official template.
create-vite v6+ uses interactive prompts (@clack/prompts) that require arrow-key navigation and cannot be driven by non-interactive terminals. The run_in_terminal tool with isBackground: false cannot send keypresses to these menus, so the command will hang and exit silently with code 1.
Solution: Launch as a background terminal and let the user interact.
Clean the target directory (if needed) using run_in_terminal with isBackground: false:
# Remove existing scaffold files if re-scaffolding
Remove-Item -Force eslint.config.js, index.html, package.json, ... -ErrorAction SilentlyContinue
Launch create-vite in a background terminal so the user can interact with the prompts:
run_in_terminal:
command: npm create vite@latest . -- --template react-ts
isBackground: true
Tell the user to switch to the terminal pane and complete the interactive steps (select framework, variant, package name, etc.).
After the user confirms completion, verify the scaffold by listing files:
Get-ChildItem -Force | Select-Object Name
Run npm install (non-background):
npm install
Verify the build:
npm run build
isBackground: false for create-vite — it will hang on the interactive promptscreate-vite versions (e.g., npm create vite@5) just to avoid prompts — always use @latestnpm run build after scaffolding to confirm the template is workingOrganize code by feature, not by file type. Each feature owns its models, services, hooks, and components:
src/
├── features/
│ ├── accounts/
│ │ ├── models/
│ │ │ └── Account.ts # Domain model types and DTOs
│ │ ├── services/
│ │ │ └── AccountService.ts # Service layer wrapping API calls
│ │ ├── hooks/
│ │ │ └── useAccounts.ts # React Query hooks
│ │ └── components/
│ │ ├── AccountList.tsx # List view
│ │ ├── AccountDetail.tsx # Detail view
│ │ └── AccountForm.tsx # Create/edit form
│ ├── contacts/
│ │ ├── models/
│ │ ├── services/
│ │ ├── hooks/
│ │ └── components/
│ └── shared/
│ └── components/ # Cross-feature UI components
├── App.tsx
└── main.tsx
Why feature-first?
components/, hooks/, services/ foldersWhen working in a multi-project workspace (e.g., code-app/ and power-pages/ as siblings),
ALWAYS use absolute or explicit relative paths at the start of terminal commands:
# GOOD — explicit directory
Set-Location c:\src\MyWorkspace\code-app; npm run build
# BAD — assumes current directory
npm run build
Rules:
Before starting a dev server (npm run dev, vite, etc.):
Kill any existing instances:
Get-Process -Name "node" -ErrorAction SilentlyContinue |
Where-Object { $_.CommandLine -match 'vite' } |
Stop-Process -Force
Use --strictPort to prevent port cascading:
// vite.config.ts
export default defineConfig({
server: {
port: 5173,
strictPort: true, // FAIL instead of silently picking next port
},
});
After browser testing, kill the dev server explicitly. Don't leave zombie processes.
Use the
ioc-development-patternskill for the complete service layer pattern — service interfaces, domain models with DTOs (CreateDto/UpdateDto), in-memory implementations for local development, service registry, React Query (TanStack Query) integration with query key factories, cache invalidation, mutation hooks, optimistic updates, real backend service implementations with error handling, and incremental backend migration. That skill is the single source of truth for data access patterns.
Most state in a data-driven business app is server state (fetched data). Use this hierarchy:
Managed by the ioc-development-pattern skill. React Query handles:
This covers 80-90% of state in a typical business app.
For cross-component UI state that doesn't come from the server:
| State Type | Approach | Example |
|---|---|---|
| Component-local | useState | Form inputs, open/close toggles, selected tab |
| Feature-scoped | useState lifted to parent | Selected list item, filter state |
| App-wide UI | React Context | Theme preference, sidebar collapsed, current user display |
| URL state | URL search params | Active filters, selected tab, page number |
// src/contexts/UIContext.tsx — minimal app-wide UI state
import { createContext, useContext, useState, type ReactNode } from "react";
interface UIState {
sidebarCollapsed: boolean;
toggleSidebar: () => void;
}
const UIContext = createContext<UIState | null>(null);
export function UIProvider({ children }: { children: ReactNode }) {
const [sidebarCollapsed, setSidebarCollapsed] = useState(false);
return (
<UIContext.Provider value={{
sidebarCollapsed,
toggleSidebar: () => setSidebarCollapsed(prev => !prev),
}}>
{children}
</UIContext.Provider>
);
}
export function useUI() {
const ctx = useContext(UIContext);
if (!ctx) throw new Error("useUI must be within UIProvider");
return ctx;
}
useStateui-fluentui-react skill → Mandatory Shell Scaffold). The notification store bridges
service/hook layer → React toast UI, which React Context alone cannot do cleanly.Is this data from the server? → React Query (via ioc-development-pattern hooks)
Is this component-local? → useState
Do siblings need to share it? → Lift state to parent
Do unrelated components need it? → React Context
Does it belong in the URL? → URL search params (useSearchParams)
Is it a cross-cutting notification queue? → Zustand (see notification store pattern)
Use the
ui-fluentui-reactskill for all Fluent UI v9 guidance — component patterns (list views, detail views, forms, dialogs, drawers, data grids, toasts),makeStylesstyling with design tokens,FluentProvidersetup, theming, layout patterns, toolbar/navigation, and the business component checklist (loading/error/empty/disabled states). That skill is the single source of truth for Fluent UI React v9.
Every React Router app must include a catch-all route that shows a "Not Found" screen.
Never redirect unknown paths to / silently — this masks broken links and confuses users.
The route tree MUST be wrapped in <ErrorBoundary> and <Suspense>:
// App.tsx — route configuration
import { Suspense } from "react";
import { Routes, Route } from "react-router-dom";
import { Spinner } from "@fluentui/react-components";
import { ErrorBoundary } from "./shared/components/ErrorBoundary";
import { NotificationBridge } from "./shared/components/NotificationBridge";
export default function App() {
return (
<ErrorBoundary>
<NotificationBridge />
<Suspense fallback={<div style={{ display: "flex", justifyContent: "center", padding: "48px" }}><Spinner label="Loading..." size="medium" /></div>}>
<Routes>
<Route path="/" element={<AppShell />}>
<Route index element={<DashboardScreen />} />
<Route path="projects" element={<ProjectListScreen />} />
<Route path="projects/new" element={<ProjectNewScreen />} />
<Route path="projects/:id" element={<ProjectDetailScreen />} />
{/* ... other routes ... */}
{/* ✅ Catch-all — shows 404 page */}
<Route path="*" element={<NotFoundScreen />} />
</Route>
</Routes>
</Suspense>
</ErrorBoundary>
);
}
ErrorBoundaryandSuspenseare mandatory. WithoutErrorBoundary, a single component crash takes down the entire app. WithoutSuspense, anyReact.lazy()import or suspense-enabled data fetch crashes the app with an unhandled promise. Seeui-fluentui-reactskill → "Mandatory Shell Scaffold" for the full required structure.
// screens/NotFoundScreen.tsx — minimal implementation
import { Button, Text, tokens, makeStyles } from "@fluentui/react-components";
import { useNavigate } from "react-router-dom";
const useStyles = makeStyles({
root: {
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
height: "100%",
gap: tokens.spacingVerticalL,
padding: tokens.spacingHorizontalXXL,
},
});
export function NotFoundScreen() {
const navigate = useNavigate();
const styles = useStyles();
return (
<div className={styles.root}>
<Text size={800} weight="bold">404</Text>
<Text size={400}>Page not found</Text>
<Button appearance="primary" onClick={() => navigate("/")}>
Go to Dashboard
</Button>
</div>
);
}
Rules:
<Route path="*"> must be the last child inside the layout route<Navigate to="/" replace /> as a catch-all — this silently hides broken routesRun these checks after every significant code change and ALWAYS before deployment:
npm run build
npm run lint
useEffect dependencies, incorrect hook usagenpm run lint -- --fix
Auto-fixable: import sorting, semicolons, whitespace, unused imports, quote style. Non-fixable (manual): logic errors, type errors, complex rule violations.
{
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
}
}
When deploying to a non-root path (e.g., Power Platform, SharePoint, subdirectory hosting):
export default defineConfig({
plugins: [react()],
base: './', // Relative paths — assets resolve correctly in any hosting location
build: {
outDir: 'dist',
assetsDir: 'assets',
rollupOptions: {
output: {
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-fluent': ['@fluentui/react-components', '@fluentui/react-icons'],
'vendor-query': ['@tanstack/react-query'],
},
},
},
},
});
Manual chunk splitting is required. Without it, the entire app bundles into a single large JS file. Splitting React, Fluent UI, and React Query into separate vendor chunks enables browser caching — vendor chunks rarely change, so users only re-download app code on updates. This can reduce reload times by 60-80% after the first visit.
Without base: './', built HTML references assets with absolute paths (/assets/index.js) which break when deployed to a non-root URL.
cat dist/index.html | grep -E 'src=|href='
# ✅ Good: src="./assets/index-abc123.js"
# ❌ Bad: src="/assets/index-abc123.js"
When you need the entire app in a single HTML file (e.g., for web resources or iframes):
npm install -D vite-plugin-singlefile
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";
export default defineConfig({
plugins: [react(), viteSingleFile()],
build: {
assetsInlineLimit: 100000000,
cssCodeSplit: false,
},
});
Produces a single dist/index.html with all JS/CSS inlined.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub scottdurow/power-platform-full-stack-skills --plugin power-platform-full-stack16 skills in this plugin
/browser-automationInteractive browser automation and visual validation using Playwright MCP server and GitHub Copilot Agent Mode. Creates a bridge between the agent and a live browser session (including authenticated user context), with optional scripted Playwright test generation for repeatable checks. Triggers on "browser automation", "interactive browser", "playwright mcp", "test the ui", "ui test", "visual test", "visual regression", "check interface", "deployment smoke test", "post-deploy validation", "config validation"./code-reviewDeep code audit and technical review skill. Handles code audits (dead wiring, silent failures, stubs, bloat), architecture decisions, security audits, feature design reviews, refactoring plans, and deployment strategy reviews. Produces actionable reports with file:line references grouped by severity, or structured decision documents with trade-off analysis. Triggers on "code review", "audit the code", "review the code", "find dead code", "find placeholders", "check for stubs", "prune the code", "code cleanup", "implementation review", "completeness check", "find unused code", "architecture decision", "security audit", "design review", "refactoring plan", "deployment review", "team review", "review team", "collaborative review"./dataverse-data-reviewComprehensive Dataverse data model reviewer and critic. Evaluates proposed schemas against 74+ rules covering naming, normalization, data types, business rules, evolvability, and platform-specific best practices. Produces structured assessments with actionable feedback. Triggers on "review my data model", "critique this schema", "is my Dataverse design correct", "data model review", "schema review", "evaluate my tables", "check my data model", "Dataverse best practices review", "normalization check"./dataverse-prerequisitesShared prerequisite steps for any skill that interacts with the Dataverse OData Web API. Covers PAC CLI authentication, Azure CLI token acquisition, WhoAmI validation, environment URL extraction, and token refresh patterns. Triggers on "pac auth", "dataverse auth", "dataverse prerequisites", "connect to dataverse", "environment setup", "pac env who", "dataverse token", "azure cli token dataverse"./dataverse-solution-web-apiExpert guidance for the Microsoft Dataverse Web API metadata and schema management. Programmatically create tables, columns, relationships, forms, views, app modules, and sitemaps using OData v4.0 RESTful endpoints. Treats application structure as code. Also covers the Dataverse MCP server for natural language queries and CRUD via GitHub Copilot. Triggers on "dataverse api", "web api", "create table", "EntityDefinitions", "AttributeMetadata", "RelationshipDefinitions", "POST /EntityDefinitions", "PublishXml", "dataverse schema", "programmatic schema", "api metadata", "dataverse mcp", "mcp server", "dataverse mcp server", "@microsoft/dataverse", "mcp setup", "mcp dataverse"./ioc-development-patternInversion of Control (IoC) development pattern for building apps with in-memory test data first, then swapping to real data sources. Covers service interfaces, domain models with DTOs, in-memory implementations, service registry, React Query (TanStack Query) integration with cache invalidation, error handling, and incremental backend migration. Triggers on "IoC", "inversion of control", "in-memory data", "mock data", "test data first", "service interface", "swap implementation", "local development pattern", "dev without dataverse", "dev without database", "develop locally", "mock service", "in-memory service", "service abstraction", "data service pattern", "service layer", "react query", "tanstack query", "query key factory", "cache invalidation", "optimistic update", "domain model", "dto pattern".Other plugins' skills for the same job