@riligar/agents-kit 1.18.1 → 1.20.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 (22) hide show
  1. package/.agent/skills/riligar-dev-auth-react/SKILL.md +28 -22
  2. package/.agent/skills/riligar-dev-auth-react/assets/auth-loader.jsx +31 -0
  3. package/.agent/skills/riligar-dev-auth-react/assets/layout.jsx +54 -0
  4. package/.agent/skills/riligar-dev-auth-react/assets/require-feature.jsx +33 -0
  5. package/.agent/skills/riligar-dev-auth-react/assets/routes.jsx +107 -0
  6. package/.agent/skills/riligar-dev-auth-react/assets/signin.jsx +64 -0
  7. package/.agent/skills/riligar-dev-auth-react/assets/signup.jsx +44 -0
  8. package/.agent/skills/riligar-dev-auth-react/assets/verify-email.jsx +44 -0
  9. package/.agent/skills/riligar-dev-auth-react/references/route-protection.md +26 -21
  10. package/.agent/skills/riligar-dev-website/SKILL.md +13 -7
  11. package/.agent/skills/riligar-dev-website/assets/original-25750941a92cb0dc69c14e6d15e80867.webp +0 -0
  12. package/.agent/skills/riligar-dev-website/assets/original-95606f1cc3096714cc96f51ab0c2c363.webp +0 -0
  13. package/.agent/skills/riligar-dev-website/assets/original-9fd10755c78a8ce045374395a7d950cd.webp +0 -0
  14. package/.agent/skills/riligar-dev-website/assets/original-c7047cdd97ae03d05a2fd9e3ddd35a7b.webp +0 -0
  15. package/.agent/skills/riligar-dev-website/assets/original-d9b85f53e11e5a757517a61dd6b12138.webp +0 -0
  16. package/.agent/skills/riligar-dev-website/assets/original-e2804b1011bf5706180f8938c7ebc07d.webp +0 -0
  17. package/.agent/skills/riligar-dev-website/assets/original-f86465469d037b98c639b280a5ce1b6d.webp +0 -0
  18. package/.agent/skills/riligar-dev-website/assets/original-faebdb50979bb9a33f1a37ca9d1c5716.webp +0 -0
  19. package/package.json +1 -1
  20. package/.agent/skills/riligar-dev-website/assets/original-481d7179109272dcaff2516fef62b718.webp +0 -0
  21. package/.agent/skills/riligar-dev-website/assets/original-e865b2464fdf5ca567af716e1ed4fd16.webp +0 -0
  22. package/.agent/skills/riligar-dev-website/assets/original-f1459f5315f0045705c2ca4937204146.webp +0 -0
@@ -11,10 +11,10 @@ This skill provides a complete workflow for integrating authentication and permi
11
11
 
12
12
  ### 1. Installation
13
13
 
14
- Install the SDK using bun (preferred) or npm:
14
+ Install the SDK and its core dependencies (Mantine & Tabler Icons) using bun:
15
15
 
16
16
  ```bash
17
- bun add @riligar/auth-react
17
+ bun add @riligar/auth-react @mantine/core @mantine/hooks @mantine/notifications @tabler/icons-react
18
18
  ```
19
19
 
20
20
  ### 2. Environment Variables
@@ -34,19 +34,29 @@ VITE_AUTH_API_KEY=pk_live_your_public_key
34
34
 
35
35
  ### 3. AuthProvider Setup
36
36
 
37
- Wrap your application (usually in `main.jsx` or `App.jsx`) with the `AuthProvider`.
37
+ Wrap your application (usually in `main.jsx` or `App.jsx`) with the `AuthProvider` and `MantineProvider`.
38
38
 
