@ngxtm/devkit 2.0.1 → 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 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
- Best for avoiding context limit issues
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 # Index-only (recommended)
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 (indexOnly && !isMinimal && !hasCategories) {
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
- const srcSkills = path.join(PACKAGE_ROOT, 'skills');
147
- if (fs.existsSync(srcSkills)) {
148
- if (indexOnly && !isMinimal && !hasCategories) {
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,54 +177,96 @@ function installToTool(toolId, tool, options = {}) {
171
177
  totalFiles += count;
172
178
  }
173
179
  }
180
+ }
174
181
 
175
- // 2. Install core framework under agent-assistant subfolder
176
- const coreDir = path.join(tool.skillsPath, 'agent-assistant');
177
- const coreComponents = ['agents', 'commands', 'matrix-skills'];
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
+ }
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
+ }
178
202
 
179
- for (const name of coreComponents) {
180
- const srcPath = path.join(PACKAGE_ROOT, name);
181
- if (fs.existsSync(srcPath)) {
182
- const destPath = path.join(coreDir, name);
183
- const count = copyDir(srcPath, destPath, replacements, options);
184
- console.log(` ✅ ${name}: ${count} files`);
185
- totalFiles += count;
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
+ }
186
210
  }
211
+ } else {
212
+ console.log(` ⏭️ Skipping commands (index-only mode - use --full to include)`);
187
213
  }
188
214
 
189
- // 3. Install claudekit components (agents, commands) if available
190
- const claudekitComponents = ['agents-claudekit', 'commands-claudekit'];
191
- for (const name of claudekitComponents) {
192
- const srcPath = path.join(PACKAGE_ROOT, name);
193
- if (fs.existsSync(srcPath)) {
194
- const destName = name.replace('-claudekit', '');
195
- const destPath = path.join(coreDir, 'claudekit', destName);
196
- const count = copyDir(srcPath, destPath, replacements, options);
197
- console.log(` ✅ claudekit/${destName}: ${count} files`);
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
+ }
229
+
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`);
198
236
  totalFiles += count;
199
237
  }
238
+ } else if (!isLite) {
239
+ console.log(` ⏭️ Skipping agents/matrix-skills (index-only mode)`);
200
240
  }
201
241
 
202
- // 4. Install rules
203
- const srcRules = path.join(PACKAGE_ROOT, 'rules');
204
- if (fs.existsSync(srcRules) && tool.rulesPath) {
205
- const count = copyDir(srcRules, tool.rulesPath, replacements, options);
206
- console.log(` ✅ Rules: ${count} files`);
207
- 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)`);
208
252
  }
209
253
 
210
- // 5. Install hooks (Claude Code only)
211
- if (tool.supportsHooks && tool.hooksPath) {
212
- const srcHooks = path.join(PACKAGE_ROOT, 'hooks');
213
- if (fs.existsSync(srcHooks)) {
214
- const count = copyDir(srcHooks, tool.hooksPath, replacements, options);
215
- console.log(` ✅ Hooks: ${count} files`);
216
- totalFiles += count;
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
+ }
217
263
  }
264
+ } else if (!isLite) {
265
+ console.log(` ⏭️ Skipping hooks (index-only mode)`);
218
266
  }
219
267
 
