# THINK: discover and design

import { Steps } from "@astrojs/starlight/components"

**THINK** is how your coding agent plans a Mindflow automation before it writes anything to Mindflow. **Discover**
turns your request into a brief and picks an application folder. **Design** picks real catalog operations, proposes the
flow shape, and asks how BUILD should create the flows. Files land under `src/think/` in that folder. The plan is ready
for BUILD once you have answered the design questions.

## When to use

- You described an automation and there is no ready plan yet.
- You need to change the brief, the selected operations, or your answers to the design questions.
- Prefer [BUILD: write, compile, and save](../build-the-automation/) when the plan is already ready and you want the
  agent to write and save the flow.
- Prefer [Plan before you build](../../../../getting-started/plan-before-you-build/) when you are outlining a flow in
  Studio without a coding agent.

Before you begin, [connect your coding agent](../connect-your-coding-agent/). Do not send secrets, API keys, or live
resource ids during discover.

## Guide

### Discover the brief

Discover captures **one** automation: the outcome, the exact product names, the constraints, and where files should
live. You can answer a short interview, or let the agent assume from your request and the docs in your folder.

1. **Ask for the automation.** Describe the job in plain language. Stay in this chat until the plan is ready.
2. **Choose a path.** Pick **Interview** when the request is thin or risky, or **Generate with best assumptions** when
   you already named the outcome and products. When your request already names the outcome, the exact products, and
   any approval step, the agent skips this question.
3. **Allow extra context if you want it.** The agent may read files in the current folder. It calls other MCP servers
   you connected only after you choose **Automatic** or name the sources. **Skip** keeps it to local files.
4. **Answer material questions.** The agent prefers one question with several options over many small ones. Use
   **exact product names** (for example VirusTotal v3 and Slack, not "the ticketing tool").
5. **Confirm the recap.** Check the outcome, systems, and risks. The agent shows a summary of the product chain, as a
   diagram in agents that render one.
6. **Choose the application folder.** Pick or type the folder that will hold the project. Discover writes
   `src/think/brief.json` there, not at the workspace root.

### Design the operations and finish the plan

Design searches your organization's catalog. It does not invent connector ids, and it only reads: it may look at your
existing flows to reuse one, but it never creates, changes, or runs anything in Mindflow. The plan is ready once you
answer the setup questions (which environment to use, how credentials bind, and whether BUILD creates or updates
flows).

1. **Confirm the flow shape.** Review how many flows the agent proposes and what each one is for. Ask for a simpler
   shape when the chain is too large.
2. **Confirm catalog operations.** The agent searches the vendors and products in your catalog and shows what each
   operation needs. If a named product is missing, choose an alternate, HTTP, skip, or stop. Do not let the agent
   substitute a competitor.
3. **Review service steps vs AI··Task.** For steps that write, wait for a person, or follow a known mapping, the agent
   recommends ordinary service steps. Accept AI··Task only when the job needs judgment that a rule cannot express.
4. **Say whether everything can be tested.** Tell the agent whether every product can be called on the first test. If
   so, the agent offers to try the flow right after BUILD saves it.
5. **Pick the environment.** Choose a **real environment name** from your organization for the first build and first
   test, not an abstract label such as staging.
6. **Answer the credential and create-or-update questions.** Say how credentials should bind, and whether BUILD creates
   new flows or updates existing ones.
7. **Review the ready plan.** The agent shows the diagrams and a summary, then writes `src/think/plan.json` and
   `src/think/plan-overview.md`. There is no separate approval step: keep refining in this chat, or move on.
8. **Start BUILD in a new chat.** Open a new chat and ask the agent to continue the Mindflow build. Then follow
   [BUILD: write, compile, and save](../build-the-automation/).

## Example

A SOC analyst wants a webhook that receives an IP, looks it up in VirusTotal, and posts to Slack when the reputation is
malicious. The flow title they expect is **Triage malicious webhook IPs**.

1. **State the job.** They ask for that webhook triage automation and choose **Generate with best assumptions**.
2. **Confirm systems.** The recap keeps **VirusTotal v3** and **Slack**, not a swapped vendor.
3. **Pick the folder.** They accept `triage-malicious-webhook-ips` as the application folder.
4. **Finish design.** They accept a single flow with a VirusTotal lookup and a Slack post. They confirm both products
   can be called on the first test, pick the **Docs** environment, and create a new flow. The plan is ready, so they
   open a **new** chat for BUILD.

## Keep in mind

- Your agent's own plan mode is optional. BUILD starts only when `src/think/plan.json` is marked ready and your design
  answers are filled.
- THINK reads only. It does not create, update, deploy, or run flows in Mindflow.
- Do not ask the agent to skip design and jump to code while the plan is not ready.

## Related

[Connect your coding agent](../connect-your-coding-agent/) · [BUILD: write, compile, and save](../build-the-automation/) ·
[Plan before you build](../../../../getting-started/plan-before-you-build/)
