atomic

flowstate-epic-flowstate-community-epicdm-flowstate-tunnel-worker

Package-local agent skill for @epicdm/flowstate-tunnel-worker.

Tags

Publisher

Versions

1 version published — latest: 0.1.0

  • 0.1.0
    publishedInvalid Date

Skill

flowstate-tunnel-worker Package Skill

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

Tunnel Worker Auth And KV

Status: Active Purpose: Keep Worker authentication and KV indexes consistent. Scope: packages/flowstate-tunnel-worker/src/lib/auth.ts and src/lib/kv.ts Trigger: A task changes auth, provision secrets, org records, slug ownership, or tunnel reverse lookup. Input: Authorization header, org ID, slug, or TunnelKVRecord. Output: Correct auth decision and KV mutations.


Auth Modes

OperationSecret
registershared WORKER_API_KEY bearer token.
provision, status, heartbeat, teardownper-org provision secret stored in org:{orgId}.

Auth headers must be Bearer <token>.

Secrets are compared with a constant-time function to avoid early-return timing leaks.

KV Keys

KeyValue
org:{orgId}full TunnelKVRecord.
slug:{orgSlug}{ orgId } slug owner mapping.
tunnel:{tunnelId}{ orgId } reverse lookup, only written when tunnelId is set.

Consistency Rules

  • setOrgRecord writes org and slug keys together.
  • Re-registration deletes the previous slug mapping when slug changes.
  • Registration-only records have empty tunnelId; do not write a tunnel reverse lookup.
  • deleteOrgRecord mirrors setOrgRecord and deletes reverse lookup only when tunnelId exists.
  • updateLastSeen updates only the org record.

Verification

yarn workspace @epicdm/flowstate-tunnel-worker test -- src/__tests__/auth.test.ts src/__tests__/kv.test.ts

Package Skill Inventory

Skill Inventory: @epicdm/flowstate-tunnel-worker

Review date: 2026-06-30

Skill Map

SkillTypeUse When
flowstate-tunnel-workerOrchestratorSelecting the Cloudflare Worker tunnel control plane.
flowstate-tunnel-worker-endpoint-lifecycleWorkflowImplementing or debugging register/provision/status/heartbeat/teardown routes.
flowstate-tunnel-worker-auth-kvReference/workflowWorking with bearer auth and KV records/indexes.
flowstate-tunnel-worker-cloudflare-apiReference/troubleshootingCreating/configuring/deleting Cloudflare tunnels and DNS records.
flowstate-tunnel-worker-scheduled-cleanupWorkflowMaintaining stale tunnel cron cleanup behavior.
flowstate-tunnel-worker-maintenanceMaintenanceUpdating docs, tests, Dojo files, worker build/deploy behavior, or shared contracts.

Feature Coverage

Feature Matrix ItemsCovered By
endpoint route handlersflowstate-tunnel-worker-endpoint-lifecycle
validateApiKey, validateProvisionSecret, KV helpersflowstate-tunnel-worker-auth-kv
Cloudflare API helpersflowstate-tunnel-worker-cloudflare-api
handleScheduledflowstate-tunnel-worker-scheduled-cleanup
Worker fetch/scheduled entrypoint and Wrangler buildflowstate-tunnel-worker, flowstate-tunnel-worker-maintenance

Composition Notes

  • Use flowstate-tunnel skills when changing shared types, constants, or slug validation.
  • This package owns Worker behavior; the shared package owns vocabulary.

Review Gate

Package Skill Review: @epicdm/flowstate-tunnel-worker

Review date: 2026-06-30 Verdict: pass

Quality Gate

  • Source-backed package purpose: pass.
  • Public entry points documented: pass.
  • Composable skill map: pass.
  • Generated Dojo weaknesses called out: pass.
  • Dojo publish readiness: deferred until generated artifacts are rebuilt from reviewed skills.

Evidence Checked

  • package.json
  • src/index.ts
  • src/handlers/*.ts
  • src/lib/*.ts
  • src/scheduled.ts
  • .flowstate/feature-matrix/inventory.md
  • .flowstate/dojo/agent-skillset.md

Verification Results

yarn workspace @epicdm/flowstate-tunnel-worker test
yarn workspace @epicdm/flowstate-tunnel-worker typecheck
yarn workspace @epicdm/flowstate-tunnel-worker build
yarn workspace @epicdm/flowstate-tunnel-worker lint

Results:

  • ASCII/frontmatter check passed.
  • test passed: 4 files, 34 tests. Vitest emitted the existing Vite CJS Node API deprecation warning.
  • typecheck passed.
  • lint passed with 2 existing console.log warnings in src/scheduled.ts.
  • build passed via wrangler deploy --dry-run --outdir dist; Wrangler reported telemetry notice and an out-of-date v3 warning.

Dojo Status

Deferred. Existing generated Dojo artifacts should be rebuilt from reviewed local skills because current files split every helper into a feature skilllet instead of teaching endpoint lifecycle, auth/KV, Cloudflare API, and scheduled cleanup workflows.

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-tunnel-worker/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-tunnel-worker --target <target> --out ./skills

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