Skip to content

microsoft/power-platform-skills / plugins/power-pages/skills/setup-pipeline

setup-pipeline

Verified

Sets up a Power Platform Pipeline for automated Power Pages deployments. Power Platform Pipelines is Microsoft's native CI/CD tool built into the Power Platform — no external infrastructure required. Use when asked to: "set up ci/cd", "create pipeline", "setup pipeline", "set up power platform pipelines", "create power pipelines", "automate deployments", "set up automated deployment", "create deployment pipeline", "use power pipelines". Also handles: "set up github actions" or "set up azure devops pipeline" (shows coming-soon guidance for those platforms).

FileKindSize
SKILL.mdskill md42.2 KB
scripts/validate-pipeline.jsscript4.9 KB

scripts/validate-pipeline.js

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

// Validates that setup-pipeline completed: checks for docs/alm/last-pipeline.json (Power Platform Pipelines)
// or pipeline YAML files (GitHub Actions / ADO — legacy / future).
// For PP Pipelines: validates pipelineId, hostEnvUrl, sourceDeploymentEnvironmentId, non-empty stages[].
// Gracefully exits 0 when no pipeline artifacts are found (not a setup-pipeline session).

const fs = require('fs');
const path = require('path');
const { approve, block, runValidation, findProjectRoot, findPath, readDeferralMarker } = require('../../../scripts/lib/validation-helpers');
const { almPath } = require('../../../scripts/lib/alm-paths');

runValidation(async (cwd) => {
  if (readDeferralMarker(findProjectRoot(cwd) || cwd)) return approve();  // ALM deferred — silent-approve.
  const projectRoot = findProjectRoot(cwd) || cwd;

  // Check for Power Platform Pipelines marker (primary path)
  const ppMarkerPath = almPath(projectRoot, 'lastPipeline');
  const ppMarkerExists = fs.existsSync(ppMarkerPath);

  // Check for GitHub Actions workflow or ADO pipeline (future/legacy paths)
  const ghWorkflowPath = findPath(projectRoot, path.join('.github', 'workflows', 'deploy.yml'));
  const adoPipelinePath = findPath(projectRoot, 'azure-pipelines.yml');

  // No pipeline artifacts found — not a setup-pipeline session
  if (!ppMarkerExists && !ghWorkflowPath && !adoPipelinePath) return approve();

  // --- Power Platform Pipelines path ---
  if (ppMarkerExists) {
    let marker;
    try {
      marker = JSON.parse(fs.readFileSync(ppMarkerPath, 'utf8'));
    } catch {
      return block('docs/alm/last-pipeline.json exists but could not be parsed as JSON.');
    }

    if (!marker.pipelineId) {
      return block('docs/alm/last-pipeline.json is missing required field: pipelineId');
    }
    if (!marker.hostEnvUrl) {
      return block('docs/alm/last-pipeline.json is missing required field: hostEnvUrl');
    }
    if (!marker.sourceDeploymentEnvironmentId) {
      return block('docs/alm/last-pipeline.json is missing required field: sourceDeploymentEnvironmentId');
    }
    if (!Array.isArray(marker.stages) || marker.stages.length === 0) {
      return block('docs/alm/last-pipeline.json has empty or missing stages array. At least one deployment stage is required.');
    }

    // Verify each stage has required fields
    for (const stage of marker.stages) {
      if (!stage.stageId) {
        return block(`docs/alm/last-pipeline.json stage "${stage.name || '?'}" is missing stageId.`);
      }
      if (!stage.targetDeploymentEnvironmentId) {
        return block(`docs/alm/last-pipeline.json stage "${stage.name || '?'}" is missing targetDeploymentEnvironmentId.`);
      }
    }

    // Check docs/pipeline-setup.md was created
    const setupDocPath = findPath(projectRoot, path.join('docs', 'pipeline-setup.md'));
    if (!setupDocPath) {
      return block('docs/pipeline-setup.md was not created. The setup documentation is required.');
    }

    return approve();
  }

  // --- GitHub Actions / ADO path (future implementation) ---
  const pipelinePath = ghWorkflowPath || adoPipelinePath;
  const isGitHub = !!ghWorkflowPath;

  let pipelineContent;
  try {
    pipelineContent = fs.readFileSync(pipelinePath, 'utf8');
  } catch {
    return block(`Pipeline file '${pipelinePath}' could not be read. The file may be corrupt.`);
  }

  if (!pipelineContent.trim()) {
    return block(`Pipeline file '${pipelinePath}' is empty.`);
  }

  // Check for required YAML keys
  if (isGitHub) {
    if (!pipelineContent.includes('on:') && !pipelineContent.includes("'on':")) {
      return block("GitHub Actions workflow is missing the 'on:' trigger section.");
    }
    if (!pipelineContent.includes('jobs:')) {
      return block("GitHub Actions workflow is missing the 'jobs:' section.");
    }
  } else {
    if (!pipelineContent.includes('trigger:')) {
      return block("Azure DevOps pipeline is missing the 'trigger:' section.");
    }
    if (!pipelineContent.includes('stages:') && !pipelineContent.includes('jobs:')) {
      return block("Azure DevOps pipeline is missing both 'stages:' and 'jobs:' sections.");
    }
  }

  if (!pipelineContent.includes('pac pages upload-code-site')) {
    return block("Pipeline file does not contain a 'pac pages upload-code-site' step. The Power Pages deploy step is missing.");
  }

  // Check for unreplaced placeholder tokens
  const lines = pipelineContent.split('\n');
  for (const line of lines) {
    const trimmed = line.trim();
    if (trimmed.startsWith('#')) continue;
    if (/\{[A-Z][A-Z_]+\}/.test(trimmed) && !trimmed.includes('${{')) {
      return block(`Pipeline file contains an unreplaced placeholder token in line: "${trimmed.substring(0, 100)}". Fill in all required values.`);
    }
  }

  const setupGuidePath = findPath(projectRoot, path.join('docs', 'ci-cd-setup.md'));
  if (!setupGuidePath) {
    return block('docs/ci-cd-setup.md was not created. The setup guide is required to document manual steps.');
  }

  return approve();
});
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall