backend-setup
Skill1 starsChanged 23 days agoMITView on GitHub
Use when the person wants a new local Drupal backend for their app. It clones the backend template into a new folder, starts it with DDEV, which installs Drupal, writes the project's AGENTS.md rules and installs the pinned Drupal agent skills. Also use it when that site's install fails or the person asks to reset it.
In this repository3 other files it gives its agents.
- frontend-connectSkill
- machine-checkSkill
- safe-deleteSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Run the machine-check skill first: bash scripts/check-machine.sh in that skill.
- Distinctive: line 18
Run this skill's script:
- Distinctive: line 50
Security advisories: When the output holds this line, show it to the person:
- Distinctive: line 58
Half-finished install: When the output holds this line, the database has tables but Drupal did not finish installing:
- Distinctive: line 74
When the person asks to reset, find out which of these they mean.
- Distinctive: line 82
After you fix the cause, run the setup script again on the same folder.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backend setup
This skill gives the person a local Drupal site, built from the backend template, that their app can use as its backend.
Before you start
- Run the machine-check skill first:
bash scripts/check-machine.shin that skill. Go on only when its JSON saysreadyis true. Otherwise, show the person what it reports and stop. - Agree the project folder with the person. It must not exist yet, or must be empty, and it must be outside this skill's folder. Pass an absolute path; a relative one is resolved from the folder you run the script in. Its parent folder must already exist.
- The DDEV project name is the folder name. A folder named like an existing DDEV project fails at
ddev start. Runddev listand pick a name that is not there.
Set up the site
Run this skill's script:
bash <this-skill-folder>/scripts/setup-backend.sh [--source <git URL or path>] [--ref <tag, branch or commit>] <project-folder>--sourceis the template's git URL or a local path. The default is https://github.com/camoa/vibe-config-backend.git.--refis a template tag, branch or commit. The default isv0.1.1, the template release these skills were tested with.--ref maingets the latest template.--helpprints both defaults.
The script does these steps in order:
- It clones the template at the requested ref into the folder. The project then sits on a local branch
mainthat tracks nothing, and the template's remote is namedtemplate. The person can add their ownorigin. - It runs
ddev start. The template's start hook installs Drupal, so this step takes about a minute. - It checks that the login page,
/user/login, answers 200. The template may close the front page to visitors, so the script does not check it. - It writes the vibe-config rules block into the project's
AGENTS.md(scripts/write-agents-block.sh). - It installs the pinned
drupal-ddevanddrupal-config-mgmtskills into the project's.claude/skills/(scripts/install-drupal-skills.sh). - It prints a
Site URL:line and aLogin link:line. Give both to the person, and tell them to open the login link in their browser. It signs them in to Drupal with no password, so the app's Sign in later goes straight through.
The login link works once and expires after 24 hours. The admin password is random. To log in again, run ddev drush uli in the project folder for a new link.
Running the script again on a folder it set up skips the clone and refreshes AGENTS.md. It keeps the template that folder already holds: when --source or --ref asks for another, it prints a note, and the person sets up a new folder to switch. A new AGENTS.md is untracked in the project's git, and so is the new .claude/ folder. Offer to commit both.
The One Line Installer is an optional helper for getting DDEV. This skill does not need it.
A token for checking the API
To check the API as a signed-in person, get an access token with bash <this-skill-folder>/scripts/get-token.sh [--name <user>] <project-folder>. It signs in through ddev drush uli, then runs the app's own sign-in flow with the nextjs client, so the token has the app's scope and the user's permissions. It needs no password or secret and no running app. It prints only the token, which lasts 5 minutes. Keep it in a shell variable; never print it, write it to a file or commit it. The AGENTS.md block says how to use it.
Messages from the template
Watch the ddev start output for these two lines.
Security advisories. When the output holds this line, show it to the person:
WARNING: composer audit reported security advisories or abandoned packages; run composer auditOffer to run ddev composer update. Run it only when the person agrees.
Half-finished install. When the output holds this line, the database has tables but Drupal did not finish installing:
ERROR: the database has tables but the Drupal install did not finish. Recover with: ddev drush sql:drop -y && ddev restartRecover in the project folder with:
ddev drush sql:drop -y && ddev restartThe restart runs the start hook again, and it installs Drupal on the empty database. Then run the setup script again on the same folder. It skips the clone and writes AGENTS.md, installs the skills and prints the login link.
The three resets
When the person asks to reset, find out which of these they mean.
- Undo a recent change:
ddev snapshot restore --latest. It restores the latest snapshot. - Fresh install, on sites made from this template only. Warn the person first that all content and configuration in the database is lost. When they agree, run
ddev snapshotfirst, thenddev drush sql:drop -y && ddev restart. The restart installs Drupal again. - Delete the project: send this to the safe-delete skill. Only the person deletes a project. Never run DDEV's delete command yourself, and never remove the project folder yourself.
When a step fails
After you fix the cause, run the setup script again on the same folder. It skips the clone and finishes the steps it missed.
The script stops with a message and leaves the folder and the DDEV project as they are. One exception: when --ref names no tag, branch or commit in the template, the script removes the clone it just made, so run it again on the same folder with a valid --ref.
ddevis missing: run the machine-check skill and follow what it says.- The folder exists and is not empty: pick another folder, or ask the person.
ddev startfails: show the person the output. A name clash with another DDEV project is a common cause. See "Before you start".- The login page does not answer 200: show the person the status and the
ddev startoutput.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

