.agents/skills/auth-middleware/SKILL.md
Work on Madoc TS auth-related middleware, request guards, and state setup. Use when changing parse/set JWT behavior, auth error handling, or middleware order in services/madoc-ts.
npx skillsauth add digirati-co-uk/madoc-platform auth-middlewareInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Document the auth middleware chain so changes to JWT parsing, cookie handling, and authorization errors are consistent.
services/madoc-ts/src/middleware/parse-jwt.tsservices/madoc-ts/src/middleware/set-jwt.tsservices/madoc-ts/src/middleware/error-handler.tsservices/madoc-ts/src/middleware/site-api.tsservices/madoc-ts/src/utility/get-jwt-cookies.tsservices/madoc-ts/src/utility/get-token.tsparse-jwt.ts reads site-scoped cookies when a slug is present, refreshes expired tokens, and otherwise verifies Bearer tokens.parse-jwt.ts supports service tokens with user/site overrides via x-madoc-* headers.set-jwt.ts sets JWT cookies after authentication when an authenticated user exists but no JWT is in state.error-handler.ts maps auth errors and expired JWTs to 401 responses.services/madoc-ts/src/middleware/parse-jwt.ts to understand token sources and refresh behavior.services/madoc-ts/src/middleware/set-jwt.ts for JWT cookie issuance after login.services/madoc-ts/src/middleware/error-handler.ts to see how auth errors surface to clients.siteManager is instantiated in services/madoc-ts/src/middleware/site-api.ts if you touch token refresh logic.authenticatedUser state before set-jwttools
Work on Madoc TS shared utility helpers (JWT, metadata, errors, IIIF helpers, auth helpers). Use when changing core utility functions or shared helpers in services/madoc-ts.
development
Work on Madoc TS shared type definitions and schema contracts. Use when updating TypeScript types, JSON schema shapes, or cross-layer data contracts in services/madoc-ts.
tools
Understand and extend Madoc TS task automation, including bots and task-related extensions. Use when adding task automation, bot behavior, or task metadata resolution in services/madoc-ts.
development
Work on Madoc TS site SSR pipeline, HTML template injection, and site render data wiring. Use when changing site SSR behavior, template tokens, or site SSR data wiring in services/madoc-ts.