New Python CLI + dual SKILL.md (Code + Desktop) for organizing Google Drive folders under OurDigital conventions: - Refresh root README index (preserves manual Topics/Notes between AUTO-STRUCTURE markers) - Ensure per-subfolder README.md meta files - Propose filename + folder renames (D.intelligence → OurDigital with SEO-context caveat documented in patterns/gotchas.md) - Propose moves for cluttered files (screenshots, temp downloads) - Sensitive-folder skip list (04_Case Studies, 99_Project Archive, *Archive*, 진단*) - shared/patterns/ gotcha library: canonical-files, canonical-folders, categorization-rules, 12 known gotchas — grows over time as the system encounters new edge cases Slash command: /organize. CLI: ~/.local/bin/our-gdrive-organize. 82-tui-design-template renumbered to 92 (no content change) to free slot 82. AGENTS.md and CLAUDE.md updated for both moves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
85 lines
2.6 KiB
Markdown
85 lines
2.6 KiB
Markdown
# DTM Wizard — Reference Implementation
|
|
|
|
The DTM Agent TUI wizard is the first project built with this skill's patterns.
|
|
|
|
## Repository
|
|
- **Project**: D.intelligence Tag Manager Agent
|
|
- **Location**: `github.com/D-intelligence/dintel-gtm-agent`
|
|
- **TUI code**: `src/dtm/tui/` (20 files, ~2500 lines)
|
|
- **Tests**: `tools/tests/unit/test_tui_*.py` (29 tests)
|
|
|
|
## File Inventory
|
|
|
|
| File | Lines | Purpose |
|
|
|------|-------|---------|
|
|
| `__init__.py` | 13 | Public API |
|
|
| `i18n.py` | 93 | 60+ bilingual EN/KR strings |
|
|
| `input.py` | 93 | Escape sequence parser |
|
|
| `themes.py` | 48 | Norton Commander color scheme |
|
|
| `widgets.py` | 35 | Status icons, mini-tables |
|
|
| `breadcrumb.py` | 22 | Navigation path bar |
|
|
| `function_bar.py` | 33 | F-key shortcut bar |
|
|
| `status_panel.py` | 85 | Left panel health display |
|
|
| `menu.py` | 35 | Gopher-style numbered menu |
|
|
| `dialog.py` | 70 | Modal overlays |
|
|
| `core.py` | 100 | Three-tier layout engine |
|
|
| `runner.py` | 170 | Event loop + ScreenStack |
|
|
| `selector.py` | 156 | Arrow-key list selector |
|
|
| `renderers.py` | ~1100 | 15 leaf screen content renderers |
|
|
| `screens/*.py` | ~250 | 21 screen definitions |
|
|
|
|
## Screen Hierarchy (21 screens)
|
|
|
|
```
|
|
home
|
|
setup
|
|
setup.credentials
|
|
setup.account
|
|
setup.account.containers (dynamic sub-screen)
|
|
setup.ai
|
|
setup.connectivity
|
|
operations
|
|
ops.workflow
|
|
ops.container_analysis
|
|
ops.ai_analysis
|
|
ops.performance
|
|
configuration
|
|
config.review
|
|
config.change_account
|
|
config.change_container
|
|
config.export
|
|
diagnostics
|
|
diag.health
|
|
diag.test
|
|
diag.recommendations
|
|
```
|
|
|
|
## PRs and Evolution
|
|
|
|
| PR | Title | Key Changes |
|
|
|----|-------|-------------|
|
|
| #10 | Core TUI redesign | 19 modules, 28 tests |
|
|
| #11 | 7 usability fixes | Panel height, no-color, bilingual icons |
|
|
| #12 | Interactive selection | Account/container by number, help screen |
|
|
| #13 | Name resolution | Resolve IDs to names from API |
|
|
| #14 | Loading spinners | Visual feedback during API calls |
|
|
| #15 | AI model selector | Ollama + LM Studio detection |
|
|
| #16 | Batch UX fixes | ListSelector, export formats, crash fixes |
|
|
|
|
## External Service Detection Pattern
|
|
|
|
```python
|
|
def _detect_lm_studio() -> dict:
|
|
"""Detect LM Studio on localhost:1234."""
|
|
import requests
|
|
try:
|
|
resp = requests.get("http://localhost:1234/v1/models", timeout=3)
|
|
if resp.status_code == 200:
|
|
return {"available": True, "models": [m["id"] for m in resp.json().get("data", [])]}
|
|
except Exception:
|
|
pass
|
|
return {"available": False, "models": []}
|
|
```
|
|
|
|
This pattern works for any OpenAI-compatible local LLM server.
|