# Brainstorm

> Use when the user wants to build, create, plan, or ship something on the grid - an app, game, tool, dashboard, agent, or product - and the idea is not yet concrete enough to build. Triggers: "build me...", "plan me...", "I have an idea", "turn this into a product", "help me think this through", or bringing an existing folder, GitHub repo, or someone else's app to the grid. Also use when a build is about to start and no CloudGrid shape (services, layout, cloudgrid.yaml) has been agreed yet. Does not replace a general-purpose brainstorming skill the user already prefers; it can run after one.

- Skill: `cloudgrid-io/brainstorm` (Agent Skill)
- Install (CLI): `npx skillmds@latest add cloudgrid-io/brainstorm`
- Raw SKILL.md: https://api.skillmd.com/api/skills/cloudgrid-io/brainstorm/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: cloudgrid-io (https://skillmd.com/u/cloudgrid-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/cloudgrid-io/brainstorm

---


# Brainstorm

The user wants to build something on the grid. Do not jump to generating or
plugging.

This skill has two phases:

- **Phase A - Align on the idea.** Swappable. If the user has another
  brainstorming skill they prefer, use theirs.
- **Phase B - Shape it for the grid.** Not swappable. Services, folder layout,
  and `cloudgrid.yaml` have to be right before anything is scaffolded, and no
  general brainstorming skill knows CloudGrid's shape.

Keep it human and short throughout. Two or three plain questions at most. Offer
options, never demand specs.

---

## Before Phase A: do not repeat discovery the user already did

If the idea is already aligned — earlier in this conversation, or through whatever
discovery the user prefers — do not run Phase A again. Pick up what they have and go
straight to Phase B.

Otherwise run Phase A below. If the user says "just build it", skip Phase A: infer the
shape and state it in two lines for a nod.

**Phase B always runs.** It is the part that shapes the idea for the grid — services,
disk layout, `cloudgrid.yaml`, `needs:` — and nothing else covers it.

Never run two discovery passes. Never ask the same question twice.

---

## Phase A - the beat

0. **Read the person (silently).** Technical or not - infer it from their words
   ("repo", "endpoint", "Next.js" vs "a page for my shop"). Match their language
   everywhere: precise terms for builders, plain words for everyone else ("your
   files", "saved entries"). Never ask "are you technical?".
1. **New or existing?** If they mention something they already have - a folder,
   a repo, a half-built site - route through "Where the project comes from"
   below instead of starting fresh.
2. **Idea in a sentence.** "So this is a `<thing>` that lets `<who>` do `<what>`
   - right?" Confirm or adjust.
3. **Who it is for and the main goal.** One line. ("For your class, to collect
   RSVPs.")
4. **Core features.** The 3-5 things it must do. Suggest a starter set and let
   them trim.
5. **Complexity read (you decide, do not ask).** Is it a single static page, an
   interactive tool, or does it need to save data / accounts / AI? Infer it from
   the features.

If the request is already clear and simple (a landing page, a poster, a quick
calculator), skip Phase A and go straight to Phase B, then build.

---

## Where the project comes from

Meet the project where it lives; never make the user restructure or re-create it.

| Situation | Command | What it means |
|---|---|---|
| Nothing exists yet | `grid new` | Scaffolds the folder layout and `cloudgrid.yaml`. **Run Phase B first** - the layout is decided here and is annoying to undo. |
| A local folder they already have | `grid plug` inside it | `cloudgrid.yaml` is written if missing; the folder becomes the linked source. |
| On GitHub | `grid wire repo` | Binds the repo to the entity for auto-plug on push. The repo stays the source of truth and the grid follows it. Detect the stack from the code; ask nothing about frameworks. |
| Their own version of someone else's app | `grid pickup` | Like a fork or a remix. Their own copy, new direction, original untouched. |
| Continue an entity they already have access to | `grid pull` | Downloads its source + `cloudgrid.yaml` and links the folder, so their next `grid plug` updates the **same** entity in place. Owner or approved collaborator only. |
| Join someone else's entity as a collaborator | `grid collab` | Requests push access to the shared entity - same origin, same URL, like being added as a committer. Not a copy and not ownership: the owner still owns and approves. |

If the entity is wired to a GitHub repo - and only bring this up when the project
actually uses GitHub - the repo stays the source of truth. To keep editing an
entity the user already owns or collaborates on, `grid pull` fetches its live
source and links the folder so the next plug updates it in place; if they only
have push access via a repo, make sure they can push to that repo so changes keep
flowing. In a `grid pickup`, their copy starts from the source as-is and they can
wire a repo of their own.

---

## Phase B - shape it for the grid

Never skip. Even after another brainstorming skill, even when the user says
"just build it". Everything here is inference plus at most **one** plain
question.

### B1. One service, or several?

This is the only question in Phase B worth asking out loud, and only when the
answer is genuinely unclear. Ask it in plain words, never as "how many services":

> "Is this one thing running, or a few pieces that run separately - like a site
> plus a bot that keeps working in the background?"

**Several services when:**

- a frontend plus a separate backend or API
- a background worker draining a queue
- anything on a schedule (a cron service)
- **more than one agent** - each agent is its own service
- one shared API that several of their apps call

**Still one service when:**

- it saves data, has logins, or uses AI - those are `needs:` lines, not services
- one app that renders its own pages and its own API routes
- a single static page

**A resource is never a service.** A database, cache, queue, or vector store is
one line under `needs:`. Splitting an app into two services because it needs
Mongo is the second most common mistake after the `path:` one below.

### B2. Layout on disk

Code lives at **`services/<service-name>/`**, one directory per service. The
directory name must match the service key in `cloudgrid.yaml` exactly.

```
my-platform/
  cloudgrid.yaml
  services/
    web/
    api/
    worker/
```

This holds for single-service apps too: the code goes in `services/web/`, not at
the project root.

To keep code somewhere else, override it explicitly with `source.path` (see B4).

### B3. `path:` is the URL mount, NOT the filesystem path

**This is the single thing agents get wrong most often.** Read it twice.

`path: /api` means "serve this service at `/api`". It says nothing about where
the files are.

```yaml
# WRONG - path is not a directory
services:
  api:
    type: node
    path: services/api

# RIGHT - path is a URL mount; the code is at services/api/ because the key is "api"
services:
  api:
    type: node
    path: /api
```

- `path: /` - mounted at the root of the app URL
- `path: /api` - mounted at `/api`
- `path: false` - **internal only, no public URL.** Use for workers, cron
  services, agents, and any service other services call but the outside world
  should not reach.

Before writing any `path:`, ask yourself: "would I type this into a browser after
the domain?" If not, it is wrong.

### B4. `source.path`, and `depends_on`

- **`source.path`** overrides where the code lives when it is not at
  `services/<key>/`. Use it for existing repos with their own layout rather than
  asking the user to move files.
- **`depends_on`** sets start order when one service must be up before another.
  Only add it when there is a real ordering requirement; it is not documentation.

### B5. Worked example - everything above in one manifest

```yaml
name: shop-tools
services:
  web:                      # code at services/web/
    type: nextjs
    path: /                 # URL mount: the app root
  api:                      # code at services/api/
    type: node
    path: /api              # URL mount: /api
    depends_on: [worker]    # worker must be up first
  worker:                   # code at services/worker/
    type: node
    path: false             # internal only, no public URL
  nightly-digest:           # code at services/nightly-digest/
    type: cron
    schedule: "0 8 * * *"
    path: false
  legacy-ui:
    type: static
    path: /old              # URL mount: /old
    source:
      path: apps/legacy-ui  # code is HERE, not at services/legacy-ui/
needs:
  database: true
```

Confirm exact field names with `grid_get_template` / `cloudgrid-yaml.md` before
writing the file. The rules above are stable; the schema is the template's job.

### B6. What the grid gives you

Once the features are clear you usually know what the app needs. CloudGrid
provisions everything from `cloudgrid.yaml` and the grid CLI: resources live
under `needs:`, and the rest are their own yaml blocks (`vault:`, `calls:`,
`agent:`, service types) or a one-line grid command - it is never only `needs:`.
`requires:` is the deprecated v1 alias of `needs:` — do not author new yaml
with it, and never set both (the validator hard-rejects the combination).
Where a resource injects an env var, read it LAZILY (never at module top level).

| The app needs to... | Declare it (yaml or CLI) | Injected env var | Typical apps and scenarios |
|---|---|---|---|
| save data / accounts / multi-user state | `needs: { database: true }` (Mongo) | `DATABASE_MONGODB_URL` | CRUD apps, signups and RSVPs, dashboards, games with saves |
| cache hot or computed data | `needs: { cache: true }` (Redis, LRU eviction) | `CACHE_REDIS_URL` | speeding up APIs, expensive queries, rendered pages |
| keep small state that must not vanish | `needs: { kv: true }` (Redis, no eviction) | `KV_REDIS_URL` | feature flags, counters, sessions, rate limits |
| run background jobs | `needs: { queue: true }` (BullMQ) | `QUEUE_REDIS_URL` | email sending, imports, image and video processing |
| push live updates | `needs: { pubsub: true }` (Redis broadcast) | `PUBSUB_REDIS_URL` | chat, notifications, multiplayer, live dashboards |
| use an LLM (chatbot, summarize, generate) | `needs: { ai: true }` (managed gateway) | call via `@cloudgrid-io/runtime` - no API key | chatbots, summarizers, content tools, agents |
| run on a schedule | a `type: cron` service (`path: false`) | - | daily digests, cleanups, scrapers, reminders |
| semantic search / embeddings | `needs: { vector: pgvector }` (template: `simple-semantic-search`) | `VECTOR_PGVECTOR_URL` | document search, RAG, recommendations |
| durable files on disk | `needs: { disk: true }` | `DISK_PATH` | uploads, SQLite, generated PDFs and images |
| use an org-wide key without seeing its value | `vault: { STRIPE_KEY: STRIPE_LIVE_KEY }` | the var you named | payments, shared org API accounts |
| per-app secrets and plain config | `grid secrets set` / `grid env set` (CLI, not yaml) | the vars you name | third-party API keys, toggles, log levels |
| its own domain | `grid domains add` (CLI) | - | anything production-facing |
| call another of your apps | `calls:` / `callers:` | - | one backend serving several apps |
| react to outside events | `connectors:` / `hooks:` / `triggers:` | - | inbound webhooks, integrations |
| be an agent, not an app | `agent:` with a `schedule:` or `trigger: webhook`, one service each | - | scheduled bots, monitors, report writers |

Never hardcode a connection string or commit a secret - the platform injects
them. Read injected vars lazily inside a getter or handler. Everything in the
table is included out of the box: if a feature seems to call for an outside
service or a local install, it does not - it is a line in `cloudgrid.yaml` or a
grid command. Never point the user at one.

### B7. Plug shape

- No `needs:` and one self-contained HTML file -> an instant static page (any
  edition).
- Any `needs:`, or multiple files, or multiple services -> a runtime app (built
  and plugged, local edition, async).

Golden path: `grid_start` -> `grid_get_template` -> fill -> `grid_plug` ->
`grid_visibility`.

---

## Pace and control

The user should feel they are steering:

- Say the plan in two or three plain lines and get a nod before touching
  anything. Include the service shape in plain words: "one site, plus a bot
  running in the background".
- Narrate each step in one line as you take it ("writing cloudgrid.yaml",
  "plugging in", "setting visibility").
- Before the first plug, tell them where everything will live: code in their
  folder or repo, config in `cloudgrid.yaml`, secrets in the vault (write-only,
  never shown), data in the grid database (browsable in the db view on their
  grid), and the app itself at its live URL, with every control - logs, data,
  visibility, sharing - on their grid.
- Checkpoints, not nagging: confirm the plan and confirm before going live; do
  not ask permission for every small step in between.

---

## Common mistakes

| Mistake | Reality |
|---|---|
| Wrote `path: services/api` | `path:` is the URL mount. The filesystem location comes from the service key, or `source.path`. |
| Gave a worker, cron, or agent a URL path | Internal services get `path: false`. |
| Put a single service's code at the project root | Even one service lives at `services/<key>/`. |
| Renamed a folder without renaming the key | Key and directory must match, or set `source.path`. |
| Split into services because the app needs a database | Resources are `needs:` lines. Not services. |
| Put two agents in one service | One agent, one service, one folder. |
| Ran `grid new` before agreeing the service shape | The layout is written at scaffold time. Phase B comes first. |
| Asked the user about frameworks, runtimes, or hosting | Infer them. State the plan in plain words. |
| Skipped Phase B because another brainstorming skill already ran | That skill does not know CloudGrid's shape. Phase B always runs. |
| Re-asked questions the user's own brainstorming skill already answered | Pick up where it left off. |
| Said "deploy" back to the user | The CloudGrid verb is *plug*. Recognize "deploy/publish/ship" when the user says it; say "plug" when you speak. |

---

## Rules

- Never ask about databases, runtimes, frameworks, or hosting. Infer them and
  state the plan in plain words ("I'll set it up so entries are saved").
- **Say "plug", not "deploy".** The CloudGrid verb is *plug*. If you ever surface
  a go-live choice, word the CloudGrid option **exactly** "Plug live via CloudGrid
  (recommended)" - a real shareable URL plus managed infrastructure - paired with
  "Local only" (runs on the user's machine). Never label it "Deploy...". You still
  *recognize* "deploy / publish / ship / make it live" when the USER says it -
  those route to a plug - but what you say back is always "plug".
- Do not over-scope. Land the smallest version that delivers the core goal; more
  services and features can be added after it is live.
- Adding a service later is cheap: a new folder under `services/`, a new block in
  `cloudgrid.yaml`, re-plug. Say so rather than over-building up front.
- End Phase A by summarizing the idea in 2-3 bullets. End Phase B by stating the
  service shape and getting a nod.

Next: the `build` skill - structure the project, plug, and return the live URL.