39
39
  ```jsx
40
40
  import { AuthProvider } from '@riligar/auth-react'
41
+ import { MantineProvider } from '@mantine/core'
41
42
 
42
43
  ReactDOM.createRoot(document.getElementById('root')).render(
43
- <AuthProvider apiKey={import.meta.env.VITE_AUTH_API_KEY}>
44
- <App />
45
- </AuthProvider>
44
+ <MantineProvider theme={yourTheme}>
45
+ <AuthProvider apiKey={import.meta.env.VITE_AUTH_API_KEY}>
46
+ <App />
47
+ </AuthProvider>
48
+ </MantineProvider>
46
49
  )
47
50
  ```
48
51
 
49
- For more setup patterns, see [setup-snippets.js](assets/setup-snippets.js).
52
+ ## Ready-to-Use Templates
53
+
54
+ Use these assets to quickly scaffold a complete authentication flow:
55
+
56
+ - **Routing Architecture**: Comprehensive [routes.jsx](assets/routes.jsx) showing Public vs Protected patterns.
57
+ - **Login & Signup**: Generic [signin.jsx](assets/signin.jsx) and [signup.jsx](assets/signup.jsx) templates.
58
+ - **Email Verification**: [verify-email.jsx](assets/verify-email.jsx) handler.
59
+ - **Utility Wrappers**: [auth-loader.jsx](assets/auth-loader.jsx), [require-feature.jsx](assets/require-feature.jsx), and [layout.jsx](assets/layout.jsx).
50
60
 
51
61
  ## Specialized Guides
52
62
 
@@ -64,25 +74,21 @@ Use `useAuth()` to access user data and authentication status.
64
74
  const { user, isAuthenticated, loading } = useAuth()
65
75
  ```
66
76
 
67
- ### Adding a Login Form
68
-
69
- Simply drop the `<SignIn />` component. Use `variant="modal"` if you want it in a popup.
70
-
71
- ```jsx
72
- <SignIn />
73
- // or
74
- <SignIn variant="modal" opened={isOpen} onClose={() => setIsOpen(false)} />
75
- ```
76
-
77
77
  ### Protecting a Dashboard
78
78
 
79
- Wrap your sub-routes with `<Protect />`.
79
+ The recommended pattern is to use the **Protected Group** pattern with React Router as shown in [routes.jsx](assets/routes.jsx).
80
80
 
81
81
  ```jsx
82
- <Route element={<Protect redirectTo="/login" />}>
82
+ // Nested routes under <Protect /> guarantee that all sub-routes are guarded.
83
+ <Route element={<Protect fallback={<AuthLoader />} />}>
83
84
  <Route
84
- path="/dashboard"
85
- element={<Dashboard />}
86
- />
85
+ path="/"
86
+ element={<Layout />}
87
+ >
88
+ <Route
89
+ index
90
+ element={<Home />}
91
+ />
92
+ </Route>
87
93
  </Route>
