@ranimontagna/agent-toolkit 0.1.7 → 0.1.10

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 (89) hide show
  1. package/README.md +83 -14
  2. package/dist/src/args.js +10 -0
  3. package/dist/src/args.js.map +1 -1
  4. package/dist/src/menu.js +43 -2
  5. package/dist/src/menu.js.map +1 -1
  6. package/dist/src/skills.js +9 -2
  7. package/dist/src/skills.js.map +1 -1
  8. package/dist/src/state.d.ts +2 -0
  9. package/dist/src/state.js +7 -0
  10. package/dist/src/state.js.map +1 -1
  11. package/dist/src/status.js +3 -1
  12. package/dist/src/status.js.map +1 -1
  13. package/dist/src/ui.js +4 -1
  14. package/dist/src/ui.js.map +1 -1
  15. package/dist/src/usage.js +2 -0
  16. package/dist/src/usage.js.map +1 -1
  17. package/docs/assets/install-plan.svg +2 -2
  18. package/docs/assets/install-skill-packages.svg +14 -14
  19. package/package.json +1 -1
  20. package/skills/backend/database/postgres-patterns/LICENSE.ANTIGRAVITY +21 -0
  21. package/skills/backend/database/postgres-patterns/LICENSE.ECC +21 -0
  22. package/skills/backend/database/postgres-patterns/NOTICE.md +11 -0
  23. package/skills/backend/database/postgres-patterns/SKILL.md +180 -0
  24. package/skills/backend/kotlin/kotlin-patterns/LICENSE +21 -0
  25. package/skills/backend/kotlin/kotlin-patterns/NOTICE.md +7 -0
  26. package/skills/backend/kotlin/kotlin-patterns/SKILL.md +711 -0
  27. package/skills/backend/kotlin/kotlin-testing/LICENSE +21 -0
  28. package/skills/backend/kotlin/kotlin-testing/NOTICE.md +7 -0
  29. package/skills/backend/kotlin/kotlin-testing/SKILL.md +824 -0
  30. package/skills/backend/python/python-patterns/LICENSE +21 -0
  31. package/skills/backend/python/python-patterns/NOTICE.md +7 -0
  32. package/skills/backend/python/python-patterns/SKILL.md +424 -0
  33. package/skills/backend/python/python-testing/LICENSE +21 -0
  34. package/skills/backend/python/python-testing/NOTICE.md +7 -0
  35. package/skills/backend/python/python-testing/SKILL.md +494 -0
  36. package/skills/devops/docker-patterns/LICENSE.ANTIGRAVITY +21 -0
  37. package/skills/devops/docker-patterns/LICENSE.ECC +21 -0
  38. package/skills/devops/docker-patterns/NOTICE.md +11 -0
  39. package/skills/devops/docker-patterns/SKILL.md +397 -0
  40. package/skills/frontend/accessibility/LICENSE +21 -0
  41. package/skills/frontend/accessibility/NOTICE.md +10 -0
  42. package/skills/frontend/accessibility/SKILL.md +145 -0
  43. package/skills/frontend/design/ui-ux-pro-max/LICENSE +21 -0
  44. package/skills/frontend/design/ui-ux-pro-max/NOTICE.md +12 -0
  45. package/skills/frontend/design/ui-ux-pro-max/SKILL.md +672 -0
  46. package/skills/frontend/design/ui-ux-pro-max/data/_sync_all.py +414 -0
  47. package/skills/frontend/design/ui-ux-pro-max/data/app-interface.csv +31 -0
  48. package/skills/frontend/design/ui-ux-pro-max/data/charts.csv +26 -0
  49. package/skills/frontend/design/ui-ux-pro-max/data/colors.csv +162 -0
  50. package/skills/frontend/design/ui-ux-pro-max/data/design.csv +1776 -0
  51. package/skills/frontend/design/ui-ux-pro-max/data/draft.csv +1779 -0
  52. package/skills/frontend/design/ui-ux-pro-max/data/google-fonts.csv +1924 -0
  53. package/skills/frontend/design/ui-ux-pro-max/data/icons.csv +106 -0
  54. package/skills/frontend/design/ui-ux-pro-max/data/landing.csv +35 -0
  55. package/skills/frontend/design/ui-ux-pro-max/data/products.csv +162 -0
  56. package/skills/frontend/design/ui-ux-pro-max/data/react-performance.csv +45 -0
  57. package/skills/frontend/design/ui-ux-pro-max/data/stacks/angular.csv +51 -0
  58. package/skills/frontend/design/ui-ux-pro-max/data/stacks/astro.csv +54 -0
  59. package/skills/frontend/design/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
  60. package/skills/frontend/design/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
  61. package/skills/frontend/design/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
  62. package/skills/frontend/design/ui-ux-pro-max/data/stacks/laravel.csv +51 -0
  63. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
  64. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
  65. package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
  66. package/skills/frontend/design/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
  67. package/skills/frontend/design/ui-ux-pro-max/data/stacks/react.csv +54 -0
  68. package/skills/frontend/design/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
  69. package/skills/frontend/design/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
  70. package/skills/frontend/design/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
  71. package/skills/frontend/design/ui-ux-pro-max/data/stacks/threejs.csv +54 -0
  72. package/skills/frontend/design/ui-ux-pro-max/data/stacks/vue.csv +50 -0
  73. package/skills/frontend/design/ui-ux-pro-max/data/styles.csv +85 -0
  74. package/skills/frontend/design/ui-ux-pro-max/data/typography.csv +74 -0
  75. package/skills/frontend/design/ui-ux-pro-max/data/ui-reasoning.csv +162 -0
  76. package/skills/frontend/design/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
  77. package/skills/frontend/design/ui-ux-pro-max/scripts/core.py +262 -0
  78. package/skills/frontend/design/ui-ux-pro-max/scripts/design_system.py +1148 -0
  79. package/skills/frontend/design/ui-ux-pro-max/scripts/search.py +114 -0
  80. package/skills/general/code-reviewer/AGENTS.md +292 -0
  81. package/skills/general/code-reviewer/LICENSE +201 -0
  82. package/skills/general/code-reviewer/NOTICE.md +10 -0
  83. package/skills/general/code-reviewer/SKILL.md +132 -0
  84. package/skills/general/code-reviewer/rules/correctness-error-handling.md +279 -0
  85. package/skills/general/code-reviewer/rules/maintainability-naming.md +149 -0
  86. package/skills/general/code-reviewer/rules/maintainability-type-hints.md +93 -0
  87. package/skills/general/code-reviewer/rules/performance-n-plus-one.md +250 -0
  88. package/skills/general/code-reviewer/rules/security-sql-injection.md +142 -0
  89. package/skills/general/code-reviewer/rules/security-xss-prevention.md +225 -0
