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.7publishedInvalid 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:
| Type | Purpose |
|---|---|
AgentService | Adds a dynamic service/route block for an agent. |
AgentPlugin | Adds a plugin associated with generated agent routing. |
KongEmitOptions | Carries gateway, JWT, consumer, and dynamic agent extension options. |
Workflow
- Inspect the consumer path, usually
packages/flowstate-workers/src/orchestrator/kong-routes.ts. - Build sorted
agentServicesandagentPluginsfrom the authoritative registry state. - Pass them into
emitKong; do not use marker replacement as the primary generation path. - Preserve
JWT_CLAIMS_LUAreuse so agent routes do not drift from base route identity handling. - Add tests that call
emitKong(ROUTES, optionsWithAgents)twice and compare deterministic output. - 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 flag | Correction |
|---|---|
Code searches for AUTO-GENERATED AGENT ROUTES to patch YAML | Replace the patch path with full emitKong regeneration or keep marker handling only as legacy migration. |
| Dynamic services appear in random order | Sort registry-derived input before calling emitKong. |
| Agent routes use a copied Lua string | Reuse JWT_CLAIMS_LUA or generated post-function behavior from this package. |
Consumer tests mock away emitKong behavior completely | Add 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
| Skill | Type | Trigger | Teaches | Evidence | Depends On | Dojo |
|---|---|---|---|---|---|---|
flowstate-gateway-routes | orchestrator | Any gateway route package task | Task classification, subskill routing, verification | package skill, route source | none | ready-after-review |
flowstate-gateway-routes-route-table | workflow | Add, remove, order, or diagnose routes | ROUTES, route scope, auth, path matching | src/routes.ts, src/types.ts | logical bindings | ready-after-review |
flowstate-gateway-routes-logical-bindings | reference | Add or debug service bindings | LogicalService, cloud/local bindings, reverse lookup | src/logical.ts | route table | ready-after-review |
flowstate-gateway-routes-kong-emitter | workflow | Render or debug Kong YAML | emitKong, JWT, CORS, stubs, agent injections | src/emit-kong.ts, tests | route table, logical bindings | ready-after-review |
flowstate-gateway-routes-agent-kong-extensions | workflow | Add orchestrator-managed agent services/plugins | deterministic full regeneration | emit-kong.ts, worker orchestrator consumer | Kong emitter | ready-after-review |
flowstate-gateway-routes-cloud-emitter | workflow | Render or debug cloud route tables | emitCfRoutes, scope filtering, route order | src/emit-cf.ts, tests | route table | ready-after-review |
flowstate-gateway-routes-smoke-specs | workflow | Add or audit smoke specs | safe smoke probes and export workflow | src/smoke.ts, export script | route table | ready-after-review |
flowstate-gateway-routes-maintenance | maintenance | Sync vendored source, docs, feature inventory, or Dojo | upstream sync, release checks, downstream consumers | README, package scripts, consumer refs | all package skills | ready-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 Group | Source Evidence | Covered By | Notes |
|---|---|---|---|
| Route table | src/routes.ts, route tests | flowstate-gateway-routes-route-table | Includes order, auth, CORS, rate limit, path matching. |
| Logical bindings | src/logical.ts | flowstate-gateway-routes-logical-bindings | Covers cloud/local mapping parity. |
| Kong emission | src/emit-kong.ts | flowstate-gateway-routes-kong-emitter | Includes JWT claim extraction and stubs. |
| Agent route injection | emitKong options and worker consumers | flowstate-gateway-routes-agent-kong-extensions | Requires deterministic input. |
| Cloud emission | src/emit-cf.ts | flowstate-gateway-routes-cloud-emitter | Covers scope filtering and order. |
| Smoke specs | src/smoke.ts, export script | flowstate-gateway-routes-smoke-specs | Must remain safe/idempotent. |
| Vendored maintenance | README, package scripts, downstream refs | flowstate-gateway-routes-maintenance | Community 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
| Severity | Skill | Issue | Evidence | Required Fix |
|---|---|---|---|---|
| Minor | flowstate-gateway-routes-maintenance | Dojo 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 Group | Status | Skill | Notes |
|---|---|---|---|
| Route table | Covered | flowstate-gateway-routes-route-table | Operational route workflow present. |
| Logical bindings | Covered | flowstate-gateway-routes-logical-bindings | Reference-style binding rules present. |
| Kong emitter | Covered | flowstate-gateway-routes-kong-emitter | Includes local gateway pitfalls. |
| Agent Kong extensions | Covered | flowstate-gateway-routes-agent-kong-extensions | Handles dynamic agent route generation. |
| Cloud emitter | Covered | flowstate-gateway-routes-cloud-emitter | Covers scope filtering. |
| Smoke specs | Covered | flowstate-gateway-routes-smoke-specs | Covers safe smoke criteria. |
| Maintenance | Covered | flowstate-gateway-routes-maintenance | Includes vendored sync and Dojo gate. |
Drift and Contract Risks
| Area | Risk | Evidence | Decision |
|---|---|---|---|
| Vendored source | Community package can drift from platform canonical source. | README and maintenance skill. | Keep maintenance skill as required handoff after route behavior changes. |
| Published Dojo | Existing 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 ./skillsReplace <target> with your agent target identifier. See the CLI docs for details.