skills/auth-flow-designer/SKILL.md
Determines whether to use API keys, JWT, OAuth2, or mTLS. Designs token lifespans, refresh token strategies, and secure session management.
npx skillsauth add fatih-developer/fth-skills auth-flow-designerInstall 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.
This skill designs the authentication and authorization strategy for an API. It prevents developers from defaulting to "Just use JWTs for everything," ensuring the right security model is applied based on the consumers and the data sensitivity.
Core assumption: A leaked token is inevitable. The architecture must minimize the damage through short lifespans, refresh flows, and tight scopes.
Analyze the consumer type to pick the right strategy:
mTLS (Mutual TLS) or service-specific short-lived JWT signed by an internal KMS.API Keys with IP whitelisting, or OAuth2 Client Credentials flow.HttpOnly Cookies holding the session ID or a short-lived JWT. NEVER store JWTs in localStorage.OAuth2 Authorization Code Flow with PKCE. Use a refresh token rotation strategy.Define the rules of engagement:
user_id, role).Define how permissions are enforced:
admin, user).read:orders, write:profile. Ensure scopes are attached to the token payload so the API Gateway can reject requests before they hit the microservice.Required Outputs (Must write BOTH to docs/api-report/):
docs/api-report/auth-flow-report.md)### 🔐 Authentication Architecture Plan
- **Primary Consumer:** React Native Mobile App
- **Selected Flow:** OAuth2 Authorization Code Flow (PKCE)
- **Token Strategy:** JWT Access Token + Opaque Refresh Token (Rotated)
#### 🚦 Token Configurations
- **Access Token (JWT):** Lifespan: 15 minutes. Claims: `sub` (UUID), `roles` (Array).
- **Refresh Token (Opaque):** Lifespan: 30 days. Action: Rotated on every use. Stored securely on the device encrypted enclave.
#### 🛡️ API Gateway Enforcement
The API Gateway must validate the JWT Signature and ensure `Scope: read:orders` exists before forwarding to the upstream service.
docs/api-report/auth-flow-output.json){
"skill": "auth-flow-designer",
"flow": "oauth2_pkce",
"client_type": "mobile",
"access_token": {"type": "JWT", "lifespan_min": 15},
"refresh_token": {"type": "Opaque", "lifespan_days": 30, "rotation": true},
"required_scopes": ["read:orders", "write:profile"]
}
HttpOnly cookies for web clients.tools
Create, optimize, critique, and structure prompts for AI systems. Use this skill whenever the user is designing or improving a prompt, system prompt, coding prompt, image prompt, evaluation rubric, agent prompt, workflow prompt, or MCP-oriented prompt package. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, or prompt architecture.
testing
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
testing
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
testing
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.