# BrainGrid — Full Content --- > Full markdown of the product documentation, all published blog posts and the legal documents. See https://www.braingrid.ai/llms.txt for the curated index. --- # Billing & Credits Source: https://www.braingrid.ai/docs/billing Description: Understand BrainGrid's credit-based billing, model pricing, and BYOK options. BrainGrid uses a credit-based system that gives you control over usage. Choose your model, top up as needed, or bring your own API key. ## Plans & Pricing [#plans--pricing] BrainGrid requires a paid plan—there's no free trial. Choose monthly or yearly billing (yearly saves about two months). All plans are priced per seat. | Plan | Monthly | Yearly | Monthly credits | Projects | Users | | ----------- | --------- | --------------------- | --------------- | --------- | --------- | | Builder | $29/seat | $24/seat ($290/yr) | 5,000 | Up to 3 | 1 | | Builder Pro | $99/seat | $83/seat ($990/yr) | 20,000 | Up to 25 | Unlimited | | Team | $199/seat | $166/seat ($1,990/yr) | 50,000 | Unlimited | Unlimited | Yearly prices show the effective monthly rate; the full amount is billed once per year (shown in parentheses). Credits reset on your billing date each month. ## Credit Top-Ups [#credit-top-ups] Purchase additional credits anytime. Larger packs offer better value. | Pack | Price | Per Credit | Savings | | ------- | ----- | ---------- | ------- | | 1,000 | $10 | $0.0100 | — | | 5,000 | $45 | $0.0090 | 10% off | | 11,750 | $100 | $0.0085 | 15% off | | 50,000 | $400 | $0.0080 | 20% off | | 100,000 | $750 | $0.0075 | 25% off | Purchased credits are shared across your organization and valid for 12 months. ## Model Selection [#model-selection] Choose from a range of models and set a default for your organization. | Model | Best For | | ----------------- | ------------------------------------------------------------------------------------------- | | Gemini 3.5 Flash | Fast, affordable tasks (Google) | | Gemini 3.1 Pro | Deep reasoning (Google) | | Claude Haiku 4.5 | Fast, affordable tasks (Anthropic) | | Claude Sonnet 4.6 | Fast, capable everyday tasks like requirement breakdowns and quick edits (Anthropic) | | Claude Opus 4.7 | Most capable, with adaptive thinking for complex analysis and detailed planning (Anthropic) | ## Credit Rates [#credit-rates] How credits are consumed per token. | Model | Type | Credits/Token | | ---------------- | ------ | ------------- | | Gemini 3.5 Flash | Input | 0.0000355 | | Gemini 3.5 Flash | Output | 0.000177 | | Gemini 3.1 Pro | Input | 0.000071 | | Gemini 3.1 Pro | Output | 0.000354 | | Haiku 4.5 | Input | 0.000142 | | Haiku 4.5 | Output | 0.000708 | | Sonnet 4.6 | Input | 0.000425 | | Sonnet 4.6 | Output | 0.002125 | | Opus 4.7 | Input | 0.000708 | | Opus 4.7 | Output | 0.003542 | ## Bring Your Own Key (BYOK) [#bring-your-own-key-byok] Connect your own AI provider API key—Anthropic or Google—to pay the provider directly. BrainGrid charges a reduced platform fee in credits: 15% of the standard rate for Anthropic models (Haiku, Sonnet, Opus), and no platform fee for Gemini models. **BYOK rates per token (credits):** | Model | Type | Credits/Token | | ---------------- | ------ | ------------- | | Gemini 3.5 Flash | Input | 0 | | Gemini 3.5 Flash | Output | 0 | | Gemini 3.1 Pro | Input | 0 | | Gemini 3.1 Pro | Output | 0 | | Haiku 4.5 | Input | 0.0000213 | | Haiku 4.5 | Output | 0.0001062 | | Sonnet 4.6 | Input | 0.00006375 | | Sonnet 4.6 | Output | 0.00031875 | | Opus 4.7 | Input | 0.0001062 | | Opus 4.7 | Output | 0.0005313 | ## FAQ [#faq] You can access your epics and requirements, but you won't be able to use the agent. Monthly plan credits reset each billing cycle. Purchased top-ups are valid for 12 months. In **Settings** → **Organization**, you can set the default model for your organization. Go to **Settings** → **AI Provider API Keys** → Add your Anthropic or Google API key. You can choose to fallback to BrainGrid credits when your key gets rate limited. --- # Set up Claude Code to build locally Source: https://www.braingrid.ai/docs/claude-code Description: Build a BrainGrid requirement locally with Claude Code ## What is Claude Code? [#what-is-claude-code] Claude Code is an AI coding assistant made by Anthropic. It runs in your terminal and can read your codebase, write code, run commands, and work through tasks — all from a text-based interface. BrainGrid connects to Claude Code to give it structured instructions. Instead of describing what to build from scratch, you point Claude Code at a BrainGrid requirement and it implements the tasks automatically. ## Prerequisites [#prerequisites] Before you begin, make sure you have the following set up: * A [BrainGrid account](/docs/quickstart) — create an account at braingrid.ai * The [GitHub CLI](/docs/guides/github-cli) — installed and authenticated * The [BrainGrid CLI](/docs/cli/overview) — installed and authenticated * [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) — installed from Anthropic ## Check out and initialize your project [#check-out-and-initialize-your-project] Before Claude Code can build anything, you need to connect your code to BrainGrid. This tells BrainGrid which project you're working on and lets Claude Code find your requirements and tasks. Your GitHub repository needs to be linked to a BrainGrid project. This is how BrainGrid knows which codebase your requirements belong to. If you haven't done this yet, follow the [Create a Project](/docs/guides/create-project) guide. You'll also need the [GitHub App installed](/docs/github-installation) so BrainGrid can access your repository. Cloning downloads a copy of your code to your computer. Open your terminal — on Mac, press **Command + Space**, type **Terminal**, and press **Enter**. On Windows, press the **Windows key**, type **PowerShell**, and click **Windows PowerShell**. Then run: ```bash gh repo clone owner/repo ``` Replace `owner/repo` with your actual repository — for example, `my-company/my-app`. Move into the folder you just downloaded: ```bash cd repo ``` Replace `repo` with the name of your repository folder. This tells BrainGrid which project this folder belongs to: ```bash braingrid init ``` You'll be prompted to select your project. Once complete, a `.braingrid/project.json` file is created in your folder. This command will fail if your repository isn't connected to a BrainGrid project yet. Make sure you completed the first step. ## Install the integration [#install-the-integration] This adds BrainGrid commands to Claude Code so they can work together. Run this from your project folder: ```bash braingrid setup claude-code ``` ## Verify the integration [#verify-the-integration] Make sure everything was set up correctly: From your project folder, start Claude Code by running: ```bash claude ``` Type `/` in the Claude Code prompt. You should see a list of commands pop up, including `/build`. If you don't see `/build` in the list, close Claude Code, run `braingrid setup claude-code` again, and reopen it. ## What gets installed [#what-gets-installed] The setup command installs four components into your project: ### Slash commands [#slash-commands] Located in `.claude/commands/`, these give you quick access to BrainGrid features: | Command | Description | Example | | ------------------- | ------------------------------------------ | ------------------------------------ | | `/specify` | Create a requirement from a rough idea | `/specify Add user auth with OAuth2` | | `/save-requirement` | Save a Claude Code plan as a requirement | `/save-requirement` | | `/build` | Build a requirement — implements all tasks | `/build REQ-123` | ### BrainGrid CLI skill [#braingrid-cli-skill] Located in `.claude/skills/braingrid-cli/`, this gives Claude Code context about your project and the BrainGrid workflow so it knows how to use the commands effectively. ### Status line [#status-line] Located in `.claude/statusline.sh`, this displays your current progress at the top of Claude Code: **Example:** `BrainGrid: PROJ-3 > REQ-128 [2/5]` * **Project**: Your current BrainGrid project * **Requirement**: The requirement you're working on (detected from your branch name) * **Progress**: How many tasks are completed (2 of 5 in this example) ### CLAUDE.md content [#claudemd-content] Adds BrainGrid workflow documentation to your project's `CLAUDE.md` file, giving Claude Code background context about your commands and workflow. ## Build a requirement [#build-a-requirement] Once everything is set up, tell Claude Code which requirement to build: ```bash Claude Code /build REQ-123 ``` Replace `REQ-123` with your actual requirement ID. Claude Code creates a feature branch, reads the requirement's tasks, and implements them one by one. The status line at the top updates as each task is completed. You can also add specific instructions: ```bash Claude Code /build REQ-123 Use TypeScript for all new code. Include unit tests. ``` ## Learn more [#learn-more] Explore all available CLI commands Learn how to create requirements in BrainGrid Manage projects in the browser --- # Working with Cursor Source: https://www.braingrid.ai/docs/cursor Description: How to use BrainGrid and Cursor together The Cursor integration provides three powerful components: * **Slash Commands** - Quick commands for creating specs and breaking down work * **Always-On Rules** - Automatic BrainGrid context without manual activation * **AGENTS.md Integration** - Persistent workflow guidance throughout your Cursor session ## Installation [#installation] Install the CLI globally: ```bash npm install -g @braingrid/cli ``` Log in to your BrainGrid account: ```bash braingrid login ``` Link your project to BrainGrid: ```bash braingrid init ``` Set up slash commands, rules, and AGENTS.md: ```bash braingrid setup cursor ``` ## What Gets Installed [#what-gets-installed] The setup command installs four key components: ### Slash Commands [#slash-commands] Located in `.cursor/commands/`, these commands provide quick access to BrainGrid features: | Command | Description | Example | | ------------------- | ------------------------------------------------------------------------- | ------------------------------------ | | `/specify` | Create AI-refined requirement from vague idea | `/specify Add user auth with OAuth2` | | `/save-requirement` | Save a Cursor plan as a requirement | `/save-requirement` | | `/breakdown` | Break requirement into perfectly-prompted tasks | `/breakdown REQ-123` | | `/build` | Get complete implementation plan with all task prompts in markdown format | `/build REQ-123` | In Cursor's Agent input type `/` to see all available commands. BrainGrid commands appear alongside Cursor's built-in commands. ### Always-On Rules [#always-on-rules] Located in `.cursor/rules/braingrid.mdc`, this file teaches Cursor about BrainGrid automatically: * **No explaining needed** - Cursor already knows what BrainGrid is * **Context-aware responses** - Cursor understands PROJ-X, REQ-Y, TASK-Z references * **Workflow guidance** - Cursor suggests next steps in the BrainGrid workflow * **Better task execution** - Cursor follows BrainGrid task prompts more accurately The rules are always active (`alwaysApply: true`) - no manual activation required. ### AGENTS.md Integration [#agentsmd-integration] Located at your repository root, this file provides BrainGrid guidance: * **Automatically loaded** - No manual activation needed * **Persistent context** - Available throughout your Cursor session * **Consistent guidance** - Same BrainGrid workflow across all projects ## Typical Workflow [#typical-workflow] Here's how to use BrainGrid with Cursor: In Cursor Agent, start with a vague idea and let AI refine it: ```bash Cursor /specify Add dark mode toggle in settings with theme persistence ``` This creates a structured requirement with clear scope and acceptance criteria. Convert the requirement into AI-ready tasks: ```bash Cursor /breakdown REQ-1 ``` This generates 5-10 focused tasks with clear prompts optimized for Cursor. Create a git branch to enable auto-detection: ```bash Cursor git checkout -b feature/REQ-1-dark-mode ``` BrainGrid automatically detects `REQ-1` from your branch name. In Cursor Agent, get the complete implementation plan to start building: ```bash Cursor /build REQ-1 ``` This provides all task details in markdown format, perfect for Cursor. ## MCP Server Installation [#mcp-server-installation] Prefer native tool integration? Install BrainGrid as an MCP server: Add braingrid MCP server to Cursor See the [MCP vs CLI](#mcp-vs-cli) section below to choose the right approach, and visit the [MCP Server documentation](/docs/mcp-server/installation) for detailed installation instructions. ### MCP vs CLI [#mcp-vs-cli] #### Prefer the CLI when: [#prefer-the-cli-when] * Don't want to bloat your context with more MCP servers. * Speed matters, the CLI calls end up being faster than the MCP calls. * You need to script custom workflows. #### Prefer the MCP when: [#prefer-the-mcp-when] * When you are in an environment that does not support the CLI. * You are more comfortable with the MCPs than CLIs **Choose one or the other, not both** - MCP and CLI are alternative approaches to integrating BrainGrid with Cursor. Select the approach that best fits your workflow. ## Tips for Effective Use [#tips-for-effective-use] ### Writing Good Prompts for `/specify` [#writing-good-prompts-for-specify] Include these elements for best results: * **Problem** - What are you trying to solve? * **Context** - Why is this needed? What's the background? * **Constraints** - Any technical or business limitations? * **Users** - Who will use this feature? * **Success Criteria** - How will you know it's done? **Example:** ```bash Cursor /specify Add user authentication for our web app. We need OAuth2 support for Google and GitHub. Must work with our existing Express backend and React frontend. Users should stay logged in for 30 days. Success means users can sign up and log in without creating passwords. ``` ### Using Additional Instructions with `/build` [#using-additional-instructions-with-build] Provide specific guidance for task implementation: ```bash Cursor /build REQ-123 Use TypeScript for all new code. Follow the existing repository pattern in src/repositories/. Include unit tests for all business logic. ``` ### Git Branch Workflow [#git-branch-workflow] Name your branches with the requirement ID for automatic detection: ```bash # Good - auto-detects REQ-42 git checkout -b feature/REQ-42-stripe-integration # Also works git checkout -b fix/REQ-42-payment-bug git checkout -b REQ-42-any-description # Won't auto-detect git checkout -b add-stripe-payments ``` ## Learn More [#learn-more] Complete reference for all CLI commands Alternative tool-based integration View source code and contribute Manage projects in the browser --- # Connect your project to GitHub Source: https://www.braingrid.ai/docs/github-installation Description: Complete guide to permissions and installation of the BrainGrid GitHub App Installing the BrainGrid GitHub App requires specific permissions on your GitHub repository. This guide explains who can install the app and how to get the necessary permissions. ## Permission Requirements [#permission-requirements] You must have **Admin** or **Owner** permissions to install the BrainGrid GitHub App on a repository. ### Who Can Install GitHub Apps? [#who-can-install-github-apps]
Role Can Install? Limitations
**Organization Owner** ✅ Yes Can install on any repository in the organization
**Repository Admin** ✅ Yes* Only on repos where they have admin rights, and only if the app doesn't request org-level permissions
**Personal Repo Owner** ✅ Yes Full control over their personal repositories
**Maintainer/Write/Triage/Read** ❌ No Can request installation, but owner must approve
**Important**: Organization owners can restrict repository admins from installing GitHub Apps in their organization settings. ## Installation Steps [#installation-steps] Before starting, verify you have the necessary permissions: 1. Go to your repository on GitHub 2. Click **Settings** (if you don't see it, you don't have admin access) 3. Look for **Collaborators & teams** in the sidebar If you can't access Settings, you'll need to request admin access first. Go to the [Integrations](https://app.braingrid.ai/agent/integrations) section in the BrainGrid console. Or click **Connect GitHub** from your BrainGrid dashboard. Choose where to install: * **Personal account**: Select your username * **Organization**: Select the organization (you must be an owner or admin) If you're not an owner/admin, you'll see "Request" instead of "Install" Select which repositories BrainGrid can access: Grants access to all current and future repos Choose specific repositories from a list We recommend selecting only the repositories you plan to use with BrainGrid Carefully review the permissions BrainGrid is requesting: * **Read** access to code and metadata * **Write** access to issues and pull requests * **Read** access to actions and workflows These permissions allow BrainGrid to analyze your code and validate PRs. Click the installation button: * **Install** - If you have full permissions * **Install & Request** - If you have partial permissions * **Request** - If you need owner approval If you see "Request", the organization owner will receive a notification to approve your request ## Getting Admin Access [#getting-admin-access] If you don't have the necessary permissions, here's how to get them: ### For Organization Repositories [#for-organization-repositories] If you're an admin and need to grant access to someone: 1. Go to the repository on GitHub 2. Click **Settings** → **Collaborators & teams** 1. Click **Add people** or **Add teams** 2. Search for the user by their GitHub username 3. Select them from the dropdown 1. In the role dropdown, select **Admin** 2. Click **Add \[username] to \[repository]** The user now has admin access and can install GitHub Apps. ### For Personal Repositories [#for-personal-repositories] Personal repositories only have two roles: **Owner** (you) and **Collaborators** (write access only). Collaborators cannot have admin rights on personal repositories. If you need multiple admins, consider: 1. **Transfer to an Organization**: Move your repository to an organization where you can assign admin roles 2. **Create an Organization**: Set up a new organization for your projects ## Troubleshooting [#troubleshooting] You don't have admin access to the repository. Contact the repository admin or owner. Check if: * You selected at least one repository * Your organization has restrictions on GitHub App installations * You have a pending request waiting for approval The organization owner may have concerns about: * The permissions requested * Organization policies * Security requirements Discuss with them and share BrainGrid's security documentation. * For personal repos: Look for **Manage access** instead * For org repos: You might not have admin permissions * Some organizations hide this based on policies ## Quick Reference [#quick-reference] ### Installation URL [#installation-url] ``` https://github.com/apps/braingrid/installations/new ``` ### Required Permissions [#required-permissions] * **Minimum**: Repository Admin (with restrictions) * **Recommended**: Organization Owner (full control) ### Can't Install? [#cant-install] 1. Check your repository role 2. Request admin access if needed 3. Or ask an admin to install for you ## Next Steps [#next-steps] Once you've successfully installed the BrainGrid GitHub App: Return to the quickstart guide to analyze your repository Understand how BrainGrid works with your code ## Additional Resources [#additional-resources] * [GitHub's official guide on managing repository access](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/managing-repository-settings/managing-teams-and-people-with-access-to-your-repository) * [Understanding GitHub App permissions](https://docs.github.com/en/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app) * [Organization roles in GitHub](https://docs.github.com/en/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization) --- # Welcome to BrainGrid! Source: https://www.braingrid.ai/docs Description: Plan, specify, and build your AI coding projects. Built for AI coders beyond the initial prototype, BrainGrid helps you: * Build features without breaking things * Tackle more complex functionality with structured plans * Build a well-structured and more maintainable application * Ship faster with less bug fixing and rework ## The Workflow [#the-workflow] AI coding tools are powerful, but they struggle with vague instructions. They go off-track, miss requirements, and need constant hand-holding. BrainGrid is like an AI Tech Lead that brings clarity and structure with **a proven workflow to ship reliable software.** The workflow is simple, yet powerful: Start with a rough idea, a high level concept, or a problem to solve. Start with a rough idea Start with a rough idea Click `Refine` to refine the rough idea with AI into a detailed specification. Refine the rough idea with AI into a detailed specification Refine the rough idea with AI into a detailed specification BrainGrid asks clarifying questions to define the scope and uncover edge cases. Upon completion, the basic prompt is refined into a full technical requirement with feature requests. This can be edited manually, or work with the AI to update the requirement. Review and edit the refined solution. Once you are happy, accept the requirement. Review and edit the refined solution. Once you are happy, accept the requirement. In this example, the simple prompt has been expanded to include: * Overview * Actors * Data Model Changes * 6 Functional Requirements * API Contract * New Files * Environmental Variables * 10 Acceptance Criteria ## Overview [#overview] A scheduled weekly email report delivered every Monday at 08:00 UTC to all users with `is_admin = true` in the `profiles` table. The report summarises each non-admin user's checklist completion progress across all countries and flags any user whose most-recent activity (`updated_at` on `user_progress`) is more than 7 days old. The feature introduces: 1. A new Next.js API route (`POST /api/admin/weekly-report`) that builds and sends the report — callable by a Vercel Cron Job. 2. A Resend-powered HTML email template. 3. A new Supabase migration adding a `last_active_at` column to `profiles` (updated on every progress toggle). *** ## Actors [#actors] | Actor | Description | | ----------------- | --------------------------------------------------------------------------------- | | **Company Admin** | Any `profiles` row where `is_admin = true`. Receives the weekly email. | | **Employee** | Any `profiles` row where `is_admin = false`. Appears as a data row in the report. | | **Vercel Cron** | Infrastructure trigger that calls the report API every Monday at 08:00 UTC. | *** ## Data Model Changes [#data-model-changes] ### Migration: `005_last_active_at.sql` [#migration-005_last_active_atsql] ```sql ALTER TABLE public.profiles ADD COLUMN IF NOT EXISTS last_active_at TIMESTAMPTZ; ``` * `last_active_at` is set to `NOW()` whenever a row in `user_progress` is inserted or updated for that user (via a new trigger `set_last_active_at` on `user_progress`). * Existing rows default to `NULL` (treated as "never active" for inactivity logic). ### Trigger: `set_last_active_at` [#trigger-set_last_active_at] Fires `AFTER INSERT OR UPDATE ON public.user_progress FOR EACH ROW`. Updates `profiles.last_active_at = NOW()` for the affected `user_id`. *** ## Functional Requirements [#functional-requirements] ### FR-1 — Report Trigger [#fr-1--report-trigger] * A Vercel Cron Job defined in `vercel.json` calls `POST /api/admin/weekly-report` every Monday at 08:00 UTC. * The route is protected by a `CRON_SECRET` environment variable. Requests without the header `Authorization: Bearer ` receive `401 Unauthorized`. * The route can also be called manually by a super-admin for testing (same auth header). ### FR-2 — Employee Data Query [#fr-2--employee-data-query] The API route uses the Supabase **service-role** client (bypasses RLS) to: 1. Fetch all employees: `SELECT id, email, full_name, last_active_at FROM profiles WHERE is_admin = false ORDER BY full_name ASC`. 2. For each employee, fetch aggregate progress across all countries: ```sql SELECT COUNT(*) FILTER (WHERE completed = true) AS completed_count, COUNT(*) AS total_items FROM user_progress WHERE user_id = ``` 3. Compute `completion_percentage = ROUND(completed_count / total_items * 100)`. If `total_items = 0`, percentage is `0`. 4. Determine inactivity flag: `is_inactive = last_active_at IS NULL OR last_active_at < NOW() - INTERVAL '7 days'`. ### FR-3 — Admin Recipients [#fr-3--admin-recipients] * Fetch all admins: `SELECT email, full_name FROM profiles WHERE is_admin = true`. * Send one email per admin (individual `to:` addresses, not BCC). * If no admins exist, log a warning and return `200` with `{ sent: 0 }`. ### FR-4 — Email Content [#fr-4--email-content] The HTML email contains the following sections in order: #### 4a. Header [#4a-header] * App name: **International Concierge** * Report title: "Weekly Employee Progress Report" * Date range: "Week of \[Monday date] – \[Sunday date]" (ISO format: `DD MMM YYYY`) #### 4b. Summary Row [#4b-summary-row] A single-line summary above the table: > "\[N] employees · \[X] inactive (no activity in 7+ days)" #### 4c. Employee Progress Table [#4c-employee-progress-table] Columns: **Name**, **Email**, **Items Completed**, **Total Items**, **Completion %**, **Last Active**, **Status** * Rows are sorted: inactive employees first (alphabetically), then active employees (alphabetically). * **Last Active** cell: formatted as `DD MMM YYYY` if `last_active_at` is set; otherwise displays `—`. * **Status** cell: * Inactive (never active or >7 days): red badge label `⚠ Inactive` * Active (activity within 7 days): green badge label `✓ Active` #### 4d. Footer [#4d-footer] * Static text: "This report is sent automatically every Monday. Log in to International Concierge to view detailed progress." * Link to the admin dashboard (configured via `NEXT_PUBLIC_APP_URL` env var). ### FR-5 — Email Sending [#fr-5--email-sending] * Use **Resend** (`resend` npm package) with API key stored in `RESEND_API_KEY` env var. * `from:` address: `reports@` (stored in `REPORT_FROM_EMAIL` env var). * `subject:` `"International Concierge — Weekly Report ([DD MMM YYYY])"` * Email is HTML with a plain-text fallback. * If Resend returns an error for one admin, log the error and continue sending to remaining admins. Return a partial-success response. ### FR-6 — Edge Cases [#fr-6--edge-cases] | Scenario | Behaviour | | ------------------------------------------ | --------------------------------------------------------------------------------------- | | No employees (`is_admin = false` rows = 0) | Send email with empty table and summary "0 employees · 0 inactive" | | No admins (`is_admin = true` rows = 0) | Skip sending; API returns `{ sent: 0, reason: "no_admins" }` with HTTP 200 | | Employee has no `user_progress` rows | `completed_count = 0`, `total_items = 0`, `completion_percentage = 0`, flagged inactive | | `last_active_at` is NULL | Treated as inactive (never used the site) | | Resend API failure for one admin | Log error, continue to next admin, return `{ sent: N, errors: [...] }` | | Cron called with wrong/missing secret | Return `401 Unauthorized`, do not send any emails | *** ## API Contract [#api-contract] ### `POST /api/admin/weekly-report` [#post-apiadminweekly-report] **Request Headers:** ``` Authorization: Bearer ``` **Response — Success:** ```json { "sent": 2, "employees": 14, "inactive": 3 } ``` **Response — No admins:** ```json { "sent": 0, "reason": "no_admins" } ``` **Response — Partial failure:** ```json { "sent": 1, "errors": [{ "admin": "admin@example.com", "error": "Resend API error" }] } ``` **Response — Unauthorized:** ``` HTTP 401 { "error": "Unauthorized" } ``` *** ## New Files [#new-files] | File | Purpose | | -------------------------------------------- | ------------------------------------------------------ | | `supabase/migrations/005_last_active_at.sql` | Adds `last_active_at` column + trigger | | `src/app/api/admin/weekly-report/route.ts` | Cron-triggered report API route | | `src/lib/email/weeklyReport.ts` | HTML email template builder (returns `{ html, text }`) | | `vercel.json` | Cron schedule definition | ### `vercel.json` snippet [#verceljson-snippet] ```json { "crons": [ { "path": "/api/admin/weekly-report", "schedule": "0 8 * * 1" } ] } ``` *** ## Environment Variables [#environment-variables] | Variable | Description | | --------------------- | --------------------------------------------------------- | | `CRON_SECRET` | Shared secret for authenticating cron requests | | `RESEND_API_KEY` | Resend API key for sending emails | | `REPORT_FROM_EMAIL` | Sender address, e.g. `reports@internationalconcierge.com` | | `NEXT_PUBLIC_APP_URL` | Base URL for dashboard link in email footer | *** ## Acceptance Criteria [#acceptance-criteria] ### AC-1: Cron Authentication [#ac-1-cron-authentication] * **Given** a POST request to `/api/admin/weekly-report` without the `Authorization` header * **When** the request is processed * **Then** the API returns HTTP `401` and no emails are sent * **Given** a POST request with `Authorization: Bearer wrong-secret` * **When** the request is processed * **Then** the API returns HTTP `401` and no emails are sent * **Given** a POST request with the correct `Authorization: Bearer ` * **When** the request is processed * **Then** the API proceeds to build and send the report ### AC-2: Employee Progress Aggregation [#ac-2-employee-progress-aggregation] * **Given** employee Alice has completed 8 of 10 checklist items across all countries * **When** the report is generated * **Then** Alice's row shows `completed_count = 8`, `total_items = 10`, `completion_percentage = 80%` * **Given** employee Bob has no `user_progress` rows * **When** the report is generated * **Then** Bob's row shows `completed_count = 0`, `total_items = 0`, `completion_percentage = 0%` ### AC-3: Inactivity Flagging [#ac-3-inactivity-flagging] * **Given** employee Carol's `last_active_at` is 8 days ago * **When** the report is generated * **Then** Carol's row shows the `⚠ Inactive` status badge * **Given** employee Dave's `last_active_at` is NULL (never logged in) * **When** the report is generated * **Then** Dave's row shows the `⚠ Inactive` status badge * **Given** employee Eve's `last_active_at` is 3 days ago * **When** the report is generated * **Then** Eve's row shows the `✓ Active` status badge ### AC-4: last\_active\_at Updates [#ac-4-last_active_at-updates] * **Given** employee Frank toggles a checklist item (insert or update on `user_progress`) * **When** the database trigger fires * **Then** `profiles.last_active_at` for Frank is updated to the current timestamp ### AC-5: Email Delivery [#ac-5-email-delivery] * **Given** there are 2 admins and 5 employees * **When** the report API is called with a valid secret * **Then** 2 separate emails are sent (one per admin), each containing a table with 5 employee rows * **And** the API returns `{ "sent": 2, "employees": 5, "inactive": }` ### AC-6: Email Content [#ac-6-email-content] * **Given** the report email is generated * **When** the email is rendered * **Then** the subject line matches `"International Concierge — Weekly Report ([DD MMM YYYY])"` * **And** the header shows the correct week date range (Monday–Sunday) * **And** inactive employees appear before active employees in the table * **And** the footer contains a working link to `NEXT_PUBLIC_APP_URL/admin` ### AC-7: No Admins Edge Case [#ac-7-no-admins-edge-case] * **Given** no profiles have `is_admin = true` * **When** the report API is called * **Then** no emails are sent and the API returns `{ "sent": 0, "reason": "no_admins" }` with HTTP `200` ### AC-8: No Employees Edge Case [#ac-8-no-employees-edge-case] * **Given** all profiles have `is_admin = true` (zero employees) * **When** the report API is called * **Then** emails are sent to all admins with an empty table and summary "0 employees · 0 inactive" ### AC-9: Resend Partial Failure [#ac-9-resend-partial-failure] * **Given** there are 2 admins and Resend fails for the second admin's email * **When** the report API is called * **Then** the first admin's email is sent successfully * **And** the error for the second admin is logged * **And** the API returns `{ "sent": 1, "errors": [{ "admin": "...", "error": "..." }] }` ### AC-10: Cron Schedule [#ac-10-cron-schedule] * **Given** `vercel.json` is deployed with the cron configuration * **When** Monday 08:00 UTC arrives * **Then** Vercel automatically calls `POST /api/admin/weekly-report` with the correct `Authorization` header (configured via Vercel environment variables) Automatically build the requirement with your AI coding tool. You can feed tasks via the [MCP](/docs/mcp-server/overview), [CLI](/docs/cli/overview), or just copy paste them into your AI coding tool. ```bash Claude Code or Cursor /build REQ-8 ``` BrainGrid and your AI coding tool will build the code required to complete the requirement. Under the hood: * New GitHub branch * Tasks are created ``Install the `resend` npm package. Create a service-role Supabase client at `src/lib/supabase/service-role.ts` that uses SUPABASE_SERVICE_ROLE_KEY to bypass RLS. Document required env vars: RESEND_API_KEY, CRON_SECRET, REPORT_FROM_EMAIL, SUPABASE_SERVICE_ROLE_KEY.`` Create `src/lib/email/weeklyReport.ts` with a pure function `buildWeeklyReportHtml(employees, period)` that returns an HTML string. Must include: header with app name and report period, summary row (total employees, completions, inactive count), employee table sorted alphabetically (Name, Country, Items Completed/Total, Completion %, Last Active, Status badge), footer. Handle empty states: no employees message, no country shows "—", inactive employees get ⚠️ badge. Include inline styles only, no external CSS. Create `src/app/api/cron/weekly-report/route.ts` with POST handler that: 1 Validates Authorization Bearer CRON\_SECRET (401 if invalid) 2 Queries all non-admin employees with completion stats using service-role Supabase client 3 Queries all admins (is\_admin=true) 4 Builds HTML email using buildWeeklyReportHtml 5 Sends email to each admin via Resend 6 Returns 200 with sent, employees count. Handle edge cases: no admins (log report\_skipped), no employees (send empty-state email), Supabase failure (500), Resend partial failure (log error, continue). Implement structured logging: cron\_started, report\_sent, report\_skipped, cron\_error. Create `vercel.json` with cron configuration: path "/api/cron/weekly-report", schedule "0 8 \* \* 1" (every Monday at 08:00 UTC). * Completes the coding for the tasks. * Updates BrainGrid with the tasks shown as completed. BrainGrid UI showing tasks completed. SBrainGrid UI showing tasks completed. * Commits the code to the Github repository. Each stage adds structure, so by the time your AI starts coding, it knows exactly what to build and how to verify it's correct. ## Getting Started [#getting-started] Step by step guide to get started in minutes Start working on new or existing projects. --- # Quickstart Source: https://www.braingrid.ai/docs/quickstart Description: Turn your first idea into a working product This quickstart will cover: * [Creating an Account](#create-your-account) * [Starting to Build: Creating a Plan](#start-building) * [Specifying Requirements](#specify-requirements) * [Installing the BrainGrid CLI, and configuring your agent](#install-the-braingrid-cli) * [Building it with your favorite AI coding tool](#build-it-with-your-favorite-ai-coding-tool) ## Let's get started! [#lets-get-started]
Go to [https://app.braingrid.ai](https://braingrid.link/docs/sign-up) and create an account. Give your organization a name and pick a username. Creating your BrainGrid Account. Creating your BrainGrid Account.
Start Building with a prompt. Start Building with a prompt. Now it is time to start building. Enter a prompt that describes what you are looking to build. Note that you can connect your prompt to a GitHub repository. If you have not yet connected your GitHub account to BrainGrid, there are [detailed instructions](github-installation). Once you enter your prompt that describes your idea, the agent will start thinking and analyzing the codebase (if it exists). It can come back with some clarifying questions to help it understand the requirement better, or ask you if you are comfortable with the plan proposed. Iterate with the agent until you are happy with the plan. Examine the plan, and choose to accept it or not. Examine the plan, and choose to accept it or not. Once you accept the plan, BrainGrid will use the plan to create an EPIC user story. Several requirements are stubbed out that will be used to implement the plan. Accepted plan becomes an epic user story with requirements stubbed out. Accepted plan becomes an epic user story with requirements stubbed out.
In the right frame of BrainGrid, the proposed requirements are listed. Click "Specify" to begin building the specifications around a requirement. BrainGrid will begin building the requirement. It may ask clarifying questions to refine and enhance the requirements. Refine the rough idea with AI into a detailed specification Refine the rough idea with AI into a detailed specification Once completed, A full requirements document is created that outlines what will be built. You can ask the agent to make changes, clarify things, add or remove details (or you can edit the document manually.) Refine the rough idea with AI into a detailed specification Refine the rough idea with AI into a detailed specification We are now ready to build!
Before we can build locally, we need to install BrainGrid's Command Line Interface (CLI). In the local directory of your repository: ```bash npm install -g @braingrid/cli #install BrainGrid with NPM braingrid login #login to BrainGrid (a browser tab will open) braingrid init #initialize the BrainGrid project in your local repository. ``` If you have Claude Code or Cursor installed, you will be prompted to install the BrainGrid integration into those tools. (Claude code shown as an example): Initialize the BrainGrid CLI Need more help? Check our detailed [CLI installation guide](/docs/cli/overview).
We are now ready to begin building. If you click the "Start Building" button, you will see detailed instructions for your AI Agent: Time to Start Building - press the button! Time to Start Building - press the button!
Now you're ready to implement your tasks using your AI coding assistant! Instructions to build your requirement. Instructions to build your requirement. In your Agent, follow the instructions from BrainGrid: Build instruction in Claude. You Agent will connect with BrainGrid, read the EPIC and requirement, and begin building! Congratulations! You've completed the quickstart. Now you can start building your product with BrainGrid! ## Video Guides [#video-guides] Check out our complete [Video Guides](/docs/guides/create-project) section for detailed walkthroughs of each step in the BrainGrid workflow. --- # Security Source: https://www.braingrid.ai/docs/security Description: Security and compliance at BrainGrid At BrainGrid, we understand that our platform is integral to your software development lifecycle. We've built comprehensive security measures to protect your code, requirements, and intellectual property while providing powerful AI-driven development capabilities. BrainGrid was founded by ex-Twilio engineers experienced in building, operating, and securing large-scale cloud platforms. ## Account Security [#account-security] * **Passwordless Authentication**: BrainGrid exclusively uses secure, passwordless authentication methods * **Cloud Provider Sign-In**: Support for Google, GitHub, and Microsoft authentication * **Magic Links**: Email-based authentication with time-limited secure links * **Enterprise SSO**: BrainGrid supports Single Sign-On through WorkOS, compatible with providers like Okta, Azure AD, and Google Workspace. * **Maximum Session Length**: Sessions last up to 30 days with continued activity * **Inactivity Timeout**: Automatic logout after 7 days of inactivity for security * **Access Token Duration**: Short-lived 5-minute access tokens minimize exposure risk * **Secure Token Handling**: All tokens are cryptographically secure and regularly rotated * **2FA Support**: Time-based One-Time Password (TOTP) support for all accounts * **SSO MFA**: Inherits MFA policies from your SSO provider * **Backup Codes**: Generate one-time backup codes for account recovery * **Enforcement Options**: Organizations can require MFA for all team members * **Secure Recovery**: Email-based account recovery with time-limited tokens * **Identity Verification**: Additional verification steps for sensitive account changes * **Admin Recovery**: Organization admins can assist with team member account recovery * **Audit Trail**: All recovery attempts are logged. ## Infrastructure Security [#infrastructure-security] * **Encryption in Transit**: All data transmitted between your browser and BrainGrid servers is encrypted using TLS 1.3 * **Encryption at Rest**: All stored data, including requirements, code analysis results, and agent conversations, is encrypted. * **Secure Key Management**: Encryption keys are rotated regularly and stored separately from encrypted data * **Multi-Factor Authentication**: All BrainGrid employees are required to use MFA for accessing production systems * **Role-Based Access Control**: Strict RBAC policies ensure employees only access systems necessary for their role * **Audit Logging**: All access to production systems is logged and regularly reviewed * **Cloud Security**: Our infrastructure runs on Vercel's secure cloud platform with additional security layers * **Network Isolation**: Production systems are isolated from development and staging environments * **Regular Security Updates**: All systems receive security patches within 24 hours of release * **Continuous Monitoring**: 24/7 monitoring for security incidents and anomalies * **Incident Response**: Engineering team counts on documented incident response procedures * **Regular Security Audits**: Annual third-party security assessments and penetration testing ## Data Privacy & Intellectual Property [#data-privacy--intellectual-property] BrainGrid processes different types of data based on your usage: * **Requirements & Tasks**: Stored securely to enable AI-powered planning and breakdown * **Code Analysis**: Repository code is analyzed temporarily and deleted immediately after analysis completes - we never store your source code long-term * **Agent Conversations**: The agent's conversation history is retained for 30 days to improve context and performance * **Integration Data**: GitHub, Slack, and Linear data is processed according to strict access controls * **Active Data**: Requirements, tasks, and prompts are retained while your account is active * **Agent Conversations**: AI chat conversations are automatically deleted after 30 days. * **Deleted Data**: When you delete data, it's permanently removed from our systems within 30 days * **Backup Retention**: Encrypted backups are retained for 90 days for disaster recovery * **Analysis Results**: Code analysis results are cached for 7 days to improve performance * **Opt-in Only**: Your data is never used for AI model training without explicit consent * **Anonymization**: If you opt-in, data is fully anonymized before any model improvement use * **No Code Training**: Your proprietary code is never used for training, regardless of settings * **Your Output, Your IP**: All requirements, tasks, and documentation generated belong to you * **No Claims**: BrainGrid makes no intellectual property claims on your generated content * **Model Usage**: We use Anthropic's Claude and Opus models as well as Google's Gemini models depending on the task. * **Model Privacy**: We do not store any of your data in our models. ## Integration Security [#integration-security] * **Minimal Permissions**: We request only necessary GitHub permissions for functionality * **Token Security**: GitHub tokens are encrypted and never exposed in logs or errors * **Webhook Validation**: All GitHub webhooks are validated using secure signatures * **Repository Isolation**: Each repository's data is isolated from others * **OAuth 2.0**: Secure authentication using Slack's OAuth 2.0 flow * **Scoped Access**: We only access channels and messages you explicitly connect * **Message Privacy**: Slack messages are processed temporarily and not stored permanently * **Encrypted Storage**: Any stored Slack data is encrypted at rest * **API Key Security**: Linear API keys are encrypted using per-organization keys * **Sync Controls**: You control which Linear teams and projects sync with BrainGrid * **Data Minimization**: We only sync necessary fields for requirements and task management ## User Best Practices [#user-best-practices] * **Always Review AI Output**: While our AI agents are sophisticated, always review generated requirements and tasks * **Verify Technical Decisions**: Ensure AI-suggested implementations align with your architecture * **Test Generated Code**: Thoroughly test any code snippets or implementations suggested by AI * **Use SSO When Available**: Enable Single Sign-On through WorkOS for centralized access control * **Regular Access Reviews**: Periodically review team member access and permissions * **Remove Inactive Users**: Promptly remove access for team members who leave * **Never Share Secrets**: Don't include API keys, passwords, or secrets in requirements or prompts * **Use Environment Variables**: Reference credentials through environment variables, not directly * **Rotate Integration Keys**: Regularly rotate API keys for integrated services * **Avoid Entering Sensitive Data**: Avoid entering sensitive data into the requirements or tasks. * **Limit AI Access**: For highly sensitive projects, consider limiting AI agent access. * **Use Branch Protection**: Enable branch protection rules in GitHub for AI-generated PRs * **Require Reviews**: Always require human review for AI-generated code changes * **Limit Repository Access**: Only connect repositories that need AI assistance * **Sandbox Testing**: Test AI-generated code in isolated environments first ## Shared Responsibility Model [#shared-responsibility-model] Security at BrainGrid follows a shared responsibility model. While we secure the infrastructure and platform, you maintain control over your data and how you use our services. As a BrainGrid customer, you are responsible for: **Data & Access Management** * Determining what data to upload and process through BrainGrid * Managing user access and permissions within your organization * Reviewing and approving AI-generated requirements and code * Maintaining the security of your API keys and integration tokens **Content Security** * Ensuring no sensitive data is included in prompts or requirements * Protecting your source code and intellectual property * Validating AI outputs before implementation * Managing environment variables and secrets **Integration Management** * Configuring secure connections to GitHub, Slack, and Linear * Setting appropriate permissions for connected repositories * Managing which channels and teams have access to BrainGrid * Regularly reviewing and revoking unused integrations **Compliance & Best Practices** * Assessing whether BrainGrid meets your security requirements * Implementing proper code review processes * Training team members on secure AI usage * Monitoring your organization's activity logs We work together with you on: **Authentication & Access Control** * BrainGrid provides SSO and MFA capabilities; you configure and enforce them * We secure the authentication infrastructure; you manage user policies **Data Privacy** * BrainGrid encrypts data; you control what data is processed **Audit & Monitoring** * BrainGrid logs platform events. **Incident Response** * BrainGrid responds to platform incidents. * We notify you of breaches. BrainGrid is responsible for: **Infrastructure Security** * Securing our cloud infrastructure and servers * Maintaining network security and firewall rules * Applying security patches and updates promptly * Protecting against DDoS and other attacks **Platform Security** * Encrypting data in transit and at rest * Securing our APIs and web applications * Maintaining secure development practices * Regular security testing and audits **AI Model Security** * Protecting AI models from manipulation * Ensuring model outputs are safe and appropriate * Preventing prompt injection attacks * Maintaining model performance and reliability **Operational Security** * 24/7 monitoring of platform health * Incident detection and response * Disaster recovery and backup procedures * Maintaining compliance certifications ## Where Does My Data Live? [#where-does-my-data-live] Understanding where your data resides is crucial for compliance and security. BrainGrid uses a modern, distributed infrastructure designed for performance, reliability, and security. **PostgreSQL Database (Supabase)** * **Provider**: Supabase - SOC 2 Type II certified * **Location**: United States * **What's Stored**: Requirements, tasks, prompts, organization data, user profiles, and integration configurations * **Encryption**: All data encrypted at rest using AES-256 encryption * **Backups**: Automated daily backups retained for 90 days * **Access**: Restricted to authorized BrainGrid services only * **Compliance**: Hosted on SOC 2 compliant infrastructure **Redis Cache (Upstash)** * **Provider**: Upstash - SOC 2 Type II certified * **Purpose**: Performance optimization and real-time features * **What's Stored**: Conversation history, rate limiting data, temporary session information * **Data Lifetime**: Automatically expires based on usage patterns (typically 24-72 hours) * **Security**: All cached data is encrypted in transit * **Location**: United States * **Compliance**: Hosted on SOC 2 compliant infrastructure **Vercel Blob Storage** * **Purpose**: Storing large content that doesn't fit efficiently in databases * **What's Stored**: Prompt markdown files, requirement documentation, generated reports * **Location**: Distributed across Vercel's global edge network * **Access Control**: Secure, signed URLs with time-based expiration * **Location**: United States **Vercel Platform** * **Hosting**: Application deployed on Vercel's secure cloud infrastructure * **Geographic Distribution**: Global edge network for optimal performance * **Compliance**: SOC 2 Type II certified infrastructure * **DDoS Protection**: Built-in protection against distributed attacks **Google Cloud Platform** * **Services Used**: Cloud Tasks for asynchronous processing * **Security**: Enterprise-grade security infrastructure * **Compliance**: SOC 2, ISO 27001, and FedRAMP certified * **Data Processing**: Temporary processing with immediate deletion of source data ### Data Residency by Region [#data-residency-by-region] While BrainGrid's infrastructure is globally distributed for performance, we understand the importance of data residency for compliance: * **United States**: Primary data centers located in US regions * **European Union**: Data processing compliant with GDPR requirements * **Data Transfers**: All international data transfers use appropriate safeguards including Standard Contractual Clauses ### Third-Party Sub-processors [#third-party-sub-processors] BrainGrid uses carefully selected sub-processors to deliver our services: | Service | Purpose | Data Processed | | --------- | -------------------- | ------------------------------------------------------------- | | Anthropic | AI model provider | Requirements, prompts, conversations (not stored by provider) | | OpenAI | AI model provider | Requirements, prompts, conversations (not stored by provider) | | WorkOS | Authentication & SSO | User authentication data, organization info | | Resend | Email delivery | Transactional email content | | MaxMind | Geolocation | IP addresses for extension tracking | All sub-processors are bound by data protection agreements and are prohibited from using your data for their own purposes. ## GDPR Compliance [#gdpr-compliance] The EU General Data Protection Regulation (GDPR) governs the use of personal data in the European Union and United Kingdom. At BrainGrid, we are committed to GDPR compliance and protecting the privacy rights of all our users. Our GDPR commitments include: * Implementing appropriate technical and organizational security measures to protect personal data * Promptly notifying customers of any data breaches that may affect their personal data * Imposing similar data protection obligations on all our sub-processors and service providers * Responding to data subject rights requests including access, correction, deletion, and portability * Using EU Standard Contractual Clauses and UK Addendum for international data transfers For more information about how we handle your data, please refer to our [Privacy Policy](https://www.braingrid.ai/legal/privacy-policy) and [Data Processing Addendum](https://www.braingrid.ai/legal/dpa). ## Continuous Improvement [#continuous-improvement] Security at BrainGrid is an ongoing commitment. We continuously: * Update our security practices based on emerging threats * Enhance our AI models to better understand security implications * Expand our compliance certifications * Improve transparency through regular security updates Your trust is paramount to us, and we're committed to maintaining the highest security standards as we help accelerate your development workflow. ## Security Contact [#security-contact] If you discover a security vulnerability or have security concerns: **Email**: security \[at] our domain name. **Response Time**: Within 24 hours for critical issues We take all security reports seriously and will work with you to understand and address any concerns. --- # What is BrainGrid? AI Planning Platform for Coding Agents Source: https://www.braingrid.ai/docs/what-is-braingrid Description: BrainGrid is the AI planning platform that turns Claude Code, Cursor, and other coding agents into reliable teammates. Plan features, break down tasks, and ship faster. Built for developers by ex-Twilio engineers. The bottleneck in software development is no longer just the speed of writing code. The bottleneck has shifted to the speed of creating a reliable plan. BrainGrid is the AI-powered planning platform built to solve this new bottleneck. It's designed to provide the structure and guidance—the "babysitting plan"—that turns powerful but unreliable coding agents into predictable and effective teammates. Here's how: * **We Give the Agent a Map:** BrainGrid starts by deeply analyzing your entire codebase—its architecture, data models, and dependencies. It provides the persistent context that agents desperately need but currently lack. * **We Help You Define the Destination:** Our requirements agent acts like a seasoned tech lead, asking you and your team clarifying questions to transform a high-level idea into a detailed, code-aware specification. No more ambiguity. * **We Chart the Course, Step-by-Step:** BrainGrid breaks the final requirement down into a series of atomic, verifiable, AI-ready tasks. Each task is a hyper-specific prompt, rich with context and constraints, designed to keep the agent on track and dramatically increase the likelihood of a successful, one-shot execution. The goal is to get you back to focusing on the hard problems, trusting that the execution of well-defined work is being handled reliably. It's time to trade the babysitting tax for real velocity. Ready to try it? [Get started](https://www.braingrid.ai) and let's build the toolchain for reliable agentic development. --- # 2025 Changelog Source: https://www.braingrid.ai/docs/changelog/2025 Description: Product updates and improvements ## New Features [#new-features] ** The Agent is now branch-aware** - The agent's search, read, and list files tools now respect the selected GitHub branch. No more accidentally reading from main when you're working on a feature branch. *** ** Smart codebase context** - The agent starts with just the codebase summary (\~80% smaller initial context) and fetches Directory Structure, Data Model, Architecture, and Key Workflows on demand. Prevents context overflow on large codebases. *** ** CLI: Create branches** - `braingrid requirement create-branch` creates git branches via GitHub API. Auto-generates branch names in the format `{username}/REQ-123-slugified-name`. No need to manually format branch names. ```bash braingrid requirement create-branch ``` *** ** CLI: Specify tasks** - `braingrid task specify "Add error handling"` creates a single task using AI. Works on requirements that already have tasks. Context-aware: understands existing task dependencies. ```bash braingrid task specify "Add error handling" ``` *** ** CLI: Review PRs** - `braingrid requirement review` streams AI-powered acceptance reviews. Auto-detects PR from current branch. Falls back to interactive prompt if no PR found. ```bash braingrid requirement review ``` *** ## Improvements [#improvements] * **Circular context indicator** - New circular indicator replaces horizontal progress bar. Hover shows token breakdown by category. * **CLI: Task auto-detection** - `task show` and `task update` work without task ID. Uses first in-progress or planned task. * **CLI: Claude Code status line shows current task** - Status line now shows: `PROJ-X > REQ-Y > TASK-Z [completed/total]` with git branch. * **CLI: Update notifications** - Warns when newer version available with interactive update prompt. * **CLI: Shell tab completion** - Run `braingrid completion --setup` for bash/zsh autocomplete. * **CLI: Requirement auto-detection for tasks** - Task commands detect requirement from branch name (e.g., `feature/REQ-123-something`). * **CLI: Format options** - `--format json|xml|markdown|table` for `requirement show` and `task show`. *** ## Fixes [#fixes] * **Filter documents by branch** - Analysis documents now filter correctly by branch. * **Repository renamed handling** - When you rename a repo on GitHub, BrainGrid updates automatically. * **Editor overflow** - Fixed content overflow in requirement editor. * **Cleaner requirement UI** - Removed metadata clutter and moved title to header. *** ## New Features [#new-features-1] ** Message actions & feedback** - Take control of your conversations with the agent: * **Copy** any message to clipboard with one click * **Edit** any of your messages (not just the most recent) * **Delete** user messages to continue the conversation from that point * **Rate responses** with thumbs up/down for better feedback Agent message actions appear on the last message in each group, keeping the interface clean while giving you control when you need it. Useful when: * You want to go back to a previous point in the conversation. You can delete the message and start over from there. Message actions screenshot * You want to tweak a message you sent earlier. Message actions screenshot You can edit the message and start over from there. Message actions screenshot *** ** Connect repository to existing projects** - Link a GitHub repository to projects you've already created. Previously, you had to delete and recreate a project to add repo integration. Now: * Go to project settings to connect a repository * Automatic code analysis starts when you connect * Repository becomes read-only once linked (prevents accidental changes) *** ## Improvements [#improvements-1] * **Type while agent streams** - The input box stays enabled while the agent is thinking or streaming a response. Compose your next message while waiting instead of watching the agent work. * **MCP tool improvements** - Added task deletion tool and git branch creation tool to the MCP server. The server now requires `project_id` explicitly for better clarity in server mode deployments. * **Smarter task dependency validation** - Circular dependencies are now detected before saving, and cancelled tasks no longer incorrectly block other tasks from being updated. *** ## Fixes [#fixes-1] * **Race condition in requirement updates** - Fixed 500 errors when a requirement was deleted while being updated. Now returns a proper 404 with a helpful message. * **Consistent error responses** - Fixed cases where missing requirements returned 500 instead of 404, making it easier to understand what went wrong. * **CLI skill installation** - Fixed issue where Claude Code skills were installed to a nested directory instead of the correct flat structure. * **CLI organization ID** - Fixed issue where `.braingrid/project.json` stored "default" instead of the actual organization UUID, which could cause authentication issues. *** ## New Features [#new-features-2] **GitHub branch-aware code reading** - The agent can now read code from any branch, not just main: * Read files from specific branches, tags, or commits * Compare implementations across releases * Reference code from feature branches * Example: "Show me auth.ts from the feature/auth-improvements branch" *** ## Improvements [#improvements-2] * **Better Accept/Reject UI for accepting edits** - Improved bottom bar in the agent UI, making it easier to accept or reject edits. * **Branch selector in workflows** - Added branch selector to the new requirement workflows to easily provide the right branch as context. *** ## Fixes [#fixes-2] * **Task update errors** - Fixed 500 errors when updating tasks in unfunded organizations - now returns proper 402 payment required status. * **GitHub avatar display** - Fixed GitHub avatar in integrations page. *** ## New Features [#new-features-3] **AI Implementation plan review** - The "Review implementation plan" action now appears when tasks exist. This review takes a second look at the tasks and makes sure: * Tasks fully cover the requirement * Tasks are complete and ready to be implemented * Implementation is architecturally sound. Review Implementation plan action *** ## Improvements [#improvements-3] * **Streaming AI responses** - The thinking tool now streams responses in real-time. Watch the agent's reasoning unfold as it happens instead of waiting for the complete response. *** ## Fixes [#fixes-3] * **Invite links in Apple Mail** - Fixed critical bug where Apple Mail was breaking invite links. * **MCP dependency validation** - When task dependencies block completion, you now get helpful error messages instead of cryptic 500 errors. Shows exactly which tasks need completion first with proper HTTP 409 Conflict status and clear resolution steps. * **Repository dropdown display** - Fixed visual issues with repository selection, making repository names clearer and selection smoother. *** ## New Features [#new-features-4] ** AI Feature & Bug Fix Recommendations** - You now get AI-powered recommendations on what to build next. BrainGrid will recommend features, bug fixes, ideas, and deep dives to learn about your codebase, including: * "Did you know" insights about your codebase * Features mapped to customer value * Bug fixes affecting the user experience * Ideas to brainstorm and explore AI Feature & Bug Fix Recommendations in project cards *** ** Complete build workflow guide** - New Build tab provides an 8-step development flow from setup through deployment: * Step-by-step instructions for opening AI agents (Claude Code, Cursor, etc.) * Git commands with copy buttons for branching, committing, and pushing * BrainGrid MCP integration guidance with official documentation links * Dynamic content using your actual requirement IDs, titles, and branch names * Acceptance criteria validation and deployment checklists * Works for both technical and non-technical team members *** ## Improvements [#improvements-4] * **Smarter idea agent** - Idea agent now suggests the simplest implementation first, to prevent over-engineering. Emphasizes code reuse and progressive complexity - build the MVP, then add features when needed. *** ## Fixes [#fixes-4] * **Better analysis status visibility** - Fixed color contrast issues in analysis status indicators for better readability in both light and dark modes. Status colors now use semantic design tokens that adapt to your theme. *** ## New Features [#new-features-5] ** Ideas workflow** - Not every requirement is ready to build immediately. The new Ideas status and dedicated Ideas tab give you a space to capture possibilities before committing to development: * Collect feature concepts and user requests as Ideas * Validate the technical feasibility of the idea * Refine and discuss them before they hit your backlog * Move to Backlog when ready to build * Keep your active backlog focused on ready-to-build work Ideas screenshot → Click on a [Project](https://braingrid.link/app), then go to the "Ideas" tab to create your first idea. *** ** Requirement mentions** - Reference specific requirements using `@` syntax to bring another requirement into context: * Type `@` followed by requirement ID or name in agent chat * Useful when breaking down large features into smaller requirements * Useful when a new requirement depends on another one that is not yet built Mentions screenshot → Click on a [Project](https://braingrid.link/app), create a new requirement, and use the `@` syntax to mention another requirement. *** ** Project deletion** - Clean up old projects or remove test data safely: * Organization owners can delete projects from settings * GitHub-style "Danger Zone" shows exactly what will be deleted * Preview includes requirements, tasks, and other project data * Must type project name to confirm deletion * Prevents accidental deletions while giving you control *** ## Improvements [#improvements-5] ** Automatic code analysis** - Creating a new project with a repository? Code analysis now starts automatically in the background. Within a few minutes, you'll have architecture summaries, directory structures, and other analysis documents available without manually triggering the analysis. This saves a step and ensures your project documentation is ready when you need it. *** ## New Features [#new-features-6] ** Projects** - Requirements now automatically organize into projects based on your repositories: * Each repository gets its own project with sequential IDs (PROJ-1, PROJ-2, etc.) * Easy to identify work by codebase at a glance * Requirements without a repo link go to your organization's default project * Project pages show only relevant requirements for that repository * No more manual filtering or searching through unrelated work Projects screenshot → Create your first [Project](https://braingrid.link/app). *** ** Bulk operations** - Select multiple requirements and update them together instead of one-by-one: * Change status of 10 items from "Planned" to "In Progress" at once * Assign a batch of requirements to the same person * Move a group to a different project * Update tags or other properties across multiple items * Smart confirmation dialogs show exactly what's changing before you commit *** ## New Features [#new-features-7] ** GitHub code search** - Large codebases often have similar patterns implemented multiple times. The agent can now search across your GitHub repositories to find existing implementations, helping you maintain consistency and avoid reinventing solutions. Need to see how authentication is handled elsewhere? Search for "auth token" to find all the relevant code. Includes language filtering so you can narrow results to Python when working on Python features. The search respects GitHub's rate limits with smart retry logic. *** ** Branch-specific file reading** - Sometimes you need to see how code worked in a previous release, or compare implementations across branches. The agent's GitHub file tools now accept a `ref` parameter, letting you read files from any branch, tag, or commit - not just the default branch. Want to see how authentication worked in release v1.2? Just specify the tag. This works with both authenticated repositories and public repos you have access to. *** ## Improvements [#improvements-6] ** 400k context window** - The context window is now 400k tokens, up from 200k. Think of the context window like the agent's working memory - it's how much information it can consider at once. Doubling this means the agent can handle much larger codebases and longer conversations without losing track of earlier context. You'll especially notice this when working with monorepos or having extended back-and-forth discussions about complex requirements. The agent maintains full awareness of your entire conversation history and codebase structure. *** ## Improvements [#improvements-7] ** Precise requirement editing** - The agent can now make surgical edits to your requirements with the new `update_requirement` tool. Instead of rewriting entire documents, it makes targeted line-by-line changes and shows exactly what changed: "Successfully made 3 changes" or "No changes made." *** ** Cleaner question flow** - When the agent generates clarifying questions, it now stops right there instead of continuing. Makes the conversation feel more natural when gathering requirements. *** ## New Features [#new-features-8] ** AI-powered PR acceptance reviews** - An easy way to know if the agent is done. The new [MCP tool](https://docs.braingrid.ai/mcp-server/usage#acceptance-review-on-a-pull-request) validates pull requests against a requirement's acceptance criteria to know if it is done done. AI-powered PR acceptance reviews screenshot *** ## New Features [#new-features-9] ** Smart file summarization** - BrainGrid now intelligently summarizes the files it reads. It is great to learn what a specific file does and what are the key parts and integration points. Just click the "Show more" any time the agent reads a file. Smart file summarization screenshot *** ** Massive performance boost for code analysis** - We spent a week making analysis 10x faster. *** ## Improvements [#improvements-8] ** Repository dropdown that makes sense** - Full repo names visible (`owner/repo`) for easier repository identification. *** ## New Features [#new-features-10] ** Multiple GitHub organizations** - Connect up to 5 GitHub orgs to one BrainGrid account. *** ** Redesigned feedback page** - New streamlined feedback form for easier submission. *** ** Dedicated Agent integrations page** - All your integrations now live in their own space. Less clutter, more focus. *** ## Improvements [#improvements-9] ** Tool error recovery** - Tools that fail now gracefully recover and retry automatically. *** ## New Features [#new-features-11] ** Requirement validation tool** - New MCP tool validates requirements against their acceptance criteria. Catch issues before they become problems. *** ## Improvements [#improvements-10] ** Instant tool feedback** - Agent tool cards now appear immediately instead of after processing. *** ** Web page caching** - Repeated webpage reads are now cached for 10x faster performance. *** ## New Features [#new-features-12] ** Web search** - BrainGrid can now search the internet for current information. Documentation moved? API changed? No problem - we'll find the latest. *** ** Read any webpage** - Give BrainGrid a URL and it extracts the content, understands it, and uses it in your requirements. *** ## Improvements [#improvements-11] ** Workflow-aware requirements** - BrainGrid now understands whether you are creating requirements from scratch, refining an existing requirements doc, or breaking an existing requirement into tasks. *** ## New Features [#new-features-13] ** Image support** - You can now share screenshots, designs, and diagrams with the BrainGrid agent for more visual collaboration. *** ** Refine existing PRDs** - Upload your existing PRDs in markdown format to enhance them and get them AI-ready before you start building. *** ** Smart context compaction** - Long conversations with large repos now use intelligent context management, so the agent maintains performance without running out of context window. *** ## Improvements [#improvements-12] ** Faster code analysis** - Code analysis now runs 2-5x faster, making a huge difference for large repositories. Your feedback helped us optimize this! *** ** Reasoning agent** - BrainGrid now shows its "thinking" process, making it more transparent and capable of handling complex planning and specification challenges. --- # 2026 Changelog Source: https://www.braingrid.ai/docs/changelog/2026 Description: Product updates and improvements ## The docs moved to braingrid.ai/docs [#the-docs-moved-to-braingridaidocs] Same guides, same changelog, now on the main site with full-text search, a dark mode, and mobile navigation that works. Old `docs.braingrid.ai` links redirect to their new home. The one exception is the API reference, which is temporarily unavailable while we rebuild it — those URLs redirect to the CLI overview for now. Every page also has a plain-markdown twin at `.md` — try [/docs/quickstart.md](/docs/quickstart.md) — so Claude Code, Cursor, and any other agent can read the docs directly. ** New Build experience** — Coding agents can now build entire requirements, so we replaced the Tasks tab with a new Build workflow. Choose your agent (Claude Code, Cursor, MCP, or copy-paste), paste one command, and go. Agents create tasks in BrainGrid as they work — serving as a record of what happened so you can resume builds without losing progress. Build and Plan tabs are now bookmarkable via `?tab=build` and `?tab=plan`. Build tab with agent picker showing four options [Try the Build tab →](https://app.braingrid.ai?utm_source=changelog\&utm_medium=content\&utm_campaign=build_tab) *** ## New Features [#new-features] ** Base Branch Setting** - Configure which branch new requirement branches are based on. Set it once in Project Settings → Advanced, and every new branch starts from the right place. The setting shows your repository's default branch automatically when no custom branch has been saved. *** ## Improvements [#improvements] * **Cleaner credit display** - Organization and total credit balances now show a single number (e.g., "99,018") instead of a redundant fraction ("99,018 / 99,018"). *** ## Fixes [#fixes] * **Completed requirement badge** - Requirements already marked as completed no longer show a misleading "In Review" pill in the build tab. * **Agent input overflow** - Long repository names in the agent pane are now truncated with ellipsis instead of breaking the layout when resizing. * **Branch creation conflicts** - Creating a branch that already exists now returns a clear 409 conflict instead of a 500 server error. ## Designs [#designs] Create visual designs from a prompt, tied to your requirements. See what you are building before you build it. BrainGrid Designs showing desktop and mobile view boards [Try Designs →](https://app.braingrid.ai/designs?utm_source=changelog\&utm_medium=content\&utm_campaign=designs) · [Read the blog post →](https://www.braingrid.ai/blog/introducing-designs) *** ** Desktop and Mobile Views** - Switch between desktop and mobile boards to see your designs at every screen size before writing code. Desktop and mobile view boards side by side *** ** Chat-Based Iteration** - Talk to the design agent to iterate on your designs. Try different directions, refine layouts, and get it right through conversation. Chatting with the design agent to refine a design *** ** Annotations** - Select parts of the design you want to change. Draw annotations and highlight elements — the agent sees exactly what you mean. Annotating a design to select areas for changes *** ** Element Selection** - Pick individual components from your design and send them to the agent for precise, targeted changes. Selecting an element from a design for targeted changes ## AI Product Planner Agent [#ai-product-planner-agent] Structure your ideas before you build. Turn scattered thinking into organized epics and requirements that AI coding tools can execute reliably. AI Product Planner unified view with epics and requirements [Try AI Product Planner →](https://app.braingrid.ai/projects/new?utm_source=changelog\&utm_medium=content\&utm_campaign=ai_product_planner) *** ** AI-Guided Specification** - A planning agent asks clarifying questions to refine vague ideas into buildable requirements. Covers scope, edge cases, constraints, and acceptance criteria. AI-guided clarifying questions during specification *** ** Readiness Scoring** - Each requirement receives an AI-evaluated score from 1 to 5. Know what is ready to build and what still needs work before handing off to your coding agent. Readiness scoring showing 3/5 improving to 5/5 *** ** Dependency Management** - See what is blocked and what is blocking it. AI Product Planner sets dependencies automatically so you build in the right order. *** ** Coding Agent Handoff** - Send structured tasks to Claude Code, Cursor, or your favorite coding agent via MCP, CLI, or copy-paste. Each task includes all the context needed to build it correctly. Task list with Claude Code building a requirement ## New Features [#new-features-1] ** File Attachments in Planning** - Upload files directly in the Product Planning Agent chat. Share mockups, specs, or reference documents so the agent has full context when refining your requirements. ** Feature Requests** - Submit product ideas, vote on others' requests, and track what the community wants. Feature request titles are auto-generated from your description, and you get a confirmation email when you submit. ** Change Repository in Settings** - Switch which GitHub repository is linked to your project directly from Project Settings — no need to recreate the project. ** Sonnet 4.6** - The default AI model has been upgraded from Claude Sonnet 4.5 to Sonnet 4.6 across the entire platform — planning, specification, and all agent conversations. ** Cost Tier Badges** - Model selection cards now show relative cost indicators (`$` through `$$$$$`) next to each model name, so you can see the trade-off between capability and cost at a glance. ** Epics API (v1)** - Full CRUD for epics under the `/v1/projects` scope. Requirement and epic API responses now include a `url` field linking directly to the resource in the app. ** CLI: Parallel Build Mode** - The `/build` command can now spawn agent teams for concurrent task implementation. Multiple tasks build simultaneously instead of one at a time. ** CLI: Frontend Design & UX Skills** - Two new skills ship with `braingrid setup claude-code`: a frontend design skill with design system references (color, typography, spacing, accessibility) and a UX skill covering patterns for forms, navigation, search, feedback, and more. ## Improvements [#improvements-1] * **Smarter context recovery** - When you hit the context limit, the "start a new chat" banner now preserves your requirement and artifact context instead of starting a blank conversation. * **Value-first requirement ordering** - The planning agent now bundles infrastructure (auth, payments, notifications) into single requirements and prioritizes user-facing features in execution order. * **Improved onboarding** - Requirement descriptions are more concise, wireframes appear before user stories, and the editor auto-accepts content instead of showing an empty diff view. * **Instant credit allocation** - Credits are allocated immediately when you upgrade your plan, instead of waiting for the next billing cycle. * **Codebase summaries include file paths** - Generated codebase summaries now serve as a navigable index with key file paths per section, not just descriptions. * **CLI: SSH URL support** - `.braingrid/project.json` now accepts SSH git remote URLs (`git@github.com:...`), not just HTTPS. *** ## Fixes [#fixes-1] * **Git branch creation for OAuth-only users** - Creating branches no longer fails with a 500 error for users who connected via personal OAuth instead of the GitHub App. * **Requirement creation deadlock** - Concurrent requirement creation across different projects no longer causes database deadlocks. * **Billing page for trial users** - The upgrade button now shows correctly on the billing page for users on the trial plan. * **BYOK rate limit handling** - Mid-stream rate limits from bring-your-own-key API providers are now caught and surfaced with a clear error message. * **Archived account credit balance** - Archived user accounts no longer inflate organization credit totals, preventing phantom balances. ## New Features [#new-features-2] ** Personal GitHub OAuth** - Connect your personal GitHub account without installing the GitHub App. BrainGrid tries your personal connection first, then your org's GitHub App, then public access—so you always get the best available access. Perfect for personal repos or orgs where you can't install apps. Find it in Settings → Integrations → Connect GitHub Account. Personal GitHub OAuth in Settings showing connected account with hybrid authentication *** ** Epic hierarchy** - Organize requirements into epics with parent-child relationships: * Group related requirements under an epic * Add dependencies between requirements (Requirement A blocks Requirement B) * View execution order—BrainGrid automatically determines the right order based on dependencies * Status gates prevent starting blocked requirements until dependencies complete * Max 20 dependencies per requirement, with warnings if requirements would block each other in a loop Epic hierarchy showing parent epic with child requirements in the Plan view *** ** Requirements filter bar** - Find requirements faster with new filter dropdowns: * Filter by status (Planned, In Progress, Review, etc.) * Filter by assignee * Filter by tags * Search by title or description * Filters persist in URL—bookmark filtered views or share with teammates Requirements filter bar with Status, Assignee, Tags dropdowns and search *** ** Clarifying questions redesign** - The survey experience got a major upgrade: * Click any option label to add inline clarifications * Agent messages now display formatted text properly (headings, tables, code, and quotes) * Auto-scrolls to bottom when the agent starts thinking * Cleaner checkbox and multiple-choice styling --- # Command Reference Source: https://www.braingrid.ai/docs/cli/commands Description: Complete reference for all BrainGrid CLI commands ## Authentication Commands [#authentication-commands] ### login [#login] Authenticate with your BrainGrid account using OAuth2. ```bash braingrid login ``` Opens your browser for authentication. Once complete, your credentials are stored locally. ### whoami [#whoami] Display information about the currently authenticated user. ```bash braingrid whoami ``` Shows your username, email, and account details. ### logout [#logout] Sign out from your BrainGrid account. ```bash braingrid logout ``` Removes stored authentication credentials from your local machine. ## Initialization Commands [#initialization-commands] ### init [#init] Initialize a BrainGrid project in the current directory. ```bash # Interactive wizard braingrid init # Specify project directly braingrid init --project PROJ-123 # Skip confirmation prompts braingrid init --force ``` Creates a `.braingrid/project.json` file linking your local directory to a BrainGrid project. **Options:** * `--project ` - Specify the project ID to link * `--force` - Skip confirmation prompts ## Project Commands [#project-commands] ### project list [#project-list] List all accessible projects. ```bash # Default table format braingrid project list # JSON format with pagination braingrid project list --format json --page 1 --limit 20 ``` **Options:** * `--format ` - Output format: `table`, `json`, `xml`, `markdown` * `--page ` - Page number for pagination (default: 1) * `--limit ` - Results per page (default: 20) ### project show [#project-show] Display details for a specific project. ```bash # Show initialized project braingrid project show # Show specific project by ID braingrid project show PROJ-123 # Show project by repository braingrid project show --repository "owner/repo" ``` **Options:** * `--repository ` - GitHub repository in format "owner/name" ### project create [#project-create] Create a new project. ```bash braingrid project create --name "My Project" \ --description "Project description" \ --repository "owner/repo-name" ``` **Options:** * `--name ` - Project name (required) * `--description ` - Project description (optional) * `--repository ` - GitHub repository (optional) ### project update [#project-update] Update an existing project. ```bash # Update project name braingrid project update PROJ-123 --name "New Name" # Update description braingrid project update PROJ-123 --description "Updated description" ``` **Options:** * `--name ` - New project name * `--description ` - New project description ### project delete [#project-delete] Delete a project. ```bash # With confirmation prompt braingrid project delete PROJ-123 # Skip confirmation braingrid project delete PROJ-123 --force ``` **Options:** * `--force` - Skip confirmation prompt Deleting a project also deletes all associated requirements and tasks. This action cannot be undone. ## Requirement Commands [#requirement-commands] ### specify [#specify] Create an AI-refined requirement from a natural language prompt. ```bash # Create requirement in current project braingrid specify --prompt "Add user authentication with OAuth2" # Create in specific project braingrid specify -p PROJ-123 --prompt "Implement dark mode toggle" # JSON output for scripting braingrid specify --prompt "Add email notifications" --format json ``` **Options:** * `-p, --project ` - Target project (defaults to initialized project) * `--prompt ` - Natural language description (required) * `--format ` - Output format: `table`, `json`, `xml`, `markdown` The `specify` command uses AI to refine your prompt into a structured requirement with clear scope, acceptance criteria, and technical considerations. ### requirement list [#requirement-list] List all requirements in a project. ```bash # List all requirements braingrid requirement list # Filter by status braingrid requirement list --status IN_PROGRESS # JSON format braingrid requirement list --format json ``` **Options:** * `--status ` - Filter by status: `IDEA`, `PLANNED`, `IN_PROGRESS`, `REVIEW`, `COMPLETED`, `CANCELLED` * `--format ` - Output format: `table`, `json`, `xml`, `markdown` ### requirement show [#requirement-show] Display details for a specific requirement. ```bash # Auto-detect from git branch (e.g., feature/REQ-123-auth) braingrid requirement show # Show specific requirement braingrid requirement show REQ-123 # JSON format for scripting braingrid requirement show REQ-123 --format json ``` **Options:** * `--format ` - Output format: `table`, `json`, `xml`, `markdown` ### requirement create [#requirement-create] Manually create a requirement without AI refinement. ```bash braingrid requirement create --name "Implement feature X" \ --content "Detailed description here" ``` **Options:** * `--name ` - Requirement name (required) * `--content ` - Detailed description (optional) ### requirement update [#requirement-update] Update an existing requirement. ```bash # Update status braingrid requirement update REQ-123 --status IN_PROGRESS # Update name braingrid requirement update REQ-123 --name "Updated Name" # Update content braingrid requirement update REQ-123 --content "New description" ``` **Options:** * `--status ` - New status * `--name ` - New name * `--content ` - New content ### requirement delete [#requirement-delete] Delete a requirement and all associated tasks. ```bash # With confirmation prompt braingrid requirement delete REQ-123 # Skip confirmation braingrid requirement delete REQ-123 --force ``` **Options:** * `--force` - Skip confirmation prompt ### requirement build [#requirement-build] Generate a complete implementation plan with all task details. ```bash # Markdown format (default, perfect for AI agents) braingrid requirement build REQ-123 # JSON format for tooling braingrid requirement build REQ-123 --format json # Auto-detect requirement from branch braingrid requirement build --format markdown ``` **Options:** * `--format ` - Output format: `markdown`, `json`, `xml` ### requirement create-branch [#requirement-create-branch] Create a git branch for a requirement via the GitHub API. ```bash # Auto-detect requirement from current context braingrid requirement create-branch # Create branch for specific requirement braingrid requirement create-branch REQ-123 ``` Automatically generates branch names in the format `{username}/REQ-123-slugified-name` and creates the branch on GitHub. This command requires a GitHub repository to be linked to your project. The branch is created remotely via the GitHub API. ### requirement review [#requirement-review] Stream an AI-powered acceptance review for a pull request. ```bash # Auto-detect PR from current branch braingrid requirement review # Review specific requirement braingrid requirement review REQ-123 ``` Analyzes your pull request against the requirement's acceptance criteria and provides detailed feedback. If no PR is found for the current branch, you'll be prompted to select one interactively. ## Task Commands [#task-commands] ### task list [#task-list] List all tasks for a requirement. ```bash # Auto-detect requirement from git branch braingrid task list # List tasks for specific requirement braingrid task list -r REQ-123 # Markdown format for AI context braingrid task list -r REQ-123 --format markdown # JSON for scripting braingrid task list -r REQ-123 --format json ``` **Options:** * `-r, --requirement ` - Requirement ID (auto-detected from branch if not specified) * `--format ` - Output format: `table`, `json`, `xml`, `markdown` ### task show [#task-show] Display details for a specific task. ```bash # Auto-detect first in-progress or planned task braingrid task show # Show specific task braingrid task show TASK-456 # JSON format for scripting braingrid task show TASK-456 --format json ``` **Options:** * `--format ` - Output format: `table`, `json`, `xml`, `markdown` When called without a task ID, shows the first in-progress task. If none are in progress, shows the first planned task. ### task create [#task-create] Manually create a task. ```bash braingrid task create -r REQ-123 \ --title "Implement OAuth2 login flow" \ --content "Create login endpoint and integrate with provider" ``` **Options:** * `-r, --requirement ` - Parent requirement ID (required) * `--title ` - Task title (required) * `--content ` - Task description (optional) ### task update [#task-update] Update a task's status, title, or content. ```bash # Auto-detect current task and update status braingrid task update --status COMPLETED # Update specific task status braingrid task update TASK-456 --status COMPLETED # Update title braingrid task update TASK-456 --title "New title" # Update content braingrid task update TASK-456 --content "Updated description" ``` **Options:** * `--status ` - New status: `PLANNED`, `IN_PROGRESS`, `COMPLETED`, `CANCELLED` * `--title ` - New title * `--content ` - New content When called without a task ID, updates the first in-progress task. If none are in progress, updates the first planned task. ### task delete [#task-delete] Delete a task. ```bash # With confirmation prompt braingrid task delete TASK-456 # Skip confirmation braingrid task delete TASK-456 --force ``` **Options:** * `--force` - Skip confirmation prompt ### task specify [#task-specify] Create a single AI-refined task from a description. ```bash # Create task with AI refinement braingrid task specify "Add input validation for email field" # Specify for a specific requirement braingrid task specify -r REQ-123 "Implement rate limiting on API endpoints" ``` **Options:** * `-r, --requirement ` - Parent requirement ID (auto-detected from branch if not specified) The `task specify` command creates individual tasks with AI refinement. It's context-aware and understands existing task dependencies when adding to a requirement that already has tasks. ## Utility Commands [#utility-commands] ### status [#status] Display CLI configuration and status. ```bash braingrid status ``` Shows authentication status, current project, CLI version, and configuration details. ### update [#update] Update the CLI to the latest version. ```bash # Check for updates and install braingrid update # Check for updates without installing braingrid update --check ``` **Options:** * `--check` - Only check for updates, don't install ### completion [#completion] Set up shell autocompletion for the CLI. ```bash # Interactive setup (recommended) braingrid completion --setup ``` This adds autocompletion to your shell configuration. After setup, restart your terminal or source your config file. **Manual setup:** ```bash Bash # Add to ~/.bashrc eval "$(braingrid completion bash)" ``` ```bash Zsh # Add to ~/.zshrc eval "$(braingrid completion zsh)" ``` ### --version [#--version] Display the CLI version. ```bash braingrid --version ``` ### --help [#--help] Display help information. ```bash # General help braingrid --help # Command-specific help braingrid project --help braingrid requirement build --help ``` ## Status Flows [#status-flows] ### Requirement Status Flow [#requirement-status-flow] Requirements progress through the following states: ``` IDEA → PLANNED → IN_PROGRESS → REVIEW → COMPLETED ↓ CANCELLED ``` * **IDEA** - Initial concept or feature request * **PLANNED** - Refined and ready for implementation * **IN\_PROGRESS** - Active development * **REVIEW** - Under review or testing * **COMPLETED** - Successfully implemented * **CANCELLED** - No longer needed ### Task Status Flow [#task-status-flow] Tasks have a simpler workflow: ``` PLANNED → IN_PROGRESS → COMPLETED ↓ CANCELLED ``` * **PLANNED** - Ready to be worked on * **IN\_PROGRESS** - Currently being implemented * **COMPLETED** - Successfully finished * **CANCELLED** - No longer needed ## Flexible ID Formats [#flexible-id-formats] All commands accept multiple ID formats for convenience: * **Canonical**: `REQ-456`, `TASK-123`, `PROJ-789` * **Lowercase**: `req-456`, `task-123`, `proj-789` * **Numeric**: `456`, `123`, `789` * **UUID**: Full UUID strings Examples: ```bash # All of these are equivalent braingrid requirement show REQ-123 braingrid requirement show req-123 braingrid requirement show 123 braingrid requirement show 550e8400-e29b-41d4-a716-446655440000 ``` ## Output Formats [#output-formats] Most commands support multiple output formats: ### Table (Default) [#table-default] Human-readable ASCII tables for terminal viewing. ```bash braingrid project list ``` ### JSON [#json] Machine-readable format for scripting and automation. ```bash braingrid project list --format json ``` ### XML [#xml] Structured data for enterprise integrations. ```bash braingrid project list --format xml ``` ### Markdown [#markdown] Rich formatted output optimized for AI agents and documentation. ```bash braingrid task list -r REQ-123 --format markdown ``` Use markdown format when providing task context to AI coding agents. It includes all necessary details in a format that's easy for AI to parse and understand. ## Common Patterns [#common-patterns] ### Complete Feature Development Workflow [#complete-feature-development-workflow] ```bash # 1. Create and refine requirement braingrid specify --prompt "Add payment integration with Stripe" # → Creates REQ-42 # 2. Create feature branch via GitHub API braingrid requirement create-branch REQ-42 # → Creates nico/REQ-42-stripe-integration # 4. Check out the branch locally git fetch && git checkout nico/REQ-42-stripe-integration # 5. Get full context for AI agent braingrid requirement build --format markdown # 6. Work through tasks (auto-detects current task) braingrid task update --status IN_PROGRESS # ... implement task ... braingrid task update --status COMPLETED # 7. Create PR and get AI review braingrid requirement review ``` ### Quick Status Check [#quick-status-check] ```bash # Check your current context braingrid status # View current requirement (from branch) braingrid requirement show # List remaining tasks braingrid task list -r REQ-42 ``` ### CI/CD Integration [#cicd-integration] ```bash # Get requirement data in CI pipeline REQ_DATA=$(braingrid requirement show REQ-42 --format json) # List completed tasks for release notes braingrid task list -r REQ-42 --format markdown > RELEASE_NOTES.md ``` --- # CLI Source: https://www.braingrid.ai/docs/cli/overview Description: The power of BrainGrid in your terminal Manage projects, requirements, and tasks from your terminal. Common use cases: * **Fetch a requirement's tasks** - Get the tasks for a requirement for your coding agent to implement. * **Save agent plans** - Save your coding agent's plans to share and implement later. * **Refine vague ideas** - Transform rough concepts into clear, actionable requirements with AI assistance. ## Installation [#installation] Install the BrainGrid CLI globally using npm: ```bash npm install -g @braingrid/cli ``` ## Authentication [#authentication] Before using the CLI, authenticate with your BrainGrid account: ```bash braingrid login ``` ## Quick Start: One-Minute Flow [#quick-start-one-minute-flow] Get started with BrainGrid in four simple steps: Initialize your project with BrainGrid: ```bash braingrid init ``` Create a requirement with AI refinement: ```bash braingrid specify --prompt "Add user authentication with OAuth2" ``` Get complete implementation plan: ```bash braingrid requirement build REQ-1 ``` The CLI automatically detects your current project from `.braingrid/project.json` and can extract requirement IDs from your git branch names (e.g., `feature/REQ-123-auth`). ## AI Coding Integration [#ai-coding-integration] BrainGrid CLI integrates seamlessly with AI coding tools: Skills and slash commands for Claude Code. Rules and slash commands for Cursor. ## Typical Workflow [#typical-workflow] Here's how BrainGrid CLI fits into your development process: 1. **Capture Ideas** - Use `braingrid specify` to refine vague ideas into structured requirements 2. **Build Features** - Create a git branch and let your AI agent work through tasks 3. **Track Progress** - Update task status with `braingrid task update` as you complete work ## Auto-Detection Features [#auto-detection-features] The CLI includes smart auto-detection to minimize typing: * **Project Detection** - Automatically finds project from `.braingrid/project.json` * **Branch-Based Requirements** - Extracts requirement IDs from branch names like `feature/REQ-123-description` * **Flexible ID Formats** - Accepts `REQ-123`, `req-123`, `123`, or full UUIDs ## Output Formats [#output-formats] Commands support multiple output formats for different use cases: * **`table`** (default) - Human-readable tables for terminal viewing * **`json`** - Machine-readable format for scripting and automation * **`xml`** - Structured data for enterprise integrations * **`markdown`** - Rich formatted output perfect for AI agents Use the `--format` flag on any command: ```bash braingrid requirement list --format json braingrid requirement build REQ-123 --format markdown ``` ## Next Steps [#next-steps] Explore all available commands and their options Set up BrainGrid as a Model Context Protocol server --- # Create a Project Source: https://www.braingrid.ai/docs/guides/create-project Description: Learn how to create your first project in BrainGrid This guide will walk you through creating your first project in BrainGrid. A project is where you'll organize your requirements, tasks, and codebase analysis.