Add server-logic, cloud-flow, integrate-backend skills and plugin version check - #57
Conversation
New skill that orchestrates creating Power Pages Server Logic — server-side JavaScript that runs securely on the Power Pages runtime. Includes: - 9-phase workflow: verify site, gather requirements, fetch Microsoft Learn docs (source of truth), review plan, implement, configure site settings, client-side integration, verify/test guidance, review/deploy - Validation script (stop hook) that checks .js file structure, allowed functions, error handling, and prohibited APIs - Explore agent integration to discover existing server logics and frontend patterns before implementation - Client-side integration phase with framework-specific patterns (shell.safeAjax, powerPagesApi.ts, standalone fetch) - Microsoft Learn MCP tools in allowed tools for dynamic doc discovery - Reference file for documentation discovery strategy - Skill tracking registered as IntegrateServerlogic Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Based on testing feedback, update the integrate-serverlogic skill: - Server logic files now live in .powerpages-site/server-logic/<name>/ with two files: <name>.js (code) and <name>.serverlogic.yml (metadata) - .powerpages-site folder is now a mandatory prerequisite (not optional) - YAML metadata includes id (UUID), web roles, display name, description with alphabetically sorted fields to match PAC CLI conventions - Phase 5 now reads web roles from .powerpages-site/web-roles/ to populate adx_serverlogic_adx_webrole array - Explore agent updated to search .powerpages-site/server-logic/ and read web role files - Validation script updated to check new file locations, YAML structure, UUID validity, and non-empty web role array - Removed redundant deployment check in Phase 6 (already enforced in Phase 1.5) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Server.Connector.Dataverse respects table permissions — without them, the connector silently returns 0 records. Added Phase 6 (conditional) that: - Parses the server logic .js to detect which Dataverse tables are accessed and what CRUD operations are performed - Launches the table-permissions-architect agent to create table permission YAML files in .powerpages-site/table-permissions/ - Only runs when Server.Connector.Dataverse is used; skipped for HttpClient-only server logics Also updated: - Phase 4 plan table: shows table permissions needed upfront - Phase 10.2 summary: includes table permissions row - Phase 10.4 post-deploy: specific guidance about table permissions - Stop hook: verifies table permissions were configured - Key decision points and progress tracking table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…kill Two gaps mitigated vs integrate-webapi skill: 1. Web role creation (Phase 5.2): If no web roles exist, the skill now creates default roles (Authenticated Users, Anonymous Users, Administrators) using create-web-role.js before writing the server logic YAML. Previously only read existing roles. 2. Permission source choice (Phase 6.2): Added Path A (user-provided permissions diagram) alongside existing Path B (let architect analyze). Path A parses user diagrams and creates permissions via deterministic scripts, matching how integrate-webapi handles this. Path B now explicitly instructs the architect agent to create missing web roles if needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Power Pages skill (integrate-serverlogic) to orchestrate authoring and deploying Server Logic, including documentation discovery and stop-hook validation.
Changes:
- Introduces
integrate-serverlogicskill orchestration with a 10-phase workflow and stop-hook checks. - Adds a Node.js validation script to verify generated Server Logic
.jsand.serverlogic.ymloutputs. - Adds a Microsoft Learn discovery reference and updates skill tracking reference.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| plugins/power-pages/skills/integrate-serverlogic/scripts/validate-serverlogic.js | Adds a stop-hook validator for Server Logic folders, JS constraints, and YAML metadata checks. |
| plugins/power-pages/skills/integrate-serverlogic/references/server-logic-docs.md | Documents dynamic Microsoft Learn discovery strategy for Server Logic docs. |
| plugins/power-pages/skills/integrate-serverlogic/SKILL.md | Adds the full 10-phase orchestration for creating Server Logic and integrating it into a site. |
| plugins/power-pages/references/skill-tracking-reference.md | Registers the new skill for tracking (IntegrateServerlogic). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ills into users/suyashpatel/server-logic-skill
- 🔧 Changed command references from `/power-pages:create-site` to `/create-site`. - 🔧 Updated prompt messages to reflect new command structure. - 🔧 Adjusted deployment instructions for consistency. -Priyanshu
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add explicit user confirmation before running /test-site after deployment, include tracking file commit guidance, and bump power-pages plugin version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix early approve() calls to return so execution terminates - Add fetch to disallowed browser APIs list - Scope web role GUID validation to adx_serverlogic_adx_webrole section - Strip YAML quotes before validating UUIDs and name fields - Require name field in serverlogic.yml (fail if missing) - Detect disallowed top-level functions outside the allowlist - Expand try/catch detection to full function body instead of 100-char window - Fix console.* error message to match the actual regex check - Surface filesystem errors in findServerLogicDirs instead of swallowing - Add path traversal guard on --name in create-serverlogic-metadata.js - Fix phase cross-reference (Phase 7 -> Phase 8) in SKILL.md - Renumber Phase 8 subsections (8.5/8.6 -> 8.3/8.4) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ✏️ Update SKILL.md to clarify async function usage with Dataverse. - ✅ Add validation tests for server logic functions, including checks for async/await usage and error handling. - 📝 Implement detailed error messages for validation failures. -Priyanshu
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Rename skills/integrate-serverlogic/ to skills/add-server-logic/ - Update skill name in SKILL.md frontmatter - Update all path references in SKILL.md, frontend-integration-reference.md - Update skill key and validator path in powerpages-hook-utils.js - Update skill name in render-serverlogic-plan.js - Update tracking reference (skill name, PascalCase, setting name) - Update skill name in test files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The top-level function regex now uses ^...gm anchoring so nested helper functions inside handlers are no longer flagged as disallowed. create-serverlogic-metadata.js now single-quotes description and display_name to handle special characters safely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…support New add-cloud-flow skill that connects Power Automate flows to Power Pages sites. Key behaviors beyond basic flow registration: - Analyzes user intent to suggest the most relevant flows instead of a flat list - Supports re-integrating already-registered flows into additional pages without re-creating metadata (integration-only path skips Phases 4-6) - Guides users to Power Automate when no flows with a PowerPages trigger exist Also adds hook registration, skill tracking, cloudflow plan renderer, render-template dataObject support, and hook debug logging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Standalone script that compares local plugin.json version against origin/main and prints update commands (marketplace + plugin) if a newer version is available. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each skill now runs check-version.js before starting and shows an update notice if the remote has a newer plugin version. Added the convention to AGENTS.md and cleaned up hooks.json format. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GitHub Actions workflow using the GitHub App to auto-add the version check line to any SKILL.md missing it on PRs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show a Key Vault banner in the plan overview and per-card secret chips when the user chooses Azure Key Vault for secret management. Move the Key Vault decision from Phase 7 to Phase 2.3.1 so it is known before the plan is rendered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 61 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace regex-based top-level function detection with brace-depth scan to avoid false positives on nested helper functions - Improve return validation to check for string-compatible values (string literals, JSON.stringify, String()) per handler - Add HTML-escape helper for user-provided values rendered via innerHTML in the Key Vault plan section - Update Key Decision Points to reference Phase 2.3.1 for the Key Vault decision (moved from Phase 7.1 in prior commit) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
store-keyvault-secret.js: Write the secret to a temp file (mode 0600) and pass --file to az CLI instead of --value, so the secret never appears in az process arguments. Support reading the secret from stdin (preferred) alongside the existing --secretValue flag. ensure-skill-version-check.yml: Guard the auto-fix-and-push path behind github.event.pull_request.head.repo.fork == false. Fork PRs run the script in --check mode for a clear failure message without requiring repository secrets or write access. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…RL validation - Remove unused SITE_NAME JS variable from backend-plan.html and cloud-flow-plan.html script blocks (eliminates unescaped string placeholder in JS context) - Add esc() HTML-escape helper to both templates for safe innerHTML - Strengthen cloudflow validator to reject empty flowapiurl and flowtriggerurl values, with test coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 61 out of 61 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The flowtriggerurl field is always '' in real Power Pages cloud flow consumer YAML — only validate that the key is present, not that it has a value. Keep the non-empty check for flowapiurl only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fetch existing Custom APIs and Custom Process Actions from the user's Dataverse environment so server logic can wrap them via InvokeCustomApi instead of building equivalent logic from scratch. - New script: list-custom-actions.js queries both customapis and workflows (category=3) tables with auth/retry support - SKILL.md Phase 2.1.2: discover actions, present to user, map to server logic items - SKILL.md Phase 5.3: code templates for unbound actions, entity-bound actions, and unbound functions - HTML plan: purple "Custom Action" badge and detail box on cards that wrap an existing action - Plan data format: optional customAction field on SERVER_LOGICS_DATA - integrate-backend: Phase 1.3 discovers actions during site scan, factors them into approach recommendation and skill routing - Decision framework: expanded Custom API entry and intent mapping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 62 out of 62 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix frontmatter parsing in ensure-skill-version-check.js to use line-based
regex instead of indexOf, handling CRLF and avoiding false matches
- Reject newline characters in yamlStr() for both serverlogic and cloudflow
metadata scripts to prevent invalid YAML generation
- Accept optional catch binding syntax (catch { }) in validator
- Strip comments and string literals before disallowed-token checks in
validator to prevent false positives
- Add HTTPS URL validation in list-custom-actions.js before passing to
getAuthToken() to prevent shell injection
- Fix header comment in list-cloud-flows.js to match actual output shape
- Remove duplicate test in list-cloud-flows.test.js
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Mermaid v11 prefixes node IDs with the SVG element ID (e.g. "erSvg1-entity-CONTACT-0"), so the anchored regex ^entity- never matched. Remove the ^ anchor, use .outer-path selector for the header group, and color divider strokes to match status. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 63 out of 63 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
add-server-logic,add-cloud-flow, andintegrate-backendorigin/mainNew skills
Plugin version check
scripts/check-version.jscompares localplugin.jsonversion againstorigin/mainand prints marketplace + plugin update commands if remote is newer> **Plugin check**instruction that runs the script before starting any phaseAGENTS.mdupdated with the convention so new skills include itensure-skill-version-check.yml) uses the GitHub App to auto-add the version check line to any SKILL.md missing it on PRsWhat's included
validate-serverlogic.js,validate-cloudflow.js) with stop-hook integrationcreate-serverlogic-metadata.js,create-cloud-flow-metadata.js) with YAML-safe serializationrender-serverlogic-plan.js,render-cloudflow-plan.js,render-backend-plan.js) with HTML template supportlist-cloud-flows.js) using the Power Automate Flow RP APIcheck-version.js) with test coverage (check-version.test.js)ensure-skill-version-check.js+ GitHub Actions workflow)Test plan
/add-server-logicon a deployed Power Pages code site/add-cloud-flowand verify flow discovery, metadata creation, and plan rendering/integrate-backendand verify routing to sub-skills.serverlogic.ymland.cloudflowconsumer.ymlhave valid UUIDs and web role GUIDsplugin.jsonversion and confirm update notice appears🤖 Generated with Claude Code