Install the Playwright CLI skill for Codex and other agents, not only Claude Code

Aperta Adatta ai principianti
#7 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
80/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
playwright, shell
Ambito
devtools

Direzione di ricerca

Inizia da config.playwright-cli.yaml per vedere come l’hook post-avvio installa la skill, poi leggi il README e tests/test.bats per conoscere la configurazione e le asserzioni esistenti. Aggiungi il supporto alla scelta delle destinazioni claude e agents tramite PLAYWRIGHT_CLI_SKILLS, mantenendo claude come valore predefinito e facendo in modo che gli errori dell’hook non siano fatali. Il lavoro è completo quando il README documenta entrambe le destinazioni e i test coprono il comportamento configurato e quello predefinito, inclusi i percorsi della skill previsti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Is there an existing issue for this?
  • I have searched the existing issues
Is your feature request related to a problem?

Problem

The post-start hook in config.playwright-cli.yaml runs playwright-cli install --skills without a value:

- exec: "which playwright-cli > /dev/null 2>&1 && playwright-cli install --skills || true"

Playwright CLI treats that as claude:

$ playwright-cli install --help
  --skills  install skills, possible values: claude (default), agents.

So the skill only lands in .claude/skills/playwright-cli/. Codex, and other agents that read .agents/skills/, never get it, although the CLI and Chromium are installed and work for them.

Steps to reproduce

  1. ddev add-on get e0ipso/ddev-playwright-cli && ddev restart
  2. ddev exec ls .agents/skills: there's no playwright-cli.
  3. In Codex inside the web container, the skill isn't listed (codex debug prompt-input "hi" doesn't mention it).

Running ddev exec playwright-cli install --skills agents by hand writes .agents/skills/playwright-cli/, and Codex picks it up.

Versions: add-on v1.2.3, @playwright/cli 0.1.24, Codex CLI 0.169.0, DDEV ≥ 1.25.

Current workaround

A project-owned .ddev/config.playwright-cli-codex.yaml:

hooks:
  post-start:
    - exec: "which playwright-cli > /dev/null 2>&1 && playwright-cli install --skills agents || true"

DDEV runs the hooks from every config.*.yaml file, so the add-on's own hook still runs too.

Describe your solution

Let projects choose the targets with an environment variable, keeping today's behavior as the default:

#ddev-generated
hooks:
  post-start:
    # Install the Playwright CLI skill for each target in PLAYWRIGHT_CLI_SKILLS
    # ("claude", "agents"; default "claude"), if the CLI is available.
    - exec: 'which playwright-cli > /dev/null 2>&1 && for target in ${PLAYWRIGHT_CLI_SKILLS:-claude}; do playwright-cli install --skills "$target"; done || true'
web_environment:
  - PLAYWRIGHT_MCP_CONFIG=/var/www/html/.ddev/playwright-cli/cli.config.json

A project opts in with:

ddev dotenv set .ddev/.env.web --playwright-cli-skills="claude agents"
ddev restart

Setting web_environment in a project config.*.yaml file would work too.

  • Default unchanged: existing projects don't suddenly get an .agents/skills/ folder they would need to ignore in Git.
  • Failures stay non-fatal: || true keeps the hook from breaking ddev start, as it does today.
  • README: document the variable and the two targets.
  • Test: extend tests/test.bats. With PLAYWRIGHT_CLI_SKILLS="claude agents", assert that .agents/skills/playwright-cli/SKILL.md exists. With the default, keep the current .claude/skills/playwright-cli assertion and check that .agents/skills/playwright-cli doesn't exist.
Describe alternatives

No response

Additional context
  • Always install both targets: no configuration, but every project gets .agents/skills/playwright-cli/ and has to ignore it in Git.
  • Detect the agents in use from folders such as .codex/ or .agents/: works without configuration, but it's implicit and easy to get wrong.
Lingua principale
Shell
Stelle
6
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.