# Three-Bird Documentation Architecture **Status:** MVP Implementation Complete (April 2026) **Goal:** Codify documentation localization for Pi/Aider automation **Scope:** EN + SLO (MVP), roadmap: DE/SRB/CRO/BIH/RU/ZN/BR --- ## Overview The **three-bird architecture** decouples documentation concerns into three independent systems that work together: 1. **🐦 Crowdin** β€” Localization source of truth. Single English source, managed translations in 9 languages. 2. **🐦 Astro Starlight** β€” Static site generator. Builds multilingual docs from Crowdin translations + English. 3. **🐦 Strapi CMS** (deferred) β€” Content backend for rich media/structured content. Blocked by FreeBSD native binding issues at the time of this design; revisit if Strapi support is reconsidered. ## Architecture Diagram ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ ENGLISH SOURCE DOCS β”‚ β”‚ docs/public/**.md (repo) β”‚ β”‚ β”‚ β”‚ - install/ - architecture/ β”‚ β”‚ - reference/ - getting-started/ β”‚ β”‚ - api/ - troubleshooting/ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Crowdin Push β”‚ β”‚ (./scripts/ β”‚ β”‚ crowdin-sync β”‚ β”‚ .sh --push) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Crowdin β”‚ β”‚ β”‚ β”‚ Localizationβ”‚ β”‚ β”‚ β”‚ Platform β”‚ β”‚ β”‚ β”‚ (883714) β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Slovenian (SLO) β”‚ β”‚ German (DE) β”‚ β”‚ Croatian (HR) β”‚ β”‚ 100% default β”‚ β”‚ Roadmap β”‚ β”‚ Roadmap β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Crowdin Pull β”‚ β”‚ (./scripts/ β”‚ β”‚ crowdin-sync β”‚ β”‚ .sh --pull) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β” β”‚docs/ β”‚ β”‚docs/ β”‚ β”‚docs/ β”‚ β”‚public/ β”‚ β”‚public/ β”‚ β”‚public/ β”‚ β”‚sl/ β”‚ β”‚de/ β”‚ β”‚hr/ β”‚ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Astro Starlight Build β”‚ β”‚ (npm run build in β”‚ β”‚ bootstrap/cms/clawdie-docs/) β”‚ β”‚ β”‚ β”‚ - Multi-locale config β”‚ β”‚ - Sidebar i18n β”‚ β”‚ - Static site generation β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Static Site Output β”‚ β”‚ (dist/) β”‚ β”‚ β”‚ β”‚ / (SLO) β”‚ β”‚ /en/ (English) β”‚ β”‚ /de/ (German) β”‚ β”‚ /hr/ (Croatian) β”‚ β”‚ ... (others) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Deploy to nginx β”‚ β”‚ (/usr/local/www/clawdie/docs) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ PUBLIC: docs.clawdie.si β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## MVP Decision: Markdown-Only (Option A) **Chosen Approach:** Ship with Crowdin + Astro (no Strapi for now) ### Why Markdown-Only First | Factor | Markdown-Only | Strapi Path | | --------------------- | ---------------------------- | ------------------------------ | | **Shipping time** | 1-2 weeks | 3-4 weeks | | **Dependencies** | Standard tools | FreeBSD blocker | | **MVP feature set** | βœ“ Full (docs + translations) | βœ— Incomplete (no image upload) | | **Maintenance** | Simple (pure markdown) | Complex (CMS + API) | | **Codifiable for Pi** | βœ“ Yes | ⚠ Conditional | ### What Ships in MVP ``` βœ“ Crowdin localization platform (LIVE) βœ“ Markdown sources in docs/public/ βœ“ Automated Crowdin β†’ Astro pipeline βœ“ Multi-language static site βœ“ English (EN) + Slovenian (SLO) default βœ“ Roadmap languages configured (not translated yet) βœ“ Pi/Aider automation for sync & deploy ``` ### What Defers (Phase 2+) ``` βœ— Strapi CMS (blocked by FreeBSD native bindings) βœ— Rich media uploads (requires Strapi + sharp image processing) βœ— Structured content types (Page, Guide, BlogPost) βœ— CMS-driven updates (once Strapi is viable) ``` --- ## Implementation Status ### βœ“ Complete | Component | Location | Status | | ------------------------- | ------------------------------------------------------------------ | ----------------------------- | | **Crowdin Script** | `./scripts/crowdin-sync.sh` | βœ“ Working (push/pull/status) | | **Crowdin Config** | `.crowdin.yml` | βœ“ Configured (project 883714) | | **English Source Docs** | `docs/public/**/*.md` | βœ“ 42+ files ready | | **Skill Documentation** | `.agent/skills/docs-localization-pipeline/SKILL.md` | βœ“ Complete | | **Setup Script** | `.agent/skills/docs-localization-pipeline/setup-clawdie-docs.sh` | βœ“ Tested | | **Pipeline Orchestrator** | `.agent/skills/docs-localization-pipeline/orchestrate-pipeline.sh` | βœ“ Ready | | **Skill README** | `.agent/skills/docs-localization-pipeline/README.md` | βœ“ Complete | ### ⏳ Pending (User Action) | Task | Owner | Timeline | | ------------------------------- | ----------- | --------------- | | Create Crowdin translators | User | ASAP | | Push English sources to Crowdin | Pi/Aider | This week | | Assign translation languages | Translators | This week | | Reach 80% completion milestone | Translators | 1-2 weeks | | First pull & build | Pi/Aider | After milestone | | Deploy to docs.clawdie.si | Pi/Aider | After build | | Setup weekly sync schedule | Pi/Aider | Ongoing | --- ## How It Works ### Daily Workflow (Codified for Pi/Aider) ```bash # 1. English docs are edited in /docs/public/**.md # 2. Crowdin sync pushed (via Pi or cron) ./scripts/crowdin-sync.sh --push # 3. Crowdin translators update translations # 4. Weekly sync pulls translations ./scripts/crowdin-sync.sh --pull # 5. Astro builds multilingual site cd /home/clawdie/clawdie-ai/bootstrap/cms/clawdie-docs && npm run build # 6. Deploy to nginx sudo cp -r dist/* /usr/local/www/clawdie/docs/ sudo nginx -s reload ``` **Automated by Pi/Aider:** ```bash pi "sync translations and rebuild documentation site" # β†’ Executes: orchestrate-pipeline.sh --all ``` ### Configuration Codification All automation is controlled by environment variables in `.env`: ```bash # Crowdin API token CROWDIN_PERSONAL_TOKEN=tskey-xxx # Paths CMS_DOCS_SITE_PATH=/home/clawdie/clawdie-ai/bootstrap/cms/clawdie-docs DOCS_DEPLOY_TARGET=/usr/local/www/clawdie/docs # Thresholds DOCS_MIN_COMPLETION=80 # Min % before auto-deploy ``` --- ## File Structure ### Skill Assets ``` .agent/skills/docs-localization-pipeline/ β”œβ”€β”€ SKILL.md # Detailed architecture & reference β”œβ”€β”€ README.md # Quick start & troubleshooting β”œβ”€β”€ setup-clawdie-docs.sh # Bootstrap Astro project └── orchestrate-pipeline.sh # Full pipeline automation ``` ### Documentation ``` doc/ β”œβ”€β”€ THREE-BIRD-ARCHITECTURE.md # This file (overview) └── [other docs] docs/public/ # English source β”œβ”€β”€ install/ β”œβ”€β”€ architecture/ β”œβ”€β”€ reference/ └── [content sections] docs/public/{lang}/ # Crowdin translations β”œβ”€β”€ en/ # English β”œβ”€β”€ de/ # German (roadmap) β”œβ”€β”€ hr/ # Croatian (roadmap) └── [others] ``` ### Astro Project ``` /home/clawdie/clawdie-ai/bootstrap/cms/clawdie-docs/ β”œβ”€β”€ astro.config.mjs # Multi-locale Starlight config β”œβ”€β”€ package.json β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ content/ β”‚ β”‚ β”œβ”€β”€ config.ts # Content collections β”‚ β”‚ β”œβ”€β”€ docs/ β”‚ β”‚ β”‚ β”œβ”€β”€ en β†’ docs/public/en (symlink) β”‚ β”‚ β”‚ β”œβ”€β”€ de β†’ docs/public/de (symlink) β”‚ β”‚ β”‚ └── [others] β”‚ β”‚ └── i18n/ β”‚ β”‚ β”œβ”€β”€ en.json β”‚ β”‚ β”œβ”€β”€ de.json β”‚ β”‚ └── sl.json β”‚ β”œβ”€β”€ components/ β”‚ └── styles/ └── dist/ # Build output (after npm run build) ``` --- ## Integration with clawdie-ai Controlplane ### Config Values (src/config.ts) ```typescript // CMS/Docs paths export const CMS_JAIL_IP = envConfig.WARDEN_CMS_IP || '10.0.0.4'; export const CMS_DOCS_SITE_PATH = envConfig.CMS_DOCS_SITE_PATH || '/home/clawdie/clawdie-ai/bootstrap/cms/clawdie-docs'; export const CMS_WEBROOT = envConfig.CMS_WEBROOT || '/usr/local/www/clawdie'; // Used by jail runtime for mounting docs build ``` ### Jail Networking ``` 10.0.0.3 = db (PostgreSQL) 10.0.0.4 = cms (Strapi later, Astro build for now) 10.0.0.7 = web (nginx) nginx serves: - / β†’ docs.clawdie.si (from Astro build) - /api β†’ Strapi (when available) ``` --- ## Phase 2: Strapi CMS Integration (Deferred) ### Why Deferred FreeBSD lacks prebuilt binaries for native Node.js modules that Strapi depends on: - `sharp` (image processing) - `esbuild` (bundling) - `@swc/core` (transpilation) **Workaround:** Compile libvips from `/usr/ports/graphics/vips` (2-3 hours on first build). **Recommendation:** Ship MVP first, add Strapi later when image upload is needed. ### What Strapi Will Add ``` Enhanced CMS Features: βœ“ Rich media upload (images, videos) βœ“ Structured content types (Page, Guide, BlogPost) βœ“ API endpoints for dynamic content βœ“ Built-in user authentication βœ“ Content versioning & publishing workflow Integration: - Crowdin syncs content to Strapi API - Astro queries Strapi for rich media - CMS-driven metadata (authors, dates, categories) ``` --- ## Automation Examples ### Example 1: Manual Full Pipeline ```bash # One-command deployment ./.agent/skills/docs-localization-pipeline/orchestrate-pipeline.sh --all ``` ### Example 2: Scheduled Weekly Sync ```bash # Add to crontab 0 9 * * MON /home/clawdie/clawdie-ai/.agent/skills/docs-localization-pipeline/orchestrate-pipeline.sh --pull ``` ### Example 3: Pi/Aider Orchestration ```bash # Natural language command pi "Update documentation translations and rebuild the site" # Aider auto-commit aider --auto-commits \ --message "Sync translations from Crowdin" \ "docs/public/" ``` ### Example 4: GitHub Actions See `.github/workflows/crowdin-sync.yml` (optional CI/CD). --- ## Success Metrics ### MVP Launch - [ ] Crowdin project 883714 has English sources uploaded - [ ] Translators assigned to at least SLO + EN - [ ] `orchestrate-pipeline.sh --all` produces live site at docs.clawdie.si - [ ] Pi can execute: `pi "sync and rebuild docs"` - [ ] Weekly automation in place ### Phase 2 (Post-MVP) - [ ] DE, HR, SR translations at 80%+ - [ ] Automated weekly syncs running - [ ] Strapi ready (libvips compiled) - [ ] CMS content integration tested --- ## Quick Links | Resource | Path | Purpose | | ----------------------- | ------------------------------------------- | ----------------------------- | | **Skill** | `.agent/skills/docs-localization-pipeline/` | Executable automation | | **Architecture Doc** | `doc/THREE-BIRD-ARCHITECTURE.md` | This file | | **Crowdin Sync Script** | `./scripts/crowdin-sync.sh` | Manual push/pull/status | | **Crowdin Config** | `.crowdin.yml` | Project settings | | **AGENTS.md** | `AGENTS.md` | Pi/Aider harness guidance | | **Astro Example** | `examples/astro-cv/` | Reference Starlight setup | --- ## References - **Crowdin:** https://crowdin.com/project/clawdie-ai - **Astro Starlight:** https://starlight.astro.build/ - **Crowdin API:** https://developer.crowdin.com/api/