---
name: graphed-inc-marketing-skills
title: marketing skills
kind: skill-folder
description: 2 skills kept together in one folder, by graphed-inc.
skills: 2
updated: 2026-12-02
authored_by: graphed-inc
source_url: https://github.com/graphed-inc/marketing-skills
page: https://innernet.live/community/skills/graphed-inc/marketing-skills
---

# marketing skills

a folder of 2 skills by graphed-inc, kept on innernet at https://innernet.live/community/skills/graphed-inc/marketing-skills (source: https://github.com/graphed-inc/marketing-skills).
every skill in it is below, whole. each one starts with its own manifest: what it does, when to load it, whose it is.
you do not need all of them at once. read the index, then use the skill that fits the task in front of you. each skill also has its own link, if only one is wanted.

## the skills

1. **ai marketing agent**: Deploy AI Marketing Agent, an AI teammate that lives in the user's Slack workspace with the handle @graphed. People mention it in a channel or send it a direct message; it runs Claude Code in a private Modal sandbox through Graphed Tools with the full graphed CLI (warehouse queries, Graphed Tools such as Apollo, DataForSEO, Exa and Million Verifier, deploys), shows each step in plain English while it works, and answers in the thread with text, files and native Slack cards (key numbers, a table, charts and next-step buttons, rendered with json-render and the Chat SDK). It keeps a shared memory https://innernet.live/skills/graphed-inc-ai-marketing-agent
2. **ai search**: Deploy AI Search, a hosted AI search (GEO / AEO) app on Graphed that does the whole job, not only tracking, and that a coding agent can also drive over MCP. Finds what buyers really ask (sales calls, support tickets, Reddit, Search Console, keyword research), splits prompts by persona, budget, country, use case, plain vs jargon wording and question type (best X, X vs Y, alternatives, pricing), keeps branded prompts out of the score, and runs them on the consumer apps and the APIs (compares the two) and on coding agents. Counts mentions, recommendations, first picks and citations apart, finds q https://innernet.live/skills/graphed-inc-ai-search

---

<!-- skill 1 of 2: ai marketing agent · https://innernet.live/skills/graphed-inc-ai-marketing-agent -->

---
name: graphed-inc-ai-marketing-agent
title: ai marketing agent
kind: skill
description: >
  Deploy AI Marketing Agent, an AI teammate that lives in the user's Slack
  workspace with the handle @graphed. People mention it in a channel or send it
  a direct message; it runs Claude Code in a private Modal sandbox through
  Graphed Tools with the full graphed CLI (warehouse queries, Graphed Tools such
  as Apollo, DataForSEO, Exa and Million Verifier, deploys), shows each step in
  plain English while it works, and answers in the thread with text, files and
  native Slack cards (key numbers, a table, charts and next-step buttons,
  rendered with json-render and the Chat SDK). It keeps a shared memory
updated: 2026-12-02
authored_by: graphed-inc
author_url: https://github.com/graphed-inc
source_url: https://github.com/graphed-inc/marketing-skills/tree/main/skills/ai-marketing-agent
brought_by: kt
license: MIT
---

# AI Marketing Agent

An AI teammate the agent deploys into the user's own Graphed project and connects to their Slack workspace.
One always-on Node service (the dispatcher) gets Slack events over Socket Mode, queues each request in
Postgres, and starts **Claude Code** in a **Modal sandbox through Graphed Tools** (`modal:sandbox`). The
sandbox has the `graphed` CLI, Python and ffmpeg. The model is Claude Sonnet through the Graphed LLM proxy.
The answer and its files go back to the Slack thread.

- **Memory:** one shared memory (`~/brain/CLAUDE.md` plus notes, scripts and its own skills) in project
  object storage. The agent adds what it learns. Every thread also keeps its session and work folder, so a
  reply in the thread goes on where it stopped.
- **Cards:** when the answer is data, the agent also writes a UI spec (json-render format, Chat SDK card
  components). The app turns it into native Slack blocks: a header, key numbers, a data table, charts and
  buttons. A click on a button sends the button's label as that person's next request in the thread.
- **Status page** (Graphed login): setup checklist, runs with their steps and answers, spend by day and by
  person, the memory, the sandboxes, and a box to ask without Slack.
