@ngxtm/devkit 2.0.2 → 2.1.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/cli/index.js +17 -4
- package/cli/install.js +231 -53
- package/package.json +1 -1
package/cli/index.js
CHANGED
|
@@ -16,7 +16,8 @@ const {
|
|
|
16
16
|
update,
|
|
17
17
|
interactiveInstall,
|
|
18
18
|
listSkills,
|
|
19
|
-
listCategories
|
|
19
|
+
listCategories,
|
|
20
|
+
initProject
|
|
20
21
|
} = require('./install');
|
|
21
22
|
|
|
22
23
|
/**
|
|
@@ -27,6 +28,7 @@ function parseArgs(args) {
|
|
|
27
28
|
command: null,
|
|
28
29
|
tool: null,
|
|
29
30
|
minimal: false,
|
|
31
|
+
lite: false, // New: commands only, no skills/rules/hooks
|
|
30
32
|
categories: [],
|
|
31
33
|
interactive: false,
|
|
32
34
|
fullSkills: false,
|
|
@@ -40,6 +42,9 @@ function parseArgs(args) {
|
|
|
40
42
|
} else if (arg === '--minimal' || arg === '-m') {
|
|
41
43
|
options.minimal = true;
|
|
42
44
|
options.indexOnly = false;
|
|
45
|
+
} else if (arg === '--lite' || arg === '-l') {
|
|
46
|
+
options.lite = true;
|
|
47
|
+
options.indexOnly = false;
|
|
43
48
|
} else if (arg === '--interactive' || arg === '-i') {
|
|
44
49
|
options.interactive = true;
|
|
45
50
|
} else if (arg === '--full' || arg === '-f') {
|
|
@@ -69,7 +74,8 @@ USAGE:
|
|
|
69
74
|
devkit <command> [tool] [options]
|
|
70
75
|
|
|
71
76
|
COMMANDS:
|
|
72
|
-
install Install skills and rules to AI tools
|
|
77
|
+
install Install skills and rules to AI tools (global ~/.claude/)
|
|
78
|
+
init Initialize devkit in current project (.claude/ folder)
|
|
73
79
|
uninstall Remove all installed skills and rules
|
|
74
80
|
update Check for updates and reinstall
|
|
75
81
|
list List all available skills
|
|
@@ -84,9 +90,13 @@ TOOLS:
|
|
|
84
90
|
gemini Gemini / Antigravity (~/.gemini/)
|
|
85
91
|
|
|
86
92
|
OPTIONS:
|
|
93
|
+
--lite, -l LITE mode - commands only, no skills/rules/hooks
|
|
94
|
+
Best for avoiding context limit issues
|
|
95
|
+
Installs: /brainstorm, /plan, /fix, /code, etc.
|
|
96
|
+
|
|
87
97
|
(default) Index-only mode - installs skills index file only
|
|
88
98
|
Commands and agents are always fully installed
|
|
89
|
-
|
|
99
|
+
May still cause context issues with some models
|
|
90
100
|
|
|
91
101
|
--minimal, -m Install ~20 core skills (instead of index)
|
|
92
102
|
|
|
@@ -101,7 +111,8 @@ OPTIONS:
|
|
|
101
111
|
--help, -h Show this help
|
|
102
112
|
|
|
103
113
|
EXAMPLES:
|
|
104
|
-
devkit install
|
|
114
|
+
devkit install --lite # Commands only (recommended for context limit)
|
|
115
|
+
devkit install # Index-only (default)
|
|
105
116
|
devkit install claude # Index-only to Claude Code
|
|
106
117
|
devkit install --minimal # Install ~20 core skills
|
|
107
118
|
devkit install --category=react # Install React-related skills
|
|
@@ -133,11 +144,13 @@ const commands = {
|
|
|
133
144
|
}
|
|
134
145
|
install(options.tool, {
|
|
135
146
|
minimal: options.minimal,
|
|
147
|
+
lite: options.lite,
|
|
136
148
|
categories: options.categories,
|
|
137
149
|
fullSkills: options.fullSkills,
|
|
138
150
|
indexOnly: options.indexOnly
|
|
139
151
|
});
|
|
140
152
|
},
|
|
153
|
+
init: (options) => initProject(options),
|
|
141
154
|
uninstall: (options) => uninstall(options.tool),
|
|
142
155
|
update: () => update(),
|
|
143
156
|
list: () => listSkills(),
|
package/cli/install.js
CHANGED
|
@@ -122,9 +122,12 @@ function installToTool(toolId, tool, options = {}) {
|
|
|
122
122
|
// Determine install mode
|
|
123
123
|
const indexOnly = options.indexOnly !== false && !options.fullSkills;
|
|
124
124
|
const isMinimal = options.minimal;
|
|
125
|
+
const isLite = options.lite; // New lite mode - commands only
|
|
125
126
|
const hasCategories = options.categories && options.categories.length > 0;
|
|
126
127
|
|
|
127
|
-
if (
|
|
128
|
+
if (isLite) {
|
|
129
|
+
console.log(` Mode: LITE (commands only - minimal context usage)`);
|
|
130
|
+
} else if (indexOnly && !isMinimal && !hasCategories) {
|
|
128
131
|
console.log(` Mode: INDEX-ONLY (recommended - minimal context usage)`);
|
|
129
132
|
} else if (isMinimal) {
|
|
130
133
|
console.log(` Mode: MINIMAL (${MINIMAL_SKILLS.length} core skills)`);
|
|
@@ -142,10 +145,13 @@ function installToTool(toolId, tool, options = {}) {
|
|
|
142
145
|
|
|
143
146
|
let totalFiles = 0;
|
|
144
147
|
|
|
145
|
-
// 1. Install skills - depends on mode
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
148
|
+
// 1. Install skills - depends on mode (skip in lite mode)
|
|
149
|
+
if (isLite) {
|
|
150
|
+
console.log(` ⏭️ Skipping skills (lite mode)`);
|
|
151
|
+
} else {
|
|
152
|
+
const srcSkills = path.join(PACKAGE_ROOT, 'skills');
|
|
153
|
+
if (fs.existsSync(srcSkills)) {
|
|
154
|
+
if (indexOnly && !isMinimal && !hasCategories) {
|
|
149
155
|
// Index-only mode: just copy the index files
|
|
150
156
|
const indexFile = path.join(PACKAGE_ROOT, 'SKILLS_INDEX.md');
|
|
151
157
|
const jsonFile = path.join(PACKAGE_ROOT, 'skills-index.json');
|
|
@@ -171,69 +177,96 @@ function installToTool(toolId, tool, options = {}) {
|
|
|
171
177
|
totalFiles += count;
|
|
172
178
|
}
|
|
173
179
|
}
|
|
180
|
+
}
|
|
174
181
|
|
|
175
|
-
// 2. Install commands
|
|
176
|
-
if (
|
|
177
|
-
//
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
// 2. Install commands - in lite mode, install only core commands
|
|
183
|
+
if (isLite) {
|
|
184
|
+
// Lite mode: install only essential claudekit commands
|
|
185
|
+
if (tool.commandsPath) {
|
|
186
|
+
const srcCommandsClaudekit = path.join(PACKAGE_ROOT, 'commands-claudekit');
|
|
187
|
+
if (fs.existsSync(srcCommandsClaudekit)) {
|
|
188
|
+
const count = copyDir(srcCommandsClaudekit, tool.commandsPath, replacements, options);
|
|
189
|
+
console.log(` ✅ Commands (claudekit): ${count} files`);
|
|
190
|
+
totalFiles += count;
|
|
191
|
+
}
|
|
183
192
|
}
|
|
193
|
+
} else if (!indexOnly || isMinimal || hasCategories) {
|
|
194
|
+
if (tool.commandsPath) {
|
|
195
|
+
// Install commands from commands/ folder
|
|
196
|
+
const srcCommands = path.join(PACKAGE_ROOT, 'commands');
|
|
197
|
+
if (fs.existsSync(srcCommands)) {
|
|
198
|
+
const count = copyDir(srcCommands, tool.commandsPath, replacements, options);
|
|
199
|
+
console.log(` ✅ Commands: ${count} files`);
|
|
200
|
+
totalFiles += count;
|
|
201
|
+
}
|
|
184
202
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
203
|
+
// Install commands from commands-claudekit/ folder (merged into same directory)
|
|
204
|
+
const srcCommandsClaudekit = path.join(PACKAGE_ROOT, 'commands-claudekit');
|
|
205
|
+
if (fs.existsSync(srcCommandsClaudekit)) {
|
|
206
|
+
const count = copyDir(srcCommandsClaudekit, tool.commandsPath, replacements, options);
|
|
207
|
+
console.log(` ✅ Commands (claudekit): ${count} files`);
|
|
208
|
+
totalFiles += count;
|
|
209
|
+
}
|
|
191
210
|
}
|
|
211
|
+
} else {
|
|
212
|
+
console.log(` ⏭️ Skipping commands (index-only mode - use --full to include)`);
|
|
192
213
|
}
|
|
193
214
|
|
|
194
|
-
// 3. Install core framework
|
|
195
|
-
|
|
196
|
-
|
|
215
|
+
// 3. Install core framework (agents, matrix-skills) - SKIP in index-only/lite mode
|
|
216
|
+
if (!isLite && (!indexOnly || isMinimal || hasCategories)) {
|
|
217
|
+
const coreDir = path.join(tool.skillsPath, 'agent-assistant');
|
|
218
|
+
const coreComponents = ['agents', 'matrix-skills'];
|
|
219
|
+
|
|
220
|
+
for (const name of coreComponents) {
|
|
221
|
+
const srcPath = path.join(PACKAGE_ROOT, name);
|
|
222
|
+
if (fs.existsSync(srcPath)) {
|
|
223
|
+
const destPath = path.join(coreDir, name);
|
|
224
|
+
const count = copyDir(srcPath, destPath, replacements, options);
|
|
225
|
+
console.log(` ✅ ${name}: ${count} files`);
|
|
226
|
+
totalFiles += count;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
197
229
|
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
if (fs.existsSync(
|
|
201
|
-
const destPath = path.join(coreDir,
|
|
202
|
-
const count = copyDir(
|
|
203
|
-
console.log(` ✅
|
|
230
|
+
// 4. Install claudekit agents if available
|
|
231
|
+
const srcAgentsClaudekit = path.join(PACKAGE_ROOT, 'agents-claudekit');
|
|
232
|
+
if (fs.existsSync(srcAgentsClaudekit)) {
|
|
233
|
+
const destPath = path.join(coreDir, 'claudekit', 'agents');
|
|
234
|
+
const count = copyDir(srcAgentsClaudekit, destPath, replacements, options);
|
|
235
|
+
console.log(` ✅ claudekit/agents: ${count} files`);
|
|
204
236
|
totalFiles += count;
|
|
205
237
|
}
|
|
238
|
+
} else if (!isLite) {
|
|
239
|
+
console.log(` ⏭️ Skipping agents/matrix-skills (index-only mode)`);
|
|
206
240
|
}
|
|
207
241
|
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
const srcRules = path.join(PACKAGE_ROOT, 'rules');
|
|
219
|
-
if (fs.existsSync(srcRules) && tool.rulesPath) {
|
|
220
|
-
const count = copyDir(srcRules, tool.rulesPath, replacements, options);
|
|
221
|
-
console.log(` ✅ Rules: ${count} files`);
|
|
222
|
-
totalFiles += count;
|
|
242
|
+
// 5. Install rules - SKIP in index-only/lite mode (327 files = ~1.5MB, causes context limit)
|
|
243
|
+
if (!isLite && (!indexOnly || isMinimal || hasCategories)) {
|
|
244
|
+
const srcRules = path.join(PACKAGE_ROOT, 'rules');
|
|
245
|
+
if (fs.existsSync(srcRules) && tool.rulesPath) {
|
|
246
|
+
const count = copyDir(srcRules, tool.rulesPath, replacements, options);
|
|
247
|
+
console.log(` ✅ Rules: ${count} files`);
|
|
248
|
+
totalFiles += count;
|
|
249
|
+
}
|
|
250
|
+
} else if (!isLite) {
|
|
251
|
+
console.log(` ⏭️ Skipping rules (index-only mode - use --full to include)`);
|
|
223
252
|
}
|
|
224
253
|
|
|
225
|
-
// 6. Install hooks (Claude Code only)
|
|
226
|
-
if (
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
254
|
+
// 6. Install hooks (Claude Code only) - SKIP in index-only/lite mode
|
|
255
|
+
if (!isLite && (!indexOnly || isMinimal || hasCategories)) {
|
|
256
|
+
if (tool.supportsHooks && tool.hooksPath) {
|
|
257
|
+
const srcHooks = path.join(PACKAGE_ROOT, 'hooks');
|
|
258
|
+
if (fs.existsSync(srcHooks)) {
|
|
259
|
+
const count = copyDir(srcHooks, tool.hooksPath, replacements, options);
|
|
260
|
+
console.log(` ✅ Hooks: ${count} files`);
|
|
261
|
+
totalFiles += count;
|
|
262
|
+
}
|
|
232
263
|
}
|
|
264
|
+
} else if (!isLite) {
|
|
265
|
+
console.log(` ⏭️ Skipping hooks (index-only mode)`);
|
|
233
266
|
}
|
|
234
267
|
|
|
235
|
-
// 7. Install output-styles (Claude Code only)
|
|
236
|
-
if (toolId === 'claude') {
|
|
268
|
+
// 7. Install output-styles (Claude Code only) - SKIP in index-only/lite mode
|
|
269
|
+
if (!isLite && toolId === 'claude' && (!indexOnly || isMinimal || hasCategories)) {
|
|
237
270
|
const srcStyles = path.join(PACKAGE_ROOT, 'output-styles');
|
|
238
271
|
if (fs.existsSync(srcStyles)) {
|
|
239
272
|
const destStyles = path.join(tool.basePath, 'output-styles');
|
|
@@ -246,7 +279,7 @@ function installToTool(toolId, tool, options = {}) {
|
|
|
246
279
|
const srcWorkflows = path.join(PACKAGE_ROOT, 'workflows');
|
|
247
280
|
if (fs.existsSync(srcWorkflows)) {
|
|
248
281
|
const destWorkflows = path.join(tool.basePath, 'workflows');
|
|
249
|
-
const count = copyDir(
|
|
282
|
+
const count = copyDir(srcWorkflows, destWorkflows, replacements, options);
|
|
250
283
|
console.log(` ✅ Workflows: ${count} files`);
|
|
251
284
|
totalFiles += count;
|
|
252
285
|
}
|
|
@@ -513,12 +546,157 @@ function listCategories() {
|
|
|
513
546
|
console.log(' devkit install --interactive\n');
|
|
514
547
|
}
|
|
515
548
|
|
|
549
|
+
/**
|
|
550
|
+
* Initialize devkit in current project directory
|
|
551
|
+
* Creates .claude/ folder with commands, hooks, and lightweight rules
|
|
552
|
+
*/
|
|
553
|
+
function initProject(options = {}) {
|
|
554
|
+
const projectDir = process.cwd();
|
|
555
|
+
const claudeDir = path.join(projectDir, '.claude');
|
|
556
|
+
|
|
557
|
+
console.log('\n' + '='.repeat(60));
|
|
558
|
+
console.log(' DEVKIT - PROJECT INIT');
|
|
559
|
+
console.log('='.repeat(60));
|
|
560
|
+
console.log(`\nInitializing devkit in: ${projectDir}`);
|
|
561
|
+
|
|
562
|
+
// Check if .claude already exists
|
|
563
|
+
if (fs.existsSync(claudeDir)) {
|
|
564
|
+
console.log(`\n⚠️ .claude/ folder already exists.`);
|
|
565
|
+
if (!options.force) {
|
|
566
|
+
console.log('Use --force to overwrite existing files.');
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
console.log('--force specified, overwriting...');
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
fs.mkdirSync(claudeDir, { recursive: true });
|
|
573
|
+
|
|
574
|
+
let totalFiles = 0;
|
|
575
|
+
|
|
576
|
+
// 1. Copy commands (claudekit only - lightweight)
|
|
577
|
+
const srcCommands = path.join(PACKAGE_ROOT, 'commands-claudekit');
|
|
578
|
+
if (fs.existsSync(srcCommands)) {
|
|
579
|
+
const destCommands = path.join(claudeDir, 'commands');
|
|
580
|
+
const count = copyDir(srcCommands, destCommands, {}, {});
|
|
581
|
+
console.log(` ✅ Commands: ${count} files`);
|
|
582
|
+
totalFiles += count;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
// 2. Copy hooks
|
|
586
|
+
const srcHooks = path.join(PACKAGE_ROOT, 'hooks');
|
|
587
|
+
if (fs.existsSync(srcHooks)) {
|
|
588
|
+
const destHooks = path.join(claudeDir, 'hooks');
|
|
589
|
+
const count = copyDir(srcHooks, destHooks, {}, {});
|
|
590
|
+
console.log(` ✅ Hooks: ${count} files`);
|
|
591
|
+
totalFiles += count;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// 3. Copy agents (claudekit only)
|
|
595
|
+
const srcAgents = path.join(PACKAGE_ROOT, 'agents-claudekit');
|
|
596
|
+
if (fs.existsSync(srcAgents)) {
|
|
597
|
+
const destAgents = path.join(claudeDir, 'agents');
|
|
598
|
+
const count = copyDir(srcAgents, destAgents, {}, {});
|
|
599
|
+
console.log(` ✅ Agents: ${count} files`);
|
|
600
|
+
totalFiles += count;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
// 4. Copy output-styles
|
|
604
|
+
const srcStyles = path.join(PACKAGE_ROOT, 'output-styles');
|
|
605
|
+
if (fs.existsSync(srcStyles)) {
|
|
606
|
+
const destStyles = path.join(claudeDir, 'output-styles');
|
|
607
|
+
const count = copyDir(srcStyles, destStyles, {}, {});
|
|
608
|
+
console.log(` ✅ Output Styles: ${count} files`);
|
|
609
|
+
totalFiles += count;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// 5. Copy lightweight rules (create minimal rules, not the full 327 files)
|
|
613
|
+
const rulesDir = path.join(claudeDir, 'rules');
|
|
614
|
+
fs.mkdirSync(rulesDir, { recursive: true });
|
|
615
|
+
|
|
616
|
+
// Create minimal rule files similar to claudekit_engineer
|
|
617
|
+
const minimalRules = {
|
|
618
|
+
'development-rules.md': `# Development Rules
|
|
619
|
+
|
|
620
|
+
## Code Quality
|
|
621
|
+
- Write clean, readable code with meaningful names
|
|
622
|
+
- Follow project conventions and patterns
|
|
623
|
+
- Keep functions small and focused
|
|
624
|
+
- Add comments only where logic isn't self-evident
|
|
625
|
+
|
|
626
|
+
## Testing
|
|
627
|
+
- Write tests for new features
|
|
628
|
+
- Ensure tests pass before committing
|
|
629
|
+
- Use descriptive test names
|
|
630
|
+
|
|
631
|
+
## Git
|
|
632
|
+
- Write clear commit messages
|
|
633
|
+
- Keep commits focused and atomic
|
|
634
|
+
- Review changes before pushing
|
|
635
|
+
`,
|
|
636
|
+
'orchestration-protocol.md': `# Orchestration Protocol
|
|
637
|
+
|
|
638
|
+
## Workflow
|
|
639
|
+
1. Understand the task completely before starting
|
|
640
|
+
2. Break complex tasks into smaller steps
|
|
641
|
+
3. Validate assumptions with the user
|
|
642
|
+
4. Test changes incrementally
|
|
643
|
+
|
|
644
|
+
## Communication
|
|
645
|
+
- Be concise and clear
|
|
646
|
+
- Ask clarifying questions when needed
|
|
647
|
+
- Report progress on long tasks
|
|
648
|
+
`
|
|
649
|
+
};
|
|
650
|
+
|
|
651
|
+
for (const [filename, content] of Object.entries(minimalRules)) {
|
|
652
|
+
fs.writeFileSync(path.join(rulesDir, filename), content);
|
|
653
|
+
totalFiles++;
|
|
654
|
+
}
|
|
655
|
+
console.log(` ✅ Rules: ${Object.keys(minimalRules).length} files (lightweight)`);
|
|
656
|
+
|
|
657
|
+
// 6. Copy statusline scripts
|
|
658
|
+
const statuslineFiles = ['statusline.cjs', 'statusline.ps1', 'statusline.sh'];
|
|
659
|
+
for (const file of statuslineFiles) {
|
|
660
|
+
const srcFile = path.join(PACKAGE_ROOT, file);
|
|
661
|
+
if (fs.existsSync(srcFile)) {
|
|
662
|
+
fs.copyFileSync(srcFile, path.join(claudeDir, file));
|
|
663
|
+
totalFiles++;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// 7. Create settings.json
|
|
668
|
+
const settings = {
|
|
669
|
+
includeCoAuthoredBy: false
|
|
670
|
+
};
|
|
671
|
+
fs.writeFileSync(
|
|
672
|
+
path.join(claudeDir, 'settings.json'),
|
|
673
|
+
JSON.stringify(settings, null, 2)
|
|
674
|
+
);
|
|
675
|
+
totalFiles++;
|
|
676
|
+
console.log(` ✅ Settings: created`);
|
|
677
|
+
|
|
678
|
+
console.log(`\n 📊 Total: ${totalFiles} files`);
|
|
679
|
+
|
|
680
|
+
console.log('\n' + '='.repeat(60));
|
|
681
|
+
console.log(' ✅ PROJECT INITIALIZED');
|
|
682
|
+
console.log('='.repeat(60));
|
|
683
|
+
console.log(`\nDevkit initialized in ${claudeDir}`);
|
|
684
|
+
console.log('\nAvailable commands:');
|
|
685
|
+
console.log(' /plan - Plan implementation');
|
|
686
|
+
console.log(' /brainstorm - Brainstorm ideas');
|
|
687
|
+
console.log(' /fix - Fix issues');
|
|
688
|
+
console.log(' /code - Start coding');
|
|
689
|
+
console.log(' /cook - Build a feature');
|
|
690
|
+
console.log('');
|
|
691
|
+
}
|
|
692
|
+
|
|
516
693
|
// Export for CLI
|
|
517
694
|
module.exports = {
|
|
518
695
|
install,
|
|
519
696
|
uninstall,
|
|
520
697
|
update,
|
|
521
698
|
interactiveInstall,
|
|
699
|
+
initProject,
|
|
522
700
|
listSkills,
|
|
523
701
|
listCategories,
|
|
524
702
|
TOOLS
|