|
| 1 | +# Concepts |
| 2 | + |
| 3 | +## The Drydock Metaphor |
| 4 | + |
| 5 | +Like a naval drydock where ships are brought in for major overhauls, Drydock is a workspace for software architecture work: |
| 6 | + |
| 7 | +- **Ships** = Software projects |
| 8 | +- **Ocean** = Production / upstream repos |
| 9 | +- **Ship Yard** = Where projects are analyzed and decomposed |
| 10 | +- **Drydock** = Your workspace where the real work happens |
| 11 | + |
| 12 | +## The Lifecycle |
| 13 | + |
| 14 | +``` |
| 15 | +┌─────────────────────────────────────────────────────────────────────────────┐ |
| 16 | +│ │ |
| 17 | +│ OCEAN DRYDOCK OCEAN │ |
| 18 | +│ (upstream) (your yard) (downstream) │ |
| 19 | +│ │ |
| 20 | +│ ┌─────────┐ ┌───────────────────────────────────┐ ┌─────────┐ │ |
| 21 | +│ │ GitHub │ │ │ │ Your │ │ |
| 22 | +│ │ GitLab │ ──▶ │ INTAKE → WORK → RELEASE → SHIP │ ──▶ │ Prod │ │ |
| 23 | +│ │ etc. │ │ │ │ Deploy │ │ |
| 24 | +│ └─────────┘ └───────────────────────────────────┘ └─────────┘ │ |
| 25 | +│ │ |
| 26 | +│ Ships arrive Ships get rebuilt with new parts Ships return to sea │ |
| 27 | +│ for overhaul as new vessels │ |
| 28 | +│ │ |
| 29 | +└─────────────────────────────────────────────────────────────────────────────┘ |
| 30 | +``` |
| 31 | + |
| 32 | +### Phases |
| 33 | + |
| 34 | +1. **Intake** — Clone/link upstream projects into `Ship_Yard/_intake/` (read-only) |
| 35 | +2. **Analysis** — Run analyzers, document architecture in `Ship_Yard/_analysis/` |
| 36 | +3. **Extraction** — Pull out reusable components into `Ship_Yard/_extraction/` |
| 37 | +4. **Assembly** — Combine extracted parts into new projects in `Projects/` |
| 38 | +5. **Release** — Stage for deployment in `Release/` |
| 39 | +6. **Ship** — Deploy to production, track in `Ocean/` |
| 40 | + |
| 41 | +## Directory Structure |
| 42 | + |
| 43 | +``` |
| 44 | +Drydock/ |
| 45 | +├── StartHere/ # Documentation, guides, templates |
| 46 | +├── Ship_Yard/ # Incoming projects for decomposition |
| 47 | +│ ├── _intake/ # Raw project clones (READ-ONLY) |
| 48 | +│ ├── _analysis/ # Analysis documents |
| 49 | +│ └── _extraction/ # Extracted components |
| 50 | +├── Tools/ # Utilities for drydock operations |
| 51 | +│ ├── mcp_server.py # MCP server for AI assistants |
| 52 | +│ ├── intake/ # Project intake tools |
| 53 | +│ ├── analyzers/ # Code analysis tools |
| 54 | +│ ├── scaffolders/ # Project scaffolding tools |
| 55 | +│ └── builders/ # Build and ship tools |
| 56 | +├── Projects/ # New projects being assembled |
| 57 | +├── Workbench/ # Experiments and prototypes |
| 58 | +├── Release/ # Launch preparation |
| 59 | +└── Ocean/ # Deployed fleet registry |
| 60 | +``` |
| 61 | + |
| 62 | +## Design Principles |
| 63 | + |
| 64 | +- **JSON-first** — All tools default to JSON for AI consumption, `--markdown` for humans |
| 65 | +- **Pure stdlib** — Zero external dependencies (except `mcp` for the MCP server) |
| 66 | +- **Non-destructive** — Analyzers never modify source projects |
| 67 | +- **Composable** — Each tool does one thing; `context_compiler` orchestrates all |
| 68 | +- **No fat files** — Keep files under 300 lines where possible |
| 69 | + |
| 70 | +## Key Analyzer Concepts |
| 71 | + |
| 72 | +### Clusters |
| 73 | +Groups of files that import each other heavily. High internal connectivity = cohesive component. |
| 74 | + |
| 75 | +### Bridge Files |
| 76 | +Files that connect multiple clusters. Extract these carefully — they're the glue between components. |
| 77 | + |
| 78 | +### Orphans |
| 79 | +Files with no import relationships. Easy to extract or remove without breaking anything. |
| 80 | + |
| 81 | +### Extraction Risk |
| 82 | +- **Low** — Zero external dependencies. Can be extracted cleanly. |
| 83 | +- **Medium** — A few external deps. Extractable with some interface work. |
| 84 | +- **High** — Many external deps. Extraction requires significant refactoring. |
0 commit comments