- **Public surface:** only the sandbox worker's callback paths, each call checked against that run's token.
  Slack connects out from the service, so there is no public Slack route.

The deeper reference (files, settings, tables, security, limits, gotchas) is `app/AGENTS.md`.

```bash
<skill-dir>/scripts/deploy.sh --account <act_…>                 # deploy or update (apps/slack-agent in the cwd)
<skill-dir>/scripts/deploy.sh --account <act_…> --agent-login   # also give the agent its Graphed login
graphed exec --project <slug> --account <act_…> -- sh -c 'node cli.mjs setup; sleep 5'   # what is still open
graphed exec --project <slug> --account <act_…> -- sh -c 'node smoke.mjs; sleep 5'       # cloud check, free
```

Find the account id with `graphed --format json accounts list`. `deploy.sh` copies `<skill-dir>/app/` to
`apps/<slug>/`, runs the offline tests, makes the project and any missing secret (as `-`), deploys, saves the
service's address, and prints the Slack link and the next steps. Re-running it updates the same project; the
database, the memory and the secrets stay. Flags: `--slug`, `--name`, `--dir`,
`--agent-login`, `--dry-run`. The Slack app is always named **Graphed** with the handle **@graphed**; there is
no option to change it, so do not ask.

## Default run

You do the setup. The person does only what Slack makes them do: approve two things and copy two tokens.
Keep them on one short list of things to do at a time, and do everything else yourself.

1. **Ask, in one message.**
   - Which Graphed account (`graphed --format json accounts list`), the company's website, and the email they
     use in Slack (for the test message at the end).
   - Who may use it: every full member of the workspace (default), or a list of people.
   - Tell them the two things under **What the user must know** below, and get a yes.
2. **Deploy:** `deploy.sh --account <act_…> --agent-login --slug <slug>`.
   The person approves the agent's Graphed login in the browser when it opens; tell them that is coming. Wait
   until the script prints the setup list (before that the page says "Cloud service not found").
3. **Make the Slack app.** The status page's setup guide has four steps, each with Slack's screen (the button
   to press marked in red), a link to the right Slack page, and the paste box. Give the person the page URL, or
   do the first part yourself:
   - **With browser tools** (Claude in Chrome, tools named `mcp__claude-in-chrome__*`; load them with
     ToolSearch to check): offer to do the Slack clicks in their Chrome and do them after their yes.
     1. Open the guide's **Create the Slack app** link (`node cli.mjs slack-link` prints it). Pick their
        workspace in the **Workspace** box at the bottom (until then **Next** is grey), press **Next**, then
        **Create**. If a welcome box shows, press **Got It**.
     2. The app's ID is now in the address (`api.slack.com/apps/<ID>/…`). Run `node cli.mjs set slack_app <ID>`
        so the guide's links open this app's own pages.
     3. On **Basic Information**: upload the icon under **Display Information** → **+ Add App Icon**
        (`file_upload` with `apps/<slug>/assets/slack-icon.png`; Slack saves it). Then **App-Level Tokens** →
        **Generate Token and Scopes**, type the name `socket`, **Add Scope** → `connections:write`.
        **Stop there. Do not press Generate, and do not open Install App.**
     4. Hand over. **Slack prints each token in plain text**: the bot token on **Install App** right after
        **Allow**, and the app-level token in the window right after **Generate**. A screenshot or page read
        of those screens puts the token in your transcript. So from here on, do not take a screenshot of,
        read or get the text of any Slack tab. The person does the rest on the guide (steps 2 to 4): **Install
        to <workspace>** → **Allow** → **Copy** → paste → **Save**, then in the tab you left open **Generate** →
        **Copy** → paste → **Connect**. The guide page itself is safe to look at (its boxes hide what is typed).
   - **Without browser tools:** open the link for them (`open "<link>"` on a Mac) and point them at the guide.
     After they create the app, ask for its ID (in the Slack address) and run `node cli.mjs set slack_app <ID>`.
     The icon is optional: **Basic Information → Display Information → + Add App Icon** with
     `apps/<slug>/assets/slack-icon.png`.
