# .factory — software factory orchestrator Размещение: `/.factory/` (сиблинг `.common/`). ## Слои - **L0a — System bootstrap (toolchain).** Голая ОС → git, mise, runtime'ы (node/python/go), опционально Claude Code / Cursor / Ollama. Native shell скрипты. - **L0b — Factory bootstrap.** Спросить `$PROJECTS_DIR` → склонировать `.factory/` (если ещё нет) → записать `~/.config/factory/home.toml` → отдать управление в L1. - **L1 — `factory` CLI** (Go-бинарь). Читает `factory.yaml`, обходит DAG зависимостей, запускает health-check'и и, при необходимости, setup-инструкции (L2). - **L2 — `setup-*` skills** в `claude-skills/`. Уже существуют. L1 их вызывает (или печатает инструкцию запустить через slash-command). ## Статус | Слой | Статус | |------|--------| | L0a | ✅ field-test complete (install-log.md) | | L0b | ✅ bootstrap.ps1 + bootstrap.sh созданы | | L1 | ⏳ Go-бинарь в разработке (structure done, build pending) | | factory.yaml | ✅ manifest schema создан | ## Структура ``` .factory/ ├── factory.yaml # Manifest компонентов ├── bootstrap.ps1 # L0b Windows bootstrap ├── bootstrap.sh # L0b Linux/Mac bootstrap ├── go.mod # Go module ├── cmd/ │ └── factory/ │ └── main.go # CLI entry point (cobra) ├── pkg/ │ ├── config/ # home.toml чтение │ ├── manifest/ # factory.yaml парсинг │ └── health/ # Health-check логика ├── L0/ │ └── install-log.md # Field-test лог └── .wiki/ └── concepts/ └── factory-bootstrap.md ``` ## Сборка L1 Требуется Go 1.23+: ```powershell # Windows (pwsh) cd C:\Users\vitya\projects\.factory go build -o dist/factory.exe ./cmd/factory # Linux/Mac cd ~/projects/.factory go build -o dist/factory ./cmd/factory ``` ## Команды L1 ``` factory install [component...] # Install components factory update [component...] # Update installed factory status # Show health table factory diagnose # Diagnose component ``` ## Точки входа - **Новый сотрудник на голой машине:** 1. `irm https://git.kzntsv.site/OpeItcLoc03/factory/raw/branch/master/bootstrap.ps1 | iex` 2. Ответить на вопросы (gitea URL, projects_dir, etc.) 3. `cd .factory && claude` 4. В Claude: `/login`, `/plugin install ...`, `/setup-*` ... - **Существующая машина (миграция):** 1. `git clone ... .factory` 2. `factory install` напрямую ## TODO - [ ] go-git clone/update имплементация - [ ] Post-install shell script execution - [ ] Cross-compile в dist/ (Win/Mac/Linux × amd64/arm64) - [ ] Integration test на чистой VM