flowstate-flowstate-platform-epicdm-flowstate-identity
Package-local agent skill for @epicdm/flowstate-identity.
Tags
Publisher
Versions
1 version published — latest: 0.1.0
- 0.1.0publishedInvalid Date
Skill
flowstate-identity Package Skill
Package: @epicdm/flowstate-identity
Repository: flowstate-platform
Path: packages/id
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
FlowState Identity OIDC Auth Workflow
Status: Active
Purpose: Preserve identity security invariants while changing auth flows, routes, or schema.
Scope: packages/id
Trigger: OIDC/OAuth, auth route, RBAC/ACL, wallet login, session, tenant auth, or identity DB schema changes.
Input: Target route or schema, expected auth context, tenant/org behavior, and test scenario.
Output: Validated identity behavior with matching route/query tests.
Workflow
- Identify the surface: OIDC routes live in
src/app/authorize/route.ts,src/app/api/oauth/token/route.ts, andsrc/app/.well-known/*; admin/RBAC APIs live insrc/app/auth/*; account APIs live insrc/app/api/account/*. - Validate all request input with existing Zod schemas in
src/lib/validation/*or add schemas there before parsing request data. - Preserve OIDC invariants: registered redirect URI validation, PKCE S256, one-time authorization code consumption,
noncepropagation, RS256 signing, active JWK lookup, and refresh-token family revocation. - For tenant-aware protected routes, use
requireAuthorrequireAdminfromsrc/lib/auth/auth-middleware.ts.requireAdminresolves identity user ID to tenant user ID before role lookup. - For DB changes, update
src/db/schema.ts, query helpers insrc/db/queries/*, and tests. Generate migrations only when schema changes are intended. - Check exported-schema consumers with
rg "@epicdm/flowstate-identity/db/schema" packages --glob '!**/node_modules/**'.
Verification
yarn workspace @epicdm/flowstate-identity testyarn workspace @epicdm/flowstate-identity typecheck- For schema changes:
yarn workspace @epicdm/flowstate-identity db:generate - For deployment-sensitive changes:
yarn workspace @epicdm/flowstate-identity build
Red Flags
| Red flag | Required action |
|---|---|
| Plain PKCE or missing code verifier | Stop and preserve S256-only authorization code flow. |
| Raw token storage | Store hashes or encrypted values according to the existing query/crypto pattern. |
Identity userId used for tenant role lookup | Resolve to tenant user ID first. |
| Hand-edited build output | Revert that local edit and change source only. |
Composition
- Use
auth-client-oidc-pkce-workflowwhen changing consumer-side OIDC behavior. - Use package-local marketplace/admin skills when exported schema changes affect those consumers.
Package Skill Inventory
Skill Inventory: @epicdm/flowstate-identity
Created Skills
| Skill | Type | Trigger |
|---|---|---|
flowstate-identity-oidc-auth-workflow | Workflow | Use when changing OIDC/OAuth, session, RBAC, tenant-aware auth, or identity schema behavior. |
Candidate Future Skills
| Candidate | Reason to Split Later |
|---|---|
flowstate-identity-wallet-auth | Wallet challenge/login/verification has separate security tests and docs. |
flowstate-identity-rbac-admin-api | Roles, permissions, ACL, service accounts, and tokens are large enough for focused admin API guidance. |
flowstate-identity-drizzle-schema | Schema/migration work deserves a reference if exported DB tables keep expanding. |
Source Evidence
README.mddescribes architecture, database tables, and security design.src/app/authorize/route.tsandsrc/app/api/oauth/token/route.tsimplement core OAuth flow.src/lib/auth/auth-middleware.tsimplements tenant-aware route authorization.src/db/schema.tsis the exported schema surface.src/__tests__/auth-*.test.ts,oidc-flow.integration.test.ts,wallet-*.test.ts, and DB query tests cover behavior.
Review Gate
Review: @epicdm/flowstate-identity Skills
Result: Pass for source-backed package-local workflow guidance.
Checks
- The skill is security-invariant driven rather than a generated route list.
- It cites route, schema, middleware, crypto, and test paths.
- It names safe and heavier verification commands separately.
- It avoids modifying API code, build outputs, generated
.flowstate/dojo,.next, or.open-next.
Residual Risk
This package is large. Wallet auth and RBAC admin APIs should be split into their own skills before major feature work in those areas.
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/id/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-identity --target <target> --out ./skillsReplace <target> with your agent target identifier. See the CLI docs for details.