
Add Seo
Verify robots.txt, sitemap.xml, and meta-tag SEO assets exist and are valid on a Microsoft Power Pages code site after an agent session.
Install
npx skills add https://github.com/microsoft/power-platform-skills --skill add-seoWhat is this skill?
- Stop-hook validation scoped to projects with powerpages.config.json
- Requires public/robots.txt with User-agent and Sitemap directives
- Requires public/sitemap.xml with valid sitemap structure
- Skips gracefully when no SEO files were added (non-SEO sessions)
- Blocks the session when expected SEO assets are missing or malformed
Adoption & trust: 77 installs on skills.sh; 349 GitHub stars; 3/3 security scanners passed (skills.sh audits).
Recommended Skills
Seo Auditcoreyhaines31/marketingskills
Copywritingcoreyhaines31/marketingskills
Twitter Automationqu-skills/skills
Marketing Psychologycoreyhaines31/marketingskills
Content Strategycoreyhaines31/marketingskills
Programmatic Seocoreyhaines31/marketingskills
Journey fit
Common Questions / FAQ
Is Add Seo safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
SKILL.md
READMESKILL.md - Add Seo
#!/usr/bin/env node // Validates SEO assets added to a Power Pages code site. // Runs as a Stop hook to verify robots.txt, sitemap.xml, and meta tags were created. const fs = require('fs'); const path = require('path'); const { approve, block, runValidation, findPath } = require('../../../scripts/lib/validation-helpers'); runValidation((cwd) => { const configPath = findPath(cwd, 'powerpages.config.json'); if (!configPath) approve(); // Not a Power Pages project, skip const projectRoot = path.dirname(configPath); const publicDir = path.join(projectRoot, 'public'); if (!fs.existsSync(publicDir)) approve(); // Check if any SEO file exists — if none, this wasn't an SEO session, skip const hasRobots = fs.existsSync(path.join(publicDir, 'robots.txt')); const hasSitemap = fs.existsSync(path.join(publicDir, 'sitemap.xml')); if (!hasRobots && !hasSitemap) approve(); const errors = []; // 1. robots.txt if (!hasRobots) { errors.push('Missing public/robots.txt'); } else { const content = fs.readFileSync(path.join(publicDir, 'robots.txt'), 'utf8'); if (!content.includes('User-agent:')) errors.push('robots.txt: missing User-agent directive'); if (!content.toLowerCase().includes('sitemap:')) errors.push('robots.txt: missing Sitemap directive'); } // 2. sitemap.xml if (!hasSitemap) { errors.push('Missing public/sitemap.xml'); } else { const content = fs.readFileSync(path.join(publicDir, 'sitemap.xml'), 'utf8'); if (!content.includes('<urlset')) errors.push('sitemap.xml: missing <urlset> element'); if (!content.includes('<loc>')) errors.push('sitemap.xml: missing <loc> entries'); if (content.includes('<PRODUCTION_URL>') || content.includes('<TODAY_DATE>')) { errors.push('sitemap.xml: contains unreplaced template placeholders'); } } // 3. Meta tags in index.html const indexPath = findIndexHtml(projectRoot); if (indexPath) { const content = fs.readFileSync(indexPath, 'utf8'); if (!content.includes('meta name="description"')) errors.push('index.html: missing meta description tag'); if (!content.includes('meta name="viewport"')) errors.push('index.html: missing viewport meta tag'); } if (errors.length > 0) { block('SEO validation failed:\n- ' + errors.join('\n- ')); } approve(); }); function findIndexHtml(projectRoot) { const candidates = [ path.join(projectRoot, 'index.html'), path.join(projectRoot, 'src', 'index.html'), ]; for (const candidate of candidates) { if (fs.existsSync(candidate)) return candidate; } // For Astro, check layout files const layoutDir = path.join(projectRoot, 'src', 'layouts'); if (fs.existsSync(layoutDir)) { try { for (const entry of fs.readdirSync(layoutDir, { withFileTypes: true })) { if (entry.isFile() && entry.name.endsWith('.astro')) { return path.join(layoutDir, entry.name); } } } catch {} } return null; } --- name: add-seo description: >- Adds SEO essentials to a Power Pages code site, including robots.txt, sitemap.xml, meta tags, Open Graph tags, and favicon configuration. Use when the user wants to improve search engine optimization or make their site more searchable. user-invocable: true allowed-tools: Read, Write, Edit, Grep, Glob, Bash, AskUserQuestion, Task, TaskCreate, TaskUpdate, TaskList, mcp__plugin_power-pages_playwright__browser_navigate, mcp__plugin_power-pages_playwright__browser_snapshot, mcp__plugin_power-pages_playwright__browser_click, mcp__plugin_power-pages_playwright__browser_close model: sonnet --- > **Plugin check**: Run `node "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js"` — if it outputs a message, show it to the user before proceeding. # Add SEO Add essential SEO assets to a Power Pages code site: `robots.txt`, `sitemap.xml`, and meta tags. > **Prerequisite:** This skill expects an existing Power Pages code site created via `/create-site`. Run that skill first if the site doe