@ngxtm/devkit 3.9.0 → 3.10.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/init.js CHANGED
@@ -85,18 +85,22 @@ function installForTool(toolId, tool, projectDir, options = {}) {
85
85
  let totalFiles = 0;
86
86
  const stats = {};
87
87
 
88
- // 1. Install commands (if tool supports it)
88
+ // 1. Install core commands (if tool supports it) - optimized size ~400KB
89
89
  if (tool.commandsPath) {
90
- const mergedCommandsDir = path.join(PACKAGE_ROOT, 'merged-commands');
90
+ const coreCommandsDir = path.join(PACKAGE_ROOT, 'core-commands');
91
91
  const commandsDir = path.join(targetDir, tool.commandsPath);
92
92
 
93
- if (fs.existsSync(mergedCommandsDir)) {
94
- const count = copyDir(mergedCommandsDir, commandsDir);
93
+ if (fs.existsSync(coreCommandsDir)) {
94
+ const count = copyDir(coreCommandsDir, commandsDir);
95
95
  stats.commands = count;
96
96
  totalFiles += count;
97
97
  }
98
98
  }
99
99
 
100
+ // Note: Skills are loaded on-demand from skills-compact.json
101
+ // Full skills are NOT copied to reduce installation size
102
+ // User can run "devkit add-skills" to install specific skill packs
103
+
100
104
  // 2. Install rules
101
105
  if (tool.rulesPath && options.rules && options.rules.length > 0) {
102
106
  const rulesDir = path.join(targetDir, tool.rulesPath);
@@ -136,19 +140,11 @@ function installForTool(toolId, tool, projectDir, options = {}) {
136
140
  }
137
141
  }
138
142
 
139
- // 4. Install skills index files (for auto-skill detection)
140
- const indexFiles = [
141
- 'skills-index.json',
142
- 'skills-keywords.json',
143
- 'skills-categories.json',
144
- 'skills-triggers.json'
145
- ];
146
- for (const indexFile of indexFiles) {
147
- const src = path.join(PACKAGE_ROOT, indexFile);
148
- if (fs.existsSync(src)) {
149
- fs.copyFileSync(src, path.join(targetDir, indexFile));
150
- totalFiles++;
151
- }
143
+ // 4. Install compact skill index (for auto-detection, ~20KB only)
144
+ const compactIndex = path.join(PACKAGE_ROOT, 'skills-compact.json');
145
+ if (fs.existsSync(compactIndex)) {
146
+ fs.copyFileSync(compactIndex, path.join(targetDir, 'skills-compact.json'));
147
+ totalFiles++;
152
148
  }
153
149
 
154
150
  // 5. Install base rules (including auto-skill detection)
@@ -366,12 +362,19 @@ if (require.main === module) {
366
362
  const toolsArg = args.find(a => a.startsWith('--tools='));
367
363
  const tools = toolsArg ? toolsArg.split('=')[1].split(',') : [];
368
364
 
365
+ // Parse --path=value format
366
+ const pathArg = args.find(a => a.startsWith('--path='));
367
+ const pathValue = pathArg ? pathArg.split('=')[1] : null;
368
+
369
+ // Fallback to positional argument (first non-flag argument)
370
+ const positionalPath = args.find(a => !a.startsWith('-') && !a.includes('='));
371
+
369
372
  const options = {
370
373
  force: args.includes('--force') || args.includes('-f'),
371
374
  update: args.includes('--update') || args.includes('-u'),
372
375
  all: args.includes('--all') || args.includes('-a'),
373
376
  tools: tools,
374
- path: args.find(a => !a.startsWith('-') && !a.includes('=')) || process.cwd()
377
+ path: pathValue || positionalPath || process.cwd()
375
378
  };
376
379
 
377
380
  if (args.includes('--uninstall')) {
package/cli/update.js CHANGED
@@ -56,15 +56,17 @@ function updateToolInstallation(toolId, tool, projectDir, options = {}) {
56
56
 
57
57
  let updatedCount = 0;
58
58
 
59
- // 1. Update commands (if tool supports it)
59
+ // 1. Update core commands (if tool supports it) - optimized size ~400KB
60
60
  if (tool.commandsPath) {
61
- const mergedCommandsDir = path.join(PACKAGE_ROOT, 'merged-commands');
61
+ const coreCommandsDir = path.join(PACKAGE_ROOT, 'core-commands');
62
62
  const commandsDir = path.join(targetDir, tool.commandsPath);
63
- if (fs.existsSync(mergedCommandsDir)) {
64
- updatedCount += copyDir(mergedCommandsDir, commandsDir);
63
+ if (fs.existsSync(coreCommandsDir)) {
64
+ updatedCount += copyDir(coreCommandsDir, commandsDir);
65
65
  }
66
66
  }
67
67
 
68
+ // Note: Skills are loaded on-demand, not copied to project
69
+
68
70
  // 2. Update rules
69
71
  if (tool.rulesPath && options.rules && options.rules.length > 0) {
70
72
  const rulesDir = path.join(targetDir, tool.rulesPath);
@@ -97,19 +99,11 @@ function updateToolInstallation(toolId, tool, projectDir, options = {}) {
97
99
  }
98
100
  }
99
101
 
100
- // 5. Update skills index files
101
- const indexFiles = [
102
- 'skills-index.json',
103
- 'skills-keywords.json',
104
- 'skills-categories.json',
105
- 'skills-triggers.json'
106
- ];
107
- for (const indexFile of indexFiles) {
108
- const src = path.join(PACKAGE_ROOT, indexFile);
109
- if (fs.existsSync(src)) {
110
- fs.copyFileSync(src, path.join(targetDir, indexFile));
111
- updatedCount++;
112
- }
102
+ // 5. Update compact skill index (for auto-detection, ~20KB only)
103
+ const compactIndex = path.join(PACKAGE_ROOT, 'skills-compact.json');
104
+ if (fs.existsSync(compactIndex)) {
105
+ fs.copyFileSync(compactIndex, path.join(targetDir, 'skills-compact.json'));
106
+ updatedCount++;
113
107
  }
114
108
 
115
109
  // 6. Update base rules (including auto-skill detection)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngxtm/devkit",
3
- "version": "3.9.0",
3
+ "version": "3.10.1",
4
4
  "description": "Per-project AI skills with smart tech detection - lightweight and context-optimized",
5
5
  "main": "cli/index.js",
6
6
  "bin": {
@@ -4,128 +4,136 @@
4
4
 
5
5
  ## When to Activate
6
6
 
7
- Before starting ANY coding task, you MUST check if a relevant skill exists:
7
+ Before starting ANY coding task, you SHOULD check if a relevant skill exists:
8
8
 
9
9
  1. **Analyze the user's request** - Extract key technologies, patterns, or domains
10
- 2. **Quick keyword match** - Check `skills-keywords.json` for exact matches
11
- 3. **Category browse** - If no exact match, check `skills-categories.json` for relevant category
12
- 4. **Suggest to user** - Present top 1-3 matching skills with brief descriptions
10
+ 2. **Check compact index** - Read `skills-compact.json` (~20KB) for skill names and categories
11
+ 3. **Suggest to user** - Present top 1-3 matching skills
12
+ 4. **Load on-demand** - When user confirms, read full skill from `skills/{name}/SKILL.md`
13
+
14
+ ## Quick Reference: Skill Categories
15
+
16
+ | Code | Category | Examples |
17
+ |------|----------|----------|
18
+ | `fe` | Frontend | react, vue, nextjs, tailwind, ui/ux |
19
+ | `be` | Backend | node, express, nestjs, fastapi, api |
20
+ | `db` | Database | postgres, mysql, mongodb, redis, prisma |
21
+ | `ai` | AI/ML | llm, agents, rag, mcp, embeddings |
22
+ | `ops` | DevOps | docker, k8s, ci/cd, aws, terraform |
23
+ | `test` | Testing | jest, playwright, tdd, e2e |
24
+ | `sec` | Security | auth, oauth, jwt, owasp, pentest |
25
+ | `git` | Git/Workflow | pr, review, commit, branching |
26
+ | `mob` | Mobile | react-native, flutter, ios, android |
27
+ | `py` | Python | django, flask, fastapi, pandas |
28
+ | `go` | Golang | gin, echo, fiber, concurrency |
13
29
 
14
30
  ## Detection Flow
15
31
 
16
32
  ```
17
- User Request → Extract Keywords Match in skills-keywords.json
18
-
19
- Found? → Suggest: "I found /skill-name that matches your task"
20
- No
21
- Check skills-categories.json Browse category
22
-
23
- Found? → Suggest: "These skills in [category] might help: ..."
24
- ↓ No
25
- Proceed without skill
33
+ User Request → Extract keywords (react, auth, test, etc.)
34
+
35
+ Read skills-compact.json
36
+
37
+ Match skill names containing keywords
38
+
39
+ Found? → Suggest: "I found /skill-name. Use it?"
40
+ ↓ No
41
+ Check category (fe, be, ai, etc.)
42
+
43
+ Suggest skills in that category
26
44
  ```
27
45
 
28
46
  ## How to Search
29
47
 
30
- ### Step 1: Extract Keywords
31
- From user request, identify:
32
- - **Technologies**: react, python, docker, postgres, etc.
33
- - **Patterns**: authentication, caching, testing, deployment
34
- - **Domains**: ai, security, mobile, devops
48
+ ### Step 1: Read Compact Index
49
+ ```
50
+ Read: .claude/skills-compact.json
51
+ Format: { "_categories": {...}, "skills": { "skill-name": "category-code" } }
52
+ ```
35
53
 
36
- ### Step 2: Keyword Lookup
54
+ ### Step 2: Match by Name/Keyword
55
+ Look for skills whose name contains user's keywords:
56
+ - User says "react" → find skills with "react" in name
57
+ - User says "authentication" → find "auth" skills
58
+ - User says "docker" → find "docker" skills
59
+
60
+ ### Step 3: Load Full Skill
61
+ When user confirms, read the full skill:
37
62
  ```
38
- Read: .claude/skills-keywords.json
39
- Find: keywords from user request
40
- Result: List of matching skill names
63
+ Read: .claude/skills/{skill-name}/SKILL.md
41
64
  ```
42
65
 
43
- ### Step 3: Category Fallback
44
- If keywords don't match, check categories:
45
- - `frontend` - React, Vue, UI/UX, CSS
46
- - `backend` - Node, API, REST, GraphQL
47
- - `database` - SQL, Postgres, MongoDB, Redis
48
- - `ai-ml` - LLM, Agents, RAG, Embeddings
49
- - `devops` - Docker, K8s, CI/CD, Cloud
50
- - `testing` - Jest, Playwright, TDD
51
- - `security` - Auth, OAuth, OWASP
52
- - `mobile` - React Native, Flutter, iOS
53
- - `git-workflow` - PR, Code Review, Branching
54
-
55
- ### Step 4: Suggest
56
-
57
- **Format for suggestion:**
66
+ ## Suggestion Format
67
+
68
+ **Single match:**
58
69
  ```
59
- I found a skill that might help with your task:
70
+ I found a skill that might help:
60
71
 
61
- 📌 /skill-name - Brief description
72
+ 📌 /skill-name - [category]
62
73
 
63
- Would you like me to use this skill? (It will load specific patterns and best practices for [domain])
74
+ Load this skill? It has specialized patterns for your task.
64
75
  ```
65
76
 
66
- **For multiple matches:**
77
+ **Multiple matches (max 3):**
67
78
  ```
68
- I found several skills that might help:
79
+ I found skills that might help:
69
80
 
70
- 1. /skill-1 - Description
71
- 2. /skill-2 - Description
72
- 3. /skill-3 - Description
81
+ 1. /skill-1 - [category]
82
+ 2. /skill-2 - [category]
83
+ 3. /skill-3 - [category]
73
84
 
74
- Which one should I use? (or say "none" to proceed without)
85
+ Which one should I use? (or "none" to proceed without)
75
86
  ```
76
87
 
77
88
  ## Auto-Activate Triggers
78
89
 
79
- Some skills should auto-activate based on patterns:
90
+ Some patterns should auto-suggest specific skills:
80
91
 
81
- | Pattern | Auto-load Skill |
82
- |---------|----------------|
83
- | "create PR", "pull request" | /pr-description |
92
+ | User says... | Suggest skill |
93
+ |--------------|---------------|
94
+ | "create PR", "pull request" | /git-advanced-workflows |
84
95
  | "code review" | /code-review |
85
96
  | "write tests", "add tests" | /test-master |
86
97
  | "fix bug", "debug" | /systematic-debugging |
87
- | "deploy", "deployment" | Check devops category |
88
- | "authenticate", "auth" | /auth-patterns |
98
+ | "learn", "teach me" | /learn |
99
+ | "react component" | /react-expert |
100
+ | "nextjs", "next.js" | /nextjs-best-practices |
101
+ | "docker", "container" | /docker-expert |
102
+ | "api design" | /api-design-principles |
89
103
  | "database schema" | /database-design |
104
+ | "authentication", "auth" | /auth-implementation-patterns |
105
+ | "mcp server" | /mcp-developer |
90
106
 
91
107
  ## Important Rules
92
108
 
93
- 1. **Don't overwhelm** - Max 3 suggestions at a time
94
- 2. **Be concise** - One-line descriptions only
95
- 3. **Ask permission** - Always ask before loading a skill
109
+ 1. **Don't auto-load** - Always ask before loading a skill
110
+ 2. **Max 3 suggestions** - Don't overwhelm user
111
+ 3. **Be concise** - One-line per skill
96
112
  4. **Remember context** - If user said "none", don't suggest again for same task
97
- 5. **Skill stacking** - Multiple skills can be used together if relevant
113
+ 5. **On-demand loading** - Only read full SKILL.md when user confirms
114
+ 6. **Core commands available** - /learn, /react-expert, /docker-expert, etc. are pre-loaded
98
115
 
99
- ## Files Reference
116
+ ## File Locations
100
117
 
101
118
  | File | Purpose | Size |
102
119
  |------|---------|------|
103
- | `skills-keywords.json` | Keyword Skills mapping | ~330KB |
104
- | `skills-categories.json` | Category-based index | ~108KB |
105
- | `skills-triggers.json` | Trigger patterns | ~205KB |
106
- | `skills-index.json` | Full skill list | ~200KB |
120
+ | `skills-compact.json` | Quick lookup index | ~20KB |
121
+ | `skills/{name}/SKILL.md` | Full skill content | varies |
122
+ | `commands/*.md` | Core commands (pre-loaded) | ~400KB |
107
123
 
108
- ## Example Interactions
124
+ ## Example Interaction
109
125
 
110
- **User:** "Add JWT authentication to my Express API"
126
+ **User:** "Help me add JWT authentication to my Express API"
111
127
 
112
- **Claude:**
128
+ **Claude:** (reads skills-compact.json, finds "auth-implementation-patterns")
113
129
  ```
114
- I found skills that match your task:
130
+ I found a skill that matches your task:
115
131
 
116
- 📌 /auth-patterns - JWT, OAuth2, session management patterns
117
- 📌 /express-expert - Express.js best practices and middleware
132
+ 📌 /auth-implementation-patterns - security
118
133
 
119
- Should I use these? They'll help ensure secure auth implementation.
134
+ This skill has JWT, OAuth2, and session patterns. Load it?
120
135
  ```
121
136
 
122
- **User:** "Optimize my React app performance"
137
+ **User:** "yes"
123
138
 
124
- **Claude:**
125
- ```
126
- I found a relevant skill:
127
-
128
- 📌 /react-performance - React optimization patterns, memo, lazy loading, profiling
129
-
130
- Want me to apply these optimization patterns?
131
- ```
139
+ **Claude:** (reads skills/auth-implementation-patterns/SKILL.md and applies it)