@ranimontagna/agent-toolkit 0.1.7 → 0.1.9

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 (72) hide show
  1. package/README.md +59 -6
  2. package/package.json +1 -1
  3. package/skills/backend/database/postgres-patterns/LICENSE.ANTIGRAVITY +21 -0
  4. package/skills/backend/database/postgres-patterns/LICENSE.ECC +21 -0
  5. package/skills/backend/database/postgres-patterns/NOTICE.md +11 -0
  6. package/skills/backend/database/postgres-patterns/SKILL.md +180 -0
  7. package/skills/backend/kotlin/kotlin-patterns/LICENSE +21 -0
  8. package/skills/backend/kotlin/kotlin-patterns/NOTICE.md +7 -0
  9. package/skills/backend/kotlin/kotlin-patterns/SKILL.md +711 -0
  10. package/skills/backend/kotlin/kotlin-testing/LICENSE +21 -0
  11. package/skills/backend/kotlin/kotlin-testing/NOTICE.md +7 -0
  12. package/skills/backend/kotlin/kotlin-testing/SKILL.md +824 -0
  13. package/skills/backend/python/python-patterns/LICENSE +21 -0
  14. package/skills/backend/python/python-patterns/NOTICE.md +7 -0
  15. package/skills/backend/python/python-patterns/SKILL.md +424 -0
  16. package/skills/backend/python/python-testing/LICENSE +21 -0
  17. package/skills/backend/python/python-testing/NOTICE.md +7 -0
  18. package/skills/backend/python/python-testing/SKILL.md +494 -0
  19. package/skills/devops/docker-patterns/LICENSE.ANTIGRAVITY +21 -0
  20. package/skills/devops/docker-patterns/LICENSE.ECC +21 -0
  21. package/skills/devops/docker-patterns/NOTICE.md +11 -0
  22. package/skills/devops/docker-patterns/SKILL.md +397 -0
  23. package/skills/frontend/accessibility/LICENSE +21 -0
  24. package/skills/frontend/accessibility/NOTICE.md +10 -0
  25. package/skills/frontend/accessibility/SKILL.md +145 -0
  26. package/skills/frontend/design/ui-ux-pro-max/LICENSE +21 -0
  27. package/skills/frontend/design/ui-ux-pro-max/NOTICE.md +12 -0
  28. package/skills/frontend/design/ui-ux-pro-max/SKILL.md +672 -0
  29. package/skills/frontend/design/ui-ux-pro-max/data/_sync_all.py +414 -0
  30. package/skills/frontend/design/ui-ux-pro-max/data/app-interface.csv +31 -0
  31. package/skills/frontend/design/ui-ux-pro-max/data/charts.csv +26 -0
  32. package/skills/frontend/design/ui-ux-pro-max/data/colors.csv +162 -0
  33. package/skills/frontend/design/ui-ux-pro-max/data/design.csv +1776 -0
  34. package/skills/frontend/design/ui-ux-pro-max/data/draft.csv +1779 -0
  35. package/skills/frontend/design/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  36. package/skills/frontend/design/ui-ux-pro-max/data/icons.csv +106 -0
  37. package/skills/frontend/design/ui-ux-pro-max/data/landing.csv +35 -0
  38. package/skills/frontend/design/ui-ux-pro-max/data/products.csv +162 -0
  39. package/skills/frontend/design/ui-ux-pro-max/data/react-performance.csv +45 -0
  40. package/skills/frontend/design/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  41. package/skills/frontend/design/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  42. package/skills/frontend/design/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  43. package/skills/frontend/design/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  44. package/skills/frontend/design/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  45. package/skills/frontend/design/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  46. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  47. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  48. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  49. package/skills/frontend/design/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  50. package/skills/frontend/design/ui-ux-pro-max/data/stacks/react.csv +54 -0
  51. package/skills/frontend/design/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  52. package/skills/frontend/design/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  53. package/skills/frontend/design/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  54. package/skills/frontend/design/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  55. package/skills/frontend/design/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  56. package/skills/frontend/design/ui-ux-pro-max/data/styles.csv +85 -0
  57. package/skills/frontend/design/ui-ux-pro-max/data/typography.csv +74 -0
  58. package/skills/frontend/design/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  59. package/skills/frontend/design/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  60. package/skills/frontend/design/ui-ux-pro-max/scripts/core.py +262 -0
  61. package/skills/frontend/design/ui-ux-pro-max/scripts/design_system.py +1148 -0
  62. package/skills/frontend/design/ui-ux-pro-max/scripts/search.py +114 -0
  63. package/skills/general/code-reviewer/AGENTS.md +292 -0
  64. package/skills/general/code-reviewer/LICENSE +201 -0
  65. package/skills/general/code-reviewer/NOTICE.md +10 -0
  66. package/skills/general/code-reviewer/SKILL.md +132 -0
  67. package/skills/general/code-reviewer/rules/correctness-error-handling.md +279 -0
  68. package/skills/general/code-reviewer/rules/maintainability-naming.md +149 -0
  69. package/skills/general/code-reviewer/rules/maintainability-type-hints.md +93 -0
  70. package/skills/general/code-reviewer/rules/performance-n-plus-one.md +250 -0
  71. package/skills/general/code-reviewer/rules/security-sql-injection.md +142 -0
  72. package/skills/general/code-reviewer/rules/security-xss-prevention.md +225 -0
package/README.md CHANGED
@@ -23,8 +23,9 @@ any work.
23
23
  ![Detected status terminal screen](docs/assets/install-status.svg)
24
24
 
25
25
  Custom Skills are grouped by first-level package. Today this repository ships
26
- `core`, `backend` and `frontend`; future packages can be added under
27
- `skills/<package>/...` and they will appear automatically in the menu.
26
+ `core`, `backend`, `frontend`, `general` and `devops`; future packages can be
27
+ added under `skills/<package>/...` and they will appear automatically in the
28
+ menu.
28
29
 
29
30
  ![Custom Skill package selection terminal screen](docs/assets/install-skill-packages.svg)
30
31
 
@@ -128,6 +129,9 @@ skills/
128
129
  agent-toolkit-maintainer/
129
130
  SKILL.md
130
131
  backend/
132
+ database/
133
+ postgres-patterns/
134
+ SKILL.md
131
135
  fastify-best-practices/
132
136
  SKILL.md
133
137
  rules/
@@ -141,7 +145,24 @@ skills/
141
145
  SKILL.md
142
146
  java-junit/
143
147
  SKILL.md
148
+ kotlin/
149
+ kotlin-patterns/
150
+ SKILL.md
151
+ kotlin-testing/
152
+ SKILL.md
153
+ python/
154
+ python-patterns/
155
+ SKILL.md
156
+ python-testing/
157
+ SKILL.md
144
158
  frontend/
159
+ accessibility/
160
+ SKILL.md
161
+ design/
162
+ ui-ux-pro-max/
163
+ SKILL.md
164
+ data/
165
+ scripts/
145
166
  react-native/
146
167
  react-native-expert/
147
168
  SKILL.md
@@ -157,6 +178,13 @@ skills/
157
178
  react-testing/
158
179
  SKILL.md
159
180
  rules/
181
+ general/
182
+ code-reviewer/
183
+ SKILL.md
184
+ rules/
185
+ devops/
186
+ docker-patterns/
187
+ SKILL.md
160
188
  ```
161
189
 
162
190
  The first path segment is a selectable package:
@@ -184,6 +212,18 @@ Use `--skills-scope` to select a narrower path:
184
212
  npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-scope backend/java
185
213
  ```
186
214
 
215
+ Install only Python skills:
216
+
217
+ ```bash
218
+ npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-scope backend/python
219
+ ```
220
+
221
+ Install only Kotlin skills:
222
+
223
+ ```bash
224
+ npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-scope backend/kotlin
225
+ ```
226
+
187
227
  Install only React Native skills:
188
228
 
