Skip to content

[Pages] Add skill for ai webapi - #144

Merged
Neeraj Nandwana (neerajnandwana-msft) merged 4 commits into
mainfrom
user/neerajnandwana/add-ai-webapi
Jun 11, 2026
Merged

[Pages] Add skill for ai webapi#144
Neeraj Nandwana (neerajnandwana-msft) merged 4 commits into
mainfrom
user/neerajnandwana/add-ai-webapi

Conversation

@neerajnandwana-msft

@neerajnandwana-msft Neeraj Nandwana (neerajnandwana-msft) commented May 7, 2026

Copy link
Copy Markdown
Contributor

Add /add-ai-webapi: Power Pages generative-AI summarization (preview)

Summary

New user-invocable skill that wires the two Power Pages AI summarization endpoints — Search Summary (/_api/search/v1.0/summary) and Data Summarization (/_api/summarization/data/v1.0/...) — into a SPA site end-to-end: Layer 1/2
prerequisites (delegated to /integrate-webapi in AI-only read mode), Layer 3 service code with CSRF, framework wrappers, UI wiring with all four render branches, and Summarization/* site settings.

What's in the box

  • New skill plugins/power-pages/skills/add-ai-webapi/ — 8-phase orchestrator with iteration-mode detection and per-target scope classification (single-record / list / intent-mismatch).
  • Two new agents — ai-webapi-integration (raw-fetch service code, framework wrappers, citation parser, SPA URL rewrite) and ai-webapi-settings-architect (plan-mode for Summarization/* settings).
  • New validator + 36 tests — blocks missing CSRF, missing OData 4.0 headers, wrong Search Summary content-type, oversize prompts; warns on disabled-state-envelope handling, missing ContentSizeLimit, plain-scalar long prompts, missing
    citation parser/rewrite.
  • Reference docs for progressive disclosure: API shapes, list-summary playbook, Explore prompt, scope-classification matrix, agent invocation template.
  • Cross-skill contracts so nested deploy/commit prompts don't fire:
    • /integrate-webapi [AI-READ-ONLY] sentinel now also defers commits and suppresses deploy prompts.
    • /create-webroles [CALLED-BY-PARENT-SKILL] sentinel suppresses its deploy prompts.
    • /create-site reserves POWERPAGES:AI-SLOT kind= markers for the follow-up skill to find.
  • /integrate-backend decision framework — AI Web API added as a fourth approach.

Test plan

  • node --test plugins/power-pages/scripts/tests/*.test.js → 188/188 pass.
  • E2E on a fixture site with POWERPAGES:AI-SLOT markers: confirm AI-only delegation, single batched commit per phase, single deploy prompt at end.
  • E2E search-only run: confirm Phase 4 + Phase 6 skipped, no spurious prereq blocker.
  • Trigger the Search Summary disabled-state envelope: confirm remediation card renders, no retry loop.

Copilot AI review requested due to automatic review settings May 7, 2026 08:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for Power Pages generative-AI “AI Web API” integrations (Search Summary + Data Summarization) by introducing a new /add-ai-webapi skill, extending the backend decision framework/plan UI, and adding an AI-only read mode contract to /integrate-webapi for safe Layer 1/2 delegation.

Changes:

  • Introduces /add-ai-webapi skill (Layer 3) with supporting references, evals, and a post-run validator (validate-ai-webapi.js) + tests.
  • Extends /integrate-webapi with an opt-in [AI-READ-ONLY] sentinel mode to generate read-only integration code and hardened permissions/settings for AI summarization.
  • Updates backend decision framework + HTML plan renderer to include “AI Web API”, plus updates skill tracking + hook utils to recognize and validate the new skill.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
plugins/power-pages/skills/integrate-webapi/SKILL.md Adds [AI-READ-ONLY] sentinel flow and AI-only read-mode branching for delegation from /add-ai-webapi.
plugins/power-pages/skills/integrate-backend/SKILL.md Expands backend routing/decision matrix to include AI Web API and routes to /add-ai-webapi.
plugins/power-pages/skills/integrate-backend/references/decision-framework.md Documents AI Web API as a 4th approach and updates comparison tables/combination guidance.
plugins/power-pages/skills/integrate-backend/assets/backend-plan.html Updates plan UI to visualize AI Web API items (chips, stats, concepts, phase meta).
plugins/power-pages/skills/create-webroles/SKILL.md Adds caller-suppress sentinel to avoid nested deploy prompts when invoked by orchestrators.
plugins/power-pages/skills/create-site/SKILL.md Adds AI readiness planning + reserved “AI slot” markers for later /add-ai-webapi wiring.
plugins/power-pages/skills/add-ai-webapi/SKILL.md New orchestrator skill for wiring Search Summary/Data Summarization and delegating prerequisites.
plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js New post-skill validator enforcing header/$select/content-type rules and prompt-size checks.
plugins/power-pages/skills/add-ai-webapi/references/scope-classification.md New reference for Phase 3 per-target follow-ups (trigger + scope disambiguation).
plugins/power-pages/skills/add-ai-webapi/references/explore-prompt.md New canonical Explore-agent prompt for AI integration discovery + prerequisite status.
plugins/power-pages/skills/add-ai-webapi/references/ai-api-reference.md New API reference and operational guidance (headers, error codes, list-summary playbook).
plugins/power-pages/skills/add-ai-webapi/references/agent-invocation-prompt.md New prompt template for invoking ai-webapi-integration consistently per target.
plugins/power-pages/skills/add-ai-webapi/evals/evals.json Adds dry-run decision-trace eval definitions for classification/routing logic.
plugins/power-pages/scripts/tests/validate-ai-webapi.test.js Adds unit tests covering validator blocking/warning behavior.
plugins/power-pages/scripts/tests/powerpages-hook-utils.test.js Updates tracked-skill detection + validator-script mapping tests for /add-ai-webapi.
plugins/power-pages/scripts/tests/integrate-webapi-ai-only-mode.test.js Adds regression tests ensuring AI-only read-mode branches remain in integrate-webapi docs.
plugins/power-pages/scripts/lib/powerpages-hook-utils.js Registers add-ai-webapi as a tracked skill with validator script.
plugins/power-pages/references/skill-tracking-reference.md Adds AddAiWebapi tracking constants/paths.
plugins/power-pages/README.md Documents the new skill and updates skill/agent counts and recommended workflow ordering.
plugins/power-pages/agents/webapi-settings-architect.md Documents tightened Webapi/<table>/fields rules for AI-only read mode.
plugins/power-pages/agents/table-permissions-architect.md Documents hardened read-only table-permissions posture for AI-only read mode.
plugins/power-pages/agents/ai-webapi-settings-architect.md New agent for Summarization/* site settings with list-summary sizing + YAML guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/power-pages/skills/integrate-webapi/SKILL.md Outdated
Comment thread plugins/power-pages/skills/integrate-webapi/SKILL.md
Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
@priyanshu92 Priyanshu Agrawal (priyanshu92) changed the title User/neerajnandwana/add ai webapi [Pages] Add skill for ai webapi May 11, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 12:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Comment thread plugins/power-pages/skills/integrate-backend/references/decision-framework.md Outdated
Comment thread plugins/power-pages/skills/add-ai-webapi/references/scope-classification.md Outdated
Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Copilot AI review requested due to automatic review settings June 8, 2026 12:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.

Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Copilot AI review requested due to automatic review settings June 9, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Copilot AI review requested due to automatic review settings June 11, 2026 05:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.

Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Copilot AI review requested due to automatic review settings June 11, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Comment thread plugins/power-pages/skills/add-ai-webapi/scripts/validate-ai-webapi.js Outdated
Comment thread plugins/power-pages/skills/create-webroles/SKILL.md Outdated
Comment thread plugins/power-pages/skills/create-webroles/SKILL.md Outdated
Adds the add-ai-webapi skill: Search Summary and Data Summarization
integration for Power Pages code sites, with supporting agents, references,
evals, and a PostToolUse validator. Routed from integrate-backend.

Validator (validate-ai-webapi.js) highlights:
- Header/$select/OData/content-type checks are project-wide (a token present
  anywhere under src/ satisfies them), so integrations that centralize header
  and URL construction in a shared helper are not false-failed.
- Citation-parser detection matches the escaped-bracket regex form the skill
  ships (/\[\[(\d+)\]\]\(/) plus a literal [[N]]( token fallback.
- CSRF rationale clarified: token is required on these POST requests
  regardless of mutation semantics; the endpoints are read-only.
- Prompt-length error notes the request body accepts no prompt text
  (only InstructionIdentifier / RecommendationConfig).

This commit collapses the prior branch history (which had been doubled by a
bad self-merge) into a single clean change rebased onto current main, and
adopts main's dynamic TRACKED_SKILLS discovery (add-ai-webapi is auto-tracked).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 11, 2026 09:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 25 changed files in this pull request and generated 3 comments.

Comment thread plugins/power-pages/skills/add-ai-webapi/SKILL.md
Comment thread plugins/power-pages/skills/integrate-webapi/SKILL.md
@neerajnandwana-msft
Neeraj Nandwana (neerajnandwana-msft) merged commit 93e22d3 into main Jun 11, 2026
7 checks passed
@neerajnandwana-msft
Neeraj Nandwana (neerajnandwana-msft) deleted the user/neerajnandwana/add-ai-webapi branch June 11, 2026 10:55
Copilot AI added a commit that referenced this pull request Jun 11, 2026
Merge origin/main (93e22d3) into branch — two files conflicted:
  - create-webroles/SKILL.md: kept gate markers from branch, incorporated
    caller-suppress-mode text added in main (#144).
  - integrate-webapi/SKILL.md: same — kept 3 gate markers from branch,
    incorporated AI-only-read-mode conditionals added in main (#144).

New add-ai-webapi skill (#144) had 4 unmarked AskUserQuestion call sites
that failed GATE-must-have-marker. Added gate markers + 🚦 prose blocks
and §6.29 catalog rows for:
  - add-ai-webapi:iter.deploy-commit (Iteration mode)
  - add-ai-webapi:4.2.skip-webrole (Phase 4.2 skip confirmation)
  - add-ai-webapi:5.5.commit (Phase 5.5 offer to commit)
  - add-ai-webapi:6.4.commit (Phase 6.4 offer to commit)

Verified: alm-lint: 0 findings; 1108/1108 tests pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants