@smicolon/ai-kit 0.0.1 → 0.1.1

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 (163) hide show
  1. package/.claude-plugin/CLAUDE.md +7 -0
  2. package/.claude-plugin/marketplace.json +373 -0
  3. package/README.md +132 -0
  4. package/package.json +13 -3
  5. package/packs/architect/CHANGELOG.md +17 -0
  6. package/packs/architect/README.md +58 -0
  7. package/packs/architect/agents/system-architect.md +768 -0
  8. package/packs/architect/commands/diagram-create.md +300 -0
  9. package/packs/better-auth/.claude-plugin/plugin.json +14 -0
  10. package/packs/better-auth/.mcp.json +14 -0
  11. package/packs/better-auth/CHANGELOG.md +26 -0
  12. package/packs/better-auth/README.md +125 -0
  13. package/packs/better-auth/agents/auth-architect.md +278 -0
  14. package/packs/better-auth/commands/auth-provider-add.md +265 -0
  15. package/packs/better-auth/commands/auth-setup.md +298 -0
  16. package/packs/better-auth/skills/auth-security/SKILL.md +425 -0
  17. package/packs/better-auth/skills/better-auth-patterns/SKILL.md +455 -0
  18. package/packs/dev-loop/.claude-plugin/plugin.json +10 -0
  19. package/packs/dev-loop/CHANGELOG.md +69 -0
  20. package/packs/dev-loop/README.md +155 -0
  21. package/packs/dev-loop/commands/cancel-dev.md +21 -0
  22. package/packs/dev-loop/commands/dev-loop.md +72 -0
  23. package/packs/dev-loop/commands/dev-plan.md +351 -0
  24. package/packs/dev-loop/hooks/hooks.json +15 -0
  25. package/packs/dev-loop/hooks/stop-hook.sh +178 -0
  26. package/packs/dev-loop/scripts/setup-dev-loop.sh +194 -0
  27. package/packs/dev-loop/skills/tdd-planner/SKILL.md +249 -0
  28. package/packs/dev-loop/skills/tdd-planner/references/framework-patterns.md +874 -0
  29. package/packs/dev-loop/skills/tdd-planner/references/good-example.md +260 -0
  30. package/packs/dev-loop/skills/tdd-planner/references/plan-template.md +275 -0
  31. package/packs/django/CHANGELOG.md +39 -0
  32. package/packs/django/README.md +92 -0
  33. package/packs/django/agents/django-architect.md +182 -0
  34. package/packs/django/agents/django-builder.md +250 -0
  35. package/packs/django/agents/django-feature-based.md +420 -0
  36. package/packs/django/agents/django-reviewer.md +253 -0
  37. package/packs/django/agents/django-tester.md +230 -0
  38. package/packs/django/commands/api-endpoint.md +285 -0
  39. package/packs/django/commands/model-create.md +178 -0
  40. package/packs/django/commands/test-generate.md +325 -0
  41. package/packs/django/rules/migrations.md +138 -0
  42. package/packs/django/rules/models.md +167 -0
  43. package/packs/django/rules/serializers.md +126 -0
  44. package/packs/django/rules/services.md +131 -0
  45. package/packs/django/rules/tests.md +140 -0
  46. package/packs/django/rules/views.md +102 -0
  47. package/packs/django/skills/import-convention-enforcer/SKILL.md +226 -0
  48. package/packs/django/skills/import-convention-enforcer/patterns/django-imports.md +343 -0
  49. package/packs/django/skills/migration-safety-checker/SKILL.md +375 -0
  50. package/packs/django/skills/model-entity-validator/SKILL.md +298 -0
  51. package/packs/django/skills/performance-optimizer/SKILL.md +447 -0
  52. package/packs/django/skills/red-phase-verifier/SKILL.md +180 -0
  53. package/packs/django/skills/security-first-validator/SKILL.md +435 -0
  54. package/packs/django/skills/test-coverage-advisor/SKILL.md +394 -0
  55. package/packs/django/skills/test-validity-checker/SKILL.md +194 -0
  56. package/packs/failure-log/.claude-plugin/plugin.json +14 -0
  57. package/packs/failure-log/CHANGELOG.md +20 -0
  58. package/packs/failure-log/README.md +168 -0
  59. package/packs/failure-log/commands/failure-add.md +106 -0
  60. package/packs/failure-log/commands/failure-list.md +89 -0
  61. package/packs/failure-log/hooks/hooks.json +16 -0
  62. package/packs/failure-log/hooks/scripts/inject-failures.sh +64 -0
  63. package/packs/failure-log/skills/failure-log-manager/SKILL.md +164 -0
  64. package/packs/flutter/.claude-plugin/plugin.json +10 -0
  65. package/packs/flutter/CHANGELOG.md +19 -0
  66. package/packs/flutter/README.md +170 -0
  67. package/packs/flutter/agents/flutter-architect.md +166 -0
  68. package/packs/flutter/agents/flutter-builder.md +303 -0
  69. package/packs/flutter/agents/release-manager.md +355 -0
  70. package/packs/flutter/commands/fastlane-setup.md +188 -0
  71. package/packs/flutter/commands/flutter-build.md +90 -0
  72. package/packs/flutter/commands/flutter-deploy.md +133 -0
  73. package/packs/flutter/commands/flutter-test.md +117 -0
  74. package/packs/flutter/commands/signing-setup.md +209 -0
  75. package/packs/flutter/hooks/hooks.json +17 -0
  76. package/packs/flutter/skills/fastlane-knowledge/SKILL.md +193 -0
  77. package/packs/flutter/skills/flutter-architecture/SKILL.md +127 -0
  78. package/packs/flutter/skills/store-publishing/SKILL.md +163 -0
  79. package/packs/hono/.claude-plugin/plugin.json +19 -0
  80. package/packs/hono/CHANGELOG.md +19 -0
  81. package/packs/hono/README.md +143 -0
  82. package/packs/hono/agents/hono-architect.md +240 -0
  83. package/packs/hono/agents/hono-builder.md +285 -0
  84. package/packs/hono/agents/hono-reviewer.md +279 -0
  85. package/packs/hono/agents/hono-tester.md +346 -0
  86. package/packs/hono/commands/middleware-create.md +223 -0
  87. package/packs/hono/commands/project-init.md +306 -0
  88. package/packs/hono/commands/route-create.md +153 -0
  89. package/packs/hono/commands/rpc-client.md +263 -0
  90. package/packs/hono/hooks/hooks.json +4 -0
  91. package/packs/hono/skills/cloudflare-bindings/SKILL.md +408 -0
  92. package/packs/hono/skills/hono-patterns/SKILL.md +309 -0
  93. package/packs/hono/skills/rpc-typesafe/SKILL.md +388 -0
  94. package/packs/hono/skills/zod-validation/SKILL.md +332 -0
  95. package/packs/nestjs/CHANGELOG.md +29 -0
  96. package/packs/nestjs/README.md +75 -0
  97. package/packs/nestjs/agents/nestjs-architect.md +402 -0
  98. package/packs/nestjs/agents/nestjs-builder.md +301 -0
  99. package/packs/nestjs/agents/nestjs-tester.md +437 -0
  100. package/packs/nestjs/commands/module-create.md +369 -0
  101. package/packs/nestjs/rules/controllers.md +92 -0
  102. package/packs/nestjs/rules/dto.md +124 -0
  103. package/packs/nestjs/rules/entities.md +102 -0
  104. package/packs/nestjs/rules/services.md +106 -0
  105. package/packs/nestjs/skills/barrel-export-manager/SKILL.md +389 -0
  106. package/packs/nestjs/skills/import-convention-enforcer/SKILL.md +365 -0
  107. package/packs/nextjs/CHANGELOG.md +36 -0
  108. package/packs/nextjs/README.md +76 -0
  109. package/packs/nextjs/agents/frontend-tester.md +680 -0
  110. package/packs/nextjs/agents/frontend-visual.md +820 -0
  111. package/packs/nextjs/agents/nextjs-architect.md +331 -0
  112. package/packs/nextjs/agents/nextjs-modular.md +433 -0
  113. package/packs/nextjs/commands/component-create.md +398 -0
  114. package/packs/nextjs/rules/api-routes.md +129 -0
  115. package/packs/nextjs/rules/components.md +106 -0
  116. package/packs/nextjs/rules/hooks.md +132 -0
  117. package/packs/nextjs/skills/accessibility-validator/SKILL.md +445 -0
  118. package/packs/nextjs/skills/import-convention-enforcer/SKILL.md +399 -0
  119. package/packs/nextjs/skills/react-form-validator/SKILL.md +569 -0
  120. package/packs/nuxtjs/CHANGELOG.md +30 -0
  121. package/packs/nuxtjs/README.md +56 -0
  122. package/packs/nuxtjs/agents/frontend-tester.md +680 -0
  123. package/packs/nuxtjs/agents/frontend-visual.md +820 -0
  124. package/packs/nuxtjs/agents/nuxtjs-architect.md +537 -0
  125. package/packs/nuxtjs/commands/component-create.md +223 -0
  126. package/packs/nuxtjs/rules/components.md +101 -0
  127. package/packs/nuxtjs/rules/composables.md +118 -0
  128. package/packs/nuxtjs/rules/server-routes.md +127 -0
  129. package/packs/nuxtjs/skills/accessibility-validator/SKILL.md +183 -0
  130. package/packs/nuxtjs/skills/import-convention-enforcer/SKILL.md +196 -0
  131. package/packs/nuxtjs/skills/veevalidate-form-validator/SKILL.md +190 -0
  132. package/packs/onboard/CHANGELOG.md +22 -0
  133. package/packs/onboard/README.md +103 -0
  134. package/packs/onboard/agents/onboard-guide.md +118 -0
  135. package/packs/onboard/commands/onboard.md +313 -0
  136. package/packs/onboard/skills/onboard-context-provider/SKILL.md +98 -0
  137. package/packs/tanstack-router/.claude-plugin/plugin.json +14 -0
  138. package/packs/tanstack-router/CHANGELOG.md +30 -0
  139. package/packs/tanstack-router/README.md +113 -0
  140. package/packs/tanstack-router/agents/tanstack-architect.md +173 -0
  141. package/packs/tanstack-router/agents/tanstack-builder.md +360 -0
  142. package/packs/tanstack-router/agents/tanstack-tester.md +454 -0
  143. package/packs/tanstack-router/commands/form-create.md +313 -0
  144. package/packs/tanstack-router/commands/query-create.md +263 -0
  145. package/packs/tanstack-router/commands/route-create.md +190 -0
  146. package/packs/tanstack-router/commands/table-create.md +413 -0
  147. package/packs/tanstack-router/skills/ai-patterns/SKILL.md +370 -0
  148. package/packs/tanstack-router/skills/db-patterns/SKILL.md +346 -0
  149. package/packs/tanstack-router/skills/devtools-patterns/SKILL.md +415 -0
  150. package/packs/tanstack-router/skills/form-patterns/SKILL.md +425 -0
  151. package/packs/tanstack-router/skills/pacer-patterns/SKILL.md +341 -0
  152. package/packs/tanstack-router/skills/query-patterns/SKILL.md +359 -0
  153. package/packs/tanstack-router/skills/router-patterns/SKILL.md +285 -0
  154. package/packs/tanstack-router/skills/store-patterns/SKILL.md +351 -0
  155. package/packs/tanstack-router/skills/table-patterns/SKILL.md +531 -0
  156. package/packs/tanstack-router/skills/tanstack-conventions/SKILL.md +428 -0
  157. package/packs/tanstack-router/skills/virtual-patterns/SKILL.md +490 -0
  158. package/packs/worktree/.claude-plugin/plugin.json +19 -0
  159. package/packs/worktree/CHANGELOG.md +24 -0
  160. package/packs/worktree/README.md +110 -0
  161. package/packs/worktree/commands/wt.md +73 -0
  162. package/packs/worktree/scripts/wt.sh +396 -0
  163. package/packs/worktree/skills/worktree-manager/SKILL.md +68 -0
