atomic

flowstate-epic-flowstate-community-epicdm-gateway-routes

Package-local agent skill for @epicdm/gateway-routes.

Tags

Publisher

Versions

1 version published — latest: 0.1.7

  • 0.1.7
    publishedInvalid Date

Skill

gateway-routes Package Skill

Package: @epicdm/gateway-routes Repository: epic-flowstate-community Path: packages/gateway-routes Version: 0.1.7

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

Primary Package Workflow

Gateway Agent Kong Extensions

Status: Active Purpose: Preserve the full-regeneration contract for orchestrator-managed agent Kong routes. Scope: packages/gateway-routes/src/emit-kong.ts plus consumers in packages/flowstate-workers/src/orchestrator/kong-routes.ts. Trigger: A task touches dynamic agent routing, agentServices, agentPlugins, Kong sidecar reconciliation, or worker-orchestrator gateway output. Input: Base ROUTES, agent service descriptors, agent plugin descriptors, and expected Kong output. Output: Deterministic Kong YAML generated by emitKong without manual string merging.


Core Rule

Do not splice Kong YAML fragments into a previously generated file. The orchestrator should gather current registry state, then call emitKong(ROUTES, { agentServices, agentPlugins, ...options }) so the whole config is regenerated consistently.

Data Shapes

Use exported types from @epicdm/gateway-routes:

TypePurpose
AgentServiceAdds a dynamic service/route block for an agent.
AgentPluginAdds a plugin associated with generated agent routing.
KongEmitOptionsCarries gateway, JWT, consumer, and dynamic agent extension options.

Workflow

  1. Inspect the consumer path, usually packages/flowstate-workers/src/orchestrator/kong-routes.ts.
  2. Build sorted agentServices and agentPlugins from the authoritative registry state.
  3. Pass them into emitKong; do not use marker replacement as the primary generation path.
  4. Preserve JWT_CLAIMS_LUA reuse so agent routes do not drift from base route identity handling.
  5. Add tests that call emitKong(ROUTES, optionsWithAgents) twice and compare deterministic output.
  6. Add tests that parse or structurally inspect the generated service, route, consumer, and plugin sections.

Example

import { ROUTES, emitKong, type KongEmitOptions } from '@epicdm/gateway-routes'

const options: KongEmitOptions = {
  gatewayPort: 7080,
  jwtIssuer: 'http://localhost:7080',
  jwtConsumer: 'flowstate-auth',
  agentServices,
  agentPlugins,
}

const yaml = emitKong(ROUTES, options)

Verification

yarn workspace @epicdm/gateway-routes test -- emit-kong
yarn workspace @epicdm/flowstate-workers test -- kong-routes

Run package typecheck after changing exported types.

Red Flags

Red flagCorrection
Code searches for AUTO-GENERATED AGENT ROUTES to patch YAMLReplace the patch path with full emitKong regeneration or keep marker handling only as legacy migration.
Dynamic services appear in random orderSort registry-derived input before calling emitKong.
Agent routes use a copied Lua stringReuse JWT_CLAIMS_LUA or generated post-function behavior from this package.
Consumer tests mock away emitKong behavior completelyAdd at least one integration-style test against real emitKong.

Created: 2026-06-29

Package Skill Inventory

Package Skill Inventory: @epicdm/gateway-routes

Package Context

This package teaches gateway route operations. Skills must route agents to the correct runtime boundary: route table, logical bindings, Kong, Cloudflare, smoke specs, dynamic agent routes, or package maintenance.

Skill Map

SkillTypeTriggerTeachesEvidenceDepends OnDojo
flowstate-gateway-routesorchestratorAny gateway route package taskTask classification, subskill routing, verificationpackage skill, route sourcenoneready-after-review
flowstate-gateway-routes-route-tableworkflowAdd, remove, order, or diagnose routesROUTES, route scope, auth, path matchingsrc/routes.ts, src/types.tslogical bindingsready-after-review
flowstate-gateway-routes-logical-bindingsreferenceAdd or debug service bindingsLogicalService, cloud/local bindings, reverse lookupsrc/logical.tsroute tableready-after-review
flowstate-gateway-routes-kong-emitterworkflowRender or debug Kong YAMLemitKong, JWT, CORS, stubs, agent injectionssrc/emit-kong.ts, testsroute table, logical bindingsready-after-review
flowstate-gateway-routes-agent-kong-extensionsworkflowAdd orchestrator-managed agent services/pluginsdeterministic full regenerationemit-kong.ts, worker orchestrator consumerKong emitterready-after-review
flowstate-gateway-routes-cloud-emitterworkflowRender or debug cloud route tablesemitCfRoutes, scope filtering, route ordersrc/emit-cf.ts, testsroute tableready-after-review
flowstate-gateway-routes-smoke-specsworkflowAdd or audit smoke specssafe smoke probes and export workflowsrc/smoke.ts, export scriptroute tableready-after-review
flowstate-gateway-routes-maintenancemaintenanceSync vendored source, docs, feature inventory, or Dojoupstream sync, release checks, downstream consumersREADME, package scripts, consumer refsall package skillsready-after-review

Anti-Sprawl Decision: Eight skills are warranted because the package has distinct public surfaces with different failure modes. Merging them would hide route/runtime safety rules.

Feature Coverage

Feature GroupSource EvidenceCovered ByNotes
Route tablesrc/routes.ts, route testsflowstate-gateway-routes-route-tableIncludes order, auth, CORS, rate limit, path matching.
Logical bindingssrc/logical.tsflowstate-gateway-routes-logical-bindingsCovers cloud/local mapping parity.
Kong emissionsrc/emit-kong.tsflowstate-gateway-routes-kong-emitterIncludes JWT claim extraction and stubs.
Agent route injectionemitKong options and worker consumersflowstate-gateway-routes-agent-kong-extensionsRequires deterministic input.
Cloud emissionsrc/emit-cf.tsflowstate-gateway-routes-cloud-emitterCovers scope filtering and order.
Smoke specssrc/smoke.ts, export scriptflowstate-gateway-routes-smoke-specsMust remain safe/idempotent.
Vendored maintenanceREADME, package scripts, downstream refsflowstate-gateway-routes-maintenanceCommunity copy should not drift silently.

Composition Model

Start with flowstate-gateway-routes, then route to the focused skill matching the touched public surface. Use maintenance after behavior changes to update docs, feature inventory, and Dojo artifacts.

Deferred Skills

No additional skills deferred. Downstream consumer-specific guidance belongs in those package skills.

Review Questions

  • Should the community package gain an automated upstream parity check?
  • Should Dojo publish IDs use the community package ID or canonical platform package ID when both exist?

Review Gate

Package Skills Review: @epicdm/gateway-routes

Verdict

Pass

Findings

SeveritySkillIssueEvidenceRequired Fix
Minorflowstate-gateway-routes-maintenanceDojo artifacts were generated placeholders before this sync pass.Existing .flowstate/dojo course text was feature-list shaped.Rebuild Dojo artifacts from reviewed skills before publish.

Coverage

Feature GroupStatusSkillNotes
Route tableCoveredflowstate-gateway-routes-route-tableOperational route workflow present.
Logical bindingsCoveredflowstate-gateway-routes-logical-bindingsReference-style binding rules present.
Kong emitterCoveredflowstate-gateway-routes-kong-emitterIncludes local gateway pitfalls.
Agent Kong extensionsCoveredflowstate-gateway-routes-agent-kong-extensionsHandles dynamic agent route generation.
Cloud emitterCoveredflowstate-gateway-routes-cloud-emitterCovers scope filtering.
Smoke specsCoveredflowstate-gateway-routes-smoke-specsCovers safe smoke criteria.
MaintenanceCoveredflowstate-gateway-routes-maintenanceIncludes vendored sync and Dojo gate.

Drift and Contract Risks

AreaRiskEvidenceDecision
Vendored sourceCommunity package can drift from platform canonical source.README and maintenance skill.Keep maintenance skill as required handoff after route behavior changes.
Published DojoExisting generated artifacts were not useful enough.Existing local Dojo placeholders.Rebuild from reviewed skills and reset publish verification.

Dojo Publication Decision

Ready after rebuilt skill.yaml, course.json, and sync-state.json pass local validation.

Follow-Up Work

  • Add automated upstream parity check if route drift becomes frequent.
  • Retry Cloud Dojo publish after authenticated session is repaired.

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/gateway-routes/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-gateway-routes --target <target> --out ./skills

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