Skip to content

microsoft/power-platform-skills / plugins/power-pages/skills/plan-alm

plan-alm

Unverified

Creates an ALM (Application Lifecycle Management) plan for deploying a Power Pages site across environments. Gathers your promotion strategy, target environments, and approval requirements upfront, then generates a visual HTML plan document for your review and approval. **plan-alm does not deploy anything itself** — it is a planner. After you approve the plan, run the individual ALM skills (setup-solution, setup-pipeline, deploy-pipeline, or export-solution/import-solution); each detects the approved plan and executes the right step in order, keeping the plan updated as it runs. Use when asked to: "plan my alm", "set up alm", "create deployment plan", "plan my deployments", "help me deploy to multiple environments", "set up promotion strategy", "create cicd plan", "plan site promotion", "help me go to production", "set up pipeline for my site".

FileKindSize
SKILL.mdskill md98.5 KB
assets/alm-plan-template.htmlother34.2 KB
scripts/render-alm-plan.jsscript81.9 KB
scripts/validate-plan-alm.jsscript4.8 KB

scripts/validate-plan-alm.js

View on GitHub
#!/usr/bin/env node
/**
 * validate-plan-alm.js — PostToolUse(Skill) hook validator for the plan-alm skill.
 *
 * Checks that docs/alm-plan.html was written and is non-empty/non-malformed.
 * Gracefully approves if the file does not exist (not a plan-alm session).
 * Blocks only if the file exists but is empty or clearly malformed (< 500 bytes).
 */

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

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

  // If we can't find the project root, approve gracefully — not a plan-alm session
  if (!projectRoot) {
    approve();
    return;
  }

  const htmlPath = path.join(projectRoot, 'docs', 'alm-plan.html');

  // If the file does not exist at all, approve gracefully (skill may not have run)
  if (!fs.existsSync(htmlPath)) {
    approve();
    return;
  }

  // File exists — check that it is non-empty and large enough to be valid HTML
  let stat;
  try {
    stat = fs.statSync(htmlPath);
  } catch (e) {
    block(`validate-plan-alm: Could not stat ${htmlPath}: ${e.message}`);
    return;
  }

  if (stat.size < 500) {
    block(
      `validate-plan-alm: docs/alm-plan.html exists but is too small (${stat.size} bytes). ` +
      `Expected at least 500 bytes. The file may be empty or truncated. ` +
      `Re-run the render-alm-plan.js script to regenerate the plan.`
    );
    return;
  }

  // Quick content check — must contain the plan-status marker
  let content;
  try {
    content = fs.readFileSync(htmlPath, 'utf8');
  } catch (e) {
    block(`validate-plan-alm: Could not read ${htmlPath}: ${e.message}`);
    return;
  }

  if (!content.includes('plan-status')) {
    block(
      `validate-plan-alm: docs/alm-plan.html does not contain the expected "plan-status" marker. ` +
      `The file may be corrupt or was not generated by render-alm-plan.js.`
    );
    return;
  }

  // Consistency guard for the creation-time status fields. The badge + approver
  // in the HTML are derived from docs/.alm-plan-data.json, so the JSON is the
  // source of truth — catch the two half-written states that the old hand-Edit
  // Phase 4 could produce (and that set-plan-status.js now prevents). Read-only;
  // graceful-approve when there is no plan-data (not every session has one).
  const dataPath = planDataPath(projectRoot);
  if (fs.existsSync(dataPath)) {
    let planData;
    try {
      planData = JSON.parse(fs.readFileSync(dataPath, 'utf8'));
    } catch {
      // A malformed plan-data file is the render path's concern, not this guard's
      // — don't block the plan-alm session over it here.
      planData = null;
    }
    if (planData) {
      const status = planData.PLAN_STATUS || null;
      // Coerce before trimming: APPROVED_BY is normally a string, but a hand-edited
      // plan-data could set it to a truthy non-string (number/object), and calling
      // .trim() on that throws — which would escape runValidation and silently
      // approve, bypassing this guard. String(...) keeps the guard robust to any
      // malformed-but-parseable JSON.
      const approver = String(planData.APPROVED_BY || '').trim();
      // Draft must NOT carry an approver — "approver set + Draft" is the stuck
      // state where the plan shows as approved but never advances (check-alm-plan
      // only promotes from "Approved").
      if (status === 'Draft' && approver) {
        block(
          `validate-plan-alm: docs/.alm-plan-data.json is inconsistent — APPROVED_BY is "${approver}" ` +
          `but PLAN_STATUS is "Draft". An approver was recorded but the plan was never moved to ` +
          `"Approved", so downstream skills will treat it as unapproved. Re-run the approve step so ` +
          `the status matches:\n` +
          `  node "\${PLUGIN_ROOT}/scripts/lib/set-plan-status.js" --projectRoot "${projectRoot}" --status Approved --approver "${approver}" --render`
        );
        return;
      }
      // Approved must HAVE an approver — an empty audit trail on an approved plan.
      if (status === 'Approved' && !approver) {
        block(
          `validate-plan-alm: docs/.alm-plan-data.json is inconsistent — PLAN_STATUS is "Approved" ` +
          `but APPROVED_BY is empty. An approved plan must record who approved it. Re-run the approve ` +
          `step with the approver's name:\n` +
          `  node "\${PLUGIN_ROOT}/scripts/lib/set-plan-status.js" --projectRoot "${projectRoot}" --status Approved --approver "<name>" --render`
        );
        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