Bash for agents. Guardrails for WordPress.
Agents are strongest when they can inspect files, search, edit, validate, and diff from a command line. Divine exposes that shape through one MCP command, then runs it through a controlled Bash parser, virtual filesystem, and worktree boundary.
Agents write commands. Divine interprets them.
The execute command is intentionally narrow. The agent writes normal shell-shaped work, but Divine parses that Bash, resolves paths, and decides what the command is allowed to touch before anything runs.
# Agent writes shell-shaped work
execute "rg 'Download Divine' pages blocks"
→ pages/home/index.php
→ blocks/elements/download-button/index.php
execute "sed -n '1,80p' pages/home/index.php"
→ readable page source
execute "check pages/home/index.php"
→ no findings
# Divine controls the runtime
parse bash
→ command AST accepted
resolve cwd
→ /worktrees/hero-refresh
mount filesystem
→ theme files only
run command
→ scoped output returned
Why one command beats a giant MCP API.
A page builder API can grow forever. A command surface stays universal. Agents already know how to inspect, edit, validate, and diff, so Divine focuses on making that command line safe inside WordPress.
One MCP command
The agent does not need separate tools for every WordPress operation. It uses execute.
Shell-shaped work
Tasks can be expressed as search, read, edit, check, diff, and review commands.
Validation is part of the loop
Check fires after every worktree write. Bad contract code never reaches review.
The whole builder is files.
Divine does not hide the website inside builder state. Pages, blocks, schemas, assets, and data behavior stay in the theme, which means an agent can work from Divine, GitHub issues, code review comments, or any bug tracker that points at files and diffs.
# Theme source stays readable
pages/home/index.php
blocks/elements/download-button/index.php
data/newsletter_subscribers/schema.json
assets/images/divine-screenshot.png
functions.php
→ pages, blocks, data, assets, and glue code
# External context maps to files
GitHub issue: update the hero CTA
→ pages/home/index.php
→ blocks/elements/download-button/index.php
Bug report: newsletter copy is unclear
→ blocks/elements/newsletter-form/index.php
→ data/newsletter_subscribers/emails/confirmation.php
Review comment: schema field name
→ data/newsletter_subscribers/schema.json
Works with every cloud or git-based agent.
Bash compacts many tool calls into one executable string.
A page builder API would split a multi-step task into a tool call per step. Divine gives the agent a real Bash interpreter and worktree-bound wp, so a single execute can search, filter, query, count, and sort. The same surface works on shared hosts where shell access is locked down.
# Top changed PHP files by size
execute "git diff main --name-only \
| rg '\.php$' \
| xargs wc -l \
| sort -rn \
| head -5"
260 pages/home/index.php
145 pages/agent-loop/index.php
106 pages/workspace/index.php
89 pages/how-it-works/index.php
67 pages/wordpress-native/index.php
# Posts grouped by status
execute "wp post list --post_status=any \
--format=csv --fields=post_status \
| tail -n +2 \
| sort \
| uniq -c"
3 draft
47 publish
2 pending
# Block names, alphabetized
execute "find blocks -name block.json \
| xargs jq -r '.name' \
| sort -u"
divine-homepage/agent-card
divine-homepage/card
divine-homepage/code-sample
divine-homepage/dependency-card
divine-homepage/faq-item
divine-homepage/newsletter-form
divine-homepage/window
The shell is controlled by Divine.
The execute command is not an open SSH session. Divine owns the command runtime, scopes paths through its virtual filesystem, binds commands to the selected worktree, and keeps the live theme protected until review.
Virtual filesystem
Commands see the assigned theme workspace instead of the whole server filesystem.
Scoped permissions
The agent can work in the selected copy without changing the live theme directly.
Worktree-aware git
Git state is tied to the active worktree, so diffs and reviews stay scoped to the task.
Fast theme search
Agents can grep real theme files, blocks, pages, schemas, and supporting code quickly.
Validation included
Check runs on every write. Syntax, schema integrity, and contract rules, in pure PHP.
Review boundary
The command output still becomes a human-readable diff before anything reaches the live theme.
Every write runs through Check.
Check is Divine’s own static analyser, written in PHP for the theme contract. It runs after every worktree write and surfaces findings inline.
# Agent writes a schema with an unknown field type
execute "edit data/newsletter/schema.json"
→ wrote data/newsletter/schema.json
[check] data/newsletter/schema.json
divine.check.schemaFieldType
Field "email" has unknown type "mail".
Allowed: string, text, integer, ...
# Agent corrects and writes again
execute "edit data/newsletter/schema.json"
→ no findings
# Agent reaches for raw $wpdb in a data module
execute "edit data/newsletter/functions.php"
→ wrote data/newsletter/functions.php
[check] data/newsletter/functions.php
divine.check.rawWpdbWrite
Direct $wpdb writes are not allowed.
Use divine_entries('newsletter')-> instead.
# Agent switches to divine_entries(), writes again
execute "edit data/newsletter/functions.php"
→ no findings
# Agent writes eval() into a block template
execute "edit blocks/elements/card/index.php"
→ wrote blocks/elements/card/index.php
[check] blocks/elements/card/index.php
divine.check.forbiddenEval
eval() is not allowed in worktree code.
# Agent rewrites without eval, writes again
execute "edit blocks/elements/card/index.php"
→ no findings
Built on PHP-native infrastructure.
The agent loop depends on focused packages built for this workflow. They are developed separately, available on Composer, and used inside Divine to keep git, grep, and block rendering native to PHP.
The loop stays simple.
Agents write shell-shaped commands. Divine decides where they run, what they can touch, how results are validated, and when the work can move back to the live theme.
Inspect
Find the relevant page, block, schema, or asset.
Edit
Change files inside the assigned worktree.
Validate
Check fires after every write. Bad writes flag immediately.
Diff
Return exact changes instead of vague summaries.
Review
A human decides when the work reaches the live theme.
Give agents a command line they can use safely.
One MCP command, scoped to the worktree, backed by WordPress-aware validation.