SEO Agent Workspace Template

Private Molecule workspace template for an SEO-focused hermes agent.

The deployable template root stays compact: Molecule SaaS provisioning transports config.yaml plus prompts/* through the control plane (CP parses at most 512 KiB of config.yaml; the k8s seed Secret holds both files). The full SEO agent product package adapted from the current design lives under source/seo-agent-template-main/.

Status: beta. New tenant onboarding lives in source/seo-agent-template-main/SETUP.md. Validate tenant config with source/seo-agent-template-main/scripts/validate-config.sh.

Required: scheduled turns must be able to run code unattended

Every schedule below reaches hermes as a message from the scheduler plugin, and each one runs git, the website's checks and seo-ops. Two hermes gates would otherwise stop it:

HERMES_YOLO_MODE=1               # interactive approval gate
HERMES_CRON_APPROVAL_MODE=allow  # cron gate, for turns hermes treats as cron

Also required, both set to 0:

HERMES_SKILL_NUDGE_INTERVAL=0
HERMES_MEMORY_NUDGE_INTERVAL=0

With hermes's default, a background review rewrites skills and memory from past conversations. Those copies drift from the prompts and contradict them: on dinecall-ai, self-written skills still said "never merge" after the policy changed, and memory recorded that local checks were impossible. STATE.md is the agent's memory instead. These need the hermes template knobs.

Without HERMES_YOLO_MODE, any command hermes flags (for example python3 -c) waits 300 s for an /approve that the platform cannot deliver, returns BLOCKED, and the agent stops using its terminal (dinecall-ai incident, 2026-10-07 to 09). hermes hardline patterns still apply. Both are in runtime_config.required_env; setting them is a deliberate per-workspace decision that scheduled turns run code with no human in the loop.

seo-ops: the mechanical half

The plugin ships agent-skills/seo-all/scripts/seo-ops.py, installed at /configs/skills/seo-all/scripts/seo-ops.py and put on PATH as seo-ops by seo-ops now. The model decides what to change; seo-ops decides the facts a model gets wrong:

Command What it guarantees
now The real date (UTC and tenant-local). Repairs invented future dates in STATE.md and dated folders, and keeps STATE.md small: finished queue items, old tick_ sections and old done_recently: entries move to log/state-archive-<month>.md.
sweep Re-runs live checks, gives every open agent PR a verdict (GREEN, RED, PENDING, CONFLICT, BEHIND, BLOCKED) and names the next action. CI comes from check runs when the token can read them, otherwise from mergeable_state and the head commit's real age.
check Installs dependencies when needed and runs the repo's typecheck and tests. Failures that also exist on the base are reported as pre-existing. Rejects future dates, conflict markers and secrets in the diff.
open Opens the PR with the agent marker. Enforces the WIP limit, the date check and a Rollback: section for high-risk diffs.
review Checks the exact head commit in a scratch worktree, lists files, recent history and every claim to trace, and records the self-review for that commit.
merge Squash-merges only a marked PR whose CI is green for the head commit, which has a passing self-review for that commit and no hold/needs-human label, within the daily cap and with no unverified earlier merge. Records the live check.
live / revert Confirms production shows each merged change; a failed check blocks further merges until the change is reverted or the check is acknowledged with a reason.
edit / clone Replace a PR description without losing the agent marker; clone or repair the website checkout with no token in its remote (git reads SERVICES_GH_TOKEN from the environment).
forges GitHub and Gitea. SERVICES_REPO_WEBSITE is owner/repo (GitHub) or the repo's https clone URL; any host other than github.com is treated as Gitea unless SEO_FORGE=github. On Gitea, CI is read from commit statuses (Gitea has no check runs).
fetch / search Robots.txt-respecting page summaries with an honest user agent; web search only through BRAVE_SEARCH_API_KEY or TAVILY_API_KEY, with a daily budget and 429 backoff.

An agent PR needs all three of: the marker (or seo-ops' own record of having opened it), this token's own login as author, and a branch in the same repository (no forks). Reverts get their exemptions only when the PR is exactly git revert of the agent PR it names. The agent never changes the site's tests, CI or build configuration (seo-ops refuses to open or merge such a change), and checks run with secrets removed from their environment. A human stops any agent PR by adding the hold label.

Autonomy

SEO_AUTONOMY=full (default): the agent reviews and merges its own PRs through seo-ops, at most SEO_MAX_MERGES_PER_DAY (default 8) per UTC day, with SEO_WIP_LIMIT (default 3) open at once. SEO_AUTONOMY=supervised: every merge also needs a human's approved label. Facts that exist in no source go to blocked_no_source: in STATE.md instead of being invented or asked about.

Tenant knowledge (set by the operator)

Setting Purpose
TENANT_FACT_SOURCES Comma-separated repo paths holding the business's ground truth (pricing, features, customers, quotes). Business claims come only from these, or from fact_sources: in STATE.md written by the operator. The agent never picks its own sources; without any it does technical SEO only.
TENANT_SEED_KEYWORDS Comma-separated seed keywords for SERP research and the daily cluster plan (also seed-keywords.txt in the state folder).
TENANT_COMPETITOR_HINT One line describing who the competitors are.
TENANT_PARTNERS_HINT Partners and integrations; never treated as competitors.
SEO_REQUIRED_CHECKS The website repo's CI check names, comma-separated. Each must pass before a merge. If the GitHub token cannot read check results (grant it read access to Checks, or Actions, and Commit statuses instead), this declaration is what lets a clean merge state count as CI passing; without either, merges are blocked.
SEO_CHECK_ENV_PASSTHROUGH Extra non-secret environment variable names the repo's checks need; checks otherwise see only basic shell variables and NEXT_PUBLIC_*.
BRAVE_SEARCH_API_KEY / TAVILY_API_KEY Enables SERP research. Without one the agent skips it and researches competitors' pages, its own site and links instead.
HERMES_SESSION_RESET_MODE / HERMES_SESSION_RESET_HOUR Daily session reset (recommended daily, in a quiet hour). Needs the hermes template knob.

Schedules

Schedule Cadence What it does
A) Continuous agent tick every 30 min seo-ops sweep, then one unit: review and merge, fix a red PR, verify or revert a merge, ship one queue item, or one research task (SERP via search API, competitor watch, site audit, content refresh, internal links).
B) seo-all commands weekly, daily cluster, monthly at :15 Each prompt points at /configs/skills/seo-all/commands/<name>.md; findings become queue items.
C) Daily blog post 09:45 daily One fully sourced post opened as a PR in its own worktree, or nothing when it cannot be sourced. The tick reviews and merges it.

B and C run at :15 and :45 so they never start together with a tick.

State

All agent state lives in $MOLECULE_PLUGIN_STATE_ROOT/seo-agent/ on the persistent identity volume: STATE.md, scans, research evidence, seed keywords, log/ (what seo-ops now moved out of STATE.md) and ops/ (merge log, live checks, review records, search budget). /workspace is scratch and is wiped on restart; it holds only the website clone.

Platform Layout

Path What
config.yaml Molecule template metadata shown in the Canvas template picker.
prompts/seo-agent.md Compact launch prompt that fits the SaaS provisioning payload.
source/seo-agent-template-main/ Full private SEO agent package: scanners, skills, policies, scripts, and docs.

Source Package Layout

Path What
source/seo-agent-template-main/prompts/seo-agent.md The complete agent loop.
source/seo-agent-template-main/prompts/seo-scan-*.md Per-scanner prompts.
source/seo-agent-template-main/agent-policies/ Tenant-specific overrides layered on top of prompts.
agent-skills/seo-all/ (repo root) Canonical tenant-neutral SEO methodology, shipped as the seo-all plugin with scripts/seo-ops.py.
source/seo-agent-template-main/scripts/ Local wrapper, config validator, monitor, and Google token helper.
source/seo-agent-template-main/config/env.example.json Tenant configuration schema.

License

Proprietary. Buyers of this template receive an internal-use license; redistribution requires written permission.

S
Description
SEO Agent workspace template for Molecule AI.
Readme
564 KiB
Languages
Python 92.5%
Shell 7.5%