atomic

flowstate-epic-flowstate-community-epicdm-flowstate-obs-middleware

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

Tags

Publisher

Versions

1 version published — latest: 1.0.7

  • 1.0.7
    publishedInvalid Date

Skill

flowstate-obs-middleware Package Skill

Package: @epicdm/flowstate-obs-middleware Repository: epic-flowstate-community Path: packages/obs-middleware Version: 1.0.7

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

Primary Package Workflow

OBS Middleware Async Context And Request Logging

Status: Active Purpose: Preserve request-scoped context and HTTP request logging behavior. Scope: src/async-context.ts and src/request-logger.ts. Trigger: A task touches request IDs, request context, response headers, request log data, skip paths, or status-based log levels. Input: Express request/response behavior and logging expectations. Output: Request logs with correct context and noise filtering.


Async Context

createAsyncContextMiddleware():

  • Reads x-request-id, x-trace-id, x-user-id, and x-domain-id.
  • Generates req_<timestamp><random> when request ID is absent.
  • Sets response header x-request-id.
  • Runs next() inside AsyncLocalStorage.run().

Request Logger

createRequestLogger():

  • Logs on response finish.
  • Skips /health, /healthz, /ready, /readyz, and /metrics.
  • Logs method, path, statusCode, duration, and contentLength.
  • Uses info for 2xx/3xx, warn for 4xx, error for 5xx.

Verification

yarn workspace @epicdm/flowstate-obs-middleware test -- async-context
yarn workspace @epicdm/flowstate-obs-middleware test -- request-logger

Red Flags

Red flagCorrection
Calling next() outside AsyncLocalStorage.run()Keep request context active for downstream async handlers.
Logging health endpointsPreserve skip path filtering.
Not using req.originalUrl fallbackPreserve fallback when req.path is absent.

Created: 2026-06-29

Package Skill Inventory

@epicdm/flowstate-obs-middleware Skill Inventory

Inventory date: 2026-06-29 Package path: packages/obs-middleware Dojo status: local skills authored; publication deferred until package skill review and repo-wide Dojo sync.

Skill Map

SkillTypeUse when
flowstate-obs-middlewareworkflowAn agent needs to use or change the middleware package and choose the right focused skill.
flowstate-obs-middleware-configurationworkflowA task changes options, env vars, log-level decisions, enablement, or client creation.
flowstate-obs-middleware-async-request-loggingworkflowA task touches request context propagation or HTTP request logging.
flowstate-obs-middleware-logger-batchingworkflowA task touches structured app logging, buffering, flushing, or obs-client log delivery.
flowstate-obs-middleware-error-healthworkflowA task touches error handler behavior, health checks, custom checks, or status responses.
flowstate-obs-middleware-consumer-integrationworkflowA task updates downstream packages that import middleware or logger helpers.
flowstate-obs-middleware-maintenanceworkflowA task updates docs, tests, feature inventory, Dojo artifacts, package metadata, or release verification.

Composition

Start with flowstate-obs-middleware. For full Express setup, compose:

  1. flowstate-obs-middleware-configuration
  2. flowstate-obs-middleware-async-request-logging
  3. flowstate-obs-middleware-logger-batching
  4. flowstate-obs-middleware-error-health
  5. flowstate-obs-middleware-consumer-integration
  6. flowstate-obs-middleware-maintenance

Review Notes

The generated Dojo skillset under .flowstate/dojo/agent-skillset.md is not sufficient for publication as-is. It lists function names but does not teach Express ordering, disabled/no-key behavior, log batching, error ingestion TODOs, or health-check semantics.

Review Gate

@epicdm/flowstate-obs-middleware Skills Review

Review date: 2026-06-29 Reviewer: Codex Status: reviewed with verification notes

Evidence Used

  • packages/obs-middleware/package.json
  • packages/obs-middleware/README.md
  • packages/obs-middleware/src/index.ts
  • packages/obs-middleware/src/middleware.ts
  • packages/obs-middleware/src/config.ts
  • packages/obs-middleware/src/async-context.ts
  • packages/obs-middleware/src/logger.ts
  • packages/obs-middleware/src/request-logger.ts
  • packages/obs-middleware/src/error-handler.ts
  • packages/obs-middleware/src/health.ts
  • packages/obs-middleware/src/types.ts
  • packages/obs-middleware/tests/**/*.test.ts
  • packages/obs-middleware/.flowstate/feature-matrix/inventory.md
  • packages/obs-middleware/.flowstate/dojo/agent-skillset.md

Quality Gate

  • Source-backed purpose: pass
  • Public entry points captured: pass
  • Package connections captured: pass
  • Composable skill inventory: pass
  • Skills formatted with name and trigger-focused description: pass
  • Generated-skill replacement quality: pass
  • Verification commands run: pass with warnings noted

Drift Findings

  • Error handler source has a TODO: obs-server error ingestion is not implemented until obs-client supports errors.create().
  • OBS_LOG_LEVEL is cast to LogLevel without runtime validation.
  • Existing lint warnings are mostly unsafe any, floating promises, unbound methods, and require-await.
  • .flowstate/docs uses an older flat package-docs shape without workflow/troubleshooting/maintenance sections.
  • Feature matrix contains duplicate GET /health route entries.
  • Generated Dojo ID/publisher metadata drifts between skill.yaml and sync-state.json.
  • Generated Dojo skillset is export-list oriented and not ready to publish.

Verification Results

  • ASCII scan for package-local skills: passed.
  • Skill frontmatter scan for all SKILL.md files: passed.
  • yarn workspace @epicdm/flowstate-obs-middleware test --runInBand --no-cache: passed, 7 suites, 57 tests; logger test emits expected console warning.
  • yarn workspace @epicdm/flowstate-obs-middleware typecheck: passed.
  • yarn workspace @epicdm/flowstate-obs-middleware build: passed.
  • yarn workspace @epicdm/flowstate-obs-middleware lint: passed with 67 existing warnings.
  • yarn nx build @epicdm/flowstate-obs-middleware: passed with obs-client dependency; Nx read outputs from local cache and reported setup notice.

Publication Decision

Do not publish the existing generated Dojo skilllets. Publish only after local package skill verification and the repo-wide Dojo sync step convert these reviewed skills into Dojo payloads.

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-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-epic-flowstate-community-epicdm-flowstate-obs-middleware --target <target> --out ./skills

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