@ranimontagna/agent-toolkit 0.1.6 → 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.
- package/README.md +83 -10
- package/package.json +1 -1
- package/skills/backend/database/postgres-patterns/LICENSE.ANTIGRAVITY +21 -0
- package/skills/backend/database/postgres-patterns/LICENSE.ECC +21 -0
- package/skills/backend/database/postgres-patterns/NOTICE.md +11 -0
- package/skills/backend/database/postgres-patterns/SKILL.md +180 -0
- package/skills/backend/go/golang-patterns/LICENSE +21 -0
- package/skills/backend/go/golang-patterns/NOTICE.md +10 -0
- package/skills/backend/go/golang-patterns/SKILL.md +674 -0
- package/skills/backend/go/golang-testing/LICENSE +21 -0
- package/skills/backend/go/golang-testing/NOTICE.md +10 -0
- package/skills/backend/go/golang-testing/SKILL.md +329 -0
- package/skills/backend/java/java-coding-standards/LICENSE +21 -0
- package/skills/backend/java/java-coding-standards/NOTICE.md +10 -0
- package/skills/backend/java/java-coding-standards/SKILL.md +383 -0
- package/skills/backend/java/java-junit/LICENSE +21 -0
- package/skills/backend/java/java-junit/NOTICE.md +10 -0
- package/skills/backend/java/java-junit/SKILL.md +64 -0
- package/skills/backend/kotlin/kotlin-patterns/LICENSE +21 -0
- package/skills/backend/kotlin/kotlin-patterns/NOTICE.md +7 -0
- package/skills/backend/kotlin/kotlin-patterns/SKILL.md +711 -0
- package/skills/backend/kotlin/kotlin-testing/LICENSE +21 -0
- package/skills/backend/kotlin/kotlin-testing/NOTICE.md +7 -0
- package/skills/backend/kotlin/kotlin-testing/SKILL.md +824 -0
- package/skills/backend/python/python-patterns/LICENSE +21 -0
- package/skills/backend/python/python-patterns/NOTICE.md +7 -0
- package/skills/backend/python/python-patterns/SKILL.md +424 -0
- package/skills/backend/python/python-testing/LICENSE +21 -0
- package/skills/backend/python/python-testing/NOTICE.md +7 -0
- package/skills/backend/python/python-testing/SKILL.md +494 -0
- package/skills/devops/docker-patterns/LICENSE.ANTIGRAVITY +21 -0
- package/skills/devops/docker-patterns/LICENSE.ECC +21 -0
- package/skills/devops/docker-patterns/NOTICE.md +11 -0
- package/skills/devops/docker-patterns/SKILL.md +397 -0
- package/skills/frontend/accessibility/LICENSE +21 -0
- package/skills/frontend/accessibility/NOTICE.md +10 -0
- package/skills/frontend/accessibility/SKILL.md +145 -0
- package/skills/frontend/design/ui-ux-pro-max/LICENSE +21 -0
- package/skills/frontend/design/ui-ux-pro-max/NOTICE.md +12 -0
- package/skills/frontend/design/ui-ux-pro-max/SKILL.md +672 -0
- package/skills/frontend/design/ui-ux-pro-max/data/_sync_all.py +414 -0
- package/skills/frontend/design/ui-ux-pro-max/data/app-interface.csv +31 -0
- package/skills/frontend/design/ui-ux-pro-max/data/charts.csv +26 -0
- package/skills/frontend/design/ui-ux-pro-max/data/colors.csv +162 -0
- package/skills/frontend/design/ui-ux-pro-max/data/design.csv +1776 -0
- package/skills/frontend/design/ui-ux-pro-max/data/draft.csv +1779 -0
- package/skills/frontend/design/ui-ux-pro-max/data/google-fonts.csv +1924 -0
- package/skills/frontend/design/ui-ux-pro-max/data/icons.csv +106 -0
- package/skills/frontend/design/ui-ux-pro-max/data/landing.csv +35 -0
- package/skills/frontend/design/ui-ux-pro-max/data/products.csv +162 -0
- package/skills/frontend/design/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/angular.csv +51 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/astro.csv +54 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/skills/frontend/design/ui-ux-pro-max/data/styles.csv +85 -0
- package/skills/frontend/design/ui-ux-pro-max/data/typography.csv +74 -0
- package/skills/frontend/design/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
- package/skills/frontend/design/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/core.py +262 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/design_system.py +1148 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/search.py +114 -0
- package/skills/frontend/react/react-patterns/SKILL.md +4 -4
- package/skills/frontend/react/react-patterns/rules/react/LICENSE +21 -0
- package/skills/frontend/react/react-patterns/rules/react/NOTICE.md +11 -0
- package/skills/frontend/react/react-patterns/rules/react/coding-style.md +109 -0
- package/skills/frontend/react/react-patterns/rules/react/hooks.md +187 -0
- package/skills/frontend/react/react-patterns/rules/react/patterns.md +194 -0
- package/skills/frontend/react/react-patterns/rules/react/security.md +180 -0
- package/skills/frontend/react/react-patterns/rules/react/testing.md +208 -0
- package/skills/frontend/react/react-performance/SKILL.md +2 -2
- package/skills/frontend/react/react-performance/rules/react/LICENSE +21 -0
- package/skills/frontend/react/react-performance/rules/react/NOTICE.md +11 -0
- package/skills/frontend/react/react-performance/rules/react/coding-style.md +109 -0
- package/skills/frontend/react/react-performance/rules/react/hooks.md +187 -0
- package/skills/frontend/react/react-performance/rules/react/patterns.md +194 -0
- package/skills/frontend/react/react-performance/rules/react/security.md +180 -0
- package/skills/frontend/react/react-performance/rules/react/testing.md +208 -0
- package/skills/frontend/react/react-testing/SKILL.md +4 -4
- package/skills/frontend/react/react-testing/rules/react/LICENSE +21 -0
- package/skills/frontend/react/react-testing/rules/react/NOTICE.md +11 -0
- package/skills/frontend/react/react-testing/rules/react/coding-style.md +109 -0
- package/skills/frontend/react/react-testing/rules/react/hooks.md +187 -0
- package/skills/frontend/react/react-testing/rules/react/patterns.md +194 -0
- package/skills/frontend/react/react-testing/rules/react/security.md +180 -0
- package/skills/frontend/react/react-testing/rules/react/testing.md +208 -0
- package/skills/general/code-reviewer/AGENTS.md +292 -0
- package/skills/general/code-reviewer/LICENSE +201 -0
- package/skills/general/code-reviewer/NOTICE.md +10 -0
- package/skills/general/code-reviewer/SKILL.md +132 -0
- package/skills/general/code-reviewer/rules/correctness-error-handling.md +279 -0
- package/skills/general/code-reviewer/rules/maintainability-naming.md +149 -0
- package/skills/general/code-reviewer/rules/maintainability-type-hints.md +93 -0
- package/skills/general/code-reviewer/rules/performance-n-plus-one.md +250 -0
- package/skills/general/code-reviewer/rules/security-sql-injection.md +142 -0
- package/skills/general/code-reviewer/rules/security-xss-prevention.md +225 -0
package/README.md
CHANGED
|
@@ -23,8 +23,9 @@ any work.
|
|
|
23
23
|

