Capture d'écran Jahia

VérifiéPrudence

Prend des captures d'écran de référence et de rendu local pour comparer visuellement les vues Jahia lors du développement.

Spar Skills Guide Bot
DeveloppementIntermédiaire
0029/08/2026
Claude Code
#screenshot#jahia#visual-comparison#playwright#puppeteer

Recommandé pour

Notre avis

Cette compétence prend des captures d'écran d'une URL de référence et du rendu local Jahia pour comparer visuellement une vue avant et après son développement.

Points forts

  • Automatise la capture d'écran avec Playwright ou Puppeteer, sans configuration manuelle.
  • Fournit une méthode claire pour valider la conformité visuelle d'une implémentation.
  • Inclut la gestion de l'authentification Jahia pour les pages protégées.
  • Produit une analyse des éléments de design pour guider la construction.

Limites

  • Nécessite que les outils (Playwright/Puppeteer/Chrome) soient installés ou demande à l'utilisateur de le faire.
  • La comparaison est manuelle, l'utilisateur doit inspecter les captures pour repérer les différences.
  • Dépend de la disponibilité d'une URL de référence et d'un environnement local Jahia.
Quand l'utiliser

Quand vous devez construire une vue Jahia à partir d'un site existant ou vérifier que le rendu local correspond au design attendu.

Quand l'éviter

Quand la comparaison ne nécessite pas de capture d'écran, par exemple pour des tests fonctionnels automatisés.

Analyse de sécurité

Prudence
Score qualité88/100

The skill uses powerful tools (bash, npx, headless browsers) for a legitimate visual comparison workflow. It does not instruct destructive or exfiltrating actions, and the commands are transparent. However, the use of default credentials and arbitrary URL navigation warrants caution.

Points d'attention
  • Uses bash and npx to execute commands and potentially install npm packages (playwright/puppeteer).
  • Instructs entering default Jahia credentials (root/root1234) into a local web form via Puppeteer.
  • Executes Node.js one-liners that launch a headless browser and navigate to user-provided URLs.
  • Screenshots could accidentally include sensitive data if capturing authenticated pages, though intent is legitimate.

Exemples

Reference screenshot for inspiration
Take a reference screenshot of https://www.example.com and describe its layout, colors, and typography before I build the Jahia component.
Compare local render with reference
Capture the local Jahia render at http://localhost:8080/cms/render/default/en/sites/mysite/home.html and compare it with /tmp/jahia-screenshots/reference.png. List the visual differences.
Validate after deployment
After I deploy my changes, take a screenshot of the updated Jahia page and compare it with the reference screenshot to confirm it matches.

name: jahia-dev-screenshot description: Takes screenshots of a reference URL and the local Jahia render for visual comparison. Use before building a view (inspiration) and after (validation).

Skill: jahia-dev-screenshot

Takes screenshots for two purposes:

  1. Reference — capture an existing site as a visual spec before building
  2. Result — capture the local Jahia render after building to compare

Step 1 — Detect screenshot tool

Check what is available:

# Playwright (preferred)
npx playwright --version 2>/dev/null

# Puppeteer
node -e "require('puppeteer'); console.log('ok')" 2>/dev/null

# System Chrome/Chromium
which google-chrome || which chromium || which chromium-browser 2>/dev/null

Use the first one that works. If none is available, ask the user:

No screenshot tool found. Which would you like to install?

  • npm install -g playwright then npx playwright install chromium
  • npm install puppeteer (downloads Chromium automatically)
  • I'll take the screenshots manually and paste them in

If the user chooses manual, skip to Step 4 and ask them to paste the screenshots.


Step 2 — Take reference screenshot

Ask the user for the reference URL if not already provided.

Create the output directory:

mkdir -p /tmp/jahia-screenshots

With Playwright:

npx playwright screenshot \
  --browser chromium \
  --full-page \
  "<REFERENCE_URL>" \
  /tmp/jahia-screenshots/reference.png

With Puppeteer (Node.js one-liner):

node -e "
const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
  const page = await browser.newPage();
  await page.setViewport({ width: 1440, height: 900 });
  await page.goto('<REFERENCE_URL>', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: '/tmp/jahia-screenshots/reference.png', fullPage: true });
  await browser.close();
})();
"

After capturing, view the screenshot to use it as visual context:

view /tmp/jahia-screenshots/reference.png

Describe the key design elements you observe:

  • Layout structure (hero, grid, sidebar, etc.)
  • Color palette (dominant, accent, background)
  • Typography (heading sizes, font weight)
  • Component anatomy (what sub-elements make it up)

Share this description with the user before proceeding to build.


Step 3 — Take result screenshot (after building)

Once the view is built and deployed (yarn build + yarn jahia-deploy), capture the Jahia render.

Ask the user for the Jahia page URL, or construct it:

  • Default: http://localhost:8080/cms/render/default/en/sites/<siteName>/home.html
  • Or ask: "What is the URL of the page where the component is placed?"

Jahia requires authentication. Use the --auth header or log in first:

With Playwright:

npx playwright screenshot \
  --browser chromium \
  --full-page \
  "http://localhost:8080/cms/render/default/en/sites/<siteName>/home.html" \
  /tmp/jahia-screenshots/result.png

Note: if the page requires login, authenticate first:

node -e "
const puppeteer = require('puppeteer');
(async () => {
  const browser = await puppeteer.launch({ args: ['--no-sandbox'] });
  const page = await browser.newPage();
  await page.setViewport({ width: 1440, height: 900 });
  await page.goto('http://localhost:8080/cms/login', { waitUntil: 'networkidle2' });
  await page.type('#username', 'root');
  await page.type('#password', 'root1234');
  await Promise.all([page.waitForNavigation(), page.keyboard.press('Enter')]);
  await page.goto('<PAGE_URL>', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: '/tmp/jahia-screenshots/result.png', fullPage: true });
  await browser.close();
})();
"

After capturing, view the screenshot:

view /tmp/jahia-screenshots/result.png

Step 4 — Compare and report gaps

View both screenshots and compare them side by side (or sequentially).

Report gaps to the user:

## Visual Comparison

### Reference: <URL>
[description of reference]

### Result: http://localhost:8080/...
[description of result]

### Gaps
- [ ] Background color differs (reference: dark navy, result: white)
- [ ] Hero text not centered
- [ ] CTA button missing border-radius
- [ ] Font size smaller than reference

### Suggested fixes
...

Ask: "Would you like me to fix these gaps?"

If yes, update the view's .tsx and .module.css files using /jahia-dev-create-view guidance, rebuild, and re-screenshot to verify.


Integration points

This skill is called from:

  • /jahia-dev-build-component — Step 0 (optional reference) and Step 4 (result check)
  • /jahia-dev-create-view — Step 0 (optional reference) and after deploy

References

  • Playwright CLI: https://playwright.dev/docs/cli
  • Puppeteer: https://pptr.dev
Skills similaires