Skip to content

Mailspring Documentation using BMAD approach#2588

Open
talekarnishita wants to merge 23 commits intoFoundry376:masterfrom
talekarnishita:docs
Open

Mailspring Documentation using BMAD approach#2588
talekarnishita wants to merge 23 commits intoFoundry376:masterfrom
talekarnishita:docs

Conversation

@talekarnishita
Copy link
Copy Markdown

@talekarnishita talekarnishita commented Feb 3, 2026

This folder contains the complete documentation set for the Mailspring "Dual-Core" architecture, reverse-engineered using the BMAD framework.

The documentation is organized into three phases: Phase 1 (Big Picture), Phase 2 (Mechanics), and Phase 3 (Analysis).

📋 Reviewer Reading Guide

To understand the system architecture effectively, please review the documents in the following order:

1. The Roadmap

  • PLAN.md: The master plan and checklist used to generate these artifacts. Start here to see the scope of work.
  • CLAUDE.md: The existing high-level summary (updated/referenced).

2. Phase 1: The Big Picture (Architecture)

  • docs/architecture/current-state.md: The core narrative explaining the "Dual-Core" design (Electron frontend + C++ backend).
  • docs/architecture/diagrams/system-context.md: High-level C4 diagram showing Mailspring and its external providers (Gmail, O365, etc.).
  • docs/architecture/diagrams/containers.md: C4 Container diagram showing the process boundaries (Renderer, Main, Mailsync, SQLite).

3. Phase 2: The Mechanics (How it works)

  • docs/architecture/data-flow.md: Traces the critical path of data from the Internet → C++ Engine → SQLite → Electron UI.
  • docs/architecture/data-model.md: (New) ER Diagram showing the database schema (Threads, Messages, Contacts) derived from Flux models.
  • docs/guides/debugging-dual-core.md: (New) Essential guide for debugging the C++ bridge and inspecting stdin/stdout traffic.
  • docs/architecture/module-dependencies.md: Explains how Flux stores (DatabaseStore, Actions) interact with the Mailsync Bridge.

4. Phase 3: Analysis & Decisions

  • docs/adr/: Retrospective Architecture Decision Records explaining why the system is built this way.
    • 0001-split-engine-architecture.md (Why C++?)
    • 0002-local-first-strategy.md (Why local SQLite?)
  • docs/technical-debt.md: A prioritized register of TODOs and legacy patterns found in the codebase.

📂 File Structure Overview

File / Folder Description
docs/architecture/diagrams/ Mermaid.js source files for all C4 diagrams.
docs/architecture/deployment.md Details on the build pipeline, signing, and packaging (macOS/Windows/Linux).
docs/architecture/technology-stack.md Inventory of versions (Electron, Node, C++) and build tools.
docs/architecture/integration-points.md Documentation of external protocols (IMAP, SMTP) and OAuth flows.

@indent-staging
Copy link
Copy Markdown
Contributor

indent-staging bot commented Feb 3, 2026

Issues

2 potential issues found:

  • Autofix The PR adds ~280 files of BMAD framework tooling (.cursor/commands/, _bmad/) that is a generic AI agent framework, not specific to Mailspring. This adds ~40K+ lines of repository bloat with tooling unrelated to the email client.
  • Autofix Moving SECURITY.md, CODE_OF_CONDUCT.md, CONTRIBUTING.md, and LICENSE.md to docs/ will break GitHub's automatic detection of these files. GitHub expects them at the repository root for special features like license display, security policy, and contributor guidelines. Additionally, CLAUDE.md should stay at root for Claude Code to find it.
Resolved (1 issue)
  • Minor remaining duplication: PLAN.md exists at both root and BMAD/PLAN.md, and docs/technical-debt.md is duplicated in BMAD/docs/technical-debt.md. Good progress - the _bmad/ duplication was resolved! (fixed by commit 1c36156)

Summary

This PR adds comprehensive architecture documentation for Mailspring's dual-core (Electron + C++) design and reorganizes existing documentation.

  • Adds architecture documentation in docs/architecture/ covering the dual-core design, data flow, technology stack, deployment, and data model with Mermaid diagrams
  • Adds a technical debt register (docs/technical-debt.md) cataloging TODO/FIXME items with priority and effort estimates
  • Adds .cursor/commands/ (41 files) for Cursor IDE AI agent workflows
  • Adds docs/README.md as an index for all documentation
  • Moves some root docs to docs/: CODE_OF_CONDUCT, CONTRIBUTING, LOCALIZATION, PLUGIN_SYSTEM_ARCHITECTURE, SECURITY, LICENSE, CLAUDE
  • CHANGELOG.md stays at root
  • Adds BMAD/ to .gitignore (local tooling folder)
  • Includes merge from master with accessibility plans, community plugin/theme docs, and various improvements

CI Checks

Waiting for CI checks...

Rule Checks 3 rules evaluated, 3 passed, 0 failed

Passing rules

Passing This is a longer title to see what happens when they are too long to fit
Passing B
Passing Ben Rule

Autofix All

@bengotow
Copy link
Copy Markdown
Collaborator

bengotow commented Feb 7, 2026

Hey thanks for contributing this! I think I agree with Indent re: the duplication of the generated documentation and all of the tooling files. Happy to accept the architectural documentation if you can split it out from the other stuff going on here. There are a few existing files like PLUGIN_SYSTEM_ARCHITECTURE.md that should probably go into a new docs folder too.

@talekarnishita
Copy link
Copy Markdown
Author

talekarnishita commented Feb 9, 2026 via email

@talekarnishita
Copy link
Copy Markdown
Author

talekarnishita commented Feb 12, 2026 via email

@talekarnishita
Copy link
Copy Markdown
Author

Hi, I’ve moved all the Markdown files to the root docs folder, created a README for it, and removed all unnecessary and duplicate files—keeping only the architecture-related files. I’ve pushed the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants