logging-scaffoldlisted
Install: claude install-skill bakw00ds/yakos
# Logging scaffold
## Purpose
Drop in a working structured logger for the project's primary
backend language. Operator runs this once per project. After
that, `rule:logging-discipline` keeps the discipline going.
This skill is the FIRST half of the soft+hard pairing for
Standard 1 (logging). The rule is the second half.
## Scope
Operates on the operator's project repo, NOT on
`~/github/yakOS/`. Adds a logger module + example wiring;
doesn't touch existing log call sites (those evolve via normal
dev work).
NOT in scope:
- Log SHIPPING infrastructure (Loki / Datadog / Splunk / CloudWatch)
- Distributed tracing setup (OpenTelemetry)
- Log rotation / disk management
- Replacing existing custom loggers (operator decides)
## Automated pass
1. Detect primary backend language from project files:
- `go.mod` → Go
- `package.json` with `express`/`fastify`/`koa`/`nest` →
Node/TS
- `pyproject.toml` or `requirements.txt` with `django`/`flask`/
`fastapi` → Python
- `Cargo.toml` with `axum`/`actix` → Rust
- Otherwise: ask operator via `--lang` flag
2. Read `.yakos.yml` `profile.logging` (format, levels) for
config overrides.
3. Drop in logger module per language:
### Go variant
- Writes `internal/log/log.go` with `slog`-based logger
- JSON handler; reads `LOG_LEVEL` env (debug|info|warn|error)
- Example wiring in `cmd/server/main.go` if such file exists
### Node/TS variant
- Writes `src/lib/log/index.ts` with `pino` setup
- Adds `pino` to `package.json