4. **The two tokens.** The person copies them; you never read a token off a screen or type one into a page.
   They either paste them into steps 3 and 4 of the setup page (it checks them, keeps them encrypted in the
   project database with the key secret `TOKEN_KEY` that `deploy.sh` made, and connects at once), or paste
   them to you in this chat. If they give them to you: save each as a project secret, then deploy again:
   ```bash
   graphed secrets set SLACK_BOT_TOKEN --value '<xoxb-…>' --project <slug> --account <act_…>
   graphed secrets set SLACK_APP_TOKEN --value '<xapp-…>' --project <slug> --account <act_…>
   <skill-dir>/scripts/deploy.sh --account <act_…> --slug <slug>
   ```
   Then check: `graphed exec --project <slug> --account <act_…> -- sh -c 'node cli.mjs slack; sleep 5'` says
   `connected`. `half connected` means only the bot token is there: the bot can send, but mentions and
   messages do not arrive until the app-level token is saved (**Connect**). Never repeat a token back, never
   write one to a file.
5. **Teach it the company:** `graphed exec … -- sh -c 'node cli.mjs memory <website>; sleep 5'` queues a run that
   reads the site and the connected Graphed data and writes the memory (about 2 minutes). Check it with
   `node cli.mjs show <run>` every 30 seconds until `status` is `done`, then show the person the summary
   (`node cli.mjs brain` prints the memory).
6. **Test it in Slack:** `graphed exec … -- sh -c 'node cli.mjs hello <their Slack email>; sleep 5'`. The bot
   sends them a direct message and answers a first question in that thread, end to end (sandbox, model,
   Slack). Check `node cli.mjs show <run>` until `done`, and tell them to look at the DM. If the email lookup
   fails (an app made before the `users:read.email` scope), use their Slack member ID instead (their profile →
   ⋮ → **Copy member ID**).
7. **Settings** they asked for: `node cli.mjs set allowed U0123,U0456`, `set guests on`.
8. **Check:** `node cli.mjs setup` shows every line `ok`, and `node smoke.mjs` passes. Ask them to invite the
   bot to one channel (`/invite @graphed`).
9. **Report** (see Done).

## What the user must know (say it before the deploy)

- **The agent acts as the person who approves its Graphed login.** That token can reach every project,
  secret and credit in the account. Anyone allowed to talk to the agent in Slack can ask it to use that
  access. In a large or mixed workspace, set an allow list.
- **It spends credits, and there is no limit.** Each request costs LLM calls plus sandbox time. A simple
  question is about 10 to 30 credits; a long research task can be a few hundred. Graphed Tools the agent runs
  (enrichment, search, video) are extra. Nothing stops spend: the app shows it (each answer's "Done" line, the
  status page, `node cli.mjs spend`), and the agent's instructions make it ask before a tool batch over about
  50 credits. The allow list is how the user limits who can spend.

## What the user sees

