# paulomtts/brd architecture

> Architecture diagram of the GitHub repository paulomtts/brd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paulomtts/brd
- Repository: https://github.com/paulomtts/brd

## Overview

brd is a local-first CLI kanban manager. A user runs a command in a project directory; the CLI opens the shared database, resolves the registered project, executes board operations, and returns JSON or human-readable output. The domain covers cards and blocker readiness, issues, registered documents and their backups, comments, tags and references, plus snapshot export/import and project management. The graph includes these documented capabilities; some command-to-domain links are based on README descriptions because the command implementations were not excerpted.

Main entry points: [`src/brd/core.py`](https://github.com/paulomtts/brd/blob/main/src/brd/core.py) (Cards and blockers), [`src/brd/refs.py`](https://github.com/paulomtts/brd/blob/main/src/brd/refs.py) (Links and references), [`src/brd/documents.py`](https://github.com/paulomtts/brd/blob/main/src/brd/documents.py) (Documents and backups), [`src/brd/db.py`](https://github.com/paulomtts/brd/blob/main/src/brd/db.py) (Shared SQLite store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command line"]
  node_app["Command setup<br/>[_app.py]"]
  node_card_commands["Card commands<br/>[cards.py]"]
  node_issue_commands["Issue commands<br/>[issues.py]"]
  node_project_commands["Project commands<br/>[project.py]"]
  node_document_commands["Document commands<br/>[docs.py]"]
  node_social_commands["Comments and tags<br/>[comments.py]"]
  node_reference_commands["Reference commands<br/>[refs.py]"]
  node_snapshot_commands["Snapshot commands<br/>[snapshot.py]"]
  node_prompt["Agent primer<br/>[prompt.py]"]
end

subgraph group_board["Board domain"]
  node_cards["Cards and blockers<br/>[core.py]"]
  node_issues["Issues<br/>[issues.py]"]
  node_entities["Shared entities<br/>[entities.py]"]
  node_models["Domain models<br/>[models.py]"]
end

subgraph group_content["Content and links"]
  node_comments["Comments<br/>[comments.py]"]
  node_documents["Documents and backups<br/>[documents.py]"]
  node_tags["Document tags<br/>[tags.py]"]
  node_references["Links and references<br/>[refs.py]"]
  node_link_parser["Link parsing<br/>[links.py]"]
end

subgraph group_storage["Storage and projects"]
  node_master["Project registry<br/>[master.py]"]
  node_consolidation["Legacy migration<br/>[consolidate.py]"]
  node_database[("Shared SQLite store<br/>[db.py]")]
end

subgraph group_presentation["Views and snapshots"]
  node_views["Entity views<br/>[views.py]"]
  node_pretty["Pretty rendering<br/>[pretty.py]"]
  node_output["Output envelopes<br/>[output.py]"]
  node_snapshots["Snapshot transfer<br/>[snapshot.py]"]
end

node_user(("Project user"))

node_user -->|"runs command"| node_app
node_app -->|"opens project"| node_master
node_app -->|"prints result"| node_output
node_card_commands -->|"manages cards"| node_cards
node_issue_commands -->|"manages issues"| node_issues
node_project_commands -->|"manages projects"| node_master
node_document_commands -->|"manages documents"| node_documents
node_social_commands -->|"adds comments"| node_comments
node_social_commands -->|"manages tags"| node_tags
node_reference_commands -->|"manages refs"| node_references
node_snapshot_commands -->|"transfers snapshots"| node_snapshots
node_cards -->|"reads and writes"| node_database
node_issues -->|"adds blockers"| node_cards
node_issues -->|"reads and writes"| node_database
node_cards -->|"reindexes links"| node_references
node_documents -->|"stores metadata"| node_database
node_documents -->|"adds tags"| node_tags
node_documents -->|"reindexes links"| node_references
node_references -->|"parses tokens"| node_link_parser
node_references -->|"stores refs"| node_database
node_entities -->|"reads and deletes"| node_database
node_master -->|"connects and resolves"| node_database
node_master -->|"migrates legacy data"| node_consolidation
node_views -->|"resolves status"| node_cards
node_views -->|"syncs documents"| node_documents
node_views -->|"loads comments"| node_comments
node_views -->|"loads link views"| node_references
node_pretty -->|"resolves links"| node_references
node_pretty -->|"renders links"| node_link_parser
node_snapshots -->|"transfers board data"| node_cards
node_snapshots -->|"transfers documents"| node_documents
node_snapshots -->|"transfers issues"| node_issues
node_snapshots -->|"places projects"| node_master
node_cards -->|"registers entities"| node_entities
node_issues -->|"registers entities"| node_entities
node_cards -->|"uses card model"| node_models
node_app -.->|"offers primer"| node_prompt

click node_app "https://github.com/paulomtts/brd/blob/main/src/brd/cli/_app.py"
click node_card_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/cards.py"
click node_issue_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/issues.py"
click node_project_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/project.py"
click node_document_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/docs.py"
click node_social_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/comments.py"
click node_reference_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/refs.py"
click node_snapshot_commands "https://github.com/paulomtts/brd/blob/main/src/brd/cli/snapshot.py"
click node_cards "https://github.com/paulomtts/brd/blob/main/src/brd/core.py"
click node_issues "https://github.com/paulomtts/brd/blob/main/src/brd/issues.py"
click node_entities "https://github.com/paulomtts/brd/blob/main/src/brd/entities.py"
click node_comments "https://github.com/paulomtts/brd/blob/main/src/brd/comments.py"
click node_documents "https://github.com/paulomtts/brd/blob/main/src/brd/documents.py"
click node_tags "https://github.com/paulomtts/brd/blob/main/src/brd/tags.py"
click node_references "https://github.com/paulomtts/brd/blob/main/src/brd/refs.py"
click node_link_parser "https://github.com/paulomtts/brd/blob/main/src/brd/links.py"
click node_master "https://github.com/paulomtts/brd/blob/main/src/brd/master.py"
click node_consolidation "https://github.com/paulomtts/brd/blob/main/src/brd/consolidate.py"
click node_database "https://github.com/paulomtts/brd/blob/main/src/brd/db.py"
click node_views "https://github.com/paulomtts/brd/blob/main/src/brd/views.py"
click node_pretty "https://github.com/paulomtts/brd/blob/main/src/brd/pretty.py"
click node_output "https://github.com/paulomtts/brd/blob/main/src/brd/output.py"
click node_snapshots "https://github.com/paulomtts/brd/blob/main/src/brd/snapshot.py"
click node_prompt "https://github.com/paulomtts/brd/blob/main/src/brd/prompt.py"
click node_models "https://github.com/paulomtts/brd/blob/main/src/brd/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_card_commands,node_issue_commands,node_project_commands,node_document_commands,node_social_commands,node_reference_commands,node_snapshot_commands,node_prompt,node_user toneBlue
class node_cards,node_issues,node_entities,node_models toneAmber
class node_comments,node_documents,node_tags,node_references,node_link_parser toneMint
class node_master,node_consolidation,node_database toneRose
class node_views,node_pretty,node_output,node_snapshots toneIndigo
```

## Components

### Command line

- [Command setup](https://github.com/paulomtts/brd/blob/main/src/brd/cli/_app.py): `src/brd/cli/_app.py`
- [Card commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/cards.py): `src/brd/cli/cards.py`
- [Issue commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/issues.py): `src/brd/cli/issues.py`
- [Project commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/project.py): `src/brd/cli/project.py`
- [Document commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/docs.py): `src/brd/cli/docs.py`
- [Comments and tags](https://github.com/paulomtts/brd/blob/main/src/brd/cli/comments.py): `src/brd/cli/comments.py`
- [Reference commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/refs.py): `src/brd/cli/refs.py`
- [Snapshot commands](https://github.com/paulomtts/brd/blob/main/src/brd/cli/snapshot.py): `src/brd/cli/snapshot.py`
- [Agent primer](https://github.com/paulomtts/brd/blob/main/src/brd/prompt.py): `src/brd/prompt.py`

### Board domain

- [Cards and blockers](https://github.com/paulomtts/brd/blob/main/src/brd/core.py): `src/brd/core.py`
- [Issues](https://github.com/paulomtts/brd/blob/main/src/brd/issues.py): `src/brd/issues.py`
- [Shared entities](https://github.com/paulomtts/brd/blob/main/src/brd/entities.py): `src/brd/entities.py`
- [Domain models](https://github.com/paulomtts/brd/blob/main/src/brd/models.py): `src/brd/models.py`

### Content and links

- [Comments](https://github.com/paulomtts/brd/blob/main/src/brd/comments.py): `src/brd/comments.py`
- [Documents and backups](https://github.com/paulomtts/brd/blob/main/src/brd/documents.py): `src/brd/documents.py`
- [Document tags](https://github.com/paulomtts/brd/blob/main/src/brd/tags.py): `src/brd/tags.py`
- [Links and references](https://github.com/paulomtts/brd/blob/main/src/brd/refs.py): `src/brd/refs.py`
- [Link parsing](https://github.com/paulomtts/brd/blob/main/src/brd/links.py): `src/brd/links.py`

### Storage and projects

- [Project registry](https://github.com/paulomtts/brd/blob/main/src/brd/master.py): `src/brd/master.py`
- [Legacy migration](https://github.com/paulomtts/brd/blob/main/src/brd/consolidate.py): `src/brd/consolidate.py`
- [Shared SQLite store](https://github.com/paulomtts/brd/blob/main/src/brd/db.py): `src/brd/db.py`

### Views and snapshots

- [Entity views](https://github.com/paulomtts/brd/blob/main/src/brd/views.py): `src/brd/views.py`
- [Pretty rendering](https://github.com/paulomtts/brd/blob/main/src/brd/pretty.py): `src/brd/pretty.py`
- [Output envelopes](https://github.com/paulomtts/brd/blob/main/src/brd/output.py): `src/brd/output.py`
- [Snapshot transfer](https://github.com/paulomtts/brd/blob/main/src/brd/snapshot.py): `src/brd/snapshot.py`

### Other components

- **Project user**

## Connections

- Project user → Command setup: runs command (evidence: `README.md`)
- Command setup → Project registry: opens project (evidence: `src/brd/cli/_app.py`)
- Command setup → Output envelopes: prints result (evidence: `src/brd/cli/_app.py`)
- Card commands → Cards and blockers: manages cards (evidence: `README.md`)
- Issue commands → Issues: manages issues (evidence: `README.md`)
- Project commands → Project registry: manages projects (evidence: `README.md`)
- Document commands → Documents and backups: manages documents (evidence: `README.md`)
- Comments and tags → Comments: adds comments (evidence: `src/brd/cli/comments.py`)
- Comments and tags → Document tags: manages tags (evidence: `README.md`)
- Reference commands → Links and references: manages refs (evidence: `src/brd/cli/refs.py`)
- Snapshot commands → Snapshot transfer: transfers snapshots (evidence: `src/brd/cli/snapshot.py`)
- Cards and blockers → Shared SQLite store: reads and writes (evidence: `src/brd/core.py`)
- Issues → Cards and blockers: adds blockers (evidence: `src/brd/issues.py`)
- Issues → Shared SQLite store: reads and writes (evidence: `src/brd/issues.py`)
- Cards and blockers → Links and references: reindexes links (evidence: `src/brd/core.py`)
- Documents and backups → Shared SQLite store: stores metadata (evidence: `src/brd/documents.py`)
- Documents and backups → Document tags: adds tags (evidence: `src/brd/documents.py`)
- Documents and backups → Links and references: reindexes links (evidence: `src/brd/documents.py`)
- Links and references → Link parsing: parses tokens (evidence: `src/brd/refs.py`)
- Links and references → Shared SQLite store: stores refs (evidence: `src/brd/refs.py`)
- Shared entities → Shared SQLite store: reads and deletes (evidence: `src/brd/entities.py`)
- Project registry → Shared SQLite store: connects and resolves (evidence: `src/brd/master.py`)
- Project registry → Legacy migration: migrates legacy data (evidence: `src/brd/master.py`)
- Entity views → Cards and blockers: resolves status (evidence: `src/brd/views.py`)
- Entity views → Documents and backups: syncs documents (evidence: `src/brd/views.py`)
- Entity views → Comments: loads comments (evidence: `src/brd/views.py`)
- Entity views → Links and references: loads link views (evidence: `src/brd/views.py`)
- Pretty rendering → Links and references: resolves links (evidence: `src/brd/pretty.py`)
- Pretty rendering → Link parsing: renders links (evidence: `src/brd/pretty.py`)
- Snapshot transfer → Cards and blockers: transfers board data (evidence: `src/brd/snapshot.py`)
- Snapshot transfer → Documents and backups: transfers documents (evidence: `src/brd/snapshot.py`)
- Snapshot transfer → Issues: transfers issues (evidence: `src/brd/snapshot.py`)
- Snapshot transfer → Project registry: places projects (evidence: `src/brd/snapshot.py`)
- Cards and blockers → Shared entities: registers entities (evidence: `src/brd/core.py`)
- Issues → Shared entities: registers entities (evidence: `src/brd/issues.py`)
- Cards and blockers → Domain models: uses card model (evidence: `src/brd/core.py`)
- Command setup → Agent primer: offers primer (evidence: `README.md`)
