From codeapps-toolkit
Validates Power Platform Code Apps projects: package.json scripts, port config (5173/8081), dependencies, power.config.json, vite config, project structure, TypeScript compilation, and ESLint compliance. Use after setup or before deployment.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codeapps-toolkit:codeapps-validatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Systematically validate Power Platform Code Apps projects to ensure proper configuration, structure, and readiness for development or deployment. This skill validates all critical aspects of a CodeApps project including npm scripts, port configuration, dependencies, and Power Platform integration.
Systematically validate Power Platform Code Apps projects to ensure proper configuration, structure, and readiness for development or deployment. This skill validates all critical aspects of a CodeApps project including npm scripts, port configuration, dependencies, and Power Platform integration.
ALWAYS use after:
Use to validate:
This skill performs 8 critical checks:
Ensures dev scripts are properly configured for dual-server setup.
Validates correct port usage (5173 for Vite, 8081 for pac code run).
Confirms all required packages are installed.
Verifies power.config.json exists and has proper structure.
Validates vite.config.ts has base: './' for correct asset paths in deployment.
Ensures required folders and files exist.
Validates code compiles without errors.
Verifies code passes linting rules.
Check for proper dev script configuration:
# Read package.json
cat package.json | grep -A 5 '"scripts"'
Required scripts:
{
"scripts": {
"dev": "concurrently \"npm:dev:vite\" \"npm:dev:pac\"",
"dev:vite": "vite --port 5173",
"dev:pac": "pac code run --port 8081 --appUrl http://localhost:5173",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx"
}
}
Validation checks:
dev script exists and uses concurrentlydev:vite script exists with port 5173dev:pac script exists with port 8081dev:pac references correct appUrl (http://localhost:5173)build script includes TypeScript compilationlint script existsCommon issues:
Extract and verify ports from scripts:
# Check Vite port
grep -o 'vite.*--port [0-9]*' package.json
# Check pac code run port
grep -o 'pac code run.*--port [0-9]*' package.json
# Check appUrl port
grep -o 'appUrl http://localhost:[0-9]*' package.json
Expected configuration:
Port conflict checks:
Check for required packages:
# Read dependencies
cat package.json | grep -A 20 '"dependencies"'
cat package.json | grep -A 20 '"devDependencies"'
Required dependencies:
{
"dependencies": {
"@microsoft/power-apps": "latest",
"@fluentui/react-components": "^9.x",
"@tanstack/react-query": "^5.x",
"react": "^18.x || ^19.x",
"react-dom": "^18.x || ^19.x"
},
"devDependencies": {
"concurrently": "^8.0.0",
"typescript": "^5.x",
"vite": "^5.x",
"eslint": "^8.x || ^9.x"
}
}
Validation checks:
Verify installation:
# Check node_modules
ls node_modules/@microsoft/power-apps
ls node_modules/concurrently
ls node_modules/vite
Check power.config.json:
# Verify file exists
test -f power.config.json && echo "✅ power.config.json exists" || echo "❌ power.config.json missing"
# Read configuration
cat power.config.json
Expected structure:
{
"displayName": "App Name",
"description": "App description",
"appUrl": "http://localhost:5173",
"buildPath": "dist",
"region": "prod",
"dataSources": []
}
Validation checks:
Warning signs:
pac code init)Check vite.config.ts for base path:
# Read vite.config.ts
cat vite.config.ts | grep -A 3 'export default defineConfig'
Required configuration:
export default defineConfig({
plugins: [react()],
base: './', // ✅ CRITICAL: Required for Power Apps deployment
build: {
outDir: 'dist',
assetsDir: 'assets',
},
})
Validation checks:
base: './' is configuredbuild.outDir is set to 'dist'build.assetsDir is set to 'assets'Common issues:
base: './' - causes 404 errors on deployed assetsbase: '/' (absolute path) - same issue as missing baseWhy This is Critical:
Without base: './', the built index.html will reference assets with absolute paths (/assets/index.js), which fail when deployed to Power Apps. The browser tries to load from:
https://{environment}.powerplatformusercontent.com/assets/index.js
But Power Apps serves files from a nested path. With base: './', assets use relative paths (./assets/index.js), which resolve correctly.
Symptoms of Missing base Configuration:
Refused to apply style ... MIME type ('application/json') is not a supported stylesheet MIME typeVerification:
# After build, check if paths are relative
cat dist/index.html | grep 'src=\|href='
# Should show: src="./assets/..." NOT src="/assets/..."
Auto-fix if missing:
If base: './' is not found, add it to vite.config.ts and rebuild:
# Add base: './' to vite.config.ts
# Then rebuild
npm run build
Check for required folders and files:
# Check project structure
ls -la
# Verify critical paths
test -d src && echo "✅ src/ exists" || echo "❌ src/ missing"
test -d src/generated && echo "✅ src/generated/ exists" || echo "⚠️ src/generated/ missing (expected if no data sources)"
test -f src/App.tsx && echo "✅ src/App.tsx exists" || echo "❌ src/App.tsx missing"
test -f vite.config.ts && echo "✅ vite.config.ts exists" || echo "❌ vite.config.ts missing"
test -f tsconfig.json && echo "✅ tsconfig.json exists" || echo "❌ tsconfig.json missing"
Required structure:
project-root/
├── src/
│ ├── App.tsx
│ ├── main.tsx
│ └── generated/ (if data sources added)
│ ├── models/
│ └── services/
├── package.json
├── power.config.json
├── vite.config.ts
├── tsconfig.json
└── node_modules/
Validation checks:
Run TypeScript compiler:
npm run build
Validation checks:
Common TypeScript errors in CodeApps:
Run ESLint check:
npm run lint
Validation checks:
Common ESLint issues in CodeApps:
# CodeApps Validation Report
**Date**: [current date]
**Project**: [project name from power.config.json]
**Status**: ✅ READY | ⚠️ WARNINGS | ❌ FAILED
## Summary
- **Scripts Configuration**: ✅ PASS | ❌ FAIL
- **Port Configuration**: ✅ PASS | ❌ FAIL
- **Dependencies**: ✅ PASS | ❌ FAIL (X missing)
- **Power Platform Config**: ✅ PASS | ❌ FAIL
- **Vite Configuration**: ✅ PASS | ❌ FAIL (base path missing)
- **Project Structure**: ✅ PASS | ❌ FAIL
- **TypeScript Compilation**: ✅ PASS | ❌ FAIL (X errors)
- **ESLint Check**: ✅ PASS | ❌ FAIL (X errors)
## 1. Package.json Scripts Analysis
### Dev Scripts
```json
{
"dev": "...",
"dev:vite": "...",
"dev:pac": "..."
}
Issues Found:
Recommendations:
Current Configuration:
Issues Found: None
Installed Dependencies:
Missing Dependencies:
Recommendations:
npm install @tanstack/react-querypower.config.json:
{
"displayName": "todo-demo",
"appUrl": "http://localhost:5173",
"buildPath": "dist"
}
Issues Found: None
vite.config.ts:
export default defineConfig({
plugins: [react()],
base: './', // ✅ Present
build: {
outDir: 'dist',
assetsDir: 'assets',
},
})
Validation:
Issues Found: None
Deployment Readiness: ✅ Assets will load correctly in Power Apps
Structure Validation:
Issues Found: None (expected state for new project)
Build Status: ✅ PASS
Build Output:
vite v5.4.0 building for production...
✓ 32 modules transformed.
dist/index.html 0.45 kB
dist/assets/index-abc123.js 45.32 kB
✓ built in 1.2s
Issues Found: None
Lint Status: ✅ PASS
Issues Found: None
Project is properly configured and ready for development.
npm run dev
## Usage Pattern
**Manual invocation**:
User: "/codeapps-validator" System: Runs full CodeApps validation
**After project setup**:
User: "Validate my CodeApps project configuration" Agent: Invokes codeapps-validator skill Agent: Reports validation results with specific fixes
**Before deployment**:
User: "Check if my app is ready to deploy" Agent: Invokes codeapps-validator skill Agent: Confirms readiness or identifies blockers
## Common Issues and Fixes
### Issue 1: Missing concurrently
**Symptom**: dev script doesn't start both servers
**Fix**:
```bash
npm install --save-dev concurrently
Update package.json:
"dev": "concurrently \"npm:dev:vite\" \"npm:dev:pac\""
Symptom: Port conflicts or connection errors Fix: Update scripts to use standard ports:
Symptom: pac code commands fail Fix:
pac code init --displayName "App Name"
Symptom: Import errors for Power Apps SDK Fix:
npm install @microsoft/power-apps
Symptom: "Local Play" URL doesn't work Fix: Ensure power.config.json appUrl matches Vite port:
"appUrl": "http://localhost:5173"
Symptom: Deployed app shows blank screen, 404 errors for CSS/JS files, MIME type errors Fix: Add base: './' to vite.config.ts:
export default defineConfig({
plugins: [react()],
base: './', // ✅ Add this line
build: {
outDir: 'dist',
assetsDir: 'assets',
},
})
Then rebuild and redeploy:
npm run build
pac code push
Project is READY when:
Project has WARNINGS when:
Project FAILED when:
Step 1 Validation (After project creation):
User: "Validate the project setup"
Agent: Runs codeapps-validator
Agent: Confirms proper configuration or suggests fixes
Step 6 Validation (Before testing with Dataverse):
User: "/codeapps-validator"
Agent: Checks all configuration including new data sources
Agent: Validates generated/ folder structure
Step 8 Validation (Before deployment):
User: "Validate before deploying"
Agent: Full validation including build check
Agent: Confirms production readiness
Usage: Invoke this skill after project setup, configuration changes, or before deployment to ensure proper CodeApps configuration and readiness.
npx claudepluginhub ramakrishnan24689/codeapps-toolkit --plugin codeapps-toolkitScaffolds a complete Power Apps Code App project with PAC CLI, Vite + React + TypeScript, SDK integration, and connector configuration.
Builds (npm run build) and deploys Power Apps code apps to Power Platform using pac code push. Handles TS errors, user confirmation, Mac auth fallback, and memory bank updates.
Validates multi-component full-stack apps across backend, frontend, database, and infrastructure. Detects monorepos, Docker Compose setups, and tech stacks like FastAPI, React, PostgreSQL for parallel cross-layer checks.