- **In Slack:** `@graphed <request>` in a channel, or a direct message. A status line shows what it is doing
  in plain English ("Pulling last week's ad spend"), then "Done in 40s · 6 steps · about 18 credits". The
  answer is a thread reply; files it made (CSV, PNG, PDF, MP4) are uploaded there. A data answer also gets a
  card under the reply: key numbers, one table, up to two charts, and buttons for the next step ("Break this
  down by keyword"). A click starts that request. Files attached to the
  request are given to the agent. Reply in the thread to continue. Write `stop` to cancel.
- **Status page:** the setup checklist until every step is done, every run, today's spend, the last
  7 days by day and by person, the memory, the sandboxes.

## Costs

| What | Credits (1 credit = 1¢) |
|---|---|
| The always-on service | the project's hosting, no credits per request |
| Sandbox time | about 24 per hour (2 vCPU, 4 GB); a sandbox stops after 10 idle minutes |
| A simple question (3 to 6 model calls) | about 10 to 30 |
| A long task | a few hundred; one run ends after 25 minutes at most |
| Graphed Tools the agent runs | the tool's own price |
| `smoke.mjs` | free; `--paid` about 1 |

## Rules

- **Tokens: the person copies them.** Do not read a token from a screen, and do not type or paste one into a
  web page, also when you drive their browser. Do not look at (screenshot, read, get text of) Slack's
  **Install App** page after the install, or the app-level token window after **Generate**: both show a
  token in plain text. When the person pastes tokens to you in chat, store them only
  with `graphed secrets set`; never print, repeat or write them anywhere else.
- **Ask before you click for them.** Creating the Slack app, installing it (the person's **Allow** grants it
  access to the workspace) and generating the app-level token each need the person's yes first.
- **Do the rest yourself.** Memory, settings, the Slack test and the checks are commands you run; do not hand
  them to the person.
- **Say the access and the cost before the deploy,** and get a yes.
- **There is no spend limit in the app.** Say so before the deploy. The allow list is how the user limits
  who can spend.
- **Default access is workspace members only.** Turn `guests` on, or add an outside person to `allowed`,
  only when the user names them.
- **After a secret change, deploy again** (tokens saved on the setup page need no deploy), and after a new
  agent login also stop live sandboxes (`node cli.mjs stop-sandboxes`); `deploy.sh --agent-login` does both.
- **One workspace per project.** For a second workspace deploy again with another `--slug`.
- **The memory is the user's.** Show them what you wrote before `brain-put`. `brain-reset` puts the empty
  template back and keeps the old copy.

## Limits

- 5 live Modal sandboxes per Graphed account, shared with other apps that use `modal:sandbox`.
- 3 runs at the same time, one per Slack thread; more wait in the queue. A run is 25 minutes at most.
- One card per answer: 1 table (100 rows, 20 columns), 2 charts, 10 key numbers, 5 buttons. More rows go
  in a CSV file. A card that does not pass the check, or that Slack refuses, is left out or sent as plain
  text; the written answer always arrives.
- Button clicks need "Interactivity" on in the Slack app. The manifest turns it on for a new app. For an app
  made before this, switch it on under **Interactivity & Shortcuts** (Socket Mode needs no URL).
- The agent has no web search tool of its own; it searches with Graphed Tools (Exa, Serper) and reads pages.
- The Graphed LLM proxy passes OpenAI chat completions only, so the app translates for Claude Code
  (`app/agent/shim.mjs`).
- Sandbox spend is an estimate from running time when Graphed reports no bill for the call.
- `graphed exec` can drop the output of a short command; the `sleep 5` in the commands above keeps it.

## Files

```
app/server.mjs            dispatcher: Slack events, access, queue, worker callbacks, status page API
app/lib/sandbox.mjs       Modal sandboxes through Graphed Tools
app/lib/slack.mjs         Slack Web API, Socket Mode, user lookup
app/lib/settings.mjs      settings in Postgres
app/lib/spend.mjs         credits per run and day
app/lib/storage.mjs       project object storage
app/agent/worker.mjs      runs in the sandbox: restore, Claude Code, save
app/agent/shim.mjs        Anthropic Messages <-> chat completions
app/agent/steps.mjs       plain-English step lines
app/agent/ui-spec.mjs     what a valid card is (runs in the sandbox and in the app)
app/agent/ui-check.mjs    the check the agent runs on its card before it answers
app/lib/ui.mjs            card -> Slack blocks (json-render + the Chat SDK Slack renderer)
app/handbook.md           the agent's instructions
app/brain-seed/CLAUDE.md  the empty memory template
app/slack-manifest.json   the Slack app
app/assets/slack-icon.png the Slack app icon
app/cli.mjs               terminal access
app/scripts/agent-login.sh  the agent's Graphed login
app/scripts/set-memory.sh   write the memory file
app/test.mjs              offline tests (npm test)
app/smoke.mjs             cloud check
app/AGENTS.md             the full reference
scripts/deploy.sh         copy, test, make the project and secrets, deploy, print next steps
```

## Done

Reply with the status page URL, who may use it, what you wrote
in its memory, which setup lines are `ok`, and any step still open on the user's side (Slack tokens, icon,
first message).

## About Graphed

Graphed is a marketing cloud. It includes the infrastructure for an agent to do marketing: a data warehouse, data pipelines, a Postgres database, cron jobs, runtime servers, a tool catalog, custom domains, and internal app tooling.

---

<!-- skill 2 of 2: ai search · https://innernet.live/skills/graphed-inc-ai-search -->