189
229
  ```bash
@@ -219,16 +259,25 @@ Follow these steps...
219
259
  | Package | Skill | Source |
220
260
  |---|---|---|
221
261
  | `core` | `agent-toolkit-maintainer` | Maintained in this repository |
262
+ | `backend` | `postgres-patterns` | Adapted from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/.kiro/skills/postgres-patterns) and [`sickn33/antigravity-awesome-skills`](https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/postgresql), both under the MIT license |
222
263
  | `backend` | `fastify-best-practices` | Copied from Matteo Collina's [`mcollina/skills`](https://github.com/mcollina/skills/tree/main/skills/fastify) under the MIT license |
223
264
  | `backend` | `golang-patterns` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/golang-patterns) under the MIT license |
224
265
  | `backend` | `golang-testing` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/.kiro/skills/golang-testing) under the MIT license |
225
266
  | `backend` | `java-coding-standards` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/java-coding-standards) under the MIT license |
226
267
  | `backend` | `java-junit` | Copied from GitHub's [`awesome-copilot`](https://github.com/github/awesome-copilot/tree/main/skills/java-junit) under the MIT license |
268
+ | `backend` | `kotlin-patterns` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/kotlin-patterns) under the MIT license |
269
+ | `backend` | `kotlin-testing` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/kotlin-testing) under the MIT license |
270
+ | `backend` | `python-patterns` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/.kiro/skills/python-patterns) under the MIT license |
271
+ | `backend` | `python-testing` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/.kiro/skills/python-testing) under the MIT license |
272
+ | `devops` | `docker-patterns` | Adapted from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/.kiro/skills/docker-patterns) and [`sickn33/antigravity-awesome-skills`](https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/docker-expert), both under the MIT license |
273
+ | `frontend` | `accessibility` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/accessibility) under the MIT license |
274
+ | `frontend` | `ui-ux-pro-max` | Copied from Next Level Builder's [`ui-ux-pro-max-skill`](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/tree/main/.claude/skills/ui-ux-pro-max) under the MIT license |
227
275
  | `frontend` | `react-native-expert` | Copied from Jeffallan's [`claude-skills`](https://github.com/Jeffallan/claude-skills/tree/main/skills/react-native-expert) under the MIT license |
228
276
  | `frontend` | `react-native-unistyles-v3` | Copied from Jacek Pudysz's [`react-native-unistyles`](https://github.com/jpudysz/react-native-unistyles/tree/main/skills/react-native-unistyles-v3), declared MIT upstream |
229
277
  | `frontend` | `react-patterns` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/react-patterns) under the MIT license |
230
278
  | `frontend` | `react-performance` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/react-performance) under the MIT license |
231
279
  | `frontend` | `react-testing` | Copied from Affaan Mustafa's [`ECC`](https://github.com/affaan-m/ECC/tree/main/skills/react-testing) under the MIT license |
280
+ | `general` | `code-reviewer` | Copied from Shubhamsaboo's [`awesome-llm-apps`](https://github.com/Shubhamsaboo/awesome-llm-apps/tree/main/awesome_agent_skills/code-reviewer) under the repository Apache-2.0 license |
232
281
 
233
282
  Each React skill carries its own ECC `rules/react` references so Markdown links
234
283
  still resolve after the installer copies skills into flat runtime directories.
@@ -241,8 +290,8 @@ The installer validates:
241
290
  - `name` uses lowercase letters, numbers and hyphens;
242
291
  - `description` is non-empty and under 1024 characters.
243
292
 
244
- Third-party frontend design skills such as Impeccable and Taste Skill are not
245
- vendored as bundled Custom Skills. The `frontend-skills` tool installs them
293
+ Other third-party frontend design skills such as Impeccable and Taste Skill are
294
+ not vendored as bundled Custom Skills. The `frontend-skills` tool installs them
246
295
  externally through the Agent Skills CLI from pinned public sources.
247
296
 
248
297
  ## CLI Reference
@@ -369,6 +418,10 @@ Bundled third-party skills preserve upstream attribution and license files:
369
418
  | `react-patterns` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
370
419
  | `react-performance` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
371
420
  | `react-testing` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
421
+ | `python-patterns` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
422
+ | `python-testing` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
423
+ | `kotlin-patterns` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
424
+ | `kotlin-testing` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
372
425
 
373
426
  Releases use npm trusted publishing through GitHub Actions OIDC. The npm
374
427
  package is published without a long-lived npm token, and npm automatically
@@ -483,8 +536,8 @@ Release a new npm version by updating `package.json`, pushing the change to
483
536
  `main`, then pushing a matching tag:
484
537
 
485
538
  ```bash