package/dist/src/usage.js CHANGED
@@ -39,6 +39,7 @@ Install scope:
39
39
  --skills-dir DIR Use another source directory for Custom Skills
40
40
  --skills-package NAME Install Custom Skills from a first-level package, repeatable
41
41
  --skills-scope SCOPE Install skills under a relative scope path, repeatable
42
+ --skills-path PATH Install exact Custom Skill path, repeatable
42
43
  --skills-list List discovered Custom Skills and exit
43
44
 
44
45
  Other:
@@ -61,6 +62,7 @@ Environment:
61
62
  CUSTOM_SKILLS_DIR Source directory for custom skills
62
63
  SKILLS_PACKAGE Comma-separated first-level skill package filters
63
64
  SKILLS_SCOPE Comma-separated skill scope filters
65
+ SKILLS_PATH Comma-separated exact skill path filters
64
66
  CLAUDE_CLI_PACKAGE npm package used to install Claude Code CLI
65
67
  CODEX_CLI_PACKAGE npm package used to install Codex CLI
66
68
  OPENCODE_CLI_PACKAGE npm package used to install OpenCode CLI
@@ -1 +1 @@
1
- {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/usage.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK;IACnB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAiEsD,CAAC;AAChE,CAAC"}
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/usage.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK;IACnB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAmEsD,CAAC;AAChE,CAAC"}
@@ -21,8 +21,8 @@
21
21
 
22
22
  <text x="74" y="392" fill="#cbd5e1" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">Custom Skills:</text>
23
23
  <text x="96" y="422" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">- Selected packages: core</text>
24
- <text x="96" y="450" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">- Selected source skills: core/agent-toolkit-maintainer</text>
25
- <text x="96" y="478" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">- Codex CLI: 0/1 already present at ~/.codex/skills; 1 will be copied</text>
24
+ <text x="96" y="450" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">- Selected individual skills: core/agent-toolkit-maintainer</text>
25
+ <text x="96" y="478" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">- Selected source skills: core/agent-toolkit-maintainer</text>
26
26
 
27
27
  <rect x="52" y="506" width="876" height="36" rx="8" fill="#111827" stroke="#334155"/>
28
28
  <text x="70" y="530" fill="#86efac" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">Continue with installation? Yes</text>
@@ -1,31 +1,31 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" width="980" height="520" viewBox="0 0 980 520" role="img" aria-labelledby="title desc">
2
- <title id="title">Agent Toolkit Custom Skill package selection screen</title>
3
- <desc id="desc">Terminal screenshot showing selectable Custom Skill packages in the Clack installer.</desc>
2
+ <title id="title">Agent Toolkit Custom Skill selection screen</title>
3
+ <desc id="desc">Terminal screenshot showing selectable individual Custom Skills in the Clack installer.</desc>
4
4
  <rect width="980" height="520" rx="18" fill="#111827"/>
5
5
  <rect x="24" y="24" width="932" height="472" rx="14" fill="#0b1020" stroke="#263247"/>
6
6
  <circle cx="52" cy="52" r="7" fill="#ff5f57"/>
7
7
  <circle cx="76" cy="52" r="7" fill="#ffbd2e"/>
8
8
  <circle cx="100" cy="52" r="7" fill="#28c840"/>
9
- <text x="126" y="57" fill="#9ca3af" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">Custom Skills package selection</text>
9
+ <text x="126" y="57" fill="#9ca3af" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="14">Custom Skills granular selection</text>
10
10
 
11
- <text x="52" y="104" fill="#93c5fd" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="19" font-weight="700">Select Custom Skill packages</text>
12
- <text x="52" y="138" fill="#cbd5e1" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">Space toggles a package. Enter confirms the selection.</text>
11
+ <text x="52" y="104" fill="#93c5fd" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="19" font-weight="700">Select individual Custom Skills</text>
12
+ <text x="52" y="138" fill="#cbd5e1" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">After package and scope filters, choose exact skills or keep all selected.</text>
13
13
 
14
14
  <rect x="72" y="172" width="836" height="56" rx="10" fill="#172033" stroke="#3b82f6"/>
15
- <text x="96" y="207" fill="#bfdbfe" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">(*) All skill packages</text>
16
- <text x="388" y="207" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">install every bundled package</text>
15
+ <text x="96" y="207" fill="#bfdbfe" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">(*) All selected skills</text>
16
+ <text x="388" y="207" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">keep the current package/scope result</text>
17
17
 
18
18
  <rect x="72" y="244" width="836" height="56" rx="10" fill="#111827" stroke="#334155"/>
19
- <text x="96" y="279" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">( ) core</text>
20
- <text x="238" y="279" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">agent-toolkit-maintainer and repository workflow skills</text>
19
+ <text x="96" y="279" fill="#e5e7eb" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">( ) backend/python/python-patterns</text>
20
+ <text x="458" y="279" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">Pythonic design patterns</text>
21
21
 
22
22
  <rect x="72" y="316" width="836" height="56" rx="10" fill="#111827" stroke="#334155" opacity="0.72"/>
23
- <text x="96" y="351" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">( ) backend</text>
24
- <text x="266" y="351" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">appears automatically when skills/backend exists</text>
23
+ <text x="96" y="351" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">(*) backend/python/python-testing</text>
24
+ <text x="458" y="351" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">pytest fixtures, mocking and coverage</text>
25
25
 
26
26
  <rect x="72" y="388" width="836" height="56" rx="10" fill="#111827" stroke="#334155" opacity="0.72"/>
27
- <text x="96" y="423" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">( ) frontend</text>
28
- <text x="278" y="423" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">appears automatically when skills/frontend exists</text>
27
+ <text x="96" y="423" fill="#94a3b8" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="16">( ) backend/kotlin/kotlin-testing</text>
28
+ <text x="466" y="423" fill="#64748b" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">Kotest, MockK and coroutine testing</text>
29
29
 
30
- <text x="52" y="474" fill="#c4b5fd" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">CLI equivalent: --skills-package core</text>
30
+ <text x="52" y="474" fill="#c4b5fd" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="15">CLI equivalent: --skills-path backend/python/python-testing</text>
31
31
  </svg>
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.10",
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`.