@riligar/agents-kit 1.14.0 → 1.15.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 (61) hide show
  1. package/.agent/{skills/riligar-dev-clean-code/SKILL.md → rules/clean-code.md} +3 -51
  2. package/.agent/skills/riligar-dev-dashboard/SKILL.md +252 -0
  3. package/.agent/skills/riligar-infra-cloudfare/.gitkeep +0 -0
  4. package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/SKILL.md +1 -1
  5. package/.agent/skills/skill-creator/SKILL.md +1 -1
  6. package/package.json +1 -1
  7. package/.agent/skills/riligar-dev-architecture/SKILL.md +0 -54
  8. package/.agent/skills/riligar-dev-architecture/references/context-discovery.md +0 -43
  9. package/.agent/skills/riligar-dev-architecture/references/examples.md +0 -94
  10. package/.agent/skills/riligar-dev-architecture/references/pattern-selection.md +0 -68
  11. package/.agent/skills/riligar-dev-architecture/references/patterns-reference.md +0 -50
  12. package/.agent/skills/riligar-dev-architecture/references/trade-off-analysis.md +0 -77
  13. package/.agent/skills/riligar-dev-autopilot/SKILL.md +0 -59
  14. package/.agent/skills/riligar-dev-code-review/SKILL.md +0 -116
  15. package/.agent/skills/riligar-dev-database/SKILL.md +0 -51
  16. package/.agent/skills/riligar-dev-database/references/database-selection.md +0 -43
  17. package/.agent/skills/riligar-dev-database/references/indexing.md +0 -39
  18. package/.agent/skills/riligar-dev-database/references/migrations.md +0 -48
  19. package/.agent/skills/riligar-dev-database/references/optimization.md +0 -36
  20. package/.agent/skills/riligar-dev-database/references/orm-selection.md +0 -30
  21. package/.agent/skills/riligar-dev-database/references/schema-design.md +0 -56
  22. package/.agent/skills/riligar-dev-database/scripts/schema_validator.py +0 -172
  23. package/.agent/skills/riligar-dev-frontend/SKILL.md +0 -215
  24. package/.agent/skills/riligar-plan-writing/SKILL.md +0 -162
  25. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/SKILL.md +0 -0
  26. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/references/elysia-basics.md +0 -0
  27. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/references/elysia-lifecycle.md +0 -0
  28. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/references/elysia-patterns.md +0 -0
  29. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/references/elysia-plugins.md +0 -0
  30. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/references/elysia-validation.md +0 -0
  31. /package/.agent/skills/{riligar-dev-backend → riligar-dev-manager}/scripts/api_validator.py +0 -0
  32. /package/.agent/skills/{riligar-tech-stack → riligar-dev-stack}/SKILL.md +0 -0
  33. /package/.agent/skills/{riligar-tech-stack → riligar-dev-stack}/references/tech-stack.md +0 -0
  34. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/SKILL.md +0 -0
  35. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-2a03320f967a884fd2ad275d788f32e5.webp +0 -0
  36. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-481d7179109272dcaff2516fef62b718.webp +0 -0
  37. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-56d848520060ca714456601d1a7417cd.webp +0 -0
  38. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-93104cd260129cd6b76dac4119622eaf.webp +0 -0
  39. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-c5d259b0497cec98c36c48fc33ebbde6.webp +0 -0
  40. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-e865b2464fdf5ca567af716e1ed4fd16.webp +0 -0
  41. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-f1459f5315f0045705c2ca4937204146.webp +0 -0
  42. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/original-f67954754fdc2fc57009369fd3437205.webp +0 -0
  43. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/screencapture-caddaddy-app-2025-11-03-20_16_14.webp +0 -0
  44. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/screencapture-ciromaciel-click-2026-01-06-17_08_01.webp +0 -0
  45. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/screencapture-notionsecondbrain-2026-01-06-16_07_56.webp +0 -0
  46. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/assets/screencapture-skillsmp-2026-01-16-14_40_22.webp +0 -0
  47. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/references/conversion-framework.md +0 -0
  48. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/references/copywriting-guide.md +0 -0
  49. /package/.agent/skills/{riligar-dev-landing-page → riligar-dev-website}/references/section-blueprints.md +0 -0
  50. /package/.agent/skills/{riligar-dev-seo → riligar-dev-website-seo}/SKILL.md +0 -0
  51. /package/.agent/skills/{riligar-dev-seo → riligar-dev-website-seo}/references/checklist.md +0 -0
  52. /package/.agent/skills/{riligar-dev-seo → riligar-dev-website-seo}/references/implementation.md +0 -0
  53. /package/.agent/skills/{riligar-dev-seo → riligar-dev-website-seo}/references/structured-data.md +0 -0
  54. /package/.agent/skills/{riligar-infrastructure → riligar-infra-fly}/SKILL.md +0 -0
  55. /package/.agent/skills/{riligar-infrastructure → riligar-infra-fly}/references/infrastructure.md +0 -0
  56. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/assets/stripe-client.js +0 -0
  57. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/assets/stripe-server.js +0 -0
  58. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/references/stripe-database.md +0 -0
  59. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/references/stripe-elysia.md +0 -0
  60. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/references/stripe-react.md +0 -0
  61. /package/.agent/skills/{riligar-dev-stripe → riligar-infra-stripe}/references/stripe-webhooks.md +0 -0
@@ -1,25 +1,6 @@
1
- ---
2
- name: riligar-dev-clean-code
3
- description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments. CRITICAL skill that defines RiLiGar coding standards. Use when writing or reviewing any code.
4
- ---
1
+ # Clean Code
5
2
 
6
- # Clean Code - RiLiGar Standards
7
-
8
- > **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
9
-
10
- ## Rules Reference
11
-
12
- This skill builds on the foundational rules defined in `.agent/rules/`:
13
-
14
- | Rule File | Content |
15
- | --- | --- |
16
- | [code-style.md](../../rules/code-style.md) | Prettier formatting (4 spaces, no semi, single quotes) |
17
- | [javascript-only.md](../../rules/javascript-only.md) | ES6+ only, no TypeScript |
18
- | [naming-conventions.md](../../rules/naming-conventions.md) | PascalCase, camelCase, SCREAMING_SNAKE |
19
- | [conventional-commits.md](../../rules/conventional-commits.md) | Commit message format |
20
- | [pr-guidelines.md](../../rules/pr-guidelines.md) | Pull request standards |
21
-
22
- ---
3
+ Pragmatic coding standards concise, direct, no over-engineering.
23
4
 
24
5
  ## Core Principles
25
6
 
@@ -31,8 +12,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
31
12
  | **YAGNI** | You Aren't Gonna Need It - don't build unused features |
32
13
  | **Boy Scout** | Leave code cleaner than you found it |
33
14
 
34
- ---
35
-
36
15
  ## Function Rules
37
16
 
38
17
  | Rule | Description |
@@ -44,8 +23,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
44
23
  | **No Side Effects** | Don't mutate inputs unexpectedly |
45
24
  | **Async/Await** | Prefer `async/await` over `.then()` chains |
46
25
 
47
- ---
48
-
49
26
  ## Code Structure
50
27
 
51
28
  | Pattern | Apply |
@@ -55,8 +32,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
55
32
  | **Composition** | Small functions composed together |
56
33
  | **Colocation** | Keep related code close |
57
34
 
58
- ---
59
-
60
35
  ## Component & Framework Rules (React/Elysia)
61
36
 
62
37
  | Situation | Action |
@@ -67,8 +42,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
67
42
  | **API Endpoints** | Extract complex handler logic to `services/` |
68
43
  | **Early Returns** | Use Guard Clauses to avoid deep nesting |
69
44
 
70
- ---
71
-
72
45
  ## AI Coding Style
73
46
 
74
47
  | Situation | Action |
@@ -77,8 +50,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
77
50
  | User reports bug | Fix it, don't explain |
78
51
  | No clear requirement | Ask, don't assume |
79
52
 
80
- ---
81
-
82
53
  ## Anti-Patterns (DON'T)
83
54
 
84
55
  | Pattern | Fix |
@@ -92,8 +63,6 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
92
63
  | Magic numbers | Named constants |
93
64
  | God functions | Split by responsibility |
94
65
 
95
- ---
96
-
97
66
  ## Before Editing ANY File
98
67
 
99
68
  **Ask yourself:**
@@ -104,9 +73,7 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
104
73
  | **What does this file import?** | Interface changes |
105
74
  | **Is this a shared component?** | Multiple places affected |
106
75
 
107
- > **Rule:** Edit the file + all dependent files in the SAME task.
108
-
109
- ---
76
+ > Edit the file + all dependent files in the SAME task.
110
77
 
111
78
  ## Self-Check Before Completing (MANDATORY)
112
79
 
@@ -117,18 +84,3 @@ This skill builds on the foundational rules defined in `.agent/rules/`:
117
84
  | **Code works?** | Did I test/verify the change? |
118
85
  | **No TypeScript?** | Verified no `.ts` or type syntax? |
119
86
  | **Formatting?** | 4 spaces, no semi, single quotes? |
120
-
121
- ---
122
-
123
- ## Summary
124
-
125
- | Do | Don't |
126
- | --- | --- |
127
- | Write code directly | Write tutorials |
128
- | Let code self-document | Add obvious comments |
129
- | Fix bugs immediately | Explain the fix first |
130
- | Inline small things | Create unnecessary files |
131
- | Name things clearly | Use abbreviations |
132
- | Keep functions small | Write 100+ line functions |
133
-
134
- > **Remember: The user wants working code, not a programming lesson.**
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: riligar-dev-dashboard
3
+ description: Padrões React específicos do RiLiGar. Zustand, i18n, estrutura de arquivos, composição de componentes. Use quando construindo componentes, gerenciando estado ou implementando UI.
4
+ ---
5
+
6
+ # Front-End — Padrões do RiLiGar
7
+
8
+ > Regras concretas baseadas na arquitetura real dos projetos. Não são genéricas — são do código que existe.
9
+
10
+ ---
11
+
12
+ ## Referências obrigatórias
13
+
14
+ > [!IMPORTANT]
15
+ > Sempre respeite também:
16
+ > - @[.agent/skills/riligar-design-system] — UI exclusivo via Mantine, zero CSS
17
+ > - Rules em `.agent/rules/` — clean-code, naming-conventions, code-style, javascript-only
18
+
19
+ ---
20
+
21
+ ## 1. Estrutura de arquivos
22
+
23
+ ```
24
+ src/
25
+ ├── components/ # Componentes reutilizáveis
26
+ │ ├── Sidebar.jsx # PascalCase (SEMPRE)
27
+ │ ├── RichEditor.jsx
28
+ │ └── MediaLibrary.jsx
29
+ ├── pages/ # Uma pasta por página/feature
30
+ │ ├── home.jsx # Arquivo raiz da página: kebab-case
31
+ │ ├── editor/
32
+ │ │ └── index.jsx
33
+ │ └── feeds/
34
+ │ ├── index.jsx
35
+ │ └── FeedConfig.jsx # Sub-componentes: PascalCase
36
+ ├── store/ # Zustand stores — um arquivo por domínio
37
+ │ ├── auth-store.js
38
+ │ ├── feed-store.js
39
+ │ └── post-store.js
40
+ ├── services/ # Chamadas HTTP — um arquivo por domínio
41
+ │ ├── api.js # Instância base do cliente HTTP
42
+ │ ├── feeds.js
43
+ │ └── posts.js
44
+ ├── constants/ # Constantes estáticas do app
45
+ ├── i18n/ # Internacionalização
46
+ │ ├── index.js
47
+ │ └── locales/
48
+ └── hooks/ # Custom hooks compartilhados
49
+ ```
50
+
51
+ ### Regras de naming de arquivos
52
+
53
+ | Tipo | Convenção | Exemplo |
54
+ |---|---|---|
55
+ | Componentes (reutilizáveis) | PascalCase | `MediaLibrary.jsx` |
56
+ | Página raiz | kebab-case | `home.jsx`, `index.jsx` |
57
+ | Sub-componentes de página | PascalCase | `FeedConfig.jsx` |
58
+ | Stores | kebab-case + sufixo `-store` | `feed-store.js` |
59
+ | Services | kebab-case | `feeds.js` |
60
+ | Hooks | camelCase com prefixo `use` | `useDebounce.js` |
61
+
62
+ ---
63
+
64
+ ## 2. Estado — Zustand (não é opcional)
65
+
66
+ Estado global **sempre** Zustand. Sem Context para estado compartilhado. Sem Redux.
67
+
68
+ ### Padrão de store
69
+
70
+ ```javascript
71
+ import { create } from 'zustand'
72
+ import { feedsService } from '../services/feeds'
73
+
74
+ const useFeedStore = create((set, get) => ({
75
+ feeds: [],
76
+ activeFeed: null,
77
+ isLoading: false,
78
+
79
+ fetchFeeds: async () => {
80
+ set({ isLoading: true })
81
+ const feeds = await feedsService.getAll()
82
+ set({ feeds, isLoading: false })
83
+ },
84
+
85
+ setActiveFeed: (feed) => set({ activeFeed: feed }),
86
+ }))
87
+ ```
88
+
89
+ ### Regras
90
+
91
+ - **Sem getters JavaScript** (`get isTrialing() {}`) — não são reativos no Zustand. Derive no componente ou use um selector.
92
+ - **Persistência:** use `persist` middleware apenas quando necessário (ex: `activeFeed`).
93
+ - **Sem lógica de UI** dentro do store. Stores são dados + chamadas de API.
94
+ - **Selectors granulares:** `useStore((state) => state.feeds)` — não `useStore()` inteiro.
95
+
96
+ ### Errado vs Certo
97
+
98
+ ```javascript
99
+ // ❌ Getter não-reativo — nunca vai atualizar o componente
100
+ const useSubscriptionStore = create((set) => ({
101
+ subscription: null,
102
+ get isTrialing() { return this.subscription?.status === 'trialing' }
103
+ }))
104
+
105
+ // ✅ Derive no componente
106
+ const subscription = useSubscriptionStore((s) => s.subscription)
107
+ const isTrialing = subscription?.status === 'trialing'
108
+ ```
109
+
110
+ ---
111
+
112
+ ## 3. i18n — Todas as strings visíveis devem usar `t()`
113
+
114
+ O projeto usa **i18next** com 3 idiomas (pt-BR, en, es). Nenhuma string visível ao usuário pode ser hardcoded.
115
+
116
+ ### Como usar
117
+
118
+ ```javascript
119
+ import { useTranslation } from 'react-i18next'
120
+
121
+ const MyComponent = () => {
122
+ const { t } = useTranslation()
123
+
124
+ return (
125
+ <Button onClick={handleSave}>{t('common.save')}</Button>
126
+ )
127
+ }
128
+ ```
129
+
130
+ ### Regras
131
+
132
+ - **Sempre importar `useTranslation`** antes de usar `t()`. Sem isso, crash em runtime.
133
+ - Strings de UI: `t('namespace.key')` — nunca hardcode.
134
+ - Strings técnicas (logs, variável interna): podem ser em inglês, não precisam de `t()`.
135
+ - Chaves de namespace: domínio da feature (`feeds.`, `posts.`, `media.`) + `common.` para compartilhados.
136
+ - Mensagens de erro da API já vêm traduzidas do backend — não duplique.
137
+
138
+ ### Errado
139
+
140
+ ```javascript
141
+ // ❌ String hardcoded visível ao usuário
142
+ <Button>Salvar Alterações</Button>
143
+ <Text>Nenhuma mídia encontrada.</Text>
144
+
145
+ // ❌ t() sem import — crash
146
+ const handleSave = async () => {
147
+ showNotification({ title: t('common.success') }) // ReferenceError
148
+ }
149
+ ```
150
+
151
+ ### Certo
152
+
153
+ ```javascript
154
+ // ✅
155
+ import { useTranslation } from 'react-i18next'
156
+
157
+ const { t } = useTranslation()
158
+ <Button>{t('common.save')}</Button>
159
+ <Text>{t('media.empty')}</Text>
160
+ ```
161
+
162
+ ---
163
+
164
+ ## 4. Services — camada de HTTP
165
+
166
+ Todas as chamadas de API vão por `services/`. Componentes e stores não chamam HTTP diretamente.
167
+
168
+ ### Padrão
169
+
170
+ ```javascript
171
+ // services/feeds.js
172
+ import { api } from './api'
173
+
174
+ export const feedsService = {
175
+ getAll: () => api.get('feeds').json(),
176
+ getById: (id) => api.get(`feeds/${id}`).json(),
177
+ create: (data) => api.post('feeds', { json: data }).json(),
178
+ update: (id, data) => api.put(`feeds/${id}`, { json: data }).json(),
179
+ remove: (id) => api.delete(`feeds/${id}`).json(),
180
+ }
181
+ ```
182
+
183
+ - `api.js` tem a instância base com token de auth e tratamento de erro.
184
+ - **Não duplique `API_URL`** — já está no `api.js`. Nunca redefina em outro arquivo.
185
+ - Services são funções puras de chamada HTTP. Sem lógica de estado.
186
+
187
+ ---
188
+
189
+ ## 5. Componentes — regras práticas
190
+
191
+ ### Composição
192
+
193
+ - Um componente, uma responsabilidade.
194
+ - Se um componente ultrapassar ~100 linhas, divide.
195
+ - Props down, events up. Sem drilling profundo — usa store.
196
+
197
+ ### Interação com usuário
198
+
199
+ - **Confirmação de exclusão:** sempre usar `HoldButton` / `ButtonDelete` do `components/Buttons.jsx`. Nunca usar `confirm()` nativo.
200
+ - **Hover/focus:** usar props do Mantine (`styles`, `withBorder`, hover via `&:hover` no `styles`). Nunca manipular DOM diretamente via `e.currentTarget.style`.
201
+
202
+ ```javascript
203
+ // ❌ Manipulação direta de DOM
204
+ onMouseEnter={(e) => e.currentTarget.style.background = '#eee'}
205
+
206
+ // ✅ Mantine styles prop
207
+ styles={{ root: { '&:hover': { backgroundColor: 'var(--mantine-color-dimmed)' } } }}
208
+ ```
209
+
210
+ ### Não redefina componentes do Mantine
211
+
212
+ Se você precisa de um `Center`, `TextInput`, `Button` — use o do Mantine. Nunca crie um local com o mesmo nome, isso gera shadow e confusão.
213
+
214
+ ---
215
+
216
+ ## 6. Constantes e valores fixos
217
+
218
+ - Strings de config (phone numbers, mensagens template, URLs externas) vão em `constants/` ou `.env`.
219
+ - Nunca hardcode dentro de componentes.
220
+
221
+ ```javascript
222
+ // ❌
223
+ const message = `Olá, preciso de ajuda com meu plano.`
224
+
225
+ // ✅ constants/whatsapp.js
226
+ export const WHATSAPP_SUPPORT_NUMBER = '...'
227
+ export const WHATSAPP_SUPPORT_MESSAGE = '...' // ou via i18n se traduzível
228
+ ```
229
+
230
+ ---
231
+
232
+ ## 7. Anti-patterns (do código real)
233
+
234
+ | ❌ Problema real encontrado | ✅ Como resolver |
235
+ |---|---|
236
+ | `slugify` duplicado em 2 arquivos | Extrair para `utils/slugify.js` |
237
+ | `stripHtml` duplicado em 2 arquivos | Extrair para `utils/stripHtml.js` |
238
+ | `API_URL` redefinido fora do `api.js` | Importar do `services/api.js` |
239
+ | `t()` usado sem `useTranslation` importado | Sempre verificar import |
240
+ | Componente Mantine shadowed por local | Deletar o local, usar Mantine |
241
+ | Código comentado espalhado | Deletar. Se precisa, usa git. |
242
+ | `confirm()` misturado com HoldButton | Usa HoldButton sempre |
243
+ | `<style>` tag com CSS raw | Usa `styles` prop do Mantine (exceção: libs externas como ProseMirror que precisam de CSS global) |
244
+ | Getters no Zustand store | Derive no componente |
245
+ | `onMouseEnter` manipulando style diretamente | Usa `styles` prop do Mantine |
246
+
247
+ ---
248
+
249
+ ## Related Skills
250
+
251
+ - @[.agent/skills/riligar-design-system]
252
+ - @[.agent/skills/riligar-dev-stack]
File without changes
@@ -252,6 +252,6 @@ stripe trigger checkout.session.completed
252
252
  ## Related Skills
253
253
 
254
254
  - @[.agent/skills/riligar-dev-backend]
255
- - @[.agent/skills/riligar-dev-frontend]
255
+ - @[.agent/skills/riligar-dev-dashboard]
256
256
  - @[.agent/skills/riligar-dev-auth-elysia]
257
257
  - @[.agent/skills/riligar-tech-stack]
@@ -78,7 +78,7 @@ Every skill must have a `type` field that categorizes it. This enables organizat
78
78
 
79
79
  - Directory name MUST match the `name` field in frontmatter
80
80
  - Use pattern: `riligar-{type}-{specific-name}`
81
- - Examples: `riligar-dev-frontend`, `riligar-marketing-copy`, `riligar-business-startup-analyst`
81
+ - Examples: `riligar-dev-dashboard`, `riligar-marketing-copy`, `riligar-business-startup-analyst`
82
82
 
83
83
  #### SKILL.md (required)
84
84
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/agents-kit",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,54 +0,0 @@
1
- ---
2
- name: riligar-dev-architecture
3
- description: Architectural decision-making framework. Requirements analysis, trade-off evaluation, ADR documentation. Use when making architecture decisions or analyzing system design.
4
- ---
5
-
6
- # Architecture Decision Framework
7
-
8
- > "Requirements drive architecture. Trade-offs inform decisions. ADRs capture rationale."
9
-
10
- ## 🎯 Selective Reading Rule
11
-
12
- **Read ONLY files relevant to the request!** Check the content map, find what you need.
13
-
14
- | File | Description | When to Read |
15
- | ----------------------------------- | ---------------------------------------- | ---------------------------- |
16
- | `references/context-discovery.md` | Questions to ask, project classification | Starting architecture design |
17
- | `references/trade-off-analysis.md` | ADR templates, trade-off framework | Documenting decisions |
18
- | `references/pattern-selection.md` | Decision trees, anti-patterns | Choosing patterns |
19
- | `references/examples.md` | MVP, SaaS, Enterprise examples | Reference implementations |
20
- | `references/patterns-reference.md` | Quick lookup for patterns | Pattern comparison |
21
-
22
- ---
23
-
24
- ## 🔗 Related Skills
25
-
26
- | Skill | Use For |
27
- | --------------------------------- | ----------------------- |
28
- | `@[skills/database-design]` | Database schema design |
29
- | `@[skills/api-patterns]` | API design patterns |
30
- | `@[skills/deployment-procedures]` | Deployment architecture |
31
-
32
- ---
33
-
34
- ## Core Principle
35
-
36
- **"Simplicity is the ultimate sophistication."**
37
-
38
- - Start simple
39
- - Add complexity ONLY when proven necessary
40
- - You can always add patterns later
41
- - Removing complexity is MUCH harder than adding it
42
-
43
- ---
44
-
45
- ## Validation Checklist
46
-
47
- Before finalizing architecture:
48
-
49
- - [ ] Requirements clearly understood
50
- - [ ] Constraints identified
51
- - [ ] Each decision has trade-off analysis
52
- - [ ] Simpler alternatives considered
53
- - [ ] ADRs written for significant decisions
54
- - [ ] Team expertise matches chosen patterns
@@ -1,43 +0,0 @@
1
- # Context Discovery
2
-
3
- > Before suggesting any architecture, gather context.
4
-
5
- ## Question Hierarchy (Ask User FIRST)
6
-
7
- 1. **Scale**
8
- - How many users? (10, 1K, 100K, 1M+)
9
- - Data volume? (MB, GB, TB)
10
- - Transaction rate? (per second/minute)
11
-
12
- 2. **Team**
13
- - Solo developer or team?
14
- - Team size and expertise?
15
- - Distributed or co-located?
16
-
17
- 3. **Timeline**
18
- - MVP/Prototype or long-term product?
19
- - Time to market pressure?
20
-
21
- 4. **Domain**
22
- - CRUD-heavy or business logic complex?
23
- - Real-time requirements?
24
- - Compliance/regulations?
25
-
26
- 5. **Constraints**
27
- - Budget limitations?
28
- - Legacy systems to integrate?
29
- - Technology stack preferences?
30
-
31
- ## Project Classification Matrix
32
-
33
- ```
34
- MVP SaaS Enterprise
35
- ┌─────────────────────────────────────────────────────────────┐
36
- │ Scale │ <1K │ 1K-100K │ 100K+ │
37
- │ Team │ Solo │ 2-10 │ 10+ │
38
- │ Timeline │ Fast (weeks) │ Medium (months)│ Long (years)│
39
- │ Architecture │ Simple │ Modular │ Distributed │
40
- │ Patterns │ Minimal │ Selective │ Comprehensive│
41
- │ Example │ Next.js API │ NestJS │ Microservices│
42
- └─────────────────────────────────────────────────────────────┘
43
- ```
@@ -1,94 +0,0 @@
1
- # Architecture Examples
2
-
3
- > Real-world architecture decisions by project type.
4
-
5
- ---
6
-
7
- ## Example 1: MVP E-commerce (Solo Developer)
8
-
9
- ```yaml
10
- Requirements:
11
- - <1000 users initially
12
- - Solo developer
13
- - Fast to market (8 weeks)
14
- - Budget-conscious
15
-
16
- Architecture Decisions:
17
- App Structure: Monolith (simpler for solo)
18
- Framework: Next.js (full-stack, fast)
19
- Data Layer: Prisma direct (no over-abstraction)
20
- Authentication: JWT (simpler than OAuth)
21
- Payment: Stripe (hosted solution)
22
- Database: PostgreSQL (ACID for orders)
23
-
24
- Trade-offs Accepted:
25
- - Monolith → Can't scale independently (team doesn't justify it)
26
- - No Repository → Less testable (simple CRUD doesn't need it)
27
- - JWT → No social login initially (can add later)
28
-
29
- Future Migration Path:
30
- - Users > 10K → Extract payment service
31
- - Team > 3 → Add Repository pattern
32
- - Social login requested → Add OAuth
33
- ```
34
-
35
- ---
36
-
37
- ## Example 2: SaaS Product (5-10 Developers)
38
-
39
- ```yaml
40
- Requirements:
41
- - 1K-100K users
42
- - 5-10 developers
43
- - Long-term (12+ months)
44
- - Multiple domains (billing, users, core)
45
-
46
- Architecture Decisions:
47
- App Structure: Modular Monolith (team size optimal)
48
- Framework: NestJS (modular by design)
49
- Data Layer: Repository pattern (testing, flexibility)
50
- Domain Model: Partial DDD (rich entities)
51
- Authentication: OAuth + JWT
52
- Caching: Redis
53
- Database: PostgreSQL
54
-
55
- Trade-offs Accepted:
56
- - Modular Monolith → Some module coupling (microservices not justified)
57
- - Partial DDD → No full aggregates (no domain experts)
58
- - RabbitMQ later → Initial synchronous (add when proven needed)
59
-
60
- Migration Path:
61
- - Team > 10 → Consider microservices
62
- - Domains conflict → Extract bounded contexts
63
- - Read performance issues → Add CQRS
64
- ```
65
-
66
- ---
67
-
68
- ## Example 3: Enterprise (100K+ Users)
69
-
70
- ```yaml
71
- Requirements:
72
- - 100K+ users
73
- - 10+ developers
74
- - Multiple business domains
75
- - Different scaling needs
76
- - 24/7 availability
77
-
78
- Architecture Decisions:
79
- App Structure: Microservices (independent scale)
80
- API Gateway: Kong/AWS API GW
81
- Domain Model: Full DDD
82
- Consistency: Event-driven (eventual OK)
83
- Message Bus: Kafka
84
- Authentication: OAuth + SAML (enterprise SSO)
85
- Database: Polyglot (right tool per job)
86
- CQRS: Selected services
87
-
88
- Operational Requirements:
89
- - Service mesh (Istio/Linkerd)
90
- - Distributed tracing (Jaeger/Tempo)
91
- - Centralized logging (ELK/Loki)
92
- - Circuit breakers (Resilience4j)
93
- - Kubernetes/Helm
94
- ```
@@ -1,68 +0,0 @@
1
- # Pattern Selection Guidelines
2
-
3
- > Decision trees for choosing architectural patterns.
4
-
5
- ## Main Decision Tree
6
-
7
- ```
8
- START: What's your MAIN concern?
9
-
10
- ┌─ Data Access Complexity?
11
- │ ├─ HIGH (complex queries, testing needed)
12
- │ │ → Repository Pattern + Unit of Work
13
- │ │ VALIDATE: Will data source change frequently?
14
- │ │ ├─ YES → Repository worth the indirection
15
- │ │ └─ NO → Consider simpler ORM direct access
16
- │ └─ LOW (simple CRUD, single database)
17
- │ → ORM directly (Prisma, Drizzle)
18
- │ Simpler = Better, Faster
19
-
20
- ├─ Business Rules Complexity?
21
- │ ├─ HIGH (domain logic, rules vary by context)
22
- │ │ → Domain-Driven Design
23
- │ │ VALIDATE: Do you have domain experts on team?
24
- │ │ ├─ YES → Full DDD (Aggregates, Value Objects)
25
- │ │ └─ NO → Partial DDD (rich entities, clear boundaries)
26
- │ └─ LOW (mostly CRUD, simple validation)
27
- │ → Transaction Script pattern
28
- │ Simpler = Better, Faster
29
-
30
- ├─ Independent Scaling Needed?
31
- │ ├─ YES (different components scale differently)
32
- │ │ → Microservices WORTH the complexity
33
- │ │ REQUIREMENTS (ALL must be true):
34
- │ │ - Clear domain boundaries
35
- │ │ - Team > 10 developers
36
- │ │ - Different scaling needs per service
37
- │ │ IF NOT ALL MET → Modular Monolith instead
38
- │ └─ NO (everything scales together)
39
- │ → Modular Monolith
40
- │ Can extract services later when proven needed
41
-
42
- └─ Real-time Requirements?
43
- ├─ HIGH (immediate updates, multi-user sync)
44
- │ → Event-Driven Architecture
45
- │ → Message Queue (RabbitMQ, Redis, Kafka)
46
- │ VALIDATE: Can you handle eventual consistency?
47
- │ ├─ YES → Event-driven valid
48
- │ └─ NO → Synchronous with polling
49
- └─ LOW (eventual consistency acceptable)
50
- → Synchronous (REST/GraphQL)
51
- Simpler = Better, Faster
52
- ```
53
-
54
- ## The 3 Questions (Before ANY Pattern)
55
-
56
- 1. **Problem Solved**: What SPECIFIC problem does this pattern solve?
57
- 2. **Simpler Alternative**: Is there a simpler solution?
58
- 3. **Deferred Complexity**: Can we add this LATER when needed?
59
-
60
- ## Red Flags (Anti-patterns)
61
-
62
- | Pattern | Anti-pattern | Simpler Alternative |
63
- |---------|-------------|-------------------|
64
- | Microservices | Premature splitting | Start monolith, extract later |
65
- | Clean/Hexagonal | Over-abstraction | Concrete first, interfaces later |
66
- | Event Sourcing | Over-engineering | Append-only audit log |
67
- | CQRS | Unnecessary complexity | Single model |
68
- | Repository | YAGNI for simple CRUD | ORM direct access |