486
- git tag v0.1.7
487
- git push origin v0.1.7
539
+ git tag v0.1.9
540
+ git push origin v0.1.9
488
541
  ```
489
542
 
490
543
  The `Release` workflow runs the full check and publishes the scoped package to
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ranimontagna/agent-toolkit",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Personal AI agent toolkit installer for Claude Code, Codex CLI, OpenCode, Gemini CLI and graph-aware workflows.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.0.6",
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Antigravity User
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Affaan Mustafa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ # Third-party notice
2
+
3
+ This skill is adapted from two MIT-licensed community skills:
4
+
5
+ - ECC postgres-patterns: https://github.com/affaan-m/ECC/tree/main/.kiro/skills/postgres-patterns
6
+ - ECC source commit: 0f84c0e2796703fbda87d577b2636351418c7442
7
+ - Antigravity postgresql: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/postgresql
8
+ - Antigravity source commit: b806b97a9a48063f7bdbee5611caf40edd17e305
9
+
10
+ The upstream MIT license texts are included in `LICENSE.ECC` and
11
+ `LICENSE.ANTIGRAVITY`.
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: postgres-patterns
3
+ description: Use when writing PostgreSQL queries or migrations, designing schemas, choosing data types, adding indexes, implementing RLS, tuning slow queries, reviewing DDL safety, or configuring production database behavior.
4
+ metadata:
5
+ origin: ECC and antigravity-awesome-skills
6
+ credit: Supabase team, Affaan Mustafa, and Antigravity User
7
+ ---
8
+
9
+ # PostgreSQL Patterns
10
+
11
+ Quick reference for PostgreSQL best practices. For detailed guidance, use the `database-reviewer` agent.
12
+
13
+ ## When to Activate
14
+
15
+ - Writing SQL queries or migrations
16
+ - Designing database schemas
17
+ - Troubleshooting slow queries
18
+ - Implementing Row Level Security
19
+ - Setting up connection pooling
20
+
21
+ ## Schema Review Guardrails
22
+
23
+ Before changing DDL, capture entities, access patterns, expected row counts,
24
+ QPS, retention, and migration constraints. Optimize for correctness first,
25
+ then tune for measured hot paths.
26
+
27
+ - Prefer `snake_case` unquoted identifiers.
28
+ - Define primary keys where rows are referenced by other tables.
29
+ - Prefer `bigint generated always as identity` for local IDs; use UUID only
30
+ when global uniqueness, opacity, or distributed creation is required.
31
+ - Normalize first; denormalize only after measuring read bottlenecks.
32
+ - Add `not null`, `check`, `unique`, and foreign key constraints to enforce
33
+ invariants in the database.
34
+ - Index foreign keys manually. PostgreSQL does not auto-index FK columns.
35
+ - Prefer `timestamptz` for event time and `numeric(p,s)` for money.
36
+ - Prefer `text` plus optional `check (length(col) <= n)` over arbitrary
37
+ `varchar(n)`.
38
+ - Use `jsonb` for optional or semi-structured attributes, not for relations
39
+ that need joins, constraints, or frequent filtering.
40
+ - Validate important queries with `explain (analyze, buffers)` before adding
41
+ indexes or denormalized columns.
42
+
43
+ ## Quick Reference
44
+
45
+ ### Index Cheat Sheet
46
+
47
+ | Query Pattern | Index Type | Example |
48
+ |--------------|------------|---------|
49
+ | `WHERE col = value` | B-tree (default) | `CREATE INDEX idx ON t (col)` |
50
+ | `WHERE col > value` | B-tree | `CREATE INDEX idx ON t (col)` |
51
+ | `WHERE a = x AND b > y` | Composite | `CREATE INDEX idx ON t (a, b)` |
52
+ | `WHERE jsonb @> '{}'` | GIN | `CREATE INDEX idx ON t USING gin (col)` |
53
+ | `WHERE tsv @@ query` | GIN | `CREATE INDEX idx ON t USING gin (col)` |
54
+ | Time-series ranges | BRIN | `CREATE INDEX idx ON t USING brin (col)` |
55
+
56
+ ### Data Type Quick Reference
57
+
58
+ | Use Case | Correct Type | Avoid |
59
+ |----------|-------------|-------|
60
+ | IDs | `bigint` | `int`, random UUID |
61
+ | Strings | `text` | `varchar(255)` |
62
+ | Timestamps | `timestamptz` | `timestamp` |
63
+ | Money | `numeric(10,2)` | `float` |
64
+ | Flags | `boolean` | `varchar`, `int` |
65
+
66
+ ### Common Patterns
67
+
68
+ **Composite Index Order:**
69
+ ```sql
70
+ -- Equality columns first, then range columns
71
+ CREATE INDEX idx ON orders (status, created_at);
72
+ -- Works for: WHERE status = 'pending' AND created_at > '2024-01-01'
73
+ ```
74
+
75
+ **Covering Index:**
76
+ ```sql
77
+ CREATE INDEX idx ON users (email) INCLUDE (name, created_at);
78
+ -- Avoids table lookup for SELECT email, name, created_at
79
+ ```
80
+
81
+ **Partial Index:**
82
+ ```sql
83
+ CREATE INDEX idx ON users (email) WHERE deleted_at IS NULL;
84
+ -- Smaller index, only includes active users
85
+ ```
86
+
87
+ **RLS Policy (Optimized):**
88
+ ```sql
89
+ CREATE POLICY policy ON orders
90
+ USING ((SELECT auth.uid()) = user_id); -- Wrap in SELECT!
91
+ ```
92
+
93
+ **UPSERT:**
94
+ ```sql
95
+ INSERT INTO settings (user_id, key, value)
96
+ VALUES (123, 'theme', 'dark')
97
+ ON CONFLICT (user_id, key)
98
+ DO UPDATE SET value = EXCLUDED.value;
99
+ ```
100
+
101
+ **Cursor Pagination:**
102
+ ```sql
103
+ SELECT * FROM products WHERE id > $last_id ORDER BY id LIMIT 20;
104
+ -- O(1) vs OFFSET which is O(n)
105
+ ```
106
+
107
+ **Queue Processing:**
108
+ ```sql
109
+ UPDATE jobs SET status = 'processing'
110
+ WHERE id = (
111
+ SELECT id FROM jobs WHERE status = 'pending'
112
+ ORDER BY created_at LIMIT 1
113
+ FOR UPDATE SKIP LOCKED
114
+ ) RETURNING *;
115
+ ```
116
+
117
+ ### Anti-Pattern Detection
118
+
119
+ ```sql
120
+ -- Find unindexed foreign keys
121
+ SELECT conrelid::regclass, a.attname
122
+ FROM pg_constraint c
123
+ JOIN pg_attribute a ON a.attrelid = c.conrelid AND a.attnum = ANY(c.conkey)
124
+ WHERE c.contype = 'f'
125
+ AND NOT EXISTS (
126
+ SELECT 1 FROM pg_index i
127
+ WHERE i.indrelid = c.conrelid AND a.attnum = ANY(i.indkey)
128
+ );
129
+
130
+ -- Find slow queries
131
+ SELECT query, mean_exec_time, calls
132
+ FROM pg_stat_statements
133
+ WHERE mean_exec_time > 100
134
+ ORDER BY mean_exec_time DESC;
135
+
136
+ -- Check table bloat
137
+ SELECT relname, n_dead_tup, last_vacuum
138
+ FROM pg_stat_user_tables
139
+ WHERE n_dead_tup > 1000
140
+ ORDER BY n_dead_tup DESC;
141
+ ```
142
+
143
+ ### Configuration Template
144
+
145
+ ```sql
146
+ -- Connection limits (adjust for RAM)
147
+ ALTER SYSTEM SET max_connections = 100;
148
+ ALTER SYSTEM SET work_mem = '8MB';
149
+
150
+ -- Timeouts
151
+ ALTER SYSTEM SET idle_in_transaction_session_timeout = '30s';
152
+ ALTER SYSTEM SET statement_timeout = '30s';
153
+
154
+ -- Monitoring
155
+ CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
156
+
157
+ -- Security defaults
158
+ REVOKE ALL ON SCHEMA public FROM public;
159
+
160
+ SELECT pg_reload_conf();
161
+ ```
162
+
163
+ ## Related
164
+
165
+ - Agent: `database-reviewer` - Full database review workflow
166
+ - Skill: `backend-patterns` - API and backend patterns
167
+ - Skill: `database-migrations` - Safe schema changes
168
+
169
+ ## When to Use This Skill
170
+
171
+ - Writing SQL queries
172
+ - Designing database schemas
173
+ - Optimizing query performance
174
+ - Implementing Row Level Security
175
+ - Troubleshooting database issues
176
+ - Setting up PostgreSQL configuration
177
+
178
+ ---
179
+
180
+ *Based on Supabase Agent Skills (credit: Supabase team) (MIT License)*
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Affaan Mustafa
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ # Attribution
2
+
3
+ This skill is adapted from `affaan-m/ECC`, `skills/kotlin-patterns`, commit `0f84c0e2796703fbda87d577b2636351418c7442`.
4
+
5
+ Source: https://github.com/affaan-m/ECC/tree/main/skills/kotlin-patterns
6
+
7
+ License: MIT. See `LICENSE`.