flowstate-flowstate-platform-epicdm-flowstate-id-api
Package-local agent skill for @epicdm/flowstate-id-api.
Tags
Publisher
Versions
1 version published — latest: 0.0.1
- 0.0.1publishedInvalid Date
Skill
flowstate-id-api Package Skill
Package: @epicdm/flowstate-id-api
Repository: flowstate-platform
Path: packages/worker-id-api
Version: 0.0.1
Use this published Dojo skill as the package-level entrypoint. For detailed workflows, use the package-local skills listed below.
Primary Package Workflow
Identity API Tenant RBAC
Status: Active
Purpose: Help agents modify identity API routes without breaking tenant isolation or admin gates.
Scope: packages/worker-id-api
Trigger: Route, schema, middleware, or test work for /auth/* identity endpoints.
Input: Target route behavior, expected tenant collection, auth requirements.
Output: Source and tests that preserve tenant-scoped RBAC behavior.
Workflow
- Start at
src/index.tsand confirm middleware order./auth/*getscreateTenantMiddleware(). Admin route groups also getrequireAdminMiddleware()for exact and wildcard paths. - Edit the matching route factory under
src/routes/and the matching Zod/OpenAPI schemas undersrc/schemas/. - Use
TenantClientmethods fromsrc/lib/tenant-client.ts; do not add direct D1 access in this package. - Preserve tenant selectors. Most reads and writes must include
tenant.orgId,tenant.tenantUserId, active status, or collection-specific scope fields. - Return through
ok,created,noContent, anderrfrom@epicdm/flowstate-api-corewhere local route patterns already use them. - Add or update tests in
test/routes/and middleware tests when auth behavior changes.
Source Map
| Concern | Files |
|---|---|
| App and middleware order | src/index.ts |
| Tenant REST proxy | src/lib/tenant-client.ts |
| Route behavior | src/routes/*.ts |
| Request/response validation | src/schemas/*.ts |
| Route verification | test/routes/*.test.ts, test/middleware/*.test.ts |
Example
For a membership route change:
- Check
src/routes/memberships.tsfor collection names and active membership rules. - Check
src/schemas/memberships.tsfor request validation. - Add a test in
test/routes/memberships.test.tsthat asserts the tenant client query includesorgId.
Verification
yarn test test/routes/<area>.test.tsyarn typecheckyarn generate:openapiwhen OpenAPI route metadata or schemas changed.
Composition
- Use
flowstate-id-api-token-lifecyclefor token routes. - Use
flowstate-rxdb-d1-rest-rbacwhen the failure is in tenant worker REST enforcement rather than this API wrapper.
Package Skill Inventory
worker-id-api Skill Inventory
Package: @epicdm/flowstate-id-api
Purpose: Identity, RBAC, schema permission, invitation, service account, and token API over tenant worker collections.
| Skill | Type | Use When | Source Anchors |
|---|---|---|---|
flowstate-id-api-tenant-rbac | Workflow | Changing or debugging user, role, membership, ACL, invitation, service-account, or schema-permission routes. | src/index.ts, src/lib/tenant-client.ts, src/routes/*.ts, src/schemas/*.ts, test/routes/*.test.ts |
flowstate-id-api-token-lifecycle | Workflow | Changing token creation, listing, revocation, cleanup, or token sanitization behavior. | src/routes/tokens.ts, src/schemas/tokens.ts, src/lib/helpers.ts, test/routes/tokens.test.ts |
Composition
- Compose with
packages/worker-rxdb-d1/.flowstate/skills/flowstate-rxdb-d1-rest-rbacwhen a route bug crosses into tenant worker REST behavior. - Compose with
packages/worker-mcp/.flowstate/skills/flowstate-mcp-tenant-tool-proxywhen MCP RBAC tools call identity data indirectly through tenant dispatch.
Exclusions
- Do not create one skill per route file. The route groups share the same middleware, tenant client, response helpers, and test pattern.
- Do not write Dojo output from this pass. Local package skills are the source of truth.
Review Gate
worker-id-api Skill Review
Reviewed: 2026-06-30 Result: Pass for local agent use.
Checks
- Skills are based on source files and tests, not generated feature lists.
- Each skill has YAML frontmatter with
nameand trigger-focuseddescription. - Skills identify concrete routes, schemas, middleware, commands, and cross-package composition.
- Scope is package-local and limited to
.flowstate/skills.
Follow-up
- Re-run after any new route group is added to
src/index.ts. - If token format changes in
src/lib/helpers.ts, updateflowstate-id-api-token-lifecycle.
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/worker-id-api/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-flowstate-platform-epicdm-flowstate-id-api --target <target> --out ./skillsReplace <target> with your agent target identifier. See the CLI docs for details.