workos 0.8.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/README.md +10 -8
  2. package/dist/bin.js +62 -27
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/auth-status.d.ts +1 -0
  5. package/dist/commands/auth-status.js +56 -0
  6. package/dist/commands/auth-status.js.map +1 -0
  7. package/dist/commands/install-skill.d.ts +0 -1
  8. package/dist/commands/install-skill.js +2 -10
  9. package/dist/commands/install-skill.js.map +1 -1
  10. package/dist/commands/list-skills.d.ts +4 -0
  11. package/dist/commands/list-skills.js +52 -0
  12. package/dist/commands/list-skills.js.map +1 -0
  13. package/dist/commands/login.js +5 -4
  14. package/dist/commands/login.js.map +1 -1
  15. package/dist/commands/uninstall-skill.d.ts +11 -0
  16. package/dist/commands/uninstall-skill.js +116 -0
  17. package/dist/commands/uninstall-skill.js.map +1 -0
  18. package/dist/doctor/checks/ai-analysis.js +3 -3
  19. package/dist/doctor/checks/ai-analysis.js.map +1 -1
  20. package/dist/integrations/dotnet/index.js +7 -12
  21. package/dist/integrations/dotnet/index.js.map +1 -1
  22. package/dist/integrations/elixir/index.js +7 -13
  23. package/dist/integrations/elixir/index.js.map +1 -1
  24. package/dist/integrations/go/index.js +5 -11
  25. package/dist/integrations/go/index.js.map +1 -1
  26. package/dist/integrations/python/index.js +7 -13
  27. package/dist/integrations/python/index.js.map +1 -1
  28. package/dist/integrations/ruby/index.js +9 -14
  29. package/dist/integrations/ruby/index.js.map +1 -1
  30. package/dist/lib/adapters/cli-adapter.js +1 -1
  31. package/dist/lib/adapters/cli-adapter.js.map +1 -1
  32. package/dist/lib/agent-interface.js +10 -9
  33. package/dist/lib/agent-interface.js.map +1 -1
  34. package/dist/lib/agent-runner.js +24 -19
  35. package/dist/lib/agent-runner.js.map +1 -1
  36. package/dist/lib/credential-proxy.js +1 -1
  37. package/dist/lib/credential-proxy.js.map +1 -1
  38. package/dist/lib/ensure-auth.js +3 -3
  39. package/dist/lib/ensure-auth.js.map +1 -1
  40. package/dist/lib/run-with-core.js +1 -1
  41. package/dist/lib/run-with-core.js.map +1 -1
  42. package/dist/lib/token-refresh-client.js +1 -1
  43. package/dist/lib/token-refresh-client.js.map +1 -1
  44. package/dist/lib/token-refresh.js +1 -1
  45. package/dist/lib/token-refresh.js.map +1 -1
  46. package/dist/lib/version-check.js +2 -1
  47. package/dist/lib/version-check.js.map +1 -1
  48. package/dist/utils/exit-codes.js +1 -1
  49. package/dist/utils/exit-codes.js.map +1 -1
  50. package/dist/utils/help-json.js +62 -23
  51. package/dist/utils/help-json.js.map +1 -1
  52. package/package.json +2 -3
  53. package/.claude-plugin/plugin.json +0 -13
  54. package/skills/workos-authkit-base/SKILL.md +0 -123
  55. package/skills/workos-authkit-nextjs/SKILL.md +0 -247
  56. package/skills/workos-authkit-react/SKILL.md +0 -91
  57. package/skills/workos-authkit-react-router/SKILL.md +0 -107
  58. package/skills/workos-authkit-sveltekit/SKILL.md +0 -160
  59. package/skills/workos-authkit-tanstack-start/SKILL.md +0 -300
  60. package/skills/workos-authkit-vanilla-js/SKILL.md +0 -83
  61. package/skills/workos-dotnet/SKILL.md +0 -163
  62. package/skills/workos-elixir/SKILL.md +0 -194
  63. package/skills/workos-go/SKILL.md +0 -191
  64. package/skills/workos-kotlin/SKILL.md +0 -161
  65. package/skills/workos-management/SKILL.md +0 -250
  66. package/skills/workos-node/SKILL.md +0 -164
  67. package/skills/workos-php/SKILL.md +0 -127
  68. package/skills/workos-php-laravel/SKILL.md +0 -147
  69. package/skills/workos-python/SKILL.md +0 -159
  70. package/skills/workos-ruby/SKILL.md +0 -163