|
|
24
24
|
|
|
25
25
|
Custom Skills are grouped by first-level package. Today this repository ships
|
|
26
|
-
`core`; future packages can be
|
|
27
|
-
appear automatically in the
|
|
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
|

|
|
30
31
|
|
|
@@ -128,10 +129,40 @@ 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/
|
|
138
|
+
go/
|
|
139
|
+
golang-patterns/
|
|
140
|
+
SKILL.md
|
|
141
|
+
golang-testing/
|
|
142
|
+
SKILL.md
|
|
143
|
+
java/
|
|
144
|
+
java-coding-standards/
|
|
145
|
+
SKILL.md
|
|
146
|
+
java-junit/
|
|
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
|
|
134
158
|
frontend/
|
|
159
|
+
accessibility/
|
|
160
|
+
SKILL.md
|
|
161
|
+
design/
|
|
162
|
+
ui-ux-pro-max/
|
|
163
|
+
SKILL.md
|
|
164
|
+
data/
|
|
165
|
+
scripts/
|
|
135
166
|
react-native/
|
|
136
167
|
react-native-expert/
|
|
137
168
|
SKILL.md
|
|
@@ -140,10 +171,20 @@ skills/
|
|
|
140
171
|
react/
|
|
141
172
|
react-patterns/
|
|
142
173
|
SKILL.md
|
|
174
|
+
rules/
|
|
143
175
|
react-performance/
|
|
144
176
|
SKILL.md
|
|
177
|
+
rules/
|
|
145
178
|
react-testing/
|
|
146
179
|
SKILL.md
|
|
180
|
+
rules/
|
|
181
|
+
general/
|
|
182
|
+
code-reviewer/
|
|
183
|
+
SKILL.md
|
|
184
|
+
rules/
|
|
185
|
+
devops/
|
|
186
|
+
docker-patterns/
|
|
187
|
+
SKILL.md
|
|
147
188
|
```
|
|
148
189
|
|
|
149
190
|
The first path segment is a selectable package:
|
|
@@ -153,10 +194,10 @@ skills/<package>/<optional-scope>/<skill-name>/SKILL.md
|
|
|
153
194
|
```
|
|
154
195
|
|
|
155
196
|
Runtime installs are flat even when repository paths are nested. For example,
|
|
156
|
-
`skills/backend/
|
|
197
|
+
`skills/backend/java/java-junit/SKILL.md` installs as:
|
|
157
198
|
|
|
158
199
|
```text
|
|
159
|
-
~/.codex/skills/
|
|
200
|
+
~/.codex/skills/java-junit/
|
|
160
201
|
```
|
|
161
202
|
|
|
162
203
|
Use `--skills-package` to select first-level packages:
|
|
@@ -168,7 +209,19 @@ npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-package core
|
|
|
168
209
|
Use `--skills-scope` to select a narrower path:
|
|
169
210
|
|
|
170
211
|
```bash
|
|
171
|
-
npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-scope backend/
|
|
212
|
+
npx -y @ranimontagna/agent-toolkit --skills-only --codex --skills-scope backend/java
|
|
213
|
+
```
|
|
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
|
|
172
225
|
```
|
|
173
226
|
|
|
174
227
|
Install only React Native skills:
|
|
@@ -185,7 +238,7 @@ npx -y @ranimontagna/agent-toolkit \
|
|
|
185
238
|
--skills-only \
|
|
186
239
|
--codex \
|
|
187
240
|
--skills-package backend \
|
|
188
|
-
--skills-scope backend/
|
|
241
|
+
--skills-scope backend/java
|
|
189
242
|
```
|
|
190
243
|
|
|
191
244
|
Each skill must be a directory containing `SKILL.md` with frontmatter:
|
|
@@ -206,12 +259,28 @@ Follow these steps...
|
|
|
206
259
|
| Package | Skill | Source |
|
|
207
260
|
|---|---|---|
|
|
208
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 |
|
|
209
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
210
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 |
|
|
211
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 |
|
|
212
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 |
|
|
213
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 |
|
|
214
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 |
|
|
281
|
+
|
|
282
|
+
Each React skill carries its own ECC `rules/react` references so Markdown links
|
|
283
|
+
still resolve after the installer copies skills into flat runtime directories.
|
|
215
284
|
|
|
216
285
|
The installer validates:
|
|
217
286
|
|
|
@@ -221,8 +290,8 @@ The installer validates:
|
|
|
221
290
|
- `name` uses lowercase letters, numbers and hyphens;
|
|
222
291
|
- `description` is non-empty and under 1024 characters.
|
|
223
292
|
|
|
224
|
-
|
|
225
|
-
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
|
|
226
295
|
externally through the Agent Skills CLI from pinned public sources.
|
|
227
296
|
|
|
228
297
|
## CLI Reference
|
|
@@ -349,6 +418,10 @@ Bundled third-party skills preserve upstream attribution and license files:
|
|
|
349
418
|
| `react-patterns` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
|
|
350
419
|
| `react-performance` | `affaan-m/ECC@0f84c0e2796703fbda87d577b2636351418c7442` | MIT |
|
|
351
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 |
|
|
352
425
|
|
|
353
426
|
Releases use npm trusted publishing through GitHub Actions OIDC. The npm
|
|
354
427
|
package is published without a long-lived npm token, and npm automatically
|
|
@@ -463,8 +536,8 @@ Release a new npm version by updating `package.json`, pushing the change to
|
|
|
463
536
|
`main`, then pushing a matching tag:
|
|
464
537
|
|
|
465
538
|
```bash
|
|
466
|
-
git tag v0.1.
|
|
467
|
-
git push origin v0.1.
|
|
539
|
+
git tag v0.1.9
|
|
540
|
+
git push origin v0.1.9
|
|
468
541
|
```
|
|
469
542
|
|
|
470
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.
|
|
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,10 @@
|
|
|
1
|
+
# Third-party notice
|
|
2
|
+
|
|
3
|
+
This skill was copied from Affaan Mustafa's ECC repository.
|
|
4
|
+
|
|
5
|
+
- Source: https://github.com/affaan-m/ECC/tree/main/skills/golang-patterns
|
|
6
|
+
- Source commit: 0f84c0e2796703fbda87d577b2636351418c7442
|
|
7
|
+
- License: MIT
|
|
8
|
+
- Copyright: Copyright (c) 2026 Affaan Mustafa
|
|
9
|
+
|
|
10
|
+
The upstream MIT license is included in `LICENSE`.
|