88
94
  ```
@@ -0,0 +1,31 @@
1
+ import { Center, Loader, Stack, Text } from '@mantine/core'
2
+
3
+ /**
4
+ * AuthLoader Component
5
+ *
6
+ * Standard loading screen used during authentication state transitions
7
+ * (e.g., checking tokens on initial load or redirects).
8
+ */
9
+ export default function AuthLoader() {
10
+ return (
11
+ <Center h="100vh">
12
+ <Stack
13
+ align="center"
14
+ gap="md"
15
+ >
16
+ <Loader
17
+ size="lg"
18
+ variant="dots"
19
+ color="brand"
20
+ />
21
+ <Text
22
+ size="sm"
23
+ c="dimmed"
24
+ fw={500}
25
+ >
26
+ Verificando acesso...
27
+ </Text>
28
+ </Stack>
29
+ </Center>
30
+ )
31
+ }
@@ -0,0 +1,54 @@
1
+ import { AppShell, Burger, Group, Text } from '@mantine/core'
2
+ import { useDisclosure } from '@mantine/hooks'
3
+ import { Outlet } from 'react-router-dom'
4
+
5
+ /**
6
+ * Layout Component
7
+ *
8
+ * Standard Dashboard layout using Mantine AppShell.
9
+ * Provides the structure for sidebars, headers, and main content area.
10
+ */
11
+ export default function Layout() {
12
+ const [opened, { toggle }] = useDisclosure()
13
+
14
+ return (
15
+ <AppShell
16
+ header={{ height: 60 }}
17
+ navbar={{
18
+ width: 300,
19
+ breakpoint: 'sm',
20
+ collapsed: { mobile: !opened },
21
+ }}
22
+ padding="md"
23
+ >
24
+ <AppShell.Header>
25
+ <Group
26
+ h="100%"
27
+ px="md"
28
+ >
29
+ <Burger
30
+ opened={opened}
31
+ onClick={toggle}
32
+ hiddenFrom="sm"
33
+ size="sm"
34
+ />
35
+ <Text fw={700}>Dashboard</Text>
36
+ </Group>
37
+ </AppShell.Header>
38
+
39
+ <AppShell.Navbar p="md">
40
+ {/* Navigation links go here */}
41
+ <Text
42
+ size="sm"
43
+ c="dimmed"
44
+ >
45
+ Navigation Menu
46
+ </Text>
47
+ </AppShell.Navbar>
48
+
49
+ <AppShell.Main>
50
+ <Outlet />
51
+ </AppShell.Main>
52
+ </AppShell>
53
+ )
54
+ }
@@ -0,0 +1,33 @@
1
+ import { useAuth } from '@riligar/auth-react'
2
+ import { Navigate } from 'react-router-dom'
3
+ import AuthLoader from './auth-loader'
4
+
5
+ /**
6
+ * RequireFeature Wrapper
7
+ *
8
+ * Protects routes based on specific user attributes or feature flags.
9
+ * This is an example of how to extend authentication with business logic.
10
+ */
11
+ export default function RequireFeature({ children }) {
12
+ const { user, isAuthenticated, loading } = useAuth()
13
+
14
+ if (loading) {
15
+ return <AuthLoader />
16
+ }
17
+
18
+ if (!isAuthenticated) {
19
+ return (
20
+ <Navigate
21
+ to="/auth/signin"
22
+ replace
23
+ />
24
+ )
25
+ }
26
+
27
+ // Example logic: Ensure user has a setup complete or a specific role
28
+ // if (!user.onboardingCompleted) {
29
+ // return <Navigate to="/onboarding" replace />
30
+ // }
31
+
32
+ return children
33
+ }
@@ -0,0 +1,107 @@
1
+ import { createBrowserRouter, Navigate } from 'react-router-dom'
2
+ import { Protect } from '@riligar/auth-react'
3
+
4
+ // Layouts and Loaders
5
+ import Layout from './components/layout.jsx'
6
+ import AuthLoader from './components/auth-loader.jsx'
7
+
8
+ // Feature Wrappers (if applicable)
9
+ import RequireFeature from './components/require-feature.jsx'
10
+
11
+ // Auth Pages
12
+ import SignInPage from './pages/auth/signin.jsx'
13
+ import SignUpPage from './pages/auth/signup.jsx'
14
+ import VerifyEmailPage from './pages/auth/verify-email.jsx'
15
+
16
+ // Business Pages (Sample placeholders for the pattern)
17
+ import Home from './pages/home.jsx'
18
+ import FeaturesList from './pages/features/index.jsx'
19
+ import FeatureDetail from './pages/features/detail.jsx'
20
+
21
+ /**
22
+ * ROUTES PATTERN TEMPLATE
23
+ *
24
+ * Instructions:
25
+ * 1. Auth Routes: Grouped under /auth. Non-authenticated.
26
+ * 2. Protected Routes: Wrapped with <Protect />.
27
+ * 3. Main Layout: Nested inside the Protected group to ensure all app pages have sidebars/headers.
28
+ * 4. Feature Wrappers: Use components like <RequireFeature /> to enforce business logic (e.g. valid subscription).
29
+ */
30
+ export const router = createBrowserRouter([
31
+ // Group 1: Public/Authentication Routes
32
+ {
33
+ path: '/auth',
34
+ children: [
35
+ {
36
+ index: true,
37
+ element: (
38
+ <Navigate
39
+ to="/auth/signin"
40
+ replace
41
+ />
42
+ ),
43
+ },
44
+ { path: 'signin', element: <SignInPage /> },
45
+ { path: 'signup', element: <SignUpPage /> },
46
+ { path: 'verify-email', element: <VerifyEmailPage /> },
47
+ ],
48
+ },
49
+
50
+ // Group 2: Protected Application Routes
51
+ {
52
+ element: (
53
+ <Protect
54
+ fallback={<AuthLoader />}
55
+ signInUrl="/auth/signin"
56
+ />
57
+ ),
58
+ children: [
59
+ {
60
+ path: '/',
61
+ element: <Layout />,
62
+ children: [
63
+ // Landing/Dashboard
64
+ {
65
+ index: true,
66
+ element: <Home />,
67
+ },
68
+
69
+ // Feature Example (with business logic wrapper)
70
+ {
71
+ path: 'features',
72
+ element: (
73
+ <RequireFeature>
74
+ <FeaturesList />
75
+ </RequireFeature>
76
+ ),
77
+ },
78
+ {
79
+ path: 'features/:id',
80
+ element: (
81
+ <RequireFeature>
82
+ <FeatureDetail />
83
+ </RequireFeature>
84
+ ),
85
+ },
86
+
87
+ // Simple Protected Page (without extra wrapper)
88
+ {
89
+ path: 'settings',
90
+ element: <Home />, // Reuse component or standard page
91
+ },
92
+ ],
93
+ },
94
+ ],
95
+ },
96
+
97
+ // Catch-all: Redirect to Home
98
+ {
99
+ path: '*',
100
+ element: (
101
+ <Navigate
102
+ to="/"
103
+ replace
104
+ />
105
+ ),
106
+ },
107
+ ])
@@ -0,0 +1,64 @@
1
+ import { SignIn } from '@riligar/auth-react'
2
+ import { Center } from '@mantine/core'
3
+ import { notifications } from '@mantine/notifications'
4
+ import { useNavigate } from 'react-router-dom'
5
+ import { IconUserPlus, IconX, IconMail } from '@tabler/icons-react'
6
+
7
+ import logoTipo from '/images/logotipo.webp'
8
+
9
+ export default function SignInPage() {
10
+ const navigate = useNavigate()
11
+
12
+ const handleSuccess = () => {
13
+ notifications.show({
14
+ title: 'Bem-vindo!',
15
+ message: 'Login realizado com sucesso.',
16
+ color: 'green',
17
+ icon: <IconUserPlus size={18} />,
18
+ })
19
+ navigate('/')
20
+ }
21
+
22
+ const handleError = error => {
23
+ notifications.show({
24
+ title: 'Erro',
25
+ message: error.message || 'Falha ao realizar login.',
26
+ color: 'red',
27
+ icon: <IconX size={18} />,
28
+ })
29
+ }
30
+
31
+ const handleMagicLinkSent = email => {
32
+ notifications.show({
33
+ title: 'Sucesso',
34
+ message: `Link de acesso enviado para ${email}`,
35
+ color: 'brand',
36
+ icon: <IconMail size={18} />,
37
+ })
38
+ }
39
+
40
+ const handleForgotPasswordSent = email => {
41
+ notifications.show({
42
+ title: 'Sucesso',
43
+ message: `E-mail de recuperação enviado para ${email}`,
44
+ color: 'brand',
45
+ icon: <IconMail size={18} />,
46
+ })
47
+ }
48
+
49
+ return (
50
+ <Center
51
+ h="100vh"
52
+ bg="gray.0"
53
+ >
54
+ <SignIn
55
+ logo={logoTipo}
56
+ logoWidth={111}
57
+ onSuccess={handleSuccess}
58
+ onError={handleError}
59
+ onMagicLinkSent={handleMagicLinkSent}
60
+ onForgotPasswordSent={handleForgotPasswordSent}
61
+ />
62
+ </Center>
63
+ )
64
+ }
@@ -0,0 +1,44 @@
1
+ import { SignUp } from '@riligar/auth-react'
2
+ import { Center } from '@mantine/core'
3
+ import { notifications } from '@mantine/notifications'
4
+ import { useNavigate } from 'react-router-dom'
5
+ import { IconMail, IconX } from '@tabler/icons-react'
6
+
7
+ import logoTipo from '/images/logotipo.webp'
8
+
9
+ export default function SignUpPage() {
10
+ const navigate = useNavigate()
11
+
12
+ const handleSuccess = () => {
13
+ notifications.show({
14
+ title: 'Sucesso',
15
+ message: 'Conta criada com sucesso!',
16
+ color: 'green',
17
+ icon: <IconMail size={18} />,
18
+ })
19
+ navigate('/auth/signin')
20
+ }
21
+
22
+ const handleError = error => {
23
+ notifications.show({
24
+ title: 'Erro',
25
+ message: error.message || 'Falha ao criar conta.',
26
+ color: 'red',
27
+ icon: <IconX size={18} />,
28
+ })
29
+ }
30
+
31
+ return (
32
+ <Center
33
+ h="100vh"
34
+ bg="gray.0"
35
+ >
36
+ <SignUp
37
+ logo={logoTipo}
38
+ logoWidth={111}
39
+ onSuccess={handleSuccess}
40
+ onError={handleError}
41
+ />
42
+ </Center>
43
+ )
44
+ }
@@ -0,0 +1,44 @@
1
+ import { VerifyEmail } from '@riligar/auth-react'
2
+ import { Center } from '@mantine/core'
3
+ import { notifications } from '@mantine/notifications'
4
+ import { useNavigate } from 'react-router-dom'
5
+ import { IconCheck, IconX } from '@tabler/icons-react'
6
+
7
+ import logoTipo from '/images/logotipo.webp'
8
+
9
+ export default function VerifyEmailPage() {
10
+ const navigate = useNavigate()
11
+
12
+ const handleSuccess = () => {
13
+ notifications.show({
14
+ title: 'Sucesso',
15
+ message: 'Email verificado com sucesso! Você já pode fazer login.',
16
+ color: 'green',
17
+ icon: <IconCheck size={18} />,
18
+ })
19
+ navigate('/auth/signin')
20
+ }
21
+
22
+ const handleError = error => {
23
+ notifications.show({
24
+ title: 'Erro',
25
+ message: error.message || 'Falha ao verificar email.',
26
+ color: 'red',
27
+ icon: <IconX size={18} />,
28
+ })
29
+ }
30
+
31
+ return (
32
+ <Center
33
+ h="100vh"
34
+ bg="gray.0"
35
+ >
36
+ <VerifyEmail
37
+ logo={logoTipo}
38
+ logoWidth={111}
39
+ onSuccess={handleSuccess}
40
+ onError={handleError}
41
+ />
42
+ </Center>
43
+ )
44
+ }
@@ -13,33 +13,38 @@ Use these components to control access to specific parts of your application.
13
13
 
14
14
  ## Usage Patterns
15
15
 
16
- ### Protecting Routes (React Router)
16
+ ### Protecting Routes (createBrowserRouter)
17
+
18
+ The most robust way to protect routes in a Riligar app is using the **Protected Group** pattern with `createBrowserRouter`. This ensures consistent layout and authentication guards.
17
19
 
18
20
  ```jsx
19
- import { Protect, SignIn } from '@riligar/auth-react'
20
- import { Routes, Route } from 'react-router-dom'
21
-
22
- ;<Routes>
23
- <Route
24
- path="/login"
25
- element={<SignIn />}
26
- />
27
-
28
- <Route element={<Protect redirectTo="/login" />}>
29
- <Route
30
- path="/dashboard"
31
- element={<Dashboard />}
32
- />
33
- <Route
34
- path="/settings"
35
- element={<Settings />}
36
- />
37
- </Route>
38
- </Routes>
21
+ import { createBrowserRouter, Navigate } from 'react-router-dom'
22
+ import { Protect } from '@riligar/auth-react'
23
+ import AuthLoader from '../components/auth-loader.jsx'
24
+ import Layout from '../components/layout.jsx'
25
+
26
+ export const router = createBrowserRouter([
27
+ // Public paths
28
+ { path: '/auth/signin', element: <SignIn /> },
29
+
30
+ // Protected paths
31
+ {
32
+ element: <Protect fallback={<AuthLoader />} />,
33
+ children: [
34
+ {
35
+ path: '/',
36
+ element: <Layout />,
37
+ children: [{ index: true, element: <Dashboard /> }],
38
+ },
39
+ ],
40
+ },
41
+ ])
39
42
  ```
40
43
 
41
44
  ### Conditional UI Elements
42
45
 
46
+ Use these wrappers inside your components (headers, sidebars, etc.) for granular visibility.
47
+
43
48
  ```jsx
44
49
  import { SignedIn, SignedOut, AuthLoading } from '@riligar/auth-react'
45
50
 
@@ -7,22 +7,28 @@ description: Specialist in High-Conversion Landing Pages using RiLiGar Design Sy
7
7
 
8
8
  You are a conversion optimization expert and UI architect specializing in landing pages. Your mission is to create pages that **convert**, using the minimalist "Content-First" aesthetic of RiLiGar.
9
9
 
10
+ https://alpha.mantine.dev/llms.txt
11
+ https://alpha.mantine.dev/llms.txt
12
+ https://alpha.mantine.dev/llms.txt
13
+ https://alpha.mantine.dev/llms.txt
14
+ https://alpha.mantine.dev/llms.txt
15
+
10
16
  ## Philosophy: "Trust Through Clarity"
11
17
 
12
18
  A landing page must be a slippery slope: the user should slide effortlessly from the headline to the CTA.
13
19
 
14
- - **Zero Friction:** No distractions. Every element must support the primary goal.
15
- - **High Trust:** Professional typography, perfect alignment, and social proof.
16
- - **Value First:** Focus on benefits, not just features.
20
+ - **Zero Friction:** No distractions. Every element must support the primary goal.
21
+ - **High Trust:** Professional typography, perfect alignment, and social proof.
22
+ - **Value First:** Focus on benefits, not just features.
17
23
 
