一键导入
astro-build
Build, preview, and verify the jmrp.io Astro 7 project. Use when asked to build, deploy, or run the QA pipeline.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Build, preview, and verify the jmrp.io Astro 7 project. Use when asked to build, deploy, or run the QA pipeline.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Debug Content Security Policy (CSP) and Subresource Integrity (SRI) issues in the jmrp.io project
Scaffold and write a new MDX blog post. Use when asked to create a blog post, write an article, or add content to the posts collection.
Create a new reusable Astro UI component in src/components/ui/. Use when asked to add a component, build a UI element, or extend the component library.
Run accessibility audits and fix WCAG 2.2 AA violations. Use when asked about accessibility, a11y, WCAG, or axe-core issues.
Add or update translations for the EN/ES bilingual system. Use when asked about translations, missing keys, locale routing, hardcoded strings, or adding a new language.
| name | astro-build |
| description | Build, preview, and verify the jmrp.io Astro 7 project. Use when asked to build, deploy, or run the QA pipeline. |
| argument-hint | [command: build|verify|preview|dev] |
| disable-model-invocation | true |
Build and verify the jmrp.io Astro 7 SSG project.
pnpm build
This runs: astro build → atomic swap (dist_new → dist_old → dist) → Prettier check.
Deployment: The project lives at
/var/www/jmrp.io/on the production server. Nginx serves/var/www/jmrp.io/dist/directly as the document root forjmrp.io. Runningpnpm buildon the server immediately updates the live website — no git push or separate deploy step is needed. The atomic swap ensures zero-downtime deploys.
pnpm dev
Starts on port 4321. Warning: Dev server lacks nonces/SRI — do not run tests against it.
pnpm preview
Serves dist/ on port 4321. Use this for testing.
pnpm verify)pkill -f "astro dev" 2>/dev/null # Stop dev server first!
pnpm verify
Runs scripts/run-verify.mjs — 13 sequential steps (fail-fast except SonarCloud):
| # | Step | Command |
|---|---|---|
| 1 | Static: Astro Check | pnpm typecheck --minimumFailingSeverity warning |
| 2 | Static: ESLint | pnpm lint --max-warnings=0 |
| 3 | Static: Prettier | pnpm exec prettier --check . |
| 4 | Lint: CSS Stylelint | pnpm lint:css |
| 5 | Build: Production Build | pnpm run build |
| 6 | Lint: HTML5 Validation | pnpm lint:html |
| 7 | Lint: RSS Feed | node scripts/ci/validate-rss.mjs dist |
| 8 | Lint: Spelling (CSpell) | pnpm exec cspell lint . |
| 9 | Lint: Broken Links (Lychee) | lychee --config lychee.toml --root-dir dist dist/**/*.html |
| 10 | Lint: JSDoc Coverage | node scripts/ci/calculate-jsdoc-coverage.mjs |
| 11 | Security: SonarCloud Analysis | pnpm exec sonar-scanner (if SONAR_TOKEN set) |
| 12 | Analyze: SonarCloud Issues | node scripts/ci/get-sonar-issues.mjs (if SONAR_TOKEN + SONAR_PROJECT_KEY) |
| 13 | Tests: Playwright E2E | pnpm test:e2e |
Schema.org JSON-LD is validated at build via schema-dts satisfies types on every JSON-LD builder, checked by step 1 (Astro Check).
Steps 5-13 require a successful build. Steps 11-12 are conditional (skipped without env vars). SonarCloud failures are recorded but don't block subsequent steps.
pnpm typecheck # astro check
pnpm lint # ESLint
pnpm lint:css # Stylelint
pnpm test:e2e # Playwright tests
pnpm verify-icons # Icon consistency (not in verify pipeline)
pnpm exec cspell lint . # Spell check (bilingual EN/ES)
pnpm exec prettier --check . # Format check
pnpm lint:html # HTML5 validation (requires build)
# Requires SONAR_TOKEN and SONAR_PROJECT_KEY env vars
SONAR_PROJECT_KEY=jmrplens_jmrp.io node scripts/ci/get-sonar-issues.mjs
This script queries the SonarCloud API for:
NOSONAR suppression commentspnpm exec sonar-scanner # Requires SONAR_TOKEN
https://sonarcloud.io/dashboard?id=jmrplens_jmrp.iojmrplens_jmrp.iojmrplenssonar-project.propertiesVS Code has SonarLint connected mode configured in .vscode/settings.json:
jmrplensjmrplens_jmrp.iosonar-project.properties defines multicriteria suppressions for CI scripts that intentionally use execSync/execFileSync and regex patterns. These suppress S4721 (OS Command Injection), S5852 (Regex complexity), and S4036 (OS command shell PATH) in specific files.
The build integration runs these sequentially:
extractCssDataUris() — CSS data URI extractionprocessHtmlFiles() — SRI, nonces, HTML minifyfinalizeCspConfig() — Security headers for NginxoptimizeImages() — Image optimizationcompressAssets() — Gzip + Brotli compressionfixPermissions() + deploySecurityHeaders() — Nginx deployment (if configured)purgeCloudflareCache() — Cache purge (if configured)NGINX_CSP_NONCE placeholder is expected — it's replaced by Nginx at runtime.astro dev first (pkill -f "astro dev").lsof -ti:4321 | xargs kill.