libs

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2026 License: MIT

README

Krewire Libraries

Krewire Libraries is a monorepo of modular, reusable Go libraries for the Krewire ecosystem — github.com/krewire/libs. It provides the shared building blocks behind framework, mdbind, and kiw.

The unified framework vision (KWF-M8K2Q) relies on libs for a single, typed krewire.yaml across all eight project kinds (app, cli, site, book, worker, service, infra, kernel).

Overview

Each concern is an independent package, versioned and released on its own schedule. Consumers pull only what they need. Where the Go standard library already covers a concern (flag, log/slog, os), libs does not re-implement it.

Packages

Path Description
core/ Business rules & workload registryKind/Workload matrix, SpecID/RequirementID, Project invariants, DomainEvent + shared primitives (ExitCodeSuccess/Failure/Usage). Declarative control plane (KWL-K1N2Q).
kern/ Kernel executor & supervisor — generic Kernel/Module/Registry/Executor/Supervisor for boot, lifecycle, and workload dispatch. Imperative control plane (KWL-KERN-X8P3L).
log/ Canonical slog logger factory — installs the process logger (JSON/text, level) from core.Env/debug; bridges error diagnostics into structured attrs.
term/ Terminal I/O, output formatting, and color conventions.
config/ Typed krewire.yaml loading for all 8 kinds (delegates business validation to core).
validate/ Struct validation (validate:"required" tags) for config and resource schemas.

Together core (declarative) + kern (imperative) form the central control of the ecosystem: every repo imports core for types/rules, and framework/krewire compose via kern. config + validate enforce the single-config rule — every workload from cli to infra is described in one krewire.yaml and validated before kiw build / kiw deploy.

Standard library responsibilities that libs intentionally does not duplicate:

Concern Stdlib package
Argument parsing flag
Structured logging log/slog
Environment / config sources os, strconv

Getting Started

Prerequisites
Building and testing
go build ./...
go test ./...
gofmt -l . && go vet ./...

Specifications

  • KWL-CORE-K1N2Q — Core Business Rules & Workload Registry (declarative control plane)
  • KWL-KERN-X8P3L — Kernel Executor & Supervisor (imperative control plane)
  • KWL-CONFIG-2X1QZ — Configuration loading
  • KWL-VALIDATE-LHANF — Struct validation
  • KWL-CORE-W0J2X — Errors & exit codes (extended by K1N2Q)
  • KWL-TERM-R934Y — Terminal I/O & rendering

All specs live in docs/specs/ (KWL-*).

  • framework — unified framework (tui/web+ssg/ui/app/runtime/worker/service/infra)
  • mdbind — book/site builder on framework/web
  • kiw — devtool CLI for all kinds

License

MIT — see LICENSE.

Directories

Path Synopsis
Package config provides typed configuration loading from YAML files with environment-variable overlay for the Krewire ecosystem.
Package config provides typed configuration loading from YAML files with environment-variable overlay for the Krewire ecosystem.
Package core provides shared primitives for the Krewire ecosystem, including the common error type and process exit-code mapping.
Package core provides shared primitives for the Krewire ecosystem, including the common error type and process exit-code mapping.
Package kern provides the Krewire Kernel — the imperative control plane that boots, supervises, and executes workloads.
Package kern provides the Krewire Kernel — the imperative control plane that boots, supervises, and executes workloads.
Package log provides the ecosystem's canonical logger factory: one place decides handler format and verbosity from the environment and debug switch so every binary logs consistently (KWL-P8W2N KWL-LOGV-004).
Package log provides the ecosystem's canonical logger factory: one place decides handler format and verbosity from the environment and debug switch so every binary logs consistently (KWL-P8W2N KWL-LOGV-004).
Package markdown provides the shared Goldmark-based Markdown renderer for the Krewire ecosystem.
Package markdown provides the shared Goldmark-based Markdown renderer for the Krewire ecosystem.
Package term provides terminal I/O, output formatting, and color conventions for the Krewire ecosystem.
Package term provides terminal I/O, output formatting, and color conventions for the Krewire ecosystem.
Package validate validates structs using rules declared in `validate` struct tags.
Package validate validates structs using rules declared in `validate` struct tags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL