@ngxtm/devkit 1.0.0 → 2.0.1

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/cli/config.js ADDED
@@ -0,0 +1,261 @@
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
+ // Using exact directory names for accurate matching
12
+ const MINIMAL_SKILLS = [
13
+ // Best practices
14
+ 'react-best-practices',
15
+ 'typescript-expert',
16
+ 'typescript-pro',
17
+ 'postgres-best-practices',
18
+ 'api-security-best-practices',
19
+ 'nodejs-best-practices',
20
+ // Core workflows
21
+ 'code-review',
22
+ 'debugging',
23
+ 'testing-patterns',
24
+ 'code-refactoring',
25
+ // Architecture
26
+ 'api-patterns',
27
+ 'architecture',
28
+ 'clean-code',
29
+ 'software-architecture',
30
+ // Operations
31
+ 'code-documentation',
32
+ 'performance-profiling',
33
+ // AI/MCP
34
+ 'mcp-management',
35
+ 'sequential-thinking',
36
+ // Git
37
+ 'git-pushing'
38
+ ];
39
+
40
+ // Skill categories for --category option
41
+ // Using patterns that match actual directory names
42
+ const SKILL_CATEGORIES = {
43
+ 'react': [
44
+ 'react-best-practices',
45
+ 'react-expert',
46
+ 'react-patterns',
47
+ 'react-ui-patterns',
48
+ 'react-native-expert',
49
+ 'react-flow-node',
50
+ 'nextjs-best-practices',
51
+ 'nextjs-developer',
52
+ 'nextjs-supabase-auth',
53
+ 'expo-app-design',
54
+ 'expo-deployment'
55
+ ],
56
+ 'typescript': [
57
+ 'typescript-expert',
58
+ 'typescript-pro',
59
+ 'javascript-typescript',
60
+ 'javascript-mastery',
61
+ 'javascript-pro'
62
+ ],
63
+ 'node': [
64
+ 'nodejs-best-practices',
65
+ 'nestjs-expert',
66
+ 'fastapi-expert',
67
+ 'fastapi-router',
68
+ 'prisma-expert',
69
+ 'bullmq-specialist',
70
+ 'bun-development'
71
+ ],
72
+ 'python': [
73
+ 'python-development',
74
+ 'python-patterns',
75
+ 'python-pro',
76
+ 'django-expert',
77
+ 'fastapi-expert',
78
+ 'pydantic-models',
79
+ 'pandas-pro'
80
+ ],
81
+ 'database': [
82
+ 'postgres-best-practices',
83
+ 'postgres-pro',
84
+ 'neon-postgres',
85
+ 'database-design',
86
+ 'database-optimizer',
87
+ 'databases',
88
+ 'nosql-expert',
89
+ 'sql-pro'
90
+ ],
91
+ 'devops': [
92
+ 'docker-expert',
93
+ 'kubernetes-specialist',
94
+ 'terraform-engineer',
95
+ 'github-workflow-automation',
96
+ 'aws-serverless',
97
+ 'aws-cdk-development',
98
+ 'aws-cost-operations',
99
+ 'gcp-cloud-run',
100
+ 'cloudflare-expert',
101
+ 'vercel-deploy',
102
+ 'vercel-deployment',
103
+ 'devops',
104
+ 'devops-engineer'
105
+ ],
106
+ 'testing': [
107
+ 'testing-patterns',
108
+ 'test-driven-development',
109
+ 'tdd-workflow',
110
+ 'playwright-expert',
111
+ 'playwright-skill',
112
+ 'test-master',
113
+ 'test-fixing',
114
+ 'qa-regression'
115
+ ],
116
+ 'security': [
117
+ 'api-security-best-practices',
118
+ 'secure-code-guardian',
119
+ 'security-reviewer',
120
+ 'ethical-hacking-methodology',
121
+ 'pentest-checklist',
122
+ 'pentest-commands',
123
+ 'aws-penetration-testing',
124
+ 'cloud-penetration-testing',
125
+ 'top-web-vulnerabilities'
126
+ ],
127
+ 'ai': [
128
+ 'ai-agents-architect',
129
+ 'ai-product',
130
+ 'ai-multimodal',
131
+ 'mcp-management',
132
+ 'mcp-developer',
133
+ 'mcp-builder',
134
+ 'prompt-engineering',
135
+ 'prompt-engineer',
136
+ 'langgraph',
137
+ 'langfuse',
138
+ 'crewai',
139
+ 'rag-architect',
140
+ 'rag-engineer',
141
+ 'rag-implementation',
142
+ 'llm-application-dev',
143
+ 'llm-app-patterns',
144
+ 'sequential-thinking',
145
+ 'agent-memory-mcp',
146
+ 'agent-memory-systems',
147
+ 'autonomous-agent-patterns'
148
+ ],
149
+ 'mobile': [
150
+ 'react-native-expert',
151
+ 'flutter-expert',
152
+ 'expo-app-design',
153
+ 'expo-deployment',
154
+ 'mobile-design',
155
+ 'mobile-development',
156
+ 'swift-expert',
157
+ 'kotlin-specialist'
158
+ ],
159
+ 'frontend': [
160
+ 'frontend-development',
161
+ 'frontend-design',
162
+ 'frontend-dev-guidelines',
163
+ 'tailwind-patterns',
164
+ 'ui-design-system',
165
+ 'ui-styling',
166
+ 'ui-ux-pro-max',
167
+ 'web-design-guidelines',
168
+ 'web-performance-optimization',
169
+ 'threejs',
170
+ 'vue-expert',
171
+ 'angular-architect'
172
+ ],
173
+ 'backend': [
174
+ 'backend-development',
175
+ 'backend-dev-guidelines',
176
+ 'api-patterns',
177
+ 'api-designer',
178
+ 'microservices-architect',
179
+ 'graphql',
180
+ 'graphql-architect',
181
+ 'websocket-engineer'
182
+ ],
183
+ 'tools': [
184
+ 'git-pushing',
185
+ 'code-review',
186
+ 'debugging',
187
+ 'debugging-wizard',
188
+ 'code-refactoring',
189
+ 'code-documentation',
190
+ 'repomix',
191
+ 'browser-automation',
192
+ 'cli-developer'
193
+ ]
194
+ };
195
+
196
+ // Get all available categories
197
+ function getCategories() {
198
+ return Object.keys(SKILL_CATEGORIES);
199
+ }
200
+
201
+ // Get skills for specific categories
202
+ function getSkillsForCategories(categories) {
203
+ const skills = new Set();
204
+
205
+ for (const category of categories) {
206
+ const categorySkills = SKILL_CATEGORIES[category.toLowerCase()];
207
+ if (categorySkills) {
208
+ categorySkills.forEach(skill => skills.add(skill));
209
+ }
210
+ }
211
+
212
+ return Array.from(skills);
213
+ }
214
+
215
+ // Check if a skill matches the filter
216
+ function shouldIncludeSkill(skillName, options = {}) {
217
+ const { minimal, categories, selectedSkills } = options;
218
+ const lowerSkillName = skillName.toLowerCase();
219
+
220
+ // If specific skills are selected, check against that list
221
+ if (selectedSkills && selectedSkills.length > 0) {
222
+ return selectedSkills.some(s => {
223
+ const lowerS = s.toLowerCase();
224
+ return lowerSkillName === lowerS ||
225
+ lowerSkillName.includes(lowerS) ||
226
+ lowerS.includes(lowerSkillName);
227
+ });
228
+ }
229
+
230
+ // If minimal mode, only include minimal skills
231
+ if (minimal) {
232
+ return MINIMAL_SKILLS.some(s => {
233
+ const lowerS = s.toLowerCase();
234
+ return lowerSkillName === lowerS ||
235
+ lowerSkillName.includes(lowerS) ||
236
+ lowerS.includes(lowerSkillName);
237
+ });
238
+ }
239
+
240
+ // If categories specified, check against category skills
241
+ if (categories && categories.length > 0) {
242
+ const categorySkills = getSkillsForCategories(categories);
243
+ return categorySkills.some(s => {
244
+ const lowerS = s.toLowerCase();
245
+ return lowerSkillName === lowerS ||
246
+ lowerSkillName.includes(lowerS) ||
247
+ lowerS.includes(lowerSkillName);
248
+ });
249
+ }
250
+
251
+ // Default: include all
252
+ return true;
253
+ }
254
+
255
+ module.exports = {
256
+ MINIMAL_SKILLS,
257
+ SKILL_CATEGORIES,
258
+ getCategories,
259
+ getSkillsForCategories,
260
+ shouldIncludeSkill
261
+ };
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
- const commands = {
16
- install: () => require('./install').install(),
17
- update: () => require('./install').update(),
18
- list: () => listSkills(),
19
- help: () => showHelp(),
20
- version: () => console.log(`v${VERSION}`),
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 (Claude, Cursor, Copilot)
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
- EXAMPLES:
38
- devkit install # Install to all supported tools
39
- devkit install claude # Install to Claude Code only
40
- devkit list # Show available skills
80
+ TOOLS:
81
+ claude Claude Code (~/.claude/)
82
+ cursor Cursor (~/.cursor/)
83
+ copilot GitHub Copilot (~/.copilot/)
84
+ gemini Gemini / Antigravity (~/.gemini/)
41
85
 
42
- For more info: https://github.com/ngxtm/devkit
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
- function listSkills() {
47
- const skillsDir = path.join(__dirname, '..', 'skills');
91
+ --minimal, -m Install ~20 core skills (instead of index)
48
92
 
49
- if (!fs.existsSync(skillsDir)) {
50
- console.log('No skills directory found.');
51
- return;
52
- }
93
+ --category=CATS, -c= Install specific categories
94
+ Example: --category=react,typescript,testing
53
95
 
54
- const skills = fs.readdirSync(skillsDir)
55
- .filter(f => fs.statSync(path.join(skillsDir, f)).isDirectory())
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
- console.log(`\nAvailable Skills (${skills.length} total):\n`);
99
+ --interactive, -i Interactive mode - choose categories
59
100
 
60
- skills.forEach(skill => {
61
- console.log(` - ${skill}`);
62
- });
101
+ --help, -h Show this help
63
102
 
64
- console.log('\nUse "devkit-agent install" to install these skills.\n');
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 command = process.argv[2] || 'help';
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();