atomic

flowstate-epic-flowstate-community-epicdm-flowstate-domain-context

Package-local agent skill for @epicdm/flowstate-domain-context.

Tags

Publisher

Versions

1 version published — latest: 1.0.7

  • 1.0.7
    publishedInvalid Date

Skill

flowstate-domain-context Package Skill

Package: @epicdm/flowstate-domain-context Repository: epic-flowstate-community Path: packages/flowstate-domain-context 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

Domain Context Error Contracts

Use this skill when error behavior for missing or invalid tenancy context matters to an API route, middleware, CLI, or test.

Source Map

  • src/errors.ts: error classes and JSON serialization.
  • src/__tests__/validation.test.ts: expected error code, status, and serialized shape.

Error Contract

DomainContextError carries:

  • message: human-readable explanation.
  • code: machine-readable error code.
  • httpStatus: HTTP status, defaulting to 400.
  • toJSON(): { error, message, status }.

MissingDomainIdError is the required-domain error:

  • code: MISSING_DOMAIN_ID
  • HTTP status: 400
  • message explains that x-domain-id should be set by Kong gateway.

Guardrails

  • Preserve machine-readable error codes; downstream callers may assert on them.
  • Keep toJSON() stable unless every API consumer and test is updated.
  • Do not use missing-domain errors for missing org/workspace context; those are optional globally and should be enforced by specific routes when needed.
  • Avoid leaking request headers or tokens in error messages.

Verification

yarn workspace @epicdm/flowstate-domain-context test -- validation
yarn workspace @epicdm/flowstate-domain-context typecheck

Package Skill Inventory

Skill Inventory: @epicdm/flowstate-domain-context

Package path: packages/flowstate-domain-context.

Skillset

SkillUse WhenMain Source Evidence
flowstate-domain-contextChoosing the right domain-context workflow or preserving package contractspackage.json, src/index.ts, README.md
flowstate-domain-context-header-validationExtracting, validating, or sanitizing x-domain-id, x-org-id, or x-workspace-idsrc/validation.ts, src/__tests__/validation.test.ts
flowstate-domain-context-error-contractsHandling or changing structured domain-context errorssrc/errors.ts, src/__tests__/validation.test.ts

Composition Notes

  • Use header validation before changing auth, gateway, connector, worker, replication, or document-service request context behavior.
  • Use error contracts when callers need HTTP status, machine-readable code, or JSON serialization.
  • Do not create separate skills for each helper function; they are one request-context workflow.

Publication Readiness

Status: drafted, pending verification.

Before Dojo publication, rebuild package Dojo artifacts from this reviewed skillset.

Review Gate

Package Skill Review: @epicdm/flowstate-domain-context

Package path: packages/flowstate-domain-context.

Review Result

Status: drafted, source-backed, verified, pending publication.

The skillset is compact because the package has one real workflow: safe tenancy context extraction and validation.

Checks

  • Source review: completed from package metadata, exports, validation helpers, error classes, tests, README, reverse references, and generated artifact drift.
  • Skill inventory: completed.
  • Skill files: completed.
  • Verification: completed.
  • Generated Dojo replacement: pending.
  • Cloud Dojo publication: pending.

Verification Commands

Commands run:

yarn workspace @epicdm/flowstate-domain-context test
yarn workspace @epicdm/flowstate-domain-context typecheck
yarn workspace @epicdm/flowstate-domain-context build
yarn workspace @epicdm/flowstate-domain-context lint

Results:

  • Skill file ASCII scan passed.
  • Tests passed: 1 suite, 44 tests.
  • Typecheck passed.
  • Build passed.
  • Lint passed.

Publication Gate

Do not publish existing .flowstate/dojo artifacts until they are rebuilt from reviewed package skills.

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/flowstate-domain-context/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-domain-context --target <target> --out ./skills

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