@ngxtm/devkit 1.0.0 → 2.0.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 +59 -3
- package/SKILLS_INDEX.md +2111 -0
- package/cli/config.js +196 -0
- package/cli/index.js +132 -33
- package/cli/install.js +267 -19
- package/package.json +5 -2
- package/skills-index.json +2057 -0
package/cli/config.js
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Devkit Configuration
|
|
3
|
+
*
|
|
4
|
+
* Defines skill categories and minimal skill sets for optimized installation.
|
|
5
|
+
*
|
|
6
|
+
* NOTE: Commands (/plan, /brainstorm, /cook, etc.) and Agents are ALWAYS installed
|
|
7
|
+
* regardless of --minimal or --category options. Only the skills/ directory is filtered.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Core skills that are always installed with --minimal
|
|
11
|
+
// These are reference/best-practice skills, not commands
|
|
12
|
+
const MINIMAL_SKILLS = [
|
|
13
|
+
// Best practices
|
|
14
|
+
'react-best-practices',
|
|
15
|
+
'typescript-best-practices',
|
|
16
|
+
'postgres-best-practices',
|
|
17
|
+
'api-security-best-practices',
|
|
18
|
+
// Core workflows
|
|
19
|
+
'git-commit',
|
|
20
|
+
'code-review',
|
|
21
|
+
'debugging',
|
|
22
|
+
'testing',
|
|
23
|
+
'refactoring',
|
|
24
|
+
// Architecture
|
|
25
|
+
'api-patterns',
|
|
26
|
+
'architecture',
|
|
27
|
+
'clean-code',
|
|
28
|
+
// Operations
|
|
29
|
+
'documentation',
|
|
30
|
+
'error-handling',
|
|
31
|
+
'logging',
|
|
32
|
+
'performance-optimization',
|
|
33
|
+
'security-best-practices',
|
|
34
|
+
// AI/MCP
|
|
35
|
+
'mcp-management',
|
|
36
|
+
'sequential-thinking'
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
// Skill categories for --category option
|
|
40
|
+
const SKILL_CATEGORIES = {
|
|
41
|
+
'react': [
|
|
42
|
+
'react-best-practices',
|
|
43
|
+
'react-native',
|
|
44
|
+
'nextjs',
|
|
45
|
+
'remix',
|
|
46
|
+
'vite-react',
|
|
47
|
+
'react-query',
|
|
48
|
+
'react-hooks',
|
|
49
|
+
'react-testing',
|
|
50
|
+
'react-performance'
|
|
51
|
+
],
|
|
52
|
+
'typescript': [
|
|
53
|
+
'typescript-best-practices',
|
|
54
|
+
'typescript-advanced',
|
|
55
|
+
'typescript-patterns',
|
|
56
|
+
'zod-validation'
|
|
57
|
+
],
|
|
58
|
+
'node': [
|
|
59
|
+
'nodejs',
|
|
60
|
+
'nestjs',
|
|
61
|
+
'express',
|
|
62
|
+
'fastify',
|
|
63
|
+
'prisma',
|
|
64
|
+
'drizzle'
|
|
65
|
+
],
|
|
66
|
+
'database': [
|
|
67
|
+
'postgres-best-practices',
|
|
68
|
+
'mongodb',
|
|
69
|
+
'redis',
|
|
70
|
+
'sql-optimization',
|
|
71
|
+
'database-design'
|
|
72
|
+
],
|
|
73
|
+
'devops': [
|
|
74
|
+
'docker',
|
|
75
|
+
'kubernetes',
|
|
76
|
+
'ci-cd',
|
|
77
|
+
'github-actions',
|
|
78
|
+
'terraform',
|
|
79
|
+
'aws',
|
|
80
|
+
'cloudflare-expert'
|
|
81
|
+
],
|
|
82
|
+
'testing': [
|
|
83
|
+
'testing',
|
|
84
|
+
'jest',
|
|
85
|
+
'playwright',
|
|
86
|
+
'cypress',
|
|
87
|
+
'vitest',
|
|
88
|
+
'test-driven-development'
|
|
89
|
+
],
|
|
90
|
+
'security': [
|
|
91
|
+
'security-best-practices',
|
|
92
|
+
'api-security-best-practices',
|
|
93
|
+
'owasp',
|
|
94
|
+
'authentication',
|
|
95
|
+
'authorization'
|
|
96
|
+
],
|
|
97
|
+
'ai': [
|
|
98
|
+
'ai-agents-architect',
|
|
99
|
+
'ai-product',
|
|
100
|
+
'mcp-management',
|
|
101
|
+
'prompt-engineering',
|
|
102
|
+
'langchain',
|
|
103
|
+
'openai-integration'
|
|
104
|
+
],
|
|
105
|
+
'mobile': [
|
|
106
|
+
'react-native',
|
|
107
|
+
'flutter',
|
|
108
|
+
'ios-development',
|
|
109
|
+
'android-development',
|
|
110
|
+
'mobile-optimization'
|
|
111
|
+
],
|
|
112
|
+
'frontend': [
|
|
113
|
+
'css-architecture',
|
|
114
|
+
'tailwindcss',
|
|
115
|
+
'animation',
|
|
116
|
+
'accessibility',
|
|
117
|
+
'responsive-design',
|
|
118
|
+
'web-performance'
|
|
119
|
+
],
|
|
120
|
+
'backend': [
|
|
121
|
+
'api-patterns',
|
|
122
|
+
'microservices',
|
|
123
|
+
'event-driven',
|
|
124
|
+
'caching',
|
|
125
|
+
'queue-systems',
|
|
126
|
+
'rate-limiting'
|
|
127
|
+
],
|
|
128
|
+
'tools': [
|
|
129
|
+
'git-commit',
|
|
130
|
+
'code-review',
|
|
131
|
+
'debugging',
|
|
132
|
+
'refactoring',
|
|
133
|
+
'documentation',
|
|
134
|
+
'repomix'
|
|
135
|
+
]
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Get all available categories
|
|
139
|
+
function getCategories() {
|
|
140
|
+
return Object.keys(SKILL_CATEGORIES);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Get skills for specific categories
|
|
144
|
+
function getSkillsForCategories(categories) {
|
|
145
|
+
const skills = new Set();
|
|
146
|
+
|
|
147
|
+
for (const category of categories) {
|
|
148
|
+
const categorySkills = SKILL_CATEGORIES[category.toLowerCase()];
|
|
149
|
+
if (categorySkills) {
|
|
150
|
+
categorySkills.forEach(skill => skills.add(skill));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return Array.from(skills);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Check if a skill matches the filter
|
|
158
|
+
function shouldIncludeSkill(skillName, options = {}) {
|
|
159
|
+
const { minimal, categories, selectedSkills } = options;
|
|
160
|
+
|
|
161
|
+
// If specific skills are selected, check against that list
|
|
162
|
+
if (selectedSkills && selectedSkills.length > 0) {
|
|
163
|
+
return selectedSkills.some(s =>
|
|
164
|
+
skillName.toLowerCase().includes(s.toLowerCase()) ||
|
|
165
|
+
s.toLowerCase().includes(skillName.toLowerCase())
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// If minimal mode, only include minimal skills
|
|
170
|
+
if (minimal) {
|
|
171
|
+
return MINIMAL_SKILLS.some(s =>
|
|
172
|
+
skillName.toLowerCase().includes(s.toLowerCase()) ||
|
|
173
|
+
s.toLowerCase().includes(skillName.toLowerCase())
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// If categories specified, check against category skills
|
|
178
|
+
if (categories && categories.length > 0) {
|
|
179
|
+
const categorySkills = getSkillsForCategories(categories);
|
|
180
|
+
return categorySkills.some(s =>
|
|
181
|
+
skillName.toLowerCase().includes(s.toLowerCase()) ||
|
|
182
|
+
s.toLowerCase().includes(skillName.toLowerCase())
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Default: include all
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
module.exports = {
|
|
191
|
+
MINIMAL_SKILLS,
|
|
192
|
+
SKILL_CATEGORIES,
|
|
193
|
+
getCategories,
|
|
194
|
+
getSkillsForCategories,
|
|
195
|
+
shouldIncludeSkill
|
|
196
|
+
};
|
package/cli/index.js
CHANGED
|
@@ -6,69 +6,168 @@
|
|
|
6
6
|
* Main entry point for the CLI tool.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const { execSync } = require('child_process');
|
|
10
9
|
const path = require('path');
|
|
11
10
|
const fs = require('fs');
|
|
12
11
|
|
|
13
12
|
const VERSION = require('../package.json').version;
|
|
13
|
+
const {
|
|
14
|
+
install,
|
|
15
|
+
uninstall,
|
|
16
|
+
update,
|
|
17
|
+
interactiveInstall,
|
|
18
|
+
listSkills,
|
|
19
|
+
listCategories
|
|
20
|
+
} = require('./install');
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Parse command line arguments
|
|
24
|
+
*/
|
|
25
|
+
function parseArgs(args) {
|
|
26
|
+
const options = {
|
|
27
|
+
command: null,
|
|
28
|
+
tool: null,
|
|
29
|
+
minimal: false,
|
|
30
|
+
categories: [],
|
|
31
|
+
interactive: false,
|
|
32
|
+
fullSkills: false,
|
|
33
|
+
indexOnly: true, // Default: index-only mode
|
|
34
|
+
help: false
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
for (const arg of args) {
|
|
38
|
+
if (arg === '--help' || arg === '-h') {
|
|
39
|
+
options.help = true;
|
|
40
|
+
} else if (arg === '--minimal' || arg === '-m') {
|
|
41
|
+
options.minimal = true;
|
|
42
|
+
options.indexOnly = false;
|
|
43
|
+
} else if (arg === '--interactive' || arg === '-i') {
|
|
44
|
+
options.interactive = true;
|
|
45
|
+
} else if (arg === '--full' || arg === '-f') {
|
|
46
|
+
options.fullSkills = true;
|
|
47
|
+
options.indexOnly = false;
|
|
48
|
+
} else if (arg.startsWith('--category=') || arg.startsWith('-c=')) {
|
|
49
|
+
const cats = arg.split('=')[1].split(',').map(c => c.trim());
|
|
50
|
+
options.categories.push(...cats);
|
|
51
|
+
options.indexOnly = false;
|
|
52
|
+
} else if (arg.startsWith('--')) {
|
|
53
|
+
// Unknown flag, ignore
|
|
54
|
+
} else if (!options.command) {
|
|
55
|
+
options.command = arg;
|
|
56
|
+
} else if (!options.tool) {
|
|
57
|
+
options.tool = arg;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return options;
|
|
62
|
+
}
|
|
22
63
|
|
|
23
64
|
function showHelp() {
|
|
24
65
|
console.log(`
|
|
25
66
|
Devkit v${VERSION}
|
|
26
67
|
|
|
27
68
|
USAGE:
|
|
28
|
-
devkit <command>
|
|
69
|
+
devkit <command> [tool] [options]
|
|
29
70
|
|
|
30
71
|
COMMANDS:
|
|
31
|
-
install Install skills and rules to AI tools
|
|
72
|
+
install Install skills and rules to AI tools
|
|
73
|
+
uninstall Remove all installed skills and rules
|
|
32
74
|
update Check for updates and reinstall
|
|
33
75
|
list List all available skills
|
|
76
|
+
categories List available skill categories
|
|
34
77
|
version Show version
|
|
35
78
|
help Show this help
|
|
36
79
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
80
|
+
TOOLS:
|
|
81
|
+
claude Claude Code (~/.claude/)
|
|
82
|
+
cursor Cursor (~/.cursor/)
|
|
83
|
+
copilot GitHub Copilot (~/.copilot/)
|
|
84
|
+
gemini Gemini / Antigravity (~/.gemini/)
|
|
41
85
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
86
|
+
OPTIONS:
|
|
87
|
+
(default) Index-only mode - installs skills index file only
|
|
88
|
+
Commands and agents are always fully installed
|
|
89
|
+
Best for avoiding context limit issues
|
|
45
90
|
|
|
46
|
-
|
|
47
|
-
const skillsDir = path.join(__dirname, '..', 'skills');
|
|
91
|
+
--minimal, -m Install ~20 core skills (instead of index)
|
|
48
92
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
93
|
+
--category=CATS, -c= Install specific categories
|
|
94
|
+
Example: --category=react,typescript,testing
|
|
53
95
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
.filter(f => !f.startsWith('.'));
|
|
96
|
+
--full, -f Install ALL 413+ skills (may cause context limit)
|
|
97
|
+
Only use if you need full skill content locally
|
|
57
98
|
|
|
58
|
-
|
|
99
|
+
--interactive, -i Interactive mode - choose categories
|
|
59
100
|
|
|
60
|
-
|
|
61
|
-
console.log(` - ${skill}`);
|
|
62
|
-
});
|
|
101
|
+
--help, -h Show this help
|
|
63
102
|
|
|
64
|
-
|
|
103
|
+
EXAMPLES:
|
|
104
|
+
devkit install # Index-only (recommended)
|
|
105
|
+
devkit install claude # Index-only to Claude Code
|
|
106
|
+
devkit install --minimal # Install ~20 core skills
|
|
107
|
+
devkit install --category=react # Install React-related skills
|
|
108
|
+
devkit install --full # Install all skills (large)
|
|
109
|
+
devkit install --interactive # Choose interactively
|
|
110
|
+
devkit uninstall # Remove from all tools
|
|
111
|
+
|
|
112
|
+
HOW IT WORKS:
|
|
113
|
+
By default, devkit installs:
|
|
114
|
+
- SKILLS_INDEX.md (29KB summary of 411 skills)
|
|
115
|
+
- All commands (/plan, /cook, /brainstorm, etc.)
|
|
116
|
+
- All agents (planner, debugger, reviewer, etc.)
|
|
117
|
+
- Hooks, rules, output-styles
|
|
118
|
+
|
|
119
|
+
When you need a specific skill, Claude reads it on-demand from
|
|
120
|
+
the skills-index.json or loads the full skill file.
|
|
121
|
+
|
|
122
|
+
This reduces context usage from ~59MB to ~30KB for skills.
|
|
123
|
+
|
|
124
|
+
For more info: https://github.com/ngxtm/devkit
|
|
125
|
+
`);
|
|
65
126
|
}
|
|
66
127
|
|
|
128
|
+
// Command handlers
|
|
129
|
+
const commands = {
|
|
130
|
+
install: (options) => {
|
|
131
|
+
if (options.interactive) {
|
|
132
|
+
return interactiveInstall(options.tool);
|
|
133
|
+
}
|
|
134
|
+
install(options.tool, {
|
|
135
|
+
minimal: options.minimal,
|
|
136
|
+
categories: options.categories,
|
|
137
|
+
fullSkills: options.fullSkills,
|
|
138
|
+
indexOnly: options.indexOnly
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
uninstall: (options) => uninstall(options.tool),
|
|
142
|
+
update: () => update(),
|
|
143
|
+
list: () => listSkills(),
|
|
144
|
+
categories: () => listCategories(),
|
|
145
|
+
help: () => showHelp(),
|
|
146
|
+
version: () => console.log(`v${VERSION}`),
|
|
147
|
+
};
|
|
148
|
+
|
|
67
149
|
// Main execution
|
|
68
|
-
const
|
|
150
|
+
const args = process.argv.slice(2);
|
|
151
|
+
const options = parseArgs(args);
|
|
152
|
+
|
|
153
|
+
// Show help if requested
|
|
154
|
+
if (options.help) {
|
|
155
|
+
showHelp();
|
|
156
|
+
process.exit(0);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Default to help if no command
|
|
160
|
+
const command = options.command || 'help';
|
|
69
161
|
|
|
70
162
|
if (commands[command]) {
|
|
71
|
-
commands[command]();
|
|
163
|
+
const result = commands[command](options);
|
|
164
|
+
// Handle async commands
|
|
165
|
+
if (result instanceof Promise) {
|
|
166
|
+
result.catch(err => {
|
|
167
|
+
console.error('Error:', err.message);
|
|
168
|
+
process.exit(1);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
72
171
|
} else {
|
|
73
172
|
console.log(`Unknown command: ${command}`);
|
|
74
173
|
showHelp();
|