Thank you for your interest in contributing to Brainfile! As a protocol-first project, we welcome contributions that enhance the protocol, improve tooling, or expand documentation.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests (
npm testin vscode-extension/) - Commit with clear messages (
git commit -m 'feat: add new field to schema') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request
Brainfile is transitioning to a multi-repository architecture under the github.com/brainfile organization. Each component has its own repository with independent versioning and CI/CD:
| Repository | Purpose | Contributing |
|---|---|---|
| brainfile/protocol | Protocol specification, JSON schema, documentation | Schema changes, protocol docs |
| brainfile/core | TypeScript/JavaScript library (@brainfile/core) |
Parser, validator, type definitions |
| brainfile/cli | Command-line tool (@brainfile/cli) |
CLI commands, binary builds |
| brainfile/vscode | Visual Studio Code extension | UI features, webview, commands |
Current State: This is the monorepo that will be split into the above repositories. See MIGRATION.md for the migration plan.
Protocol Changes → brainfile/protocol
- Propose in GitHub Issues first
- Update
brainfile.schema.json - Update protocol documentation
- Consider backward compatibility
Core Library → brainfile/core
- TypeScript implementation
- Parser, serializer, validator
- Must pass all tests
- Published to npm as
@brainfile/core
CLI Tool → brainfile/cli
- Add commands or improve existing ones
- Maintain binary compatibility
- Test across platforms (Linux, macOS, Windows)
- Published to npm as
@brainfile/cli
VSCode Extension → brainfile/vscode
- UI/UX improvements
- Webview features
- Extension commands
- Published to VS Code Marketplace
brainfile/ (monorepo - will be split)
├── brainfile.schema.json # → brainfile/protocol
├── docs/ # → brainfile/protocol
│ └── protocol.md
├── packages/
│ ├── brainfile-core/ # → brainfile/core
│ └── brainfile-cli/ # → brainfile/cli
├── vscode-extension/ # → brainfile/vscode
├── example/ # → brainfile/protocol
└── brainfile.md # Project task board
Changes to the Brainfile protocol require careful consideration:
- Propose First: Open an issue describing the change
- Update Schema: Modify
brainfile.schema.json - Version Bump: Update
protocolVersionin schema - Update Docs: Modify
docs/protocol.md - Add Tests: Ensure parsers handle the change
- Backward Compatibility: Consider impact on existing tools
Example PR title: feat(protocol): add effort field for AI planning
Improvements to the VSCode extension:
- Features: New UI capabilities, commands, or views
- Bug Fixes: Issues with parsing, syncing, or display
- Performance: Optimizations for large boards
- UX: Improvements to user experience
Development:
cd vscode-extension
npm install
npm run compile
# Press F5 in VSCode to testEnhancements to the command-line interface:
- Commands: New CLI commands
- Validation: Schema validation improvements
- Integration: Support for CI/CD pipelines
Development:
cd brainfile-cli
go build
./brainfile validate ../example/brainfile.mdWe value clear, concise documentation:
- Protocol Docs: Clarifications or examples
- Tool Guides: How to use specific tools
- Integration Guides: Using Brainfile with AI agents
- Examples: Real-world usage patterns
- Use TypeScript strict mode
- Follow existing code style
- Add JSDoc comments for public APIs
- Keep functions focused and small
- Use meaningful variable names
- Follow Effective Go
- Use
go fmtbefore committing - Add tests for new functionality
- Keep error handling explicit
- Maintain backward compatibility when possible
- Use semantic versioning for protocol versions
- Document all fields clearly
- Provide sensible defaults
We follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesrefactor:Code refactoringtest:Test additions/changeschore:Maintenance tasks
Include scope when relevant:
feat(protocol):Protocol changesfix(vscode):VSCode extension fixesdocs(cli):CLI documentation
cd vscode-extension
npm testcd brainfile-cli
go test ./...# Validate example files against schema
npx ajv validate -s brainfile.schema.json -d example/brainfile.md --spec=draft7- Small PRs: Keep changes focused and reviewable
- Clear Description: Explain what and why
- Link Issues: Reference related issues
- Update Docs: Include documentation updates
- Pass Tests: Ensure all tests pass
- Request Review: Tag maintainers when ready
When creating issues, please use appropriate labels:
protocol: Schema or specification changesvscode: VSCode extension issuescli: CLI tool issuesbug: Something isn't workingenhancement: New feature requestdocumentation: Documentation improvements
- Be respectful and constructive
- Help others in discussions
- Share your use cases and experiences
- Suggest improvements based on real needs
- Credit others' contributions
- Always validate changes against existing files
- Consider AI agent compatibility
- Keep human readability paramount
- Test with both hidden and non-hidden files
- Use VSCode's Extension Host debugging
- Check Developer Tools console (Help > Toggle Developer Tools)
- Enable verbose logging in extension settings
- Test with various board configurations
When proposing protocol changes, consider:
- Use Cases: Real problems being solved
- Alternatives: Other ways to achieve the goal
- Migration: How existing files will upgrade
- Tooling Impact: Changes needed in tools
- AI Compatibility: How agents will use the feature
We are migrating from a monorepo to multiple focused repositories. Here's the strategy:
- ✅ Rename all packages and identifiers
- ✅ Update schema URL to
brainfile.md/v1 - ✅ Create GitHub organization
- ✅ Update all documentation
- Create empty repos in brainfile org
- Configure branch protection
- Set up GitHub Actions for each repo
- Configure secrets for publishing
- Use
git subtree splitto preserve history - Extract each package to its own repo
- Set up inter-repo dependencies via npm
- Publish
@brainfile/coreto npm - Publish
@brainfile/clito npm - Publish extension to VS Code Marketplace
- Configure
brainfile.mddomain (GitHub Pages)
- Archive monorepo with redirect
- Update all external links
- Announce migration
Full details: See MIGRATION.md and REPOSITORY_STRUCTURE.md
Until the split is complete:
- Continue contributing to the monorepo
- PRs will be migrated to new repos
- Issues will be transferred to appropriate repos
After the split:
- Clone only the repo you need
- Follow repo-specific CONTRIBUTING.md
- Open issues in the specific repository
Releases are managed per package:
VSCode Extension:
- Update version in
vscode-extension/package.json - Create tag:
git tag vscode-v0.4.3 - GitHub Actions builds and publishes VSIX
Core & CLI:
- Update version in respective
package.json - Build:
npm run build - Publish:
npm publish(when ready)
Each repository will have independent releases:
- Semantic versioning per repo
- Automated publishing via GitHub Actions
- Release notes in each repo
Note: Build artifacts (VSIX, binaries) are never committed to the repository.
- Discord: Join our community (if available)
- Issues: Check existing issues or create new ones
- Discussions: Use GitHub Discussions for questions
- Twitter: Follow @brainfileproto for updates
Contributors are recognized in:
- Release notes
- Contributors section in README
- Git history (with Co-authored-by tags when appropriate)
By contributing, you agree that your contributions will be licensed under the same license as the project (see LICENSE file).
Thank you for helping make Brainfile better! Your contributions, whether code, documentation, or ideas, are valuable to the community.