No slash command · from drupal-ai-contrib
Stands up and environment-matches a Drupal contribution workspace: DDEV with workflow-matched add-on, CI gate config, Drupal AI skills, drupalorg CLI, GitLab CLI, and SSH-key check. Idempotent and detect-driven.
Ships in drupal-ai-contrib. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Onboarding for a Drupal contribution. Optional, idempotent, not a gate. Detect what
already exists and do only what is missing — a contributor who arrives with a ready
environment can skip straight to issue.
Backs /drupal-ai-contrib:setup. Load the knowledge layer via dev-guides-navigator:
drupal/contributing/ddev-contribution-environment,
drupal/contributing/contrib-project-scaffolding,
drupal/contributing/three-contribution-workflows-compared,
drupal/contributing-with-ai/ai-toolchain-for-contribution.
Determine — by inspecting the working directory and asking the contributor only what cannot be inferred:
Check for an existing DDEV project (.ddev/config.yaml) and the add-on in use.
If a working contribution environment already exists, report it and stop — nothing to do.
If none exists, stand up DDEV with the workflow-matched add-on:
| Workflow | Add-on |
|---|---|
| Single contrib module/theme | ddev-drupal-contrib (module repo is the project root; web/ + vendor/ generated & gitignored) |
| Multi-module suite | ddev-drupal-suite |
| Drupal core | ddev-drupal-core-dev |
Existing module — discover gates by parsing .gitlab-ci.yml:
gitlab_templates include and ref, the variables: block
(_TARGET_CORE, _TARGET_PHP, _GITLAB_TEMPLATES_REF, _PHPUNIT_CONCURRENT,
SKIP_*, OPT_IN_TEST_*).verify will mirror exactly these.New module / maintainer setup — scaffold the correct config (writes — see §Writes). Generate, version-resolved per the target core, from the scaffolding dev-guide:
.gitlab-ci.yml — the gitlab_templates include + a variables: blockphpcs.xml.dist — Drupal + DrupalPractice, scoped to src + testsphpstan.neon — phpstan-drupal extension, the project's levelphpunit.xml.dist — the major-version-correct schema (D11 → PHPUnit 11 schema,
<source> block, failOnWarning; D10 → PHPUnit 9.x schema + DrupalListener) —
copy from the target core, never hand-write the version.cspell-project-words.txtdrupal/core-dev (+ drupal/coder, phpstan/phpstan, mglaman/phpstan-drupal) in
require-dev, constrained to the target majorDrupal AI skills — ensure ai_best_practices and ai_skills are installed via
drupal_devkit (the cross-harness skill installer). If drupal_devkit is absent,
report how to obtain it; do not block.
The issue / MR CLI — the issue, submit, and pipeline skills wrap
mglaman/drupalorg-cli. Detect it with command -v drupalorg (the executable is
drupalorg, not drupalorg-cli). If it is missing, surface the install instructions
from ${CLAUDE_PLUGIN_ROOT}/skills/drupal-ai-contrib/references/drupalorg-cli.md —
that reference covers what the tool is, the recommended PHAR install, the deprecated
Composer path, and the subcommand set. Offer to install it; do not block if the
contributor declines (issue/submit re-surface the same instructions).
The GitLab CLI (glab) — authenticated GitLab writes on migrated projects (fork
push, MR create/update, pipeline status) are delegated to the drupal-gitlab skill,
which drives glab against git.drupalcode.org. The drupal-gitlab skill itself ships
with ai_best_practices (installed above via drupal_devkit) — no install step for the
skill — but glab is a separate binary. Detect and report it:
command -v glab # installed?
glab auth status --hostname git.drupalcode.org # authenticated for Drupal's GitLab?
If glab is missing or not authenticated, surface the next step — install glab, then
glab auth login --hostname git.drupalcode.org (a write-capable token is needed only for
pushes / MR creation; reads work read-only — see the drupal-gitlab README for token
scopes). Soft posture, exactly like the drupalorg check: report the gap, never block.
The legacy drupalorg reads still work without glab; only migrated-project
authenticated writes need it.
The contribution arc needs the contributor's drupal.org credentials for its write
operations. Surface this now — do not let it surface mid-issue as a failed git push. The plugin and the CLI cannot set credentials up; this is the contributor's
own account action. Guide them through it.
drupalorg issue:show, mr:list, project:issues) hit public
APIs — no credentials needed. An empty project:issues result can itself be an
auth/config gap rather than "no issues" — note that when reporting.git push to an issue fork, and the /do: issue-bot
commands — need an SSH key registered on the contributor's drupal.org account,
because issue-fork git remotes use SSH URLs ([email protected]:…).Detect, then guide:
ssh -T [email protected] # a working key greets the contributor by username
If it does not authenticate, tell the contributor plainly: this is a ~2-minute action —
register an SSH key at drupal.org → My account → SSH keys (add the public key, e.g.
~/.ssh/id_ed25519.pub). It is the prerequisite for git push to issue forks; without
it, issue can still review and read, but cannot push a branch. Never block setup on
it — report it as the next thing to do. See
${CLAUDE_PLUGIN_ROOT}/skills/drupal-ai-contrib/references/drupalorg-cli.md §Authentication.
Install the CI-target core version + drupal/core-dev so phpunit / phpstan
resolve to the same releases CI uses (the local DDEV default usually will not match).
This is the mechanism that makes verify's gates trustworthy — see contribution-verify.
Summarize, and for each item state ready vs. needs-action so the contributor knows
their exact next step: workflow, issue system, environment status, the resolved gate
set, AI-skill status, the issue/MR CLI (drupalorg) status, the GitLab CLI (glab)
status (installed + authenticated for git.drupalcode.org), the credentials/SSH-key
status, the environment-match result. Point the contributor at issue (or, if work is
underway, verify) — and if the SSH key is missing, name that as the first step.
setup writes files only with explicit user confirmation and only within the
target project. Show the contributor each file to be written before writing it. Never
write outside the project directory.
Every step checks first and does only what is missing. Re-running setup on a ready
environment is a no-op that simply reports state.
Trigger: /drupal-ai-contrib:setup in a contrib module that already has DDEV.
Actions:
.gitlab-ci.yml, record the discovered gate set; environment-match the core.
Result: No files written; the contributor is told to proceed to issue.Trigger: /drupal-ai-contrib:setup in a fresh contrib module with no CI config.
Actions:
ddev-drupal-contrib..gitlab-ci.yml, phpcs.xml.dist, phpstan.neon,
phpunit.xml.dist, .cspell-project-words.txt) and write only on confirmation.
Result: A CI-ready module the maintainer owns.| Situation | Handling |
|---|---|
drupal_devkit not installed | Report how to obtain it; do not block setup. |
drupalorg not on PATH | Surface references/drupalorg-cli.md (PHAR install); offer to install; do not block. If installed via Composer global, the bin dir may just be off PATH — see the reference's Install note. |
glab missing or not authenticated | Report it as a next step (install glab; glab auth login --hostname git.drupalcode.org); never block. Only migrated-project authenticated writes need it — drupalorg reads and the legacy queue work without it. See references/drupalorg-cli.md §Hybrid model. |
| No SSH key registered on the drupal.org account | Guide the contributor to add one (drupal.org → My account → SSH keys); report it as the next step. Read/review still works; git push to issue forks does not. Never block. |
| Workflow cannot be inferred | Ask the contributor — never assume core vs. contrib. |
.gitlab-ci.yml exists but uses a non-gitlab_templates setup | Record what is there; verify mirrors the discovered jobs as-is. |
| Contributor declines a scaffold write | Skip that file; report which gates remain unconfigured. |
What SKILL.md sets; muted values are Claude Code's defaults
inheritThree short reads, in order
drupal-contribution, ddev, environment-setup, gitlab-ci, onboarding
npx claudepluginhub camoa/claude-skills --plugin drupal-ai-contrib8 skills in this plugin
/contribution-guardrailsEnforces the development discipline for AI-assisted Drupal contributions — evidence over assertion, the no-guessing rule for external facts, the verification-gate artifact contracts, and re-verification on post-gate change. Use PROACTIVELY during any development between claiming an issue and verifying it. Use when user says 'guardrails', 'evidence over assertion', 'no guessing', 'verify this fact', 'is this actually tested', or whenever AI-assisted code is being written for a Drupal contribution. MUST apply before claiming any gate passed./contribution-issueWorks the Drupal issue lifecycle — reviews prior work on an issue first, then creates / comments on / claims it, and checks out the issue fork + branch with three-way fork handling. Use when the user runs /drupal-ai-contrib:issue or asks to find, create, claim, or check out a Drupal issue or issue fork. Wraps drupalorg-cli for no-auth reads; delegates authenticated GitLab fork/push to the drupal-gitlab skill./contribution-pipelineFetches the real GitLab merge-request pipeline for a Drupal contribution and gates on it — the authoritative final check. Use when the user runs /drupal-ai-contrib:pipeline or asks to check the real pipeline, the CI status, or whether a Drupal contribution is done. A contribution is not complete until the real drupalci pipeline is green./contribution-reviewRuns honest fresh-context review of a Drupal contribution — dispatches isolated reviewer agents with no session narrative to check the work against scope, coding standards, security, and the AI policy. Use when the user runs /drupal-ai-contrib:review or asks for an honest review, a fresh-eyes review, or a pre-submission review of a Drupal contribution. A builder cannot objectively review its own work./contribution-submitCreates or updates a Drupal merge request and generates the AI-disclosure comment at the policy threshold. Use when the user runs /drupal-ai-contrib:submit or asks to submit, open, or update a Drupal merge request or patch. Creates the cross-project MR via the drupal-gitlab skill (glab); wraps drupalorg-cli for no-auth reads; surfaces status and RTBC guidance./contribution-verifyRuns the local verification inner loop for a Drupal contribution — the drupalci-parity gate set at CI strictness, the AI-policy gate, and the eval gate, every gate passing only on a captured artifact. Use when the user runs /drupal-ai-contrib:verify or asks to verify, check, or locally test a Drupal contribution before submitting. This is the centerpiece — evidence over assertion, never a bare 'passes'.Other plugins' skills for the same job