18
24
  ## Guia de Referência
19
25
 
20
26
  Para construir páginas de alta conversão:
21
27
 
22
- - **[Conversion Frameworks](references/conversion-framework.md)**: Estruturas psicológicas (AIDA, PAS) e fluxo narrativo.
23
- - **[Section Blueprints](references/section-blueprints.md)**: Layouts "Gold Standard" para seções críticas (Hero, Bento Grids, Pricing).
24
- - **[Copywriting Guide](references/copywriting-guide.md)**: Tom de voz e padrões de texto persuasivo.
25
- - **[Visual Knowledge Base](assets/)**: Diretório de referências visuais e layouts reais para inspiração estética e estrutural.
28
+ - **[Conversion Frameworks](references/conversion-framework.md)**: Estruturas psicológicas (AIDA, PAS) e fluxo narrativo.
29
+ - **[Section Blueprints](references/section-blueprints.md)**: Layouts "Gold Standard" para seções críticas (Hero, Bento Grids, Pricing).
30
+ - **[Copywriting Guide](references/copywriting-guide.md)**: Tom de voz e padrões de texto persuasivo.
31
+ - **[Visual Knowledge Base](assets/)**: Diretório de referências visuais e layouts reais para inspiração estética e estrutural.
26
32
 
27
33
  ## Como Usar esta Skill
28
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/agents-kit",
3
- "version": "1.18.1",
3
+ "version": "1.20.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },