seed-test-env
Scaffold a fresh isolated Superagent data dir under ~/Downloads, seed agents, copy curated settings from the prod install, and print the launch command. Use when manually testing a feature against a c
Files1
View on GitHubSKILL.md.claude/skills/seed-test-env/SKILL.md
GitHubSeed Test Environment
Creates a sandbox data directory so the user can launch the Superagent dev build against a clean, populated state — without polluting their real install at ~/Library/Application Support/Superagent/.
Inputs
$ARGUMENTS — free-form. Parse it for:
- dir name (first word, optional) — defaults to
superagent-test. Used as~/Downloads/<dir-name>/. - agent specs (the rest) — comma-separated
slug:descriptionpairs to seed. If absent, seed two default agentsagent-aandagent-binstructed to use the x-agent (mcp__agents__*) tools on each other. --mode=web|electronflag — picksnpm run dev(web/Vite) ornpm run dev:electron. Defaults toelectron.
Examples:
/seed-test-env→ defaults: dirsuperagent-test, agents A+B, electron/seed-test-env xagent-test→ dir name only/seed-test-env xagent-test triager:Email triager,replier:Reply drafter→ custom agents/seed-test-env xagent-test --mode=web→ web dev server
If $ARGUMENTS is empty or ambiguous, briefly state the defaults you're using and proceed (don't ask). Confirm only if the target directory already exists with files (offer to delete-and-recreate vs abort).
Procedure
1. Locate the source settings
Source priority (settings.json):
~/Library/Application Support/Superagent-Dev/settings.json— prefer this. The dev install has hardcoded direct LLM keys (Anthropic, OpenAI, OpenRouter, etc.) instead of relying on theplatformLLM provider, which is flakey.~/Library/Application Support/Superagent/settings.json— fall back only if Superagent-Dev doesn't exist. The prod install often usesllmProvider: "platform"which depends on a flakey remote auth; tests want direct keys.~/.superagent/settings.json— last-resort fallback.
Pick the first that exists AND has a populated apiKeys.anthropicApiKey (or another working LLM key). If none have an LLM key, write the settings anyway and surface this loudly in the final summary.
2. Resolve target dir
TARGET=~/Downloads/<dir-name> (expand ~). If it already exists and contains files, prompt the user once: delete & recreate or abort. After confirmation, rm -rf and recreate.
3. Create structure
For each agent, create agents/<slug>/workspace/AGENTS.md. Write them before the first launch of the data dir: the app imports agent directories into its catalog table once, by a data migration when the database is first opened, and does not scan the directory again. An agent directory added to an already-launched data dir will not show up. Important: the AGENTS.md lives inside workspace/, NOT directly under the agent dir. The file-storage layer (src/shared/lib/utils/file-storage.ts:getAgentInstructionsPath) hard-codes that path — putting it elsewhere makes the agent invisible.
AGENTS.md uses YAML frontmatter delimited by ---. Required fields: name, createdAt (ISO string). Optional: description. Body is the agent's instructions. Mirror the format from src/shared/lib/services/agent-service.ts:createAgent. Example:
---
name: Agent A
createdAt: "2026-04-21T12:00:00.000Z"
description: Test agent A
---
You are Agent A. (instructions body)
4. Copy settings.json (curated)
Read prod settings.json and write a filtered copy to <TARGET>/settings.json.
Copy:
apiKeys(anthropicApiKey, deepgramApiKey, openaiApiKey, composioUserId — whatever is present)llmProviderand any provider-specific configmodels(agentModel, browserModel, summarizerModel)app— but stripchromeProfileId(path won't apply) and any path-bound fieldscontainer(lima/docker runner config — without this the container won't start). Always overridecontainer.agentImagetosuperagent-container:latestso the test instance uses the locally-built dev image instead of pulling the published one fromghcr.io/skillfulagents/.... That tag is whatnpm run build:containerproduces. If the user has tagged it differently, they'll tell you — otherwise default tosuperagent-container:latest.skillsets(so the test instance has the same skill catalog)platformAuthtoken block if present (so platform LLM provider keeps working)auth,voice,shareAnalytics,customEnvVarsif present
Skip:
mounts(host paths won't apply to a fresh test agent)chromeProfileId- Any session-specific or per-agent state
If a key is missing in prod, just omit it — don't invent values. If apiKeys.anthropicApiKey is missing, surface that loudly in the final summary so the user knows to add one.
5. Final output
Show:
- Tree of what you created (one
ls -Ror equivalent, terse) - Settings keys copied (just the top-level keys, not values — never echo secrets)
- Launch command — exact one-liner, e.g.:
SUPERAGENT_DATA_DIR=/Users/iddogino/Downloads/<dir-name> npm run dev:electron - Notes — anything skipped or missing (e.g. "no Anthropic key in prod settings — add one before testing").
Migrations auto-run on first launch via migrate() in src/shared/lib/db/index.ts — no separate db:migrate step needed.
Implementation notes
- Use Bash + Write tools directly, don't print the commands and stop. Actually create the files.
- Never echo full secret values back to the user — show key names only.
- The
dev:electroncommand isinstall-electron && electron-vite dev(the first part fetches the Electron binary if missing). Thedev(web) command isvite. Both honorSUPERAGENT_DATA_DIRviagetDataDir()insrc/shared/lib/config/data-dir.ts. - Don't modify the real prod data dir under any circumstances. All writes go to
~/Downloads/<dir-name>/only.
When NOT to use
- The user wants to test against their real data — they should just run the app directly.
- The user wants to write Drizzle migrations or run integration tests — those use in-memory SQLite, not a real data dir.