---
name: graphed-inc-ai-search
title: ai search
kind: skill
description: >
  Deploy AI Search, a hosted AI search (GEO / AEO) app on Graphed that does the
  whole job, not only tracking, and that a coding agent can also drive over MCP.
  Finds what buyers really ask (sales calls, support tickets, Reddit, Search
  Console, keyword research), splits prompts by persona, budget, country, use
  case, plain vs jargon wording and question type (best X, X vs Y, alternatives,
  pricing), keeps branded prompts out of the score, and runs them on the
  consumer apps and the APIs (compares the two) and on coding agents. Counts
  mentions, recommendations, first picks and citations apart, finds q
updated: 2026-12-02
authored_by: graphed-inc
author_url: https://github.com/graphed-inc
source_url: https://github.com/graphed-inc/marketing-skills/tree/main/skills/ai-search
brought_by: kt
license: MIT
---

# AI Search

The whole AI-search job in one app the agent deploys into the user's own Graphed project: research what buyers ask,
measure every engine, find what is wrong (content, off-site, technical, facts, developer docs), draft the fixes,
and recheck after they ship. One Node process serves the page,
the JSON API, an MCP server and the job worker. Postgres holds brands, prompts, every answer, cited sources,
jobs and the credit log. The app is private behind the Graphed gateway (Graphed login), except `/mcp`, which
refuses every request without a bearer token.

The deeper reference (engines, how an answer is read, metrics, schedules, MCP tools, CLI, limits) is
`app/AGENTS.md`.

```bash
<skill-dir>/scripts/deploy.sh --account <act_…> --timezone <IANA zone>   # deploy or update (apps/ai-search in the cwd)
graphed exec --project ai-search --account <act_…> -- node cli.mjs brands
graphed exec --project ai-search --account <act_…> -- node smoke.mjs   # cloud check, read-only, free
```

Find the account id with `graphed --format json accounts list`. `deploy.sh` copies `<skill-dir>/app/` to
`apps/<slug>/`, builds the page, runs the offline tests, and deploys. Re-running it updates the same project; the
data stays. Flags: `--slug`, `--name`, `--dir`, `--timezone` (for the daily job; default America/New_York, kept on
later deploys), `--secrets NAME,NAME` (optional project secrets the app may use: `GITHUB_TOKEN` for GitHub
pull requests, `INSTANTLY_API_KEY` for sending outreach, `CURSOR_API_KEY` for Cursor agent tests, `AIV_WEBHOOK_SECRET`
for signed webhooks, and test API keys for agent tests; set each first with `graphed secrets set NAME --project <slug>
--account <act_…>`, because a declared secret that is not set holds the deploy; kept on later deploys), `--dry-run`.

## Where the data comes from

| Data | Source | Cost |
|---|---|---|
| ChatGPT, Google AI Overview, Google AI Mode, Gemini, Copilot answers | cloro through Graphed Tools (logged-out web answers) | 0.18–0.23 credits per answer |
| Perplexity, Claude answers | Graphed LLM proxy (OpenRouter) with web search; cloro has no Perplexity | ≈ 0.65 / ≈ 1.6 per answer |
| Reading each answer (sentiment, other brands, fact check) | Haiku through the Graphed LLM proxy | ≈ 0.3 per answer |
| "best X for Y" keyword prompts with volume | DataForSEO Labs through Graphed Tools | ≈ 25–30 per research |
| Homepage read for setup | Serper through Graphed Tools | ≈ 0.1 |
| OpenAI API, Gemini API answers (to compare with the apps) | Graphed LLM proxy with web search | ≈ 0.9 / ≈ 0.6 per answer |
| Coding-agent answers (developer prompts only) | Graphed LLM proxy: Claude Sonnet 5.5, GPT-5.1, Gemini 2.5 Pro, no web | ≈ 1.5–2.5 per answer |
| Buyer questions from calls / tickets / chats / reviews (pasted) or Reddit | Haiku; Reddit through ScrapeCreators (Graphed Tools) | ≈ 1–4 per batch |
| Prompt variants (wording, persona, budget, use case, question type, country) | Haiku | ≈ 0.3 per prompt |
| Site + crawler check, bot logs, npm / PyPI versions | the app's own fetches | free |
| Third-party profiles, description consistency | Serper search + scrape, Haiku | ≈ 3–6 per check |
| Why their page wins | own fetch + Serper scrape, DataForSEO backlinks, Sonnet | ≈ 4 per compare |
| Trace wrong claims to their source | Serper scrape + Haiku | ≈ 0.4 per page read |
| Outreach: author email + pitch | Apollo people match, Million Verifier, Haiku | ≈ 1–3 per target |
| Drafted fix for a task | Sonnet | ≈ 3–6 per draft |
| Coding-agent install test (Claude Code, Codex or Cursor) | Modal sandbox (Graphed Tools) + the model's calls | ≈ 20–80 per run |
| What needs JavaScript (site check) | Serper scrape of 6 key pages | ≈ 0.7 per check |
| Reddit / YouTube threads read | ScrapeCreators | ≈ 0.2–0.4 per thread |
| Docs audit for agents / research ideas | Sonnet | ≈ 3 / ≈ 4 |
| Pages with old code | Serper search | ≈ 0.1 per search |
| Pages rechecked after outreach | Serper scrape + Haiku | ≈ 0.4 per page |
| Watch, alerts, conversions, publish, Instantly sync | the app's own fetches | free |
| AI-assistant sessions, key events, revenue, landing pages | GA4 in the Graphed warehouse | free |
| Google clicks, impressions, question queries, clicks per page | Search Console in the Graphed warehouse | free |