@@ -1,194 +0,0 @@
1
- ---
2
- name: workos-elixir
3
- description: Integrate WorkOS AuthKit with Elixir/Phoenix applications. Server-side authentication with Phoenix controllers and routes.
4
- ---
5
-
6
- # WorkOS AuthKit for Elixir (Phoenix)
7
-
8
- ## Step 1: Fetch SDK Documentation (BLOCKING)
9
-
10
- **STOP. Do not proceed until complete.**
11
-
12
- WebFetch: `https://raw.githubusercontent.com/workos/workos-elixir/main/README.md`
13
-
14
- The README is the source of truth for SDK API usage. If this skill conflicts with README, follow README.
15
-
16
- ## Step 2: Pre-Flight Validation
17
-
18
- ### Project Structure
19
-
20
- - Confirm `mix.exs` exists
21
- - Read `mix.exs` to extract the app name (look for `app: :my_app` in `project/0`)
22
- - Confirm `lib/{app}_web/router.ex` exists (Phoenix project marker)
23
- - Confirm `config/runtime.exs` exists
24
-
25
- ### Determine App Name
26
-
27
- The app name from `mix.exs` determines all file paths. For example, if `app: :my_app`:
28
-
29
- - Web module: `lib/my_app_web/`
30
- - Router: `lib/my_app_web/router.ex`
31
- - Controllers: `lib/my_app_web/controllers/`
32
-
33
- ### Environment Variables
34
-
35
- Check `.env.local` for:
36
-
37
- - `WORKOS_API_KEY` - starts with `sk_`
38
- - `WORKOS_CLIENT_ID` - starts with `client_`
39
-
40
- ## Step 3: Install SDK
41
-
42
- Add the `workos` package to `mix.exs` dependencies:
43
-
44
- ```elixir
45
- defp deps do
46
- [
47
- # ... existing deps
48
- {:workos, "~> 1.0"}
49
- ]
50
- end
51
- ```
52
-
53
- Then run:
54
-
55
- ```bash
56
- mix deps.get
57
- ```
58
-
59
- **Verify:** Check that `mix deps.get` completed successfully (exit code 0).
60
-
61
- ## Step 4: Configure WorkOS
62
-
63
- Add WorkOS configuration to `config/runtime.exs`:
64
-
65
- ```elixir
66
- config :workos,
67
- api_key: System.get_env("WORKOS_API_KEY"),
68
- client_id: System.get_env("WORKOS_CLIENT_ID")
69
- ```
70
-
71
- This ensures credentials are loaded from environment variables at runtime, not compiled into the release.
72
-
73
- ## Step 5: Create Auth Controller
74
-
75
- ### Prerequisite: Verify `{AppName}Web` module exists
76
-
77
- The controller uses `use {AppName}Web, :controller`. Confirm `lib/{app}_web.ex` exists and defines the `:controller` macro. If it doesn't exist (minimal Phoenix projects may lack it), create it:
78
-
79
- ```elixir
80
- defmodule {AppName}Web do
81
- def controller do
82
- quote do
83
- use Phoenix.Controller, formats: [:html, :json]
84
- import Plug.Conn
85
- end
86
- end
87
-
88
- defmacro __using__(which) when is_atom(which) do
89
- apply(__MODULE__, which, [])
90
- end
91
- end
92
- ```
93
-
94
- ### Create controller
95
-
96
- Create `lib/{app}_web/controllers/auth_controller.ex`:
97
-
98
- ```elixir
99
- defmodule {AppName}Web.AuthController do
100
- use {AppName}Web, :controller
101
-
102
- def sign_in(conn, _params) do
103
- client_id = Application.get_env(:workos, :client_id)
104
- redirect_uri = "http://localhost:4000/auth/callback"
105
-
106
- authorization_url = WorkOS.UserManagement.get_authorization_url(%{
107
- provider: "authkit",
108
- client_id: client_id,
109
- redirect_uri: redirect_uri
110
- })
111
-
112
- case authorization_url do
113
- {:ok, url} -> redirect(conn, external: url)
114
- {:error, reason} -> conn |> put_status(500) |> text("Auth error: #{inspect(reason)}")
115
- end
116
- end
117
-
118
- def callback(conn, %{"code" => code}) do
119
- client_id = Application.get_env(:workos, :client_id)
120
-
121
- case WorkOS.UserManagement.authenticate_with_code(%{
122
- code: code,
123
- client_id: client_id
124
- }) do
125
- {:ok, auth_response} ->
126
- conn
127
- |> put_session(:user, auth_response.user)
128
- |> redirect(to: "/")
129
-
130
- {:error, reason} ->
131
- conn |> put_status(401) |> text("Authentication failed: #{inspect(reason)}")
132
- end
133
- end
134
-
135
- def sign_out(conn, _params) do
136
- conn
137
- |> clear_session()
138
- |> redirect(to: "/")
139
- end
140
- end
141
- ```
142
-
143
- **IMPORTANT:** Adapt the module name and API calls based on the README. The WorkOS Elixir SDK API may differ from the pseudocode above. Always follow the README for exact function names, parameter shapes, and return types.
144
-
145
- ## Step 6: Add Routes
146
-
147
- Add auth routes to `lib/{app}_web/router.ex`. Add these routes inside or outside the existing pipeline scope as appropriate:
148
-
149
- ```elixir
150
- scope "/auth", {AppName}Web do
151
- pipe_through :browser
152
-
153
- get "/sign-in", AuthController, :sign_in
154
- get "/callback", AuthController, :callback
155
- post "/sign-out", AuthController, :sign_out
156
- end
157
- ```
158
-
159
- ## Step 7: Verification
160
-
161
- Run the following to confirm the integration compiles:
162
-
163
- ```bash
164
- mix compile
165
- ```
166
-
167
- **If compilation fails:**
168
-
169
- 1. Read the error message carefully
170
- 2. Check that the WorkOS SDK module names match what's in the README
171
- 3. Verify the app name is consistent across all files
172
- 4. Fix the issue and re-run `mix compile`
173
-
174
- ## Error Recovery
175
-
176
- ### "could not compile dependency :workos"
177
-
178
- - Check Elixir version compatibility (1.15+ recommended)
179
- - Try `mix deps.clean workos && mix deps.get`
180
-
181
- ### "module WorkOS.UserManagement is not available"
182
-
183
- - The SDK API may use different module paths — re-read the README
184
- - Check if the SDK uses `WorkOS.SSO` or another module instead
185
-
186
- ### "undefined function" in controller
187
-
188
- - Verify `use {AppName}Web, :controller` is correct
189
- - Check that the SDK functions match the README exactly
190
-
191
- ### Route conflicts
192
-
193
- - Check existing routes in router.ex for `/auth` prefix conflicts
194
- - Adjust the scope path if needed (e.g., `/workos-auth`)
@@ -1,191 +0,0 @@
1
- ---
2
- name: workos-go
3
- description: Integrate WorkOS AuthKit with Go applications. Supports Gin and stdlib net/http.
4
- ---
5
-
6
- # WorkOS AuthKit for Go
7
-
8
- ## Step 1: Fetch SDK Documentation (BLOCKING)
9
-
10
- **STOP. Do not proceed until complete.**
11
-
12
- WebFetch: `https://github.com/workos/workos-go/blob/main/README.md`
13
-
14
- The README is the source of truth for SDK API usage. If this skill conflicts with README, follow README.
15
-
16
- ## Step 2: Pre-Flight Validation
17
-
18
- ### Project Structure
19
-
20
- - Confirm `go.mod` exists in the project root
21
- - Confirm Go module is initialized (module path declared in `go.mod`)
22
-
23
- ### Environment Variables
24
-
25
- Check `.env` for:
26
-
27
- - `WORKOS_API_KEY` - starts with `sk_`
28
- - `WORKOS_CLIENT_ID` - starts with `client_`
29
- - `WORKOS_REDIRECT_URI` - valid callback URL (e.g., `http://localhost:8080/auth/callback`)
30
-
31
- ### Framework Detection
32
-
33
- Read `go.mod` to detect web framework:
34
-
35
- ```
36
- go.mod contains github.com/gin-gonic/gin?
37
- |
38
- +-- Yes --> Use Gin router patterns
39
- |
40
- +-- No --> Use stdlib net/http patterns
41
- ```
42
-
43
- ## Step 3: Install SDK
44
-
45
- Run:
46
-
47
- ```bash
48
- go get github.com/workos/workos-go/v4
49
- ```
50
-
51
- **Verify:** Check that `go.mod` now contains `github.com/workos/workos-go/v4`. Both `go.mod` and `go.sum` will be modified — this is expected.
52
-
53
- ## Step 4: Configure Authentication
54
-
55
- ### 4a: Create Auth Handler File
56
-
57
- Create an auth handler file. Respect existing project structure:
58
-
59
- - If `internal/` directory exists, create `internal/auth/handlers.go`
60
- - If `handlers/` directory exists, create `handlers/auth.go`
61
- - Otherwise, create `auth/handlers.go`
62
-
63
- The file must:
64
-
65
- - Declare a package matching the directory name
66
- - Import `github.com/workos/workos-go/v4` packages as needed
67
- - Read env vars with `os.Getenv("WORKOS_API_KEY")`, `os.Getenv("WORKOS_CLIENT_ID")`, `os.Getenv("WORKOS_REDIRECT_URI")`
68
-
69
- ### 4b: Implement Handlers
70
-
71
- Implement these three handlers following the redirect-based auth flow from the README:
72
-
73
- **Login handler** (`/auth/login`):
74
-
75
- - Get the authorization URL from WorkOS using `usermanagement.GetAuthorizationURL()`
76
- - Set `Provider` to the string `"authkit"` (it's a plain string, not a constant)
77
- - Include `ClientID` and `RedirectURI` from env vars
78
- - Redirect the user to the returned URL
79
-
80
- **Callback handler** (`/auth/callback`):
81
-
82
- - Extract the `code` query parameter from the redirect
83
- - Call `usermanagement.AuthenticateWithCode()` with the code and `ClientID`
84
- - Store user info in session/cookie (or return as JSON for API-first apps)
85
- - Redirect to homepage or return user data
86
-
87
- **Logout handler** (`/auth/logout`):
88
-
89
- - Clear session data
90
- - Redirect to homepage
91
-
92
- **CRITICAL:** Use idiomatic Go error handling throughout:
93
-
94
- ```go
95
- result, err := someFunction()
96
- if err != nil {
97
- http.Error(w, "Error message", http.StatusInternalServerError)
98
- return
99
- }
100
- ```
101
-
102
- ### 4c: Wire Handlers into Router
103
-
104
- #### If using Gin:
105
-
106
- ```go
107
- r := gin.Default()
108
- r.GET("/auth/login", handleLogin)
109
- r.GET("/auth/callback", handleCallback)
110
- r.GET("/auth/logout", handleLogout)
111
- ```
112
-
113
- #### If using stdlib net/http:
114
-
115
- ```go
116
- http.HandleFunc("/auth/login", handleLogin)
117
- http.HandleFunc("/auth/callback", handleCallback)
118
- http.HandleFunc("/auth/logout", handleLogout)
119
- ```
120
-
121
- Wire these routes into the existing router setup in `main.go` or wherever routes are defined. Do NOT replace existing routes — add alongside them.
122
-
123
- ### 4d: Initialize WorkOS Client
124
-
125
- In the appropriate init location (package-level `init()` or `main()`), initialize the WorkOS client:
126
-
127
- ```go
128
- import "github.com/workos/workos-go/v4/pkg/usermanagement"
129
-
130
- func init() {
131
- usermanagement.SetAPIKey(os.Getenv("WORKOS_API_KEY"))
132
- }
133
- ```
134
-
135
- Follow the README for the exact initialization pattern — it may differ from above.
136
-
137
- ## Step 5: Environment Setup
138
-
139
- The `.env` file should already contain the required variables (written by the installer). Verify it contains:
140
-
141
- ```
142
- WORKOS_API_KEY=sk_...
143
- WORKOS_CLIENT_ID=client_...
144
- WORKOS_REDIRECT_URI=http://localhost:8080/auth/callback
145
- ```
146
-
147
- **Note for production:** Go does not have a built-in .env convention. In production, set real OS environment variables. The `.env` file is for development only. If using a `.env` loader like `github.com/joho/godotenv`, the agent may install it and add `godotenv.Load()` to `main()`.
148
-
149
- ## Step 6: Verification
150
-
151
- Run these commands. **Do not mark complete until all pass:**
152
-
153
- ```bash
154
- # 1. Go module is tidy
155
- go mod tidy
156
-
157
- # 2. Build succeeds
158
- go build ./...
159
-
160
- # 3. Vet passes (catches common mistakes)
161
- go vet ./...
162
- ```
163
-
164
- If build fails:
165
-
166
- - Check import paths match the SDK version in `go.mod`
167
- - Ensure all new files have correct package declarations
168
- - Run `go mod tidy` to resolve dependency issues
169
-
170
- ## Error Recovery
171
-
172
- ### "cannot find module providing package github.com/workos/workos-go/v4/..."
173
-
174
- - Run `go mod tidy` to sync dependencies
175
- - Check that `go get` completed successfully
176
- - Verify the import path matches exactly (v4 suffix required)
177
-
178
- ### "undefined: usermanagement.SetAPIKey" or similar
179
-
180
- - SDK API may have changed — refer to the fetched README
181
- - Check the correct subpackage import path
182
-
183
- ### Build fails with type errors
184
-
185
- - Ensure handler function signatures match the framework (Gin uses `*gin.Context`, stdlib uses `http.ResponseWriter, *http.Request`)
186
- - Check that error return values are handled
187
-
188
- ### "package X is not in std"
189
-
190
- - Run `go mod tidy` after adding new imports
191
- - Ensure `go get` was run before writing import statements
@@ -1,161 +0,0 @@
1
- ---
2
- name: workos-kotlin
3
- description: Integrate WorkOS AuthKit with Kotlin/Spring Boot. Backend authentication with Gradle.
4
- ---
5
-
6
- # WorkOS AuthKit for Kotlin (Spring Boot)
7
-
8
- ## Step 1: Fetch SDK Documentation (BLOCKING)
9
-
10
- **STOP. Do not proceed until complete.**
11
-
12
- WebFetch: `https://raw.githubusercontent.com/workos/workos-kotlin/main/README.md`
13
-
14
- The README is the source of truth. If this skill conflicts with README, follow README.
15
-
16
- ## Step 2: Pre-Flight Validation
17
-
18
- ### Project Structure
19
-
20
- - Confirm `build.gradle.kts` exists (Kotlin DSL) or `build.gradle` (Groovy DSL)
21
- - Confirm Spring Boot plugin is present (`org.springframework.boot`)
22
- - Detect Gradle wrapper: check if `./gradlew` exists
23
-
24
- ### Gradle Wrapper
25
-
26
- ```bash
27
- # If gradlew exists, ensure it's executable
28
- if [ -f ./gradlew ]; then chmod +x ./gradlew; fi
29
- ```
30
-
31
- Use `./gradlew` if wrapper exists, otherwise fall back to `gradle`.
32
-
33
- ### Environment Variables
34
-
35
- Check `application.properties` or `application.yml` for:
36
-
37
- - `workos.api-key` or `WORKOS_API_KEY`
38
- - `workos.client-id` or `WORKOS_CLIENT_ID`
39
-
40
- ## Step 3: Install SDK
41
-
42
- Add the WorkOS Kotlin SDK dependency to `build.gradle.kts`:
43
-
44
- ```kotlin
45
- dependencies {
46
- implementation("com.workos:workos-kotlin:4.18.1")
47
- // ... existing dependencies
48
- }
49
- ```
50
-
51
- Check the README for the latest version number — use the version from the README if it differs from above.
52
-
53
- **JVM target**: Ensure `jvmTarget` in `build.gradle.kts` matches the JDK on the system. Check with `java -version`. Common values: `"17"`, `"21"`. If `kotlin { jvmToolchain(...) }` is set, ensure it matches too.
54
-
55
- **Verify:** Run `./gradlew dependencies` or `gradle dependencies` to confirm the dependency resolves.
56
-
57
- ## Step 4: Configure Authentication
58
-
59
- ### 4a: Application Properties
60
-
61
- Add WorkOS configuration to `src/main/resources/application.properties`:
62
-
63
- ```properties
64
- workos.api-key=${WORKOS_API_KEY}
65
- workos.client-id=${WORKOS_CLIENT_ID}
66
- workos.redirect-uri=http://localhost:8080/auth/callback
67
- ```
68
-
69
- Or if the project uses `application.yml`, add the equivalent YAML.
70
-
71
- ### 4b: Create WorkOS Configuration Bean
72
-
73
- Create a configuration class that initializes the WorkOS client:
74
-
75
- ```kotlin
76
- @Configuration
77
- class WorkOSConfig {
78
- @Value("\${workos.api-key}")
79
- lateinit var apiKey: String
80
-
81
- @Bean
82
- fun workos(): WorkOS = WorkOS(apiKey)
83
- }
84
- ```
85
-
86
- Adapt based on the SDK README — the exact client initialization may vary.
87
-
88
- ### 4c: Create Auth Controller
89
-
90
- Create a Spring `@RestController` with these endpoints:
91
-
92
- 1. **GET /auth/login** — Redirect user to WorkOS AuthKit hosted login
93
- - Use `workos.userManagement.getAuthorizationUrl()` — this returns a URL string
94
- - Parameters: `clientId`, `redirectUri`, `provider = "authkit"`
95
- - The method uses a builder pattern: `.provider("authkit").redirectUri(uri).build()`
96
-
97
- 2. **GET /auth/callback** — Exchange authorization code for user profile
98
- - Extract `code` query parameter
99
- - Call `workos.userManagement.authenticateWithCode()` with the code and clientId
100
- - Store user session (use Spring's `HttpSession`)
101
- - Redirect to home page
102
-
103
- 3. **GET /auth/logout** — Clear session and redirect
104
- - Invalidate `HttpSession`
105
- - Redirect to home page or WorkOS logout URL
106
-
107
- **Follow the README for exact API method names and parameters.**
108
-
109
- ## Step 5: Session Management
110
-
111
- Use Spring's built-in `HttpSession` for session management:
112
-
113
- - Store user profile in session after callback
114
- - Check session in protected routes
115
- - Clear session on logout
116
-
117
- If Spring Security is already configured, integrate with the existing security filter chain rather than replacing it.
118
-
119
- ## Step 6: Verification
120
-
121
- Run the build to verify everything compiles:
122
-
123
- ```bash
124
- ./gradlew build
125
- ```
126
-
127
- **If build fails:**
128
-
129
- - Check dependency resolution: `./gradlew dependencies | grep workos`
130
- - Check for missing imports in the auth controller
131
- - Verify application.properties syntax
132
- - Gradle builds can be slow (30-60s) — be patient
133
-
134
- ### Checklist
135
-
136
- - [ ] WorkOS SDK dependency in build.gradle.kts
137
- - [ ] Application properties configured
138
- - [ ] Auth controller with login, callback, logout endpoints
139
- - [ ] Build succeeds (`./gradlew build`)
140
-
141
- ## Error Recovery
142
-
143
- ### Dependency resolution failure
144
-
145
- - Check Maven Central is accessible
146
- - Verify the artifact coordinates match README exactly
147
- - Ensure `mavenCentral()` is in the `repositories` block of build.gradle.kts
148
-
149
- ### "Could not resolve com.workos:workos-kotlin"
150
-
151
- - The package may use a different group ID — check README
152
- - Ensure repositories block includes `mavenCentral()`
153
-
154
- ### Build fails with missing Spring Boot annotations
155
-
156
- - Verify `org.springframework.boot` plugin is applied
157
- - Check Spring Boot starter dependencies are present
158
-
159
- ### Gradle wrapper permission denied
160
-
161
- - Run `chmod +x ./gradlew` before building