Skip to content

microsoft/power-platform-skills / plugins/power-pages/skills/activate-site

activate-site

Verified

Activates and provisions a Power Pages website in a Power Platform environment via the Power Platform REST API. Use when the user wants to activate, provision, turn on, or enable a Power Pages website or portal.

FileKindSize
SKILL.mdskill md19.5 KB
scripts/activate-site.jsscript10.0 KB
scripts/generate-subdomain.jsscript336 B
scripts/validate-activation.jsscript1.4 KB

scripts/validate-activation.js

View on GitHub
#!/usr/bin/env node

// Validates Power Pages site activation output.
// Runs as a PostToolUse(Skill) hook to verify the website was provisioned in the environment.
// Calls the shared check-activation-status.js script to query the Power Platform API
// instead of relying on an intermediate file.

const path = require('path');
const { execFileSync } = require('child_process');
const { approve, block, runValidation, findPath } = require('../../../scripts/lib/validation-helpers');

runValidation(async (cwd) => {
  const configPath = findPath(cwd, 'powerpages.config.json');
  if (!configPath) approve(); // Not a Power Pages project, skip

  const projectRoot = path.dirname(configPath);
  const checkScript = path.resolve(__dirname, '../../../scripts/check-activation-status.js');

  let result;
  try {
    const output = execFileSync(process.execPath, [checkScript, '--projectRoot', projectRoot], {
      encoding: 'utf8',
      timeout: 30000,
      shell: false,
    });
    result = JSON.parse(output);
  } catch {
    approve(); // Auth/transient failure — don't block
  }

  if (result.activated === true) {
    approve();
  }

  if (result.activated === false) {
    block(
      `Power Pages activation validation failed:\n- Site '${result.siteName || 'unknown'}' is not activated. The site may not have been provisioned successfully.`
    );
  }

  // Error or unexpected shape — don't block
  approve();
});
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall