Quick Start
Installation
Section titled “Installation”Choose your preferred method:
VSCode Extension (Recommended for Visual UI)
Section titled “VSCode Extension (Recommended for Visual UI)”- Open VSCode
- Install the Brainfile extension from the marketplace
- Create a
brainfile.mdfile in your project root - The visual kanban board appears automatically
CLI Tool (Recommended for Terminal Users)
Section titled “CLI Tool (Recommended for Terminal Users)”npm install -g @brainfile/cliCore Library (For Developers)
Section titled “Core Library (For Developers)”npm install @brainfile/coreCreate Your First Brainfile
Section titled “Create Your First Brainfile”Option 1: Copy the Example (Recommended for AI Integration)
Section titled “Option 1: Copy the Example (Recommended for AI Integration)”Download the fully-featured example from the repository:
curl -o brainfile.md https://raw.githubusercontent.com/brainfile/protocol/main/example/brainfile.mdThis example includes:
- Multiple columns (todo, in-progress, review, done)
- Tasks with various metadata (priority, tags, assignee, description)
- Project rules (always, never, prefer)
- AI agent instructions
- Custom stats configuration
Option 2: Use the CLI
Section titled “Option 2: Use the CLI”Initialize a new brainfile in your project:
npm install -g @brainfile/clibrainfile initThis creates a minimal brainfile.md with basic structure.
Option 3: Create Manually
Section titled “Option 3: Create Manually”Create a file named brainfile.md in your project root:
---schema: https://brainfile.md/v1title: My First Projectagent: instructions: - Modify only the YAML frontmatter - Preserve all IDs - Keep orderingcolumns: - id: todo title: To Do tasks: - id: task-1 title: Setup project structure priority: high - id: task-2 title: Write documentation priority: medium - id: in-progress title: In Progress tasks: [] - id: done title: Done tasks: []---
# My First Project
Welcome to your Brainfile task board!Using the CLI
Section titled “Using the CLI”List Tasks
Section titled “List Tasks”brainfile listOutput:
📋 My First Project
To Do: task-1: Setup project structure [high] task-2: Write documentation [medium]Add a Task
Section titled “Add a Task”brainfile add --title "Implement authentication" --priority highMove a Task
Section titled “Move a Task”brainfile move --task task-1 --column in-progressCreate from Template
Section titled “Create from Template”brainfile template --listbrainfile template --use bug-report --title "Login fails on mobile"Using the VSCode Extension
Section titled “Using the VSCode Extension”- Open your project with
brainfile.mdin VSCode - View the board in the Brainfile sidebar
- Drag and drop tasks between columns
- Create tasks using the ”+” button or templates
- Edit tasks by clicking on them
Using the Core Library
Section titled “Using the Core Library”import { Brainfile } from '@brainfile/core';import fs from 'fs';
// Read and parseconst markdown = fs.readFileSync('brainfile.md', 'utf-8');const board = Brainfile.parse(markdown);
console.log(`Project: ${board.title}`);console.log(`Tasks: ${board.columns.flatMap(c => c.tasks).length}`);
// Add a taskconst todoColumn = board.columns.find(c => c.id === 'todo');todoColumn?.tasks.push({ id: 'task-3', title: 'New task', priority: 'medium'});
// Serialize backconst output = Brainfile.serialize(board);fs.writeFileSync('brainfile.md', output);Working with AI Agents
Section titled “Working with AI Agents”Step 1: Add Agent Configuration
Section titled “Step 1: Add Agent Configuration”Add these instructions to your agent configuration file (AGENTS.md, CLAUDE.md, .cursorrules, etc.):
# Task Management Rules
- review and follow rules in @brainfile.md- update task status in @brainfile.md as you work (todo → in-progress → done)- reference `schema` in the file for how to create tasks- your existing tools do not modify this file, you need to edit it directlyRecommended: Keep only these minimal instructions in your agent config file, and use brainfile.md for project-specific rules and context.
Step 2: Optional README Integration
Section titled “Step 2: Optional README Integration”Add this comment to your README to auto-load the board for AI assistants:
Now when AI agents read your README, they automatically understand your project’s task context.
AI agents that support Brainfile will:
- Automatically detect and load your board
- Follow the instructions in both your agent config and the
brainfile.mdagent block - Update task status as they work
- Validate changes against the schema
- Preserve your task structure
Adding Project Rules
Section titled “Adding Project Rules”Define project-specific rules:
rules: always: - id: 1 rule: write tests for all new features - id: 2 rule: update documentation when adding features never: - id: 1 rule: commit directly to main branch - id: 2 rule: skip code review prefer: - id: 1 rule: functional programming patterns - id: 2 rule: small, atomic commits context: - id: 1 rule: this is a TypeScript monorepo - id: 2 rule: we use Jest for testingUsing Subtasks
Section titled “Using Subtasks”Break down complex tasks:
tasks: - id: task-1 title: Implement user authentication priority: high subtasks: - id: task-1-1 title: Setup OAuth provider completed: true - id: task-1-2 title: Create login UI completed: false - id: task-1-3 title: Add session management completed: falseTask Templates
Section titled “Task Templates”Use built-in templates for common scenarios:
Bug Report
Section titled “Bug Report”brainfile template --use bug-report \ --title "Memory leak in data processing" \ --description "Application crashes after 1000+ items"Feature Request
Section titled “Feature Request”brainfile template --use feature-request \ --title "Add dark mode" \ --description "Users want theme customization"Refactor
Section titled “Refactor”brainfile template --use refactor \ --title "Refactor authentication module"Version Control
Section titled “Version Control”Brainfile works perfectly with Git:
# Add to version controlgit add brainfile.mdgit commit -m "Add task board"
# See task changes in diffsgit diff brainfile.md
# Merge conflicts are just YAML# Resolve like any other fileCI/CD Integration
Section titled “CI/CD Integration”Validate your brainfile in CI:
name: Validate Brainfileon: [push, pull_request]
jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - name: Validate run: npx @brainfile/cli lint --checkNext Steps
Section titled “Next Steps”- Protocol Specification - Learn the complete file format
- AI Agent Integration - Configure AI agent behavior
- CLI Commands - Explore all CLI features
- VSCode Extension - Master the visual interface
- Core API Reference - Build custom integrations
Examples
Section titled “Examples”See a fully-featured example:
- Example Project Board - Complete board with rules, multiple columns, and various task metadata