220
- // 6. Install output-styles (Claude Code only)
221
- 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)) {
222
270
  const srcStyles = path.join(PACKAGE_ROOT, 'output-styles');
223
271
  if (fs.existsSync(srcStyles)) {
224
272
  const destStyles = path.join(tool.basePath, 'output-styles');
@@ -227,16 +275,16 @@ function installToTool(toolId, tool, options = {}) {
227
275
  totalFiles += count;
228
276
  }
229
277
 
230
- // 7. Install workflows
278
+ // 8. Install workflows
231
279
  const srcWorkflows = path.join(PACKAGE_ROOT, 'workflows');
232
280
  if (fs.existsSync(srcWorkflows)) {
233
281
  const destWorkflows = path.join(tool.basePath, 'workflows');
234
- const count = copyDir(destWorkflows, destWorkflows, replacements, options);
282
+ const count = copyDir(srcWorkflows, destWorkflows, replacements, options);
235
283
  console.log(` ✅ Workflows: ${count} files`);
236
284
  totalFiles += count;
237
285
  }
238
286
 
239
- // 8. Copy statusline scripts
287
+ // 9. Copy statusline scripts
240
288
  const statuslineFiles = ['statusline.cjs', 'statusline.ps1', 'statusline.sh'];
241
289
  for (const file of statuslineFiles) {
242
290
  const srcFile = path.join(PACKAGE_ROOT, file);
@@ -247,7 +295,7 @@ function installToTool(toolId, tool, options = {}) {
247
295
  }
248
296
  }
249
297
 
250
- // 9. Copy settings.json if not exists
298
+ // 10. Copy settings.json if not exists
251
299
  const srcSettings = path.join(PACKAGE_ROOT, 'settings.json');
252
300
  const destSettings = path.join(tool.basePath, 'settings.json');
253
301
  if (fs.existsSync(srcSettings) && !fs.existsSync(destSettings)) {
@@ -498,12 +546,157 @@ function listCategories() {
498
546
  console.log(' devkit install --interactive\n');
499
547
  }
500
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
+
501
693
  // Export for CLI
502
694
  module.exports = {
503
695
  install,
504
696
  uninstall,
505
697
  update,
506
698
  interactiveInstall,
699
+ initProject,
507
700
  listSkills,
508
701
  listCategories,
509
702
  TOOLS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngxtm/devkit",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Unified multi-agent system with auto-synced skills from multiple sources",
5
5
  "main": "cli/install.js",
6
6
  "bin": {
package/settings.json CHANGED
@@ -1,94 +1,3 @@
1
1
  {
2
- "includeCoAuthoredBy": false,
3
- "statusLine": {
4
- "type": "command",
5
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/statusline.cjs",
6
- "padding": 0
7
- },
8
- "hooks": {
9
- "SessionStart": [
10
- {
11
- "matcher": "startup|resume|clear|compact",
12
- "hooks": [
13
- {
14
- "type": "command",
15
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/session-init.cjs"
16
- }
17
- ]
18
- }
19
- ],
20
- "SubagentStart": [
21
- {
22
- "matcher": "*",
23
- "hooks": [
24
- {
25
- "type": "command",
26
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/subagent-init.cjs"
27
- }
28
- ]
29
- }
30
- ],
31
- "UserPromptSubmit": [
32
- {
33
- "hooks": [
34
- {
35
- "type": "command",
36
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/dev-rules-reminder.cjs"
37
- }
38
- ]
39
- },
40
- {
41
- "hooks": [
42
- {
43
- "type": "command",
44
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/dev-rules-reminder.cjs",
45
- "_origin": "engineer"
46
- },
47
- {
48
- "type": "command",
49
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/usage-context-awareness.cjs",
50
- "timeout": 30,
51
- "_origin": "engineer"
52
- }
53
- ]
54
- }
55
- ],
56
- "PreToolUse": [
57
- {
58
- "matcher": "Bash|Glob|Grep|Read|Edit|Write",
59
- "hooks": [
60
- {
61
- "type": "command",
62
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/scout-block.cjs"
63
- },
64
- {
65
- "type": "command",
66
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/privacy-block.cjs"
67
- }
68
- ]
69
- }
70
- ],
71
- "PostToolUse": [
72
- {
73
- "matcher": "Edit|Write|MultiEdit",
74
- "hooks": [
75
- {
76
- "type": "command",
77
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/post-edit-simplify-reminder.cjs",
78
- "_origin": "engineer"
79
- }
80
- ]
81
- },
82
- {
83
- "matcher": "*",
84
- "hooks": [
85
- {
86
- "type": "command",
87
- "command": "node \"%CLAUDE_PROJECT_DIR%\"/.claude/hooks/usage-context-awareness.cjs",
88
- "_origin": "engineer"
89
- }
90
- ]
91
- }
92
- ]
93
- }
2
+ "includeCoAuthoredBy": false
94
3
  }