Skip to content

Protocol Specification

The Brainfile protocol defines a structured format for project tasks stored in markdown files with YAML frontmatter.

File Format

Primary File

FilenamePriorityNotes
brainfile.md1 (preferred)Non-hidden, visible in file browsers
.brainfile.md2Hidden, backward compatibility

Archive File

Completed tasks can be moved to brainfile-archive.md.


YAML Structure

Minimal Valid File

yaml
---
title: My Project
columns:
  - id: todo
    title: To Do
    tasks: []
---

Complete Structure

yaml
---
title: string              # Required: Project title
type: board                # Optional: defaults to board
schema: string             # Optional: URL or path to JSON schema
protocolVersion: string    # Optional: e.g., "1.0.0"

agent:                     # Optional: AI agent instructions
  instructions:
    - string
  llmNotes: string

rules:                     # Optional: Project rules
  always:
    - id: number
      rule: string
  never: []
  prefer: []
  context: []

columns:                   # Required: Array of columns
  - id: string             # Unique kebab-case identifier
    title: string          # Display title
    tasks:                 # Array of tasks
      - id: string         # Pattern: task-N
        title: string      # Required
        description: string
        priority: string   # low|medium|high|critical
        effort: string     # trivial|small|medium|large|xlarge
        assignee: string
        dueDate: string    # ISO 8601 (YYYY-MM-DD)
        tags: []
        relatedFiles: []
        blockedBy: []      # Array of task IDs
        subtasks:
          - id: string     # Pattern: task-N-M
            title: string
            completed: boolean

archive: []                # Optional: Archived tasks
---

Field Reference

Board Fields

FieldTypeRequiredDescription
titlestringYesProject or board title
typestringNoDocument type (default: board)
schemastringNoJSON schema URL for validation
protocolVersionstringNoProtocol version
agentobjectNoAI agent instructions
rulesobjectNoProject rules
columnsarrayYesWorkflow columns
archivearrayNoArchived tasks

Column Fields

FieldTypeRequiredDescription
idstringYesUnique identifier (kebab-case)
titlestringYesDisplay title
tasksarrayYesTasks in this column

Task Fields

FieldTypeRequiredDescription
idstringYesUnique ID (pattern: task-N)
titlestringYesTask title
descriptionstringNoDetailed description (markdown)
prioritystringNolow, medium, high, critical
effortstringNotrivial, small, medium, large, xlarge
assigneestringNoPerson responsible
dueDatestringNoISO 8601 date
tagsarrayNoString tags for filtering
relatedFilesarrayNoFile paths
blockedByarrayNoTask IDs that block this task
subtasksarrayNoSubtask objects
templatestringNobug, feature, refactor

Subtask Fields

FieldTypeRequiredDescription
idstringYesUnique ID (pattern: task-N-M)
titlestringYesSubtask title
completedbooleanYesCompletion status

Standard Column IDs

These IDs are conventional but not required:

IDPurpose
backlogTasks not yet scheduled
todoTasks to be started
in-progressTasks being worked on
reviewTasks pending review
doneCompleted tasks

Agent Instructions

The agent block guides AI assistant behavior:

yaml
agent:
  instructions:
    - Modify only the YAML frontmatter
    - Preserve all IDs
    - Keep ordering
    - Make minimal changes
    - Preserve unknown fields
  llmNotes: "Prefer functional patterns and comprehensive tests"
InstructionReason
Modify only YAML frontmatterContent after --- is user documentation
Preserve all IDsChanging IDs breaks references
Keep orderingMaintains visual consistency
Make minimal changesReduces merge conflicts
Preserve unknown fieldsFuture-proofs against extensions

Rules Block

Project rules for AI and human reference:

yaml
rules:
  always:
    - id: 1
      rule: write tests for new features
    - id: 2
      rule: update task status as you work
  never:
    - id: 1
      rule: commit directly to main
  prefer:
    - id: 1
      rule: functional patterns over classes
  context:
    - id: 1
      rule: TypeScript monorepo with Jest

Schema Reference

Official Schemas

TypeURL
Basehttps://brainfile.md/v1/base.json
Boardhttps://brainfile.md/v1/board.json

Browse all: brainfile.md/v1/

Type Inference

When type is omitted, tools detect by:

  1. Schema URL pattern (/v1/board.json → board)
  2. Structural analysis (columns[] → board)
  3. Default: board

ID Patterns

Task IDs

Pattern: task-N where N is a sequential number.

yaml
- id: task-1
- id: task-2
- id: task-15

Subtask IDs

Pattern: task-N-M where N is parent task number, M is subtask number.

yaml
subtasks:
  - id: task-1-1
  - id: task-1-2

Version History

v1.0.0 (Current)

  • Stable release: board-only task management
  • Simplified protocol focus
  • Full MCP tool support

v0.5.0

  • Added base schema with inheritance
  • Added agent.tools for CLI tool configuration

v0.4.0

  • Added protocolVersion field
  • Added effort and blockedBy task fields
  • Added llmNotes to agent block

v0.3.0

  • Changed default to non-hidden files (brainfile.md)
  • Added agent instruction block
  • Added subtasks support

Best Practices

  1. Use non-hidden files — Better visibility, AI-friendly
  2. Include agent instructions — Consistent AI behavior
  3. Preserve IDs — Never regenerate or change task IDs
  4. Use semantic IDs — Sequential task-1, task-2
  5. Keep descriptions concise — But informative
  6. Archive completed tasks — Keep board clean

Example

yaml
---
title: My Project
type: board
schema: https://brainfile.md/v1/board.json
agent:
  instructions:
    - Modify only the YAML frontmatter
    - Preserve all IDs
columns:
  - id: todo
    title: To Do
    tasks:
      - id: task-1
        title: Implement user authentication
        description: Add OAuth2 support for Google and GitHub
        priority: high
        effort: large
        tags: [backend, security]
        subtasks:
          - id: task-1-1
            title: Setup OAuth provider
            completed: false
          - id: task-1-2
            title: Create login UI
            completed: false
  - id: in-progress
    title: In Progress
    tasks: []
  - id: done
    title: Done
    tasks: []
---

# My Project

Project documentation can go here. This content is preserved
but not parsed by tools.

Next Steps

Released under the MIT License.