Protocol Specification
Overview
Section titled “Overview”Brainfile is a protocol for task management designed specifically for AI-assisted software development. It defines a structured format for project tasks that both humans and AI agents can understand and modify.
File Format
Section titled “File Format”Primary File: brainfile.md
Section titled “Primary File: brainfile.md”The protocol uses a Markdown file with YAML frontmatter. The default filename is brainfile.md (non-hidden), though .brainfile.md (hidden) is supported for backward compatibility.
Priority Order (when multiple files exist):
brainfile.md(preferred).brainfile.md(backward compatibility).bb.md(shorthand, deprecated)
Archive File: brainfile-archive.md
Section titled “Archive File: brainfile-archive.md”Completed tasks can be archived to brainfile-archive.md (or .brainfile-archive.md for hidden variant).
YAML Structure
Section titled “YAML Structure”Required Fields
Section titled “Required Fields”---title: string # Project or board titlecolumns: [] # Array of task columns---Optional Fields
Section titled “Optional Fields”---protocolVersion: string # Version of protocol (e.g., "0.4.0")schema: string # Reference to schema for validation (URL or local file path)agent: # AI agent instructions (recommended) instructions: [] # Array of instruction strings llmNotes: string # Free-form notes about AI work preferencesrules: # Project rules and guidelines always: [] # Rules that must always be followed never: [] # Rules that must never be violated prefer: [] # Preferred approaches context: [] # Contextual informationarchive: [] # Archived tasks (usually in separate file)---Schema Reference
Section titled “Schema Reference”The schema field provides a reference to the Brainfile schema for validation and structure enforcement. This helps ensure AI agents and tools respect the exact protocol structure.
schema: string # URL or local file pathOfficial Schema Location: https://brainfile.md/v1
The protocol schema is hosted in the brainfile/protocol repository and served via GitHub Pages at brainfile.md.
Schema Formats
Section titled “Schema Formats”-
Remote URL (recommended for consistency):
schema: https://brainfile.md/v1 -
Local file (for offline or custom schemas):
# File in project rootschema: brainfile.schema.json# Relative pathschema: ./schemas/brainfile.schema.json# Absolute pathschema: /usr/local/share/brainfile/schema.json
When present, AI agents and tools should fetch and validate against this schema to ensure proper structure and prevent taking liberties with the format.
Agent Instructions Block
Section titled “Agent Instructions Block”The agent block provides explicit guidance to AI agents interacting with the board:
agent: instructions: - Modify only the YAML frontmatter - Preserve all IDs - Keep ordering - Make minimal changes - Preserve unknown fieldsThis ensures consistent behavior across different AI agents and prevents destructive changes.
Column Structure
Section titled “Column Structure”Each column represents a workflow state:
columns: - id: string # Unique identifier (kebab-case) title: string # Display title tasks: [] # Array of tasksStandard Column IDs
Section titled “Standard Column IDs”While customizable, these IDs are conventional:
todo- Tasks to be startedin-progress- Tasks being worked onreview- Tasks pending reviewdone- Completed tasks
Task Structure
Section titled “Task Structure”Required Task Fields
Section titled “Required Task Fields”- id: string # Unique identifier (pattern: task-N) title: string # Task titleOptional Task Fields
Section titled “Optional Task Fields”description: string # Detailed description (markdown supported)assignee: string # Person responsiblepriority: string # low|medium|high|criticaleffort: string # trivial|small|medium|large|xlargeblockedBy: [] # Array of task IDs (e.g., ["task-1", "task-5"])dueDate: string # ISO 8601 datetags: [] # Array of tag stringsrelatedFiles: [] # Array of file pathssubtasks: [] # Array of subtaskstemplate: string # bug|feature|refactorSubtask Structure
Section titled “Subtask Structure”Subtasks track granular progress within a task:
subtasks: - id: string # Pattern: task-N-M title: string # Subtask title completed: boolean # Completion statusRule Structure
Section titled “Rule Structure”Rules guide project behavior:
rules: always: - id: number rule: string # Rule descriptionVersion Compatibility
Section titled “Version Compatibility”v0.4.0 (Latest)
Section titled “v0.4.0 (Latest)”- Added
protocolVersionfield for explicit versioning - Added AI-friendly task fields:
effort,blockedBy - Added
llmNotesfield to agent block - Task IDs now enforce
task-Npattern
v0.3.0
Section titled “v0.3.0”- Default to non-hidden files (
brainfile.md) - Added
agentinstruction block - Maintains backward compatibility with hidden files
- Added subtasks support
Migration Path
Section titled “Migration Path”- Projects can use either hidden or non-hidden files
- Tools should check for both variants
- Non-hidden files take priority when both exist
Best Practices
Section titled “Best Practices”- Use non-hidden files for better visibility and AI compatibility
- Include agent instructions to ensure consistent AI behavior
- Preserve IDs when moving tasks between columns
- Use semantic IDs (task-1, task-2) for easy reference
- Keep descriptions concise but informative
- Archive completed tasks to maintain board performance
File Discovery
Section titled “File Discovery”Tools implementing the protocol should:
- Check for
brainfile.mdfirst - Fall back to
.brainfile.mdif not found - Create
brainfile.mdfor new projects - Support both formats for existing projects
Validation
Section titled “Validation”Use the JSON Schema at https://brainfile.md/v1.json to validate YAML structure.
Example
Section titled “Example”---title: My ProjectprotocolVersion: "0.4.0"agent: instructions: - Modify only the YAML frontmatter - Preserve all IDs - Keep ordering llmNotes: "Prefer functional patterns and comprehensive tests"rules: always: - id: 1 rule: update task status as you workcolumns: - id: todo title: To Do tasks: - id: task-1 title: Implement user authentication description: Add OAuth2 support priority: high effort: large blockedBy: [] subtasks: - id: task-1-1 title: Setup OAuth provider completed: false - id: task-1-2 title: Create login UI completed: false---