implementing-saaskit-python
Installation
SKILL.md
SaaSKit Auth — Python
Implements Scalekit authentication in Django, FastAPI, or Flask using scalekit-sdk-python.
Guardrails
- MUST read
SCALEKIT_ENVIRONMENT_URL,SCALEKIT_CLIENT_ID, andSCALEKIT_CLIENT_SECRETfrom environment variables; MUST NOT hardcode credentials. - MUST compare the
oauth_statecookie against the callback'sstateparameter before callingauthenticate_with_code, and reject on mismatch (CSRF check). - MUST set the
oauth_statecookie withhttponly,secure, andsamesite="lax". - MUST NOT treat a successful callback as authenticated without completing
authenticate_with_codeand storing the result in the session — clear session/cookies on logout.
Framework detection
Before generating code, detect which framework is in use:
- Check for
djangoinrequirements.txt/pyproject.toml→ Django - Check for
fastapi→ FastAPI - Check for
flask→ Flask - If unclear, ask the user.