mix deps.get
mix ci- Use the project Mix aliases; prefer
mix cifor the full validation suite. - Keep changes small, tested, and formatted.
- Core owns systemd/systemdkit and unitctl primitives.
- Integrations like Caddy, Forgejo, object storage, and monitoring are providers.
- Recipes compose higher-level deployments from plain resources; they must not hide uninspectable runtime behavior.
- DSLs must compile to plain, inspectable structs; runtime API must be primary and Mix tasks should wrap it.
- Prefer structured command forms (
argv,~SH,{command, args},env:) oversh -c. Use shell strings only at real shell boundaries, and document/escape them withHostKit.Shellhelpers. - For HostKit config authoring conventions, use
SKILL.md; keep it current whenever DSL/resource/path/file/template conventions change. - Rollback is modeled as a down plan. Keep changes centered on
Project -> Plan -> Applyand avoid introducing new entities unless existing plan/change/resource abstractions cannot express the behavior. - Apply progress is mailbox-first: use
reporter: pidand%HostKit.Apply.Event{}for user-facing progress. Telemetry may mirror events but must not become the primary apply API.
When changing public behavior, DSL, resource structs, recipes, providers, Mix tasks, plan/apply semantics, events, or integration workflows, update docs in the same change:
- README stays concise and product-oriented; link to guides instead of expanding it.
guides/reference/full-reference.mddocuments user-facing DSL/API details and examples.guides/reference/cli.mddocuments Mix task flags, command shape, and examples.guides/reference/internal-architecture.mddocuments internal entities, plan/apply/down-plan flow, event flow, and Mermaid diagrams. Update diagrams when relationships change.- Deployment guides under
guides/deployment/document provider/recipe-specific operational flows. - Livebook demos under
notebooks/learn/should remain teaching material with the flow: settings -> declaration -> plan -> apply -> verify. - Examples under
examples/should stay executable and reflect current preferred APIs.
Doc quality rules:
- Prefer one canonical explanation and link to it from README/other guides.
- Keep Mermaid diagrams valid and focused; update them when adding/removing core concepts.
- Document new event types and event payload fields where they are introduced.
- Document new convention roots, default paths, and artifact/run tracking behavior.
- If a public API is intentionally not documented yet, call that out in the PR/commit rationale.
- Test structure should mirror code structure where practical, e.g.
lib/host_kit/plan.ex->test/host_kit/plan/andlib/mix/tasks/*.ex->test/mix/tasks/. - Prefer exercising public APIs in integration tests. For rollback/down behavior, use down plans and
HostKit.IntegrationCase.on_exit_rollback/3rather than only hand-rolled cleanup. - In tests and helpers, do not build HostKit DSL snippets with interpolated strings. Use quoted AST (
quote/unquotewithCode.eval_quoted/1) or plain runtime structs/APIs so dynamic values remain syntax-safe and refactorable. - Keep fallback cleanup for resources that are intentionally not reversible yet.
- Livebook integration tests belong under
test/integration/livebook/.