atomic

flowstate-flowstate-platform-epicdm-obs-hono-middleware

Package-local agent skill for @epicdm/obs-hono-middleware.

Tags

Publisher

Versions

1 version published — latest: 0.1.0

  • 0.1.0
    publishedInvalid Date

Skill

obs-hono-middleware Package Skill

Package: @epicdm/obs-hono-middleware Repository: flowstate-platform Path: packages/obs-hono-middleware Version: 0.1.0

Use this published Dojo skill as the package-level entrypoint. For detailed workflows, use the package-local skills listed below.

Primary Package Workflow

OBS Hono Middleware Integration Workflow

Status: Active Purpose: Compose observability middleware consistently across FlowState Hono services. Scope: packages/obs-hono-middleware Trigger: A Hono app needs observability, logging config changes, request context, error handling, or health checks. Input: Service name, project ID, version, env vars, and Hono app integration point. Output: Mounted middleware suite with tested logging and health behavior.


Workflow

  1. Create a suite with createObsHonoMiddleware(options) from src/middleware.ts. It returns obsContext, requestLogger, errorHandler, logger, and healthCheck.
  2. Resolve env-driven options with resolveConfigFromEnv(env) when a package has Cloudflare-style OBS_* variables. Override serviceName and version explicitly when needed.
  3. Mount context before request logging so createRequestLogger receives request IDs and service context.
  4. Use logger.withContext() for route-specific fields instead of rebuilding ad hoc log payloads.
  5. Call logger.flush() in tests or shutdown-sensitive paths when assertions depend on buffered remote transport.
  6. Before changing public types or return shape, check consumers with rg "@epicdm/obs-hono-middleware" packages --glob '!**/node_modules/**'.

Verification

  • yarn workspace @epicdm/obs-hono-middleware test
  • yarn workspace @epicdm/obs-hono-middleware typecheck

Configuration Reference

EnvMeaning
OBS_PROJECT_IDProject identifier; defaults to unknown.
OBS_API_KEYEnables remote log transport when present.
OBS_SERVER_URLRemote observability endpoint.
OBS_LOG_LEVELMinimum log level, default info.
OBS_ENABLEDSet to false to disable remote transport.
OBS_BATCH_SIZEBuffered log batch size.
OBS_FLUSH_INTERVALFlush interval in milliseconds.

Composition

  • Use worker package skills for route-specific logging decisions.
  • Use flowstate-api-core-worker-api-workflow when the Hono app also uses the shared API factory.

Package Skill Inventory

Skill Inventory: @epicdm/obs-hono-middleware

Created Skills

SkillTypeTrigger
obs-hono-middleware-integration-workflowWorkflowUse when integrating or changing FlowState Hono observability middleware.

Candidate Future Skills

CandidateReason to Split Later
obs-hono-middleware-transportRemote transport retry/failure behavior may need a troubleshooting reference.
obs-hono-middleware-request-contextRequest IDs and context propagation may become a cross-worker pattern.

Source Evidence

  • src/middleware.ts composes the suite.
  • src/config.ts resolves explicit options and OBS_* env values.
  • src/logger.ts implements batching, console logging, remote send, flush, and withContext.
  • src/__tests__/* verifies the package contract.

Review Gate

Review: @epicdm/obs-hono-middleware Skills

Result: Pass for source-backed package-local workflow guidance.

Checks

  • The skill teaches integration and mutation points, not a generated export list.
  • It cites suite composition, config, logger, and downstream callers.
  • Verification commands are package-local and lightweight.
  • Generated .flowstate/dojo files were not modified.

Residual Risk

Transport delivery semantics may deserve a deeper skill if retry/backoff behavior is added.

Usage

Start with this skill to understand the package purpose, then use the package-local focused skills for specific workflows. Keep this Dojo version aligned with packages/obs-hono-middleware/package.json. Do not treat generated feature lists as lessons; use workflow evidence from CODE-REVIEW.md, SKILL-INVENTORY.md, and REVIEW.md.

Install

Run this in your project to install via CLI:

fscloud dojo skill install flowstate-flowstate-platform-epicdm-obs-hono-middleware --target <target> --out ./skills

Replace <target> with your agent target identifier. See the CLI docs for details.