Review Scalekit code
Review a Scalekit snippet. Then stop. Do not write a new login.
Guardrails
- MUST review only. MUST NOT write a new login, callback, session, or logout.
- MUST open references/REFERENCE.md and references/COMMON-MISTAKES.md. Do not paste them here.
- MUST say "This method could not be verified" when a call is not in the reference or a live source.
- MUST NOT treat
SCALEKIT_ENV_URLas valid. The env name isSCALEKIT_ENVIRONMENT_URL. Do not prependhttps://.
Gotchas
- If the user has no snippet and wants new auth, name the implementing skill and stop.
- SaaSKit login →
implement-saaskit(Node),implement-saaskit-nextjs, orimplement-saaskit-python. - AgentKit →
integrate-agentkit. SCIM →implement-scim. SSO →implement-sso. Sessions after login →manage-saaskit-sessions. - A one-line corrected call is review. A new auth flow is generation. Do not generate.
- Cookies:
httpOnly,securein production,sameSite: 'lax'. Neverstrict. next/returnTois a relative path only.- Client is a module-level singleton.
Step 1 — Confirm this is a review
Need an existing snippet.
- No snippet, or the user asked to generate login / callback / logout → name
implement-saaskit(or the sibling for Next.js, Python, AgentKit). Stop. - Snippet exists → stay.
Done when: a snippet is in hand, or the implementing skill is named and this skill has stopped.
Step 2 — Identify language and product
| Language | Package | Import |
|---|---|---|
| Node.js / TypeScript | @scalekit-sdk/node |
import { ScalekitClient } from '@scalekit-sdk/node' |
| Python | scalekit-sdk-python |
from scalekit import ScalekitClient |
| Go | scalekit-sdk-go |
import scalekit "github.com/scalekit-inc/scalekit-sdk-go/v2" |
| Java | scalekit-sdk-java |
import com.scalekit.ScalekitClient; |
Product: SaaSKit (login, sessions, SSO, SCIM, RBAC) or AgentKit (connections, tools, MCP auth).
Done when: language, package, and product are named.
Step 3 — SDK correctness
Open references/REFERENCE.md. Then stop reading it.
For every Scalekit call, record pass or fail:
- Import path matches the table
- Method name exists for that SDK
- Parameters match name, order, and type
- Return shape is handled (Promise, dict,
(result, error), checked exception) - Client is constructed from
SCALEKIT_ENVIRONMENT_URL,SCALEKIT_CLIENT_ID,SCALEKIT_CLIENT_SECRET
If the snippet is raw HTTP, check the REST section of that same file: path, method, and Bearer token from POST /oauth/token.
Open references/COMMON-MISTAKES.md for the wrong → right pairs. Then stop reading it.
Done when: every Scalekit call is pass, fail, or "could not be verified".
Step 4 — Flow and security
Record pass, fail, or waive (not in this snippet) for:
- Login has a callback
- Callback compares stored
stateto the querystatebeforeauthenticateWithCode - Logout calls
getLogoutUrlwithidTokenHint - Refresh exists if
offline_accessis used - Cookies are
httpOnly,securein production,sameSite: 'lax' stateis cryptographically randomnextis a relative path- Secrets come from env vars
- Webhooks verify the signature on the raw body
- OAuth redirect uses
window.location.href, notrouter.push
Do not write the missing route. Name the implementing skill.
Done when: every item is pass, fail, or waive.
Step 5 — Environment
Record pass or fail for:
- Env name is
SCALEKIT_ENVIRONMENT_URL, neverSCALEKIT_ENV_URL - No
https://prepended onto a value that already has a scheme - Redirect URI matches the dashboard
- Domain is
https://<subdomain>.scalekit.com,.scalekit.dev, orhttps://app.<domain>(self-hosted)
Done when: all 4 rows have pass or fail.
Step 6 — Unknown methods
If a call is not in references/REFERENCE.md:
- Live SDK
REFERENCE.mdathttps://raw.githubusercontent.com/scalekit-inc/scalekit-sdk-{node,python,go,java}/main/REFERENCE.md - REST API at https://docs.scalekit.com/apis
- State: "This method could not be verified."
Do not invent a method.
Done when: every unknown call is verified or marked unverified.
Step 7 — Report and stop
For each fail: What's wrong → Why it matters → the correct call from the reference, or the implementing skill name.
If every check passed: say the snippet is right.
Do not write a new login.
Done when: the user has the report, and this skill has not written a new auth flow.
Reach for
- references/REFERENCE.md for signatures
- references/COMMON-MISTAKES.md for wrong → right pairs
implement-saaskitto write loginimplement-saaskit-nextjsfor Next.js App Routerimplement-saaskit-pythonfor Django, FastAPI, or Flaskintegrate-agentkitfor a connected accountimplement-scim/implement-sso/manage-saaskit-sessionswhen that is the gap
Live lookups
- Docs index: https://docs.scalekit.com/llms.txt
- REST API: https://docs.scalekit.com/apis
- SaaSKit docs: https://docs.scalekit.com/_llms-txt/saaskit-complete.txt
- AgentKit docs: https://docs.scalekit.com/_llms-txt/agentkit.txt
- MCP: https://mcp.scalekit.com