@vstlmkh/designing-databases 1.2.0 → 1.3.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.
- package/README.md +21 -6
- package/SKILL.md +18 -13
- package/bin/cli.js +14 -5
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
# designing-databases
|
|
15
15
|
|
|
16
|
-
An [Agent Skill](https://code.claude.com/docs/en/skills)
|
|
17
|
-
and
|
|
16
|
+
An [Agent Skill](https://agentskills.io/specification) for [Claude Code](https://code.claude.com/docs/en/skills)
|
|
17
|
+
and [Kimi Code](https://www.kimi.com/code/docs/en/kimi-code-cli/customization/skills.html),
|
|
18
|
+
for designing, auditing and tuning relational databases on **PostgreSQL** and
|
|
19
|
+
**MySQL/InnoDB**.
|
|
18
20
|
|
|
19
21
|
Generic SQL advice ("add an index", "normalize it") misses how relational
|
|
20
22
|
engines actually fail — a page split, a lock queue, a stale visibility map, a
|
|
@@ -41,24 +43,37 @@ approval.
|
|
|
41
43
|
|
|
42
44
|
## Install
|
|
43
45
|
|
|
46
|
+
Claude Code remains the default, so existing install commands keep working:
|
|
47
|
+
|
|
44
48
|
```bash
|
|
45
|
-
npx @vstlmkh/designing-databases install
|
|
46
|
-
npx @vstlmkh/designing-databases install --project
|
|
49
|
+
npx @vstlmkh/designing-databases install # ~/.claude/skills/
|
|
50
|
+
npx @vstlmkh/designing-databases install --project # ./.claude/skills/
|
|
51
|
+
npx @vstlmkh/designing-databases install --agent kimi # ~/.kimi-code/skills/
|
|
52
|
+
npx @vstlmkh/designing-databases install --agent kimi --project # ./.kimi-code/skills/
|
|
47
53
|
```
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
For a custom Kimi Code data root, the installer honors `KIMI_CODE_HOME` and
|
|
56
|
+
installs into `$KIMI_CODE_HOME/skills/`. Use `--agent claude` to select Claude
|
|
57
|
+
explicitly. Other commands: `uninstall`, `where`; flags `--dir <path>` and
|
|
58
|
+
`--force`.
|
|
50
59
|
|
|
51
60
|
Or clone it directly:
|
|
52
61
|
|
|
53
62
|
```bash
|
|
63
|
+
# Claude Code
|
|
54
64
|
git clone git@github.com:vstlmkh/designing-databases.git \
|
|
55
65
|
~/.claude/skills/designing-databases
|
|
66
|
+
|
|
67
|
+
# Kimi Code
|
|
68
|
+
git clone git@github.com:vstlmkh/designing-databases.git \
|
|
69
|
+
~/.kimi-code/skills/designing-databases
|
|
56
70
|
```
|
|
57
71
|
|
|
58
72
|
The skill activates on its own when a conversation turns to schema design,
|
|
59
73
|
indexes, slow queries or migrations — including when the database is never
|
|
60
74
|
named and the user only says "this endpoint got slow" or "the deploy locked
|
|
61
|
-
everything".
|
|
75
|
+
everything". You can also invoke it manually as `/designing-databases` in
|
|
76
|
+
Claude Code or `/skill:designing-databases` in Kimi Code.
|
|
62
77
|
|
|
63
78
|
## Bundled scripts
|
|
64
79
|
|
package/SKILL.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: designing-databases
|
|
3
3
|
description: >
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
approval.
|
|
4
|
+
Use when designing, auditing or tuning PostgreSQL or MySQL/InnoDB — table and
|
|
5
|
+
key design, index strategy, slow-query and EXPLAIN-plan diagnosis, transaction
|
|
6
|
+
isolation and locking, and zero-downtime migrations in any framework (Alembic,
|
|
7
|
+
Django, Laravel, Doctrine, Prisma, TypeORM, Knex, Drizzle, Flyway, Liquibase,
|
|
8
|
+
Atlas, golang-migrate). Trigger for modeling tables, choosing keys or column
|
|
9
|
+
types, adding or dropping indexes, slow queries or endpoints, deadlocks, lock
|
|
10
|
+
waits, bloat, replication lag, and schema changes, even when the database is
|
|
11
|
+
not named and the user only says "this endpoint got slow", "add a field to
|
|
12
|
+
this table", "the deploy locked everything", "which index do we need",
|
|
13
|
+
"эндпоинт стал тормозить", "добавь поле в таблицу" or "какой индекс нужен".
|
|
14
|
+
Not for NoSQL stores; never applies DDL without explicit approval.
|
|
16
15
|
license: MIT
|
|
16
|
+
compatibility: Supports Claude Code and Kimi Code. Bundled scripts require Python 3.9+.
|
|
17
17
|
metadata:
|
|
18
|
-
version: "1.
|
|
18
|
+
version: "1.3.0"
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
# designing-databases
|
|
@@ -24,6 +24,11 @@ Act as a database engineer who has operated PostgreSQL and MySQL in production:
|
|
|
24
24
|
reason from the engine's physical behaviour rather than from SQL folklore, and
|
|
25
25
|
say plainly what you could not establish.
|
|
26
26
|
|
|
27
|
+
Resolve bundled paths from the directory containing this `SKILL.md`. Kimi Code
|
|
28
|
+
exposes it as `${KIMI_SKILL_DIR}` and Claude Code as `${CLAUDE_SKILL_DIR}`; use
|
|
29
|
+
the appropriate absolute path when running scripts or loading references from
|
|
30
|
+
another working directory.
|
|
31
|
+
|
|
27
32
|
Relational engines fail in physical, deterministic ways: a page split, a lock
|
|
28
33
|
queue, a stale visibility map, a cardinality misestimate. Generic SQL advice
|
|
29
34
|
("add an index", "normalize it") misses all of them, and PostgreSQL and MySQL
|
package/bin/cli.js
CHANGED
|
@@ -18,8 +18,9 @@ Usage:
|
|
|
18
18
|
npx @vstlmkh/designing-databases where [options]
|
|
19
19
|
|
|
20
20
|
Options:
|
|
21
|
-
--
|
|
22
|
-
--
|
|
21
|
+
--agent <name> target agent: claude (default) or kimi
|
|
22
|
+
--user install into the agent's user skills directory (default)
|
|
23
|
+
--project install into the agent's project skills directory
|
|
23
24
|
--dir <path> install into <path>/${SKILL_NAME}
|
|
24
25
|
--force overwrite an existing installation
|
|
25
26
|
-h, --help show this help
|
|
@@ -27,11 +28,14 @@ Options:
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
function parseArgs(argv) {
|
|
30
|
-
const opts = { command: null, scope: 'user', dir: null, force: false, help: false };
|
|
31
|
+
const opts = { command: null, agent: 'claude', scope: 'user', dir: null, force: false, help: false };
|
|
31
32
|
for (let i = 0; i < argv.length; i++) {
|
|
32
33
|
const a = argv[i];
|
|
33
34
|
if (a === '-h' || a === '--help') opts.help = true;
|
|
34
|
-
else if (a === '--
|
|
35
|
+
else if (a === '--agent') {
|
|
36
|
+
opts.agent = argv[++i];
|
|
37
|
+
if (!['claude', 'kimi'].includes(opts.agent)) throw new Error('--agent must be claude or kimi');
|
|
38
|
+
} else if (a === '--user') opts.scope = 'user';
|
|
35
39
|
else if (a === '--project') opts.scope = 'project';
|
|
36
40
|
else if (a === '--force') opts.force = true;
|
|
37
41
|
else if (a === '--dir') {
|
|
@@ -46,6 +50,11 @@ function parseArgs(argv) {
|
|
|
46
50
|
|
|
47
51
|
function skillsRoot(opts) {
|
|
48
52
|
if (opts.dir) return path.resolve(opts.dir);
|
|
53
|
+
if (opts.agent === 'kimi') {
|
|
54
|
+
if (opts.scope === 'project') return path.resolve(process.cwd(), '.kimi-code', 'skills');
|
|
55
|
+
const kimiHome = process.env.KIMI_CODE_HOME || path.join(os.homedir(), '.kimi-code');
|
|
56
|
+
return path.resolve(kimiHome, 'skills');
|
|
57
|
+
}
|
|
49
58
|
if (opts.scope === 'project') return path.resolve(process.cwd(), '.claude', 'skills');
|
|
50
59
|
return path.join(os.homedir(), '.claude', 'skills');
|
|
51
60
|
}
|
|
@@ -76,7 +85,7 @@ function install(opts) {
|
|
|
76
85
|
if (fs.existsSync(src)) copy(src, path.join(target, item));
|
|
77
86
|
}
|
|
78
87
|
console.log(`Installed ${SKILL_NAME} to ${target}`);
|
|
79
|
-
console.log('
|
|
88
|
+
console.log('Kimi Code reloads its skill catalog automatically; restart Claude Code if the skill does not appear.');
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
function uninstall(opts) {
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vstlmkh/designing-databases",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Agent Skill for
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Agent Skill for Claude Code and Kimi Code: design, audit and tune PostgreSQL and MySQL/InnoDB schemas, indexes, EXPLAIN plans, locking, and zero-downtime migrations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skill",
|
|
7
7
|
"claude",
|
|
8
8
|
"claude-code",
|
|
9
|
+
"kimi",
|
|
10
|
+
"kimi-code",
|
|
9
11
|
"skill",
|
|
10
12
|
"postgresql",
|
|
11
13
|
"mysql",
|