一键导入
auth-flow-designer
Determines whether to use API keys, JWT, OAuth2, or mTLS. Designs token lifespans, refresh token strategies, and secure session management.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Determines whether to use API keys, JWT, OAuth2, or mTLS. Designs token lifespans, refresh token strategies, and secure session management.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, optimize, critique, and programmatically structure prompts for AI systems. Use this skill whenever the user is designing or improving a static prompt, system prompt, coding prompt, agent prompt, workflow prompt, MCP-oriented prompt package, or an algorithmic prompt optimization pipeline. Also use it when the user asks to turn vague AI behavior into a precise instruction set, tool policy, agent spec, evaluation metric, or prompt architecture.
Enforce and manage DESIGN.md specifications, extract design systems from URLs, and combine design reasoning with token roles to prevent drift.
Assumption-first architecture review skill to stress-test project plans and expose hidden risks.
Forces the agent to act with a Claude-like product mindset, prioritizing user journey, UX states, and visual quality before coding.
Compiles and extracts session knowledge into a living, interconnected LLM-Wiki. Instead of writing isolated logs, it identifies key entities, updates cross-referenced topic files in docs/knowledgelib/, and maintains an index and chronological log. Use this to ensure persistent, compounding project knowledge.
Overrides the agent's behavior to enter an interactive, consulting mode. Instead of guessing or immediately executing a task, the agent will analyze the request and ask guiding, targeted questions to clarify intent, constraints, and requirements first.
| name | auth-flow-designer |
| description | Determines whether to use API keys, JWT, OAuth2, or mTLS. Designs token lifespans, refresh token strategies, and secure session management. |
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.