GA4 and Search Console need the user's sources connected in Graphed and synced once. Without them every other
page works and the AI traffic page says "not connected".

## Default run

1. **Ask first.**
   - The brand's domain, and 3–6 real competitors (businesses that sell the same thing to the same buyers). If
     they have none, setup suggests some; check them with the user, because a guess from the homepage can be wrong.
   - The country they sell in (default US) and their timezone, for the daily job.
   - Is GA4 / Search Console connected in Graphed? If not, say it is free data they should add.
2. **Deploy** (once per account) with `--timezone`. Give the user the URL.
3. **Set up the brand** (≈ 30 credits; say so first):
   `node cli.mjs add <domain> "<Brand name>" --competitors "Rival, rival.com; Other, other.com" [--topics "a, b"]`.
   It writes the about text and facts, picks topics, researches about 20 keyword prompts with Google volume,
   writes about 10 conversational prompts, adds buyer-style Search Console questions, and finds the GA4 property
   and Search Console site. Say what it found. Ask the user to check the facts (Settings), because the fact check
   compares every answer against them.
4. **Say the cost, then run the first check:** `node cli.mjs estimate <brandId>` (about 3.5 credits per prompt
   on the default 6 engines; 30 prompts ≈ 105 credits). On a yes: `node cli.mjs run <brandId>`. A full run takes
   from a few minutes to an hour; it keeps going in the cloud.
5. **Report.** The app URL, visibility and share of voice per engine, the prompts where competitors are named and
   the brand is not, the sites those answers cite (the outreach list), any wrong claims, and AI-assistant sessions
   from GA4.
6. **Run the free checks:** the site + crawler check (`node cli.mjs site <brandId>`) and the action plan
   (`node cli.mjs plan <brandId>`). Report the top 5 tasks.
7. **Offer, do not start:** profile check, outreach drafts, buyer questions from their calls or tickets, variants
   by country / persona, coding-agent tests (devtools only), a schedule (Settings or `node cli.mjs schedule <brandId> rotate 100`), with its cost a
   day and a month; keyword research for more prompts; a content brief for a lost prompt; an MCP token so their
   coding agent can read the results.

## What the user sees

- **Brands** (sidebar), each with: Overview · **Action plan** · Measure (Prompts · Breakdown · Competitors ·
  Citations · Sentiment + facts · API vs apps · Changes · AI traffic) · Fix (Opportunities · Outreach · Profiles ·
  Site + crawlers · Bot logs · Coding agents) · Settings.
- **Action plan**: every finding as a task with impact 0-100 (Google demand, funnel stage, how badly the prompts
  are lost, how many rivals win them; severity for technical issues). Open one → Draft the fix (Sonnet) → edit →
  Approve → Mark shipped (saves the prompts' numbers as the baseline) → Recheck (runs the same prompts, or the
  site check) → before / after. Tasks that are no longer found close themselves.
