← Back to list

architecture-patterns
by bartoszwarzocha
Advanced writing environment for book authors (Writer's IDE)
⭐ 0🍴 0📅 Jan 10, 2026
SKILL.md
name: architecture-patterns description: Kalahari architecture patterns and key classes. Use for code analysis and design.
Architecture Patterns
1. Key Classes
Core Singletons
| Class | Location | Role |
|---|---|---|
| SettingsManager | core/settings_manager.h | Singleton, JSON config persistence |
| ArtProvider | core/art_provider.h | Singleton, icons, colors, QAction creation |
| IconRegistry | core/icon_registry.h | Singleton, icon registration and caching |
| ThemeManager | core/theme_manager.h | Singleton, theme loading, palette management |
| CommandRegistry | gui/command_registry.h | Singleton, central QAction owner, getAction(), updateActionState() |
| Logger | core/logger.h | Singleton, spdlog wrapper |
| TrustedKeys | core/trusted_keys.h | Singleton, plugin publisher key management |
MainWindow Coordinators (OpenSpec #00038)
| Class | Location | Role |
|---|---|---|
| MainWindow | gui/main_window.h | Thin orchestrator (~805 lines) |
| IconRegistrar | gui/icon_registrar.h | Icon registration with IconRegistry |
| CommandRegistrar | gui/command_registrar.h | Command registration with callbacks |
| DockCoordinator | gui/dock_coordinator.h | Panel and dock widget management |
| DocumentCoordinator | gui/document_coordinator.h | Document lifecycle, open/save/close |
| NavigatorCoordinator | gui/navigator_coordinator.h | Navigator panel interaction handlers |
| DiagnosticController | gui/diagnostic_controller.h | Diagnostic and dev mode management |
| SettingsCoordinator | gui/settings_coordinator.h | Settings dialog integration |
Plugin Security
| Class | Location | Role |
|---|---|---|
| PluginSignature | core/plugin_signature.h | Ed25519 signature verification |
| TrustedKeys | core/trusted_keys.h | Trusted publisher key management |
2. Design Patterns Used
Singleton
- SettingsManager, ArtProvider, ThemeManager, IconRegistry, Logger
- Access:
ClassName::getInstance()
Command Pattern
- CommandRegistry stores CommandDef entries
- Actions created via ArtProvider::createAction()
Observer (Qt Signals/Slots)
- ThemeManager::themeChanged signal
- ArtProvider::resourcesChanged signal
- Components connect to update on changes
Composite
- Book → Part → Chapter (Document)
- BookElement hierarchy
3. Source Structure
include/kalahari/
├── core/ # business logic, singletons
│ ├── art_provider.h
│ ├── settings_manager.h
│ ├── theme_manager.h
│ ├── icon_registry.h
│ ├── logger.h
│ ├── book.h
│ ├── document.h
│ ├── plugin_signature.h # Ed25519 verification
│ └── trusted_keys.h # Publisher key management
├── gui/ # UI components
│ ├── main_window.h # Thin orchestrator
│ ├── icon_registrar.h # Icon registration
│ ├── command_registrar.h # Command registration
│ ├── dock_coordinator.h # Panel management
│ ├── document_coordinator.h
│ ├── navigator_coordinator.h
│ ├── diagnostic_controller.h
│ ├── settings_coordinator.h
│ ├── command_registry.h
│ ├── settings_dialog.h
│ ├── panels/
│ │ ├── editor_panel.h
│ │ ├── navigator_panel.h
│ │ └── log_panel.h
│ └── utils/
│ └── layout_utils.h # clearLayout() helper
└── utils/ # utilities
└── ...
src/
├── core/
├── gui/
└── utils/
4. Adding New Components
New Panel (QDockWidget)
- Create header:
include/kalahari/gui/panels/my_panel.h - Create source:
src/gui/panels/my_panel.cpp - Inherit from QDockWidget
- Register in MainWindow::createDockWidgets()
- Add to CMakeLists.txt
New Dialog (QDialog)
- Create header:
include/kalahari/gui/my_dialog.h - Create source:
src/gui/my_dialog.cpp - Inherit from QDialog
- Add action in MainWindow or menu
- Add to CMakeLists.txt
New Widget (QWidget)
- Create header:
include/kalahari/gui/my_widget.h - Create source:
src/gui/my_widget.cpp - Inherit from QWidget
- Use in panel or dialog
- Add to CMakeLists.txt
New Core Class
- Create header:
include/kalahari/core/my_class.h - Create source:
src/core/my_class.cpp - Use
kalahari::corenamespace - Add to CMakeLists.txt
5. Signal/Slot Connections
Theme changes
connect(&core::ThemeManager::getInstance(), &core::ThemeManager::themeChanged,
this, &MyClass::onThemeChanged);
Icon/color changes
connect(&core::ArtProvider::getInstance(), &core::ArtProvider::resourcesChanged,
this, &MyClass::onResourcesChanged);
6. File Naming
| Component Type | Header | Source |
|---|---|---|
| Panel | my_panel.h | my_panel.cpp |
| Dialog | my_dialog.h | my_dialog.cpp |
| Widget | my_widget.h | my_widget.cpp |
| Core class | my_class.h | my_class.cpp |
7. CMakeLists.txt Integration
set(KALAHARI_GUI_SOURCES
...
src/gui/my_new_file.cpp
)
set(KALAHARI_GUI_HEADERS
...
include/kalahari/gui/my_new_file.h
)
8. Analyzing Existing Code
get_symbols_overview("path/to/file.cpp")- see class structurefind_symbol("ClassName")- find class definitionfind_referencing_symbols("ClassName")- find usages
Key files to check
main_window.cpp- thin orchestrator, coordinator creationdock_coordinator.cpp- panel/dock widget patternsdocument_coordinator.cpp- document lifecycle patternssettings_dialog.cpp- dialog patternsart_provider.cpp- icon/color handlingplugin_signature.cpp- Ed25519 verification patterns
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon