microsoft/power-platform-skills / plugins/power-pages/skills/ensure-pipelines-host
ensure-pipelines-host
UnverifiedEnsures the tenant has a usable Power Platform Pipelines host environment before any pipeline operation runs. Detects host state via the same resolution order as the Power Apps UI (org-db setting → BAP env metadata → default-custom-host setting); if any existing host (Platform or Custom) is found, uses it. If no host is bound to the source env, provisions a new **Platform Host** (recommended, idempotent) or a **Custom Host** via the BAP env-create API with the `D365_ProjectHost` template, or guides the user through PPAC install / `New custom host` (manual fallbacks). Polls lifecycle operations, verifies the host responds to Pipelines API calls, writes a host-check artifact other ALM skills consume. Use when asked to: "set up pipelines host", "ensure pipelines host", "no pipelines host", "install pipelines", "create pipelines host", "provision platform host", "provision custom host". Also invoked transparently by /power-pages:setup-pipeline when its host discovery step finds nothing.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 89.9 KB |
| scripts/validate-ensure-host.js | script | 3.2 KB |
scripts/validate-ensure-host.js
View on GitHub#!/usr/bin/env node
// Stop-hook validator for the ensure-pipelines-host skill.
// Reads docs/alm/last-host-check.json from the project and verifies the skill ran
// to a documented terminal state. Gracefully exits 0 when no marker exists
// (not an ensure-host session).
//
// Pass conditions (exit 0):
// - File missing.
// - schemaVersion is 1 or 2.
// - tenantId, sourceEnvUrl, resolutionStatus populated.
// - Either ready === true (host is usable), OR
// resolutionStatus is a documented terminal-error state where finalHostEnvUrl
// is null and the user has been told what to do (CannotRedirect /
// OrgSettingStale / PermissionDenied).
//
// Block conditions (exit 2):
// - Schema invalid / required fields missing.
// - ready === false AND resolutionStatus is not in the terminal-error allowlist.
const fs = require('fs');
const {
approve,
block,
runValidation,
findProjectRoot,
} = require('../../../scripts/lib/validation-helpers');
const { almPath } = require('../../../scripts/lib/alm-paths');
const TERMINAL_ERROR_STATES = new Set([
'CannotRedirect',
'OrgSettingStale',
'PermissionDenied',
]);
const VALID_STATUSES = new Set([
'AvailableUsingPlatformHost',
'AvailableUsingCustomHost',
'AvailableUsingCustomHostByAdminDefault',
'AvailableUnboundCustomHost',
'MultipleUnboundCustomHosts',
'PlatformHostExistsUnbound',
'CannotRedirect',
'NoHost',
'OrgSettingStale',
'PermissionDenied',
'HostWithoutPipelines',
]);
runValidation((cwd) => {
const projectRoot = findProjectRoot(cwd) || cwd;
const markerPath = almPath(projectRoot, 'lastHostCheck');
if (!fs.existsSync(markerPath)) return approve(); // Not an ensure-host session.
let marker;
try {
marker = JSON.parse(fs.readFileSync(markerPath, 'utf8'));
} catch {
return block('docs/alm/last-host-check.json exists but could not be parsed as JSON.');
}
if (marker.schemaVersion !== 1 && marker.schemaVersion !== 2) {
return block(`docs/alm/last-host-check.json has unsupported schemaVersion: ${marker.schemaVersion}. Expected 1 or 2.`);
}
if (!marker.tenantId) {
return block('docs/alm/last-host-check.json is missing required field: tenantId');
}
if (!marker.sourceEnvUrl) {
return block('docs/alm/last-host-check.json is missing required field: sourceEnvUrl');
}
if (!marker.resolutionStatus) {
return block('docs/alm/last-host-check.json is missing required field: resolutionStatus');
}
if (!VALID_STATUSES.has(marker.resolutionStatus)) {
return block(`docs/alm/last-host-check.json has unknown resolutionStatus: ${marker.resolutionStatus}`);
}
// Acceptable terminal-error: ready may be false but resolution itself was correct.
if (TERMINAL_ERROR_STATES.has(marker.resolutionStatus)) {
return approve();
}
// Otherwise the host must be usable.
if (marker.ready !== true) {
return block(`docs/alm/last-host-check.json has ready=${marker.ready} but resolutionStatus "${marker.resolutionStatus}" requires a usable host. The skill did not complete successfully.`);
}
// Sanity: when ready=true, finalHostEnvUrl must be set.
if (!marker.finalHostEnvUrl) {
return block('docs/alm/last-host-check.json has ready=true but finalHostEnvUrl is missing.');
}
return approve();
});
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 119k | Updated | Claude CodeCodex | Verified | Install |
| 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: 118k | Updated | Claude CodeCodex | Verified | Install |