@@ -0,0 +1,300 @@
1
+ ---
2
+ name: diagram-create
3
+ description: Create system architecture diagrams using Eraser.io diagram-as-code
4
+ ---
5
+
6
+ # System Diagram Creation
7
+
8
+ You are an Eraser.io diagram-as-code specialist. Your task is to create professional system architecture diagrams using Eraser.io's DSL.
9
+
10
+ ## Core Requirements
11
+
12
+ ### Diagram Types Supported
13
+ 1. **Entity Relationship Diagrams (ERD)** - Database schemas
14
+ 2. **Flowcharts** - Process flows and decision trees
15
+ 3. **Cloud Architecture** - AWS, Azure, GCP infrastructure
16
+ 4. **Sequence Diagrams** - API interactions and workflows
17
+ 5. **BPMN** - Business process modeling
18
+
19
+ ## Eraser.io Syntax
20
+
21
+ ### Entity Relationship Diagram (ERD)
22
+ ```
23
+ users [icon: user, color: blue] {
24
+ id uuid pk
25
+ email string unique
26
+ password_hash string
27
+ created_at timestamp
28
+ updated_at timestamp
29
+ is_deleted bool
30
+ }
31
+
32
+ products [icon: package, color: green] {
33
+ id uuid pk
34
+ name string
35
+ slug string unique
36
+ price decimal
37
+ stock int
38
+ created_by uuid fk
39
+ created_at timestamp
40
+ updated_at timestamp
41
+ is_deleted bool
42
+ }
43
+
44
+ orders [icon: shopping-cart, color: orange] {
45
+ id uuid pk
46
+ user_id uuid fk
47
+ total decimal
48
+ status string
49
+ created_at timestamp
50
+ updated_at timestamp
51
+ }
52
+
53
+ order_items [icon: list, color: orange] {
54
+ id uuid pk
55
+ order_id uuid fk
56
+ product_id uuid fk
57
+ quantity int
58
+ price decimal
59
+ }
60
+
61
+ // Relationships
62
+ users.id < products.created_by
63
+ users.id < orders.user_id
64
+ orders.id < order_items.order_id
65
+ products.id < order_items.product_id
66
+ ```
67
+
68
+ ### Cloud Architecture Diagram
69
+ ```
70
+ // AWS E-Commerce Architecture
71
+
72
+ // Networking
73
+ vpc [icon: aws-vpc, color: blue] {
74
+ label: Production VPC
75
+ cidr: 10.0.0.0/16
76
+ }
77
+
78
+ public_subnet [icon: aws-subnet, color: lightblue] {
79
+ label: Public Subnet
80
+ cidr: 10.0.1.0/24
81
+ }
82
+
83
+ private_subnet [icon: aws-subnet, color: gray] {
84
+ label: Private Subnet
85
+ cidr: 10.0.2.0/24
86
+ }
87
+
88
+ // Load Balancing
89
+ alb [icon: aws-elb, color: orange] {
90
+ label: Application Load Balancer
91
+ }
92
+
93
+ // Compute
94
+ ecs_cluster [icon: aws-ecs, color: purple] {
95
+ label: ECS Cluster
96
+ }
97
+
98
+ api_service [icon: aws-ecs-service, color: purple] {
99
+ label: API Service
100
+ count: 3
101
+ }
102
+
103
+ // Database
104
+ rds [icon: aws-rds, color: blue] {
105
+ label: PostgreSQL RDS
106
+ engine: postgres
107
+ instance: db.t3.medium
108
+ }
109
+
110
+ redis [icon: aws-elasticache, color: red] {
111
+ label: Redis Cache
112
+ }
113
+
114
+ // Storage
115
+ s3 [icon: aws-s3, color: green] {
116
+ label: S3 Bucket
117
+ purpose: Static Assets
118
+ }
119
+
120
+ // Connections
121
+ internet > alb
122
+ alb > api_service
123
+ api_service > rds
124
+ api_service > redis
125
+ api_service > s3
126
+
127
+ // Grouping
128
+ vpc {
129
+ public_subnet {
130
+ alb
131
+ }
132
+ private_subnet {
133
+ ecs_cluster {
134
+ api_service
135
+ }
136
+ rds
137
+ redis
138
+ }
139
+ }
140
+ ```
141
+
142
+ ### Sequence Diagram
143
+ ```
144
+ // User Authentication Flow
145
+
146
+ title: User Login Sequence
147
+
148
+ Client > API: POST /auth/login {email, password}
149
+ API > Database: Query user by email
150
+ Database > API: Return user data
151
+ API > API: Validate password hash
152
+ API > TokenService: Generate JWT
153
+ TokenService > API: Return access & refresh tokens
154
+ API > Database: Store refresh token
155
+ API > Client: Return tokens + user data
156
+
157
+ note over Client: Store tokens in secure storage
158
+
159
+ Client > API: GET /profile (Authorization: Bearer token)
160
+ API > TokenService: Validate JWT
161
+ TokenService > API: Token valid
162
+ API > Database: Fetch user profile
163
+ Database > API: Return profile data
164
+ API > Client: Return profile
165
+ ```
166
+
167
+ ### Flowchart
168
+ ```
169
+ // E-Commerce Checkout Flow
170
+
171
+ start: Start Checkout
172
+ start > check_cart: Check Cart Items
173
+
174
+ check_cart > cart_empty: Cart Empty?
175
+ cart_empty > [Yes] > show_error: Show Error Message
176
+ cart_empty > [No] > check_auth: User Authenticated?
177
+
178
+ check_auth > [No] > login: Redirect to Login
179
+ check_auth > [Yes] > shipping: Enter Shipping Info
180
+
181
+ shipping > validate_address: Validate Address
182
+ validate_address > address_invalid: Invalid Address?
183
+ address_invalid > [Yes] > shipping
184
+ address_invalid > [No] > payment: Enter Payment Info
185
+
186
+ payment > process_payment: Process Payment
187
+ process_payment > payment_failed: Payment Failed?
188
+ payment_failed > [Yes] > payment
189
+ payment_failed > [No] > create_order: Create Order
190
+
191
+ create_order > send_confirmation: Send Email Confirmation
192
+ send_confirmation > end: Show Success Page
193
+
194
+ show_error > end
195
+ login > check_auth
196
+ ```
197
+
198
+ ### BPMN Diagram
199
+ ```
200
+ // Order Fulfillment Process
201
+
202
+ start [shape: circle, label: Start]
203
+ receive_order [shape: task, label: Receive Order]
204
+ check_inventory [shape: gateway, label: Check Inventory]
205
+ reserve_items [shape: task, label: Reserve Items]
206
+ notify_warehouse [shape: task, label: Notify Warehouse]
207
+ pick_items [shape: task, label: Pick Items]
208
+ pack_order [shape: task, label: Pack Order]
209
+ ship_order [shape: task, label: Ship Order]
210
+ update_tracking [shape: task, label: Update Tracking]
211
+ notify_customer [shape: task, label: Notify Customer]
212
+ cancel_order [shape: task, label: Cancel Order]
213
+ refund [shape: task, label: Process Refund]
214
+ end [shape: circle, label: End]
215
+
216
+ start > receive_order
217
+ receive_order > check_inventory
218
+ check_inventory > [In Stock] > reserve_items
219
+ check_inventory > [Out of Stock] > cancel_order
220
+ reserve_items > notify_warehouse
221
+ notify_warehouse > pick_items
222
+ pick_items > pack_order
223
+ pack_order > ship_order
224
+ ship_order > update_tracking
225
+ update_tracking > notify_customer
226
+ notify_customer > end
227
+ cancel_order > refund
228
+ refund > end
229
+ ```
230
+
231
+ ## Workflow
232
+
233
+ 1. **Understand Requirements**: Ask user:
234
+ - What system/process to diagram?
235
+ - What diagram type?
236
+ - Level of detail needed?
237
+ - Audience for the diagram?
238
+
239
+ 2. **Design Diagram**: Plan:
240
+ - Key entities/components
241
+ - Relationships/flows
242
+ - Grouping and hierarchy
243
+ - Colors and icons
244
+
245
+ 3. **Generate Code**: Create:
246
+ - Eraser.io DSL code
247
+ - Proper syntax and formatting
248
+ - Clear labels and descriptions
249
+
250
+ 4. **Provide Instructions**: Give:
251
+ - How to use the code
252
+ - Eraser.io URL
253
+ - Editing tips
254
+
255
+ ## Usage Instructions
256
+
257
+ ```bash
258
+ # 1. Go to https://app.eraser.io/
259
+ # 2. Create a new diagram
260
+ # 3. Select "Diagram-as-Code" mode
261
+ # 4. Paste the generated code
262
+ # 5. The diagram will render automatically
263
+ # 6. Customize colors, layout, and styling as needed
264
+ ```
265
+
266
+ ## Quality Checklist
267
+
268
+ - [ ] Correct diagram type for use case
269
+ - [ ] All entities/components labeled
270
+ - [ ] Relationships clearly defined
271
+ - [ ] Appropriate icons and colors
272
+ - [ ] Proper grouping/hierarchy
273
+ - [ ] Readable and well-organized
274
+ - [ ] Includes title/description
275
+ - [ ] Follows Eraser.io syntax
276
+ - [ ] All required fields included
277
+
278
+ ## Examples by Use Case
279
+
280
+ ### Database Design
281
+ Use: **ERD**
282
+ When: Designing data models, showing relationships
283
+
284
+ ### System Architecture
285
+ Use: **Cloud Architecture Diagram**
286
+ When: Showing infrastructure, services, and connections
287
+
288
+ ### API Flows
289
+ Use: **Sequence Diagram**
290
+ When: Documenting API interactions, authentication flows
291
+
292
+ ### Business Processes
293
+ Use: **Flowchart** or **BPMN**
294
+ When: Documenting business logic, decision trees
295
+
296
+ ### User Flows
297
+ Use: **Flowchart**
298
+ When: Showing user journeys, conditional paths
299
+
300
+ Now, ask the user what diagram they want to create!
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "better-auth",
3
+ "version": "0.1.0",
4
+ "description": "Better Auth integration with MCP server for comprehensive authentication",
5
+ "author": {
6
+ "name": "Smicolon",
7
+ "email": "dev@smicolon.com",
8
+ "url": "https://github.com/smicolon"
9
+ },
10
+ "homepage": "https://github.com/smicolon/ai-kit",
11
+ "repository": "https://github.com/smicolon/ai-kit",
12
+ "license": "MIT",
13
+ "keywords": ["better-auth", "authentication", "auth", "mcp", "passkeys", "2fa", "social-login"]
14
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "mcpServers": {
3
+ "better-auth": {
4
+ "command": "npx",
5
+ "args": ["-y", "@nahmanmate/better-auth-mcp-server"],
6
+ "env": {
7
+ "BETTER_AUTH_PROJECT_ID": "${BETTER_AUTH_PROJECT_ID}",
8
+ "BETTER_AUTH_API_KEY": "${BETTER_AUTH_API_KEY}",
9
+ "BETTER_AUTH_ENV": "${BETTER_AUTH_ENV:-development}",
10
+ "LOG_LEVEL": "${LOG_LEVEL:-info}"
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,26 @@
1
+ # Changelog
2
+
3
+ All notable changes to the smi-better-auth plugin will be documented in this file.
4
+
5
+ ## [Unreleased]
6
+
7
+ ### Changed
8
+ - Renamed from `smi-better-auth` to `better-auth` as part of ai-kit migration
9
+ - Moved from `plugins/smi-better-auth/` to `packs/better-auth/`
10
+
11
+ ## [0.1.0] - 2025-01-02
12
+
13
+ ### Added
14
+ - Initial release (experimental)
15
+ - 1 agent: auth-architect
16
+ - 2 commands: auth-setup, auth-provider-add
17
+ - 2 skills:
18
+ - `better-auth-patterns` - Authentication patterns and client setup
19
+ - `auth-security` - Security best practices (rate limiting, CSRF, sessions)
20
+ - Better Auth MCP server integration
21
+ - Support for:
22
+ - Email/password authentication
23
+ - Social providers (Google, GitHub, Discord, Apple, Microsoft, etc.)
24
+ - Two-factor authentication (2FA)
25
+ - Passkeys/WebAuthn
26
+ - Session management
@@ -0,0 +1,125 @@
1
+ # better-auth
2
+
3
+ Better Auth integration with MCP server for comprehensive authentication.
4
+
5
+ ## Overview
6
+
7
+ This plugin provides comprehensive authentication support using Better Auth, a framework-agnostic TypeScript authentication library. Includes MCP server integration for AI-assisted auth implementation.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ /plugin install better-auth
13
+ ```
14
+
15
+ ## Features
16
+
17
+ ### Core Authentication
18
+ - Email/password authentication
19
+ - Session management
20
+ - Password reset flows
21
+
22
+ ### Social Providers
23
+ - Google, GitHub, Discord, etc.
24
+ - OAuth 2.0 / OpenID Connect
25
+
26
+ ### Advanced Security
27
+ - Two-factor authentication (2FA)
28
+ - Passkeys / WebAuthn
29
+ - Rate limiting
30
+
31
+ ### Enterprise
32
+ - Multi-tenancy
33
+ - Single Sign-On (SSO)
34
+ - Organization management
35
+
36
+ ## MCP Server
37
+
38
+ This plugin configures the official Better Auth MCP server for AI-assisted development.
39
+
40
+ ### Required Environment Variables
41
+ ```bash
42
+ # Add to your environment
43
+ BETTER_AUTH_SECRET=your-secret-key
44
+ DATABASE_URL=your-database-url
45
+ ```
46
+
47
+ ### MCP Tools Available
48
+ - Auth configuration generation
49
+ - Provider setup assistance
50
+ - Security best practices
51
+
52
+ ## Agents
53
+
54
+ | Agent | Purpose |
55
+ |-------|---------|
56
+ | `auth-architect` | Design authentication architecture and flows |
57
+
58
+ ## Commands
59
+
60
+ | Command | Description |
61
+ |---------|-------------|
62
+ | `/auth-setup` | Initialize Better Auth with config and optional pages |
63
+ | `/auth-provider-add` | Add a new authentication provider |
64
+
65
+ ## Usage
66
+
67
+ ### Basic Setup
68
+ ```bash
69
+ /auth-setup
70
+ ```
71
+
72
+ Options:
73
+ - `--with-pages` - Include login/register/forgot-password pages
74
+ - `--providers google,github` - Pre-configure social providers
75
+ - `--2fa` - Enable two-factor authentication
76
+ - `--passkeys` - Enable passkey support
77
+
78
+ ### Add Provider
79
+ ```bash
80
+ /auth-provider-add google
81
+ /auth-provider-add github --scopes "user:email,read:org"
82
+ ```
83
+
84
+ ## Configuration Example
85
+
86
+ ```typescript
87
+ // auth.ts
88
+ import { betterAuth } from 'better-auth'
89
+
90
+ export const auth = betterAuth({
91
+ database: {
92
+ provider: 'postgresql',
93
+ url: process.env.DATABASE_URL,
94
+ },
95
+ emailAndPassword: {
96
+ enabled: true,
97
+ },
98
+ socialProviders: {
99
+ google: {
100
+ clientId: process.env.GOOGLE_CLIENT_ID!,
101
+ clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
102
+ },
103
+ },
104
+ plugins: [
105
+ twoFactor(),
106
+ passkey(),
107
+ ],
108
+ })
109
+ ```
110
+
111
+ ## Integration with TanStack
112
+
113
+ Works seamlessly with `tanstack-router`:
114
+
115
+ ```typescript
116
+ // routes/__root.tsx
117
+ import { auth } from '@/lib/auth'
118
+
119
+ export const Route = createRootRoute({
120
+ beforeLoad: async () => {
121
+ const session = await auth.getSession()
122
+ return { session }
123
+ },
124
+ })
125
+ ```