- **Prompts**: a grid of every prompt × engine (named and position / not named / no answer), Google volume,
  topic, funnel stage; click a row for the full answers with the brand and competitors highlighted. Buttons:
  Research keywords, Write prompts, Add prompts, Run now; bulk run, pause, delete.
- **Agent access**: make or revoke MCP tokens, with the `claude mcp add` line. **Credits**: spend by tool, day and brand.

## MCP

`claude mcp add --transport http ai-search <app url>/mcp --header "Authorization: Bearer <aiv_…>"`

Make the token on the Agent access page, or `node cli.mjs token "<name>"` (printed one time). 34 tools:
list_brands, create_brand, overview, prompts, answers, add_prompts, keyword_research, estimate_run, run_prompts,
citations, sentiment, opportunities, ai_traffic, action_plan, task, draft_fix, update_task, recheck_task,
start_job (site, profiles, trace, outreach_build, outreach, compare, mine, variants, dev_prompts, agent_test,
releases, reanalyze, plan, threads, outreach_check, code_sources, research_ideas, docs_audit, watch, sync_replies),
site_report, bot_logs, breakdown, open_questions, api_vs_app, changes, coding_agents, outreach_list, profiles,
send_outreach, publish_fix, conversions, alerts, get_job, credits. Reading is free. `run_prompts` stops at the
brand's daily credit limit. A long run returns a `job_id`; call `get_job` until it is done.

## Costs

| Run | Credits (1 credit = 1¢) |
|---|---|
| New brand (with keyword research) | ≈ 30 |
| Keyword research | ≈ 25–30 |
| One prompt on the 6 default engines (+ Haiku reads) | ≈ 3.5 |
| One prompt on all 7 engines (Claude on) | ≈ 5.4 |
| ChatGPT query fan-out | +2 per ChatGPT answer |
| Content brief | ≈ 3 |
| Re-read saved answers | ≈ 0.3 per answer |
| Site + crawler check, action plan, bot logs, release watch | free |
| Profile check / page compare / drafted fix | ≈ 3–6 / ≈ 4 / ≈ 3–6 |
| Outreach target (author + email + pitch) | ≈ 1–3 |
| Coding-agent install test (one model) | ≈ 20–80 |
| GA4 + Search Console, every page and MCP read | free |

Schedules: daily = the full run every day; weekly and rotate = the full run once a week (rotate spreads it over 7
days). Example: 100 prompts on 6 engines ≈ 350 credits per full run: daily ≈ $104 a month, weekly or rotate ≈ $15.

## Rules

- **Money first.** Say the cost before setup, keyword research, a run, and any schedule (per day and per month).
  Get a yes. Reading saved results is free; do not run again to read.
- **Recurring costs are opt-in.** A new brand has schedule off, Claude off and a 200-credit daily limit. Change
  them only after the user says yes.
- **Small first.** Start with 20–50 prompts. Use rotate for more than about 200: each prompt still runs once a week.
- **Competitors are businesses.** Not marketplaces, review sites or big generic sites; those belong in citations.
- **Facts matter.** Wrong facts in Settings make false "wrong claim" flags. Check them with the user.
- **Nothing goes out on its own.** Outreach is sent (Instantly) and fixes are published (webhook, GitHub PR) only
  when a person presses the button or asks the agent; ask the user before `send_outreach` or `publish_fix`. Only
  `ok` emails are sent. A GitHub fix is a pull request for review, never merged.
- **Agent tests run code from the docs.** Run them only on the user's own docs. The sandbox holds the project's
  runtime token for the model proxy.
- **Tokens are secrets.** Keep MCP tokens out of commits, logs and chat. Revoke one the user no longer needs.
- **Say which number comes from where.** Visibility comes from sampled AI answers (they change run to run);
  sessions and clicks come from GA4 and Search Console.

## Limits

- cloro has no Perplexity (its bot protection blocks logged-out sessions); Perplexity and Claude are API answers
  with web search, not the consumer apps.
- Graphed Tools returns 500 for cloro batches over about 60 tasks; the app sends batches of 50.
- cloro runs a fixed number of tasks at once per plan, shared by everyone on the account; a 1,000-prompt run took
  about 4 hours. cloro deletes task results 24 hours after creation.
- Not built: prompt volumes from real AI chat logs, ChatGPT Shopping, Bing Webmaster Tools (no Graphed source).
- The site check fetches from Graphed Cloud with each bot's user agent, not from the bots' IP ranges: a firewall
  rule that allows "verified bots" by IP can differ. Server logs (Bot logs page) show what the real bots got.
- Coding-agent tests run Claude Code, OpenAI's Codex CLI (both on the Graphed LLM proxy) or Cursor's CLI (needs the
  user's `CURSOR_API_KEY` secret). Codex's model calls go straight to the proxy, so a Codex run's credits are not
  split out per run.
- Revenue at stake uses two assumptions (25% of Google volume asked to AI, 10% of answer readers click); say so.
- Answers read before Nov 29 2026 have no recommended / first-pick data: re-read them (Settings or
  `node cli.mjs reanalyze <brandId> 30`, ≈ 0.3 per answer).
- No WebSockets at the gateway: the page polls jobs. `graphed exec` can drop the output of a short command: add
  `--out debug/x.txt` to a CLI command and `graphed storage download debug/x.txt . --project <slug>`.

## Files

```
app/server.mjs          page, JSON API, /mcp, job worker
app/lib/engines.mjs     cloro batches + sync retry, Perplexity / Claude, answer normalizing
app/lib/analyze.mjs     brand matching, Haiku read (sentiment, other brands, fact check), site types
app/lib/metrics.mjs     every dashboard number
app/lib/keywords.mjs    "best X for Y" keyword research (DataForSEO)
app/lib/warehouse.mjs   GA4 + Search Console from the warehouse, the page join
app/lib/budget.mjs      cost estimate, daily credit limit, rotate slots
app/lib/jobs.mjs        setup, run, keywords, prompts, brief, reanalyze, queue, schedules, every playbook job
app/lib/research.mjs    buyer questions (calls, tickets, Reddit), variants, profiles, why-them compare, claim trace, outreach
app/lib/site.mjs        robots.txt per bot, bot user agents (CDN blocks), no-JS text, llms.txt, pricing, sitemap, dead cited URLs
app/lib/logs.mjs        server / CDN log parsing and the log drain
app/lib/plan.mjs        action plan: tasks, impact, drafts, ship, recheck
app/lib/devtools.mjs    code checks, npm / PyPI release watch, coding-agent tests
app/lib/sandbox.mjs     Modal sandboxes through Graphed Tools
app/lib/fetch.mjs       public-only fetcher (every redirect hop checked) + HTML reading
app/lib/publish.mjs     Instantly send + reply sync, publish by webhook or GitHub PR, Slack / webhook alerts
app/lib/watch.mjs       the daily watch: model changes, moves, new brands, competitor pages, reruns
app/lib/conversions.mjs signups / demos from AI: site snippet, ingest endpoint, report
app/agent/              runner.mjs (Claude Code, Codex or Cursor in the sandbox), events.mjs (reads Codex / Cursor JSON), shim.mjs (Anthropic → Graphed LLM proxy)
app/lib/mcp.mjs         MCP server and tokens
app/lib/tools.mjs       Graphed Tools (start once, wait), LLM proxy, warehouse, credit log
app/lib/db.mjs          the app's database setup
app/ui/                 page source (run node build-ui.mjs after a change)
app/cli.mjs             terminal access
app/cron.mjs            the daily job (queues scheduled runs for the worker)
app/test.mjs            offline tests with fixtures (npm test)
app/smoke.mjs           cloud check
app/AGENTS.md           the full reference
```

## Done

Reply with the app URL, the brand id, the top 5 action-plan tasks, what setup found (competitors, topics, prompt count, GA4 property, Search
Console site), visibility and share of voice per engine, the top 5 prompts competitors win with the sites those
answers cite, the credits spent, and what you offered to set up next.

## About Graphed

Graphed is a marketing cloud. It includes the infrastructure for an agent to do marketing: a data warehouse, data pipelines, a Postgres database, cron jobs, runtime servers, a tool catalog, custom domains, and internal app tooling.
