ccjk 7.0.0 â 7.0.2
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/dist/chunks/package.mjs +1 -1
- package/package.json +61 -68
- package/.claude/hooks/ccjk-diagnose-hook.sh +0 -106
- package/.claude/hooks/eslint-hook.ts +0 -122
- package/.claude-plugin/plugin.json +0 -9
- package/README-INTERNAL.md +0 -305
- package/agents/agent-router.md +0 -135
- package/agents/agents.json +0 -6
- package/agents/cache-manager.ts +0 -265
- package/agents/doc-researcher.md +0 -202
- package/agents/mcp-researcher.md +0 -285
- package/agents/npm-researcher.md +0 -383
- package/agents/version-checker.md +0 -332
- package/hooks/hooks.json +0 -15
- package/skills/ccjk/SKILL.md +0 -224
- package/skills/ccjk/references/ccjk-defaults.md +0 -265
- package/skills/ccjk/references/coding-standards.md +0 -198
- package/skills/ccjk/references/error-patterns.md +0 -353
- package/skills/ccjk/references/platform-conventions.md +0 -307
- package/skills/ccjk-config/SKILL.md +0 -301
- package/skills/ccjk-init/SKILL.md +0 -201
- package/skills/ccjk-mcp/SKILL.md +0 -249
- package/skills/ccjk-sync/SKILL.md +0 -328
- package/skills/coding-guidelines.md +0 -262
- package/skills/config-router/SKILL.md +0 -233
- package/skills/domain-cli.md +0 -228
- package/skills/domain-cloud.md +0 -246
- package/skills/domain-desktop.md +0 -272
- package/skills/domain-web.md +0 -229
- package/skills/layer1-api.md +0 -160
- package/skills/layer1-mcp.md +0 -305
- package/skills/layer1-workflow.md +0 -144
- package/skills/layer2-best-practices.md +0 -155
- package/skills/layer2-design-patterns.md +0 -107
package/agents/mcp-researcher.md
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
# Agent: MCP Researcher
|
|
2
|
-
|
|
3
|
-
> **Purpose**: Query MCP (Model Context Protocol) registry for server information
|
|
4
|
-
> **Data Source**: https://registry.modelcontextprotocol.io, lib.rs
|
|
5
|
-
> **Cache TTL**: 24 hours
|
|
6
|
-
> **Run Mode**: Background
|
|
7
|
-
|
|
8
|
-
## đ¯ What This Agent Does
|
|
9
|
-
|
|
10
|
-
Researches MCP servers, their configurations, latest versions, and installation instructions from official MCP registry and community sources.
|
|
11
|
-
|
|
12
|
-
## đ Data Sources
|
|
13
|
-
|
|
14
|
-
### Primary Sources
|
|
15
|
-
- **MCP Official Registry**: https://registry.modelcontextprotocol.io
|
|
16
|
-
- **MCP GitHub**: https://github.com/modelcontextprotocol
|
|
17
|
-
- **Awesome MCP List**: Community-maintained list
|
|
18
|
-
- **Individual MCP Repos**: GitHub repositories of specific servers
|
|
19
|
-
|
|
20
|
-
## đ Research Queries
|
|
21
|
-
|
|
22
|
-
### Common Queries
|
|
23
|
-
```typescript
|
|
24
|
-
// Search for MCP server
|
|
25
|
-
"filesystem MCP server configuration"
|
|
26
|
-
|
|
27
|
-
// Get server info
|
|
28
|
-
"@modelcontextprotocol/server-filesystem version features"
|
|
29
|
-
|
|
30
|
-
// List servers by category
|
|
31
|
-
"MCP servers for database access"
|
|
32
|
-
|
|
33
|
-
// Installation instructions
|
|
34
|
-
"how to install @modelcontextprotocol/server-postgres"
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## đ Cache Strategy
|
|
38
|
-
|
|
39
|
-
```typescript
|
|
40
|
-
const CACHE_CONFIG = {
|
|
41
|
-
mcpServers: {
|
|
42
|
-
ttl: 24 * 60 * 60 * 1000, // 24 hours
|
|
43
|
-
key: (serverName) => `mcp:${serverName}`
|
|
44
|
-
},
|
|
45
|
-
mcpList: {
|
|
46
|
-
ttl: 12 * 60 * 60 * 1000, // 12 hours (more frequent updates)
|
|
47
|
-
key: 'mcp:list'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**Rationale**: MCP ecosystem is evolving rapidly with new servers and updates. 24-hour cache ensures current information while avoiding excessive API calls.
|
|
53
|
-
|
|
54
|
-
## đ Workflow
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
User Query: "Tell me about the filesystem MCP server"
|
|
58
|
-
â
|
|
59
|
-
1. Check Cache
|
|
60
|
-
â
|
|
61
|
-
2. If Cache Hit (< 24h old)
|
|
62
|
-
â Return cached server info
|
|
63
|
-
â
|
|
64
|
-
3. If Cache Miss or Expired
|
|
65
|
-
â Query MCP registry
|
|
66
|
-
â Parse server metadata
|
|
67
|
-
â Extract: version, features, config, installation
|
|
68
|
-
â Store in cache
|
|
69
|
-
â Return to user
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## đ Output Format
|
|
73
|
-
|
|
74
|
-
```typescript
|
|
75
|
-
interface MCPServerInfo {
|
|
76
|
-
name: string
|
|
77
|
-
version: string
|
|
78
|
-
description: string
|
|
79
|
-
repository: string
|
|
80
|
-
author: string
|
|
81
|
-
features: string[]
|
|
82
|
-
configuration: {
|
|
83
|
-
transport: 'stdio' | 'sse'
|
|
84
|
-
command?: string
|
|
85
|
-
args?: string[]
|
|
86
|
-
env?: Record<string, string>
|
|
87
|
-
}
|
|
88
|
-
installation: {
|
|
89
|
-
npm?: string
|
|
90
|
-
docker?: string
|
|
91
|
-
git?: string
|
|
92
|
-
}
|
|
93
|
-
lastUpdated: Date
|
|
94
|
-
cacheHit: boolean
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## đ¯ Key Features
|
|
99
|
-
|
|
100
|
-
### 1. Server Metadata
|
|
101
|
-
- Latest version number
|
|
102
|
-
- Feature list
|
|
103
|
-
- Configuration template
|
|
104
|
-
- Installation instructions
|
|
105
|
-
|
|
106
|
-
### 2. Transport Detection
|
|
107
|
-
- Automatically detect stdio vs SSE
|
|
108
|
-
- Provide recommendation based on use case
|
|
109
|
-
- Example configurations for both
|
|
110
|
-
|
|
111
|
-
### 3. Installation Guidance
|
|
112
|
-
- NPM package installation
|
|
113
|
-
- Docker setup (if available)
|
|
114
|
-
- Git clone for development
|
|
115
|
-
|
|
116
|
-
## đ Query Examples
|
|
117
|
-
|
|
118
|
-
### Example 1: Filesystem MCP Server
|
|
119
|
-
```
|
|
120
|
-
User: "How to configure filesystem MCP?"
|
|
121
|
-
â
|
|
122
|
-
Agent: mcp-researcher
|
|
123
|
-
â
|
|
124
|
-
Query: "filesystem MCP server @modelcontextprotocol/server-filesystem"
|
|
125
|
-
â
|
|
126
|
-
Output:
|
|
127
|
-
{
|
|
128
|
-
"name": "@modelcontextprotocol/server-filesystem",
|
|
129
|
-
"version": "2025.01.23",
|
|
130
|
-
"description": "MCP server for filesystem access",
|
|
131
|
-
"features": ["read", "write", "list", "watch"],
|
|
132
|
-
"configuration": {
|
|
133
|
-
"transport": "stdio",
|
|
134
|
-
"command": "npx",
|
|
135
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
|
|
136
|
-
},
|
|
137
|
-
"installation": {
|
|
138
|
-
"npm": "npm install -g @modelcontextprotocol/server-filesystem"
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Example 2: Database MCP Servers
|
|
144
|
-
```
|
|
145
|
-
User: "What MCP servers exist for databases?"
|
|
146
|
-
â
|
|
147
|
-
Agent: mcp-researcher
|
|
148
|
-
â
|
|
149
|
-
Query: "MCP servers database postgres mysql sqlite"
|
|
150
|
-
â
|
|
151
|
-
Output:
|
|
152
|
-
[
|
|
153
|
-
{
|
|
154
|
-
"name": "@modelcontextprotocol/server-postgres",
|
|
155
|
-
"description": "PostgreSQL database access",
|
|
156
|
-
"features": ["query", "schema", "transactions"]
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"name": "mcp-server-sqlite",
|
|
160
|
-
"description": "SQLite database access",
|
|
161
|
-
"features": ["query", "schema", "backup"]
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## đ¨ Configuration Templates
|
|
167
|
-
|
|
168
|
-
### Template 1: stdio Transport
|
|
169
|
-
```json
|
|
170
|
-
{
|
|
171
|
-
"mcpServers": {
|
|
172
|
-
"server-name": {
|
|
173
|
-
"command": "npx",
|
|
174
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"],
|
|
175
|
-
"transport": "stdio"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Template 2: SSE Transport
|
|
182
|
-
```json
|
|
183
|
-
{
|
|
184
|
-
"mcpServers": {
|
|
185
|
-
"server-name": {
|
|
186
|
-
"transport": "sse",
|
|
187
|
-
"url": "http://localhost:3000/sse",
|
|
188
|
-
"reconnect": true
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
## âī¸ Configuration
|
|
195
|
-
|
|
196
|
-
```json
|
|
197
|
-
{
|
|
198
|
-
"agent": "mcp-researcher",
|
|
199
|
-
"runMode": "background",
|
|
200
|
-
"cache": {
|
|
201
|
-
"enabled": true,
|
|
202
|
-
"ttl": 86400000
|
|
203
|
-
},
|
|
204
|
-
"sources": [
|
|
205
|
-
"https://registry.modelcontextprotocol.io",
|
|
206
|
-
"https://github.com/modelcontextprotocol"
|
|
207
|
-
]
|
|
208
|
-
}
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
## đĢ Error Handling
|
|
212
|
-
|
|
213
|
-
```typescript
|
|
214
|
-
try {
|
|
215
|
-
const serverInfo = await fetchMCPInfo(serverName)
|
|
216
|
-
return serverInfo
|
|
217
|
-
} catch (error) {
|
|
218
|
-
// Fallback to cached data
|
|
219
|
-
const cached = await getFromCache(`mcp:${serverName}`)
|
|
220
|
-
if (cached) {
|
|
221
|
-
return { ...cached, source: 'cache (possibly outdated)' }
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
// If no cache, search GitHub
|
|
225
|
-
const githubResult = await searchGitHub(serverName)
|
|
226
|
-
if (githubResult) {
|
|
227
|
-
return githubResult
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
throw new Error(`MCP server not found: ${serverName}`)
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
## đ Security Considerations
|
|
235
|
-
|
|
236
|
-
### â ī¸ Security Warnings
|
|
237
|
-
When providing MCP configurations, agent should:
|
|
238
|
-
|
|
239
|
-
1. **Warn about file access**
|
|
240
|
-
```typescript
|
|
241
|
-
if (server.features.includes('filesystem')) {
|
|
242
|
-
warnings.push("â ī¸ Filesystem MCP server can access all files in allowed paths")
|
|
243
|
-
}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
2. **Warn about network access**
|
|
247
|
-
```typescript
|
|
248
|
-
if (server.features.includes('network')) {
|
|
249
|
-
warnings.push("â ī¸ Network MCP server can make external requests")
|
|
250
|
-
}
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
3. **Recommend path restrictions**
|
|
254
|
-
```typescript
|
|
255
|
-
recommendations.push("â
Restrict filesystem access to specific directories")
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## đ Performance Metrics
|
|
259
|
-
|
|
260
|
-
- **Average Query Time**: ~1.5 seconds
|
|
261
|
-
- **Cache Hit Rate**: Target > 70%
|
|
262
|
-
- **Success Rate**: Target > 90%
|
|
263
|
-
|
|
264
|
-
## đ Related Agents
|
|
265
|
-
|
|
266
|
-
- **doc-researcher**: Gets MCP documentation
|
|
267
|
-
- **npm-researcher**: Gets NPM package info for MCP servers
|
|
268
|
-
|
|
269
|
-
## đ Related Skills
|
|
270
|
-
|
|
271
|
-
- **layer1-mcp**: Uses MCP server information
|
|
272
|
-
- **domain-cli**: Recommends stdio vs SSE for CLI
|
|
273
|
-
- **domain-web**: Ensures CORS-compatible servers
|
|
274
|
-
|
|
275
|
-
## đ References
|
|
276
|
-
|
|
277
|
-
- [MCP Registry](https://registry.modelcontextprotocol.io)
|
|
278
|
-
- [MCP Specification](https://modelcontextprotocol.io/)
|
|
279
|
-
- [Official MCP Servers](https://github.com/modelcontextprotocol/servers)
|
|
280
|
-
|
|
281
|
-
---
|
|
282
|
-
|
|
283
|
-
**Status**: â
Ready for implementation
|
|
284
|
-
**Priority**: đ´ High
|
|
285
|
-
**Dependencies**: None (can run independently)
|
package/agents/npm-researcher.md
DELETED
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
# Agent: NPM Researcher
|
|
2
|
-
|
|
3
|
-
> **Purpose**: Query npm registry for package information, versions, and metadata
|
|
4
|
-
> **Data Source**: npm registry, unpkg.com, bundlephobia.com
|
|
5
|
-
> **Cache TTL**: 24 hours
|
|
6
|
-
> **Run Mode**: Background
|
|
7
|
-
|
|
8
|
-
## đ¯ What This Agent Does
|
|
9
|
-
|
|
10
|
-
Researches npm packages including versions, dependencies, file sizes, download counts, and installation instructions to help users make informed decisions about package usage.
|
|
11
|
-
|
|
12
|
-
## đ Data Sources
|
|
13
|
-
|
|
14
|
-
### Primary Sources
|
|
15
|
-
- **NPM Registry**: https://www.npmjs.com
|
|
16
|
-
- **Unpkg**: https://unpkg.com (package files explorer)
|
|
17
|
-
- **Bundlephobia**: https://bundlephobia.com (package size analysis)
|
|
18
|
-
- **GitHub**: Repository links from npm packages
|
|
19
|
-
|
|
20
|
-
## đ Research Queries
|
|
21
|
-
|
|
22
|
-
### Common Queries
|
|
23
|
-
```typescript
|
|
24
|
-
// Package info
|
|
25
|
-
"typescript package latest version"
|
|
26
|
-
|
|
27
|
-
// Package size
|
|
28
|
-
"react package size bundlephobia"
|
|
29
|
-
|
|
30
|
-
// Dependencies
|
|
31
|
-
"express dependencies list"
|
|
32
|
-
|
|
33
|
-
// Comparison
|
|
34
|
-
"webpack vs vite comparison"
|
|
35
|
-
|
|
36
|
-
// Installation
|
|
37
|
-
"how to install tailwindcss npm"
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## đ Cache Strategy
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
const CACHE_CONFIG = {
|
|
44
|
-
packageInfo: {
|
|
45
|
-
ttl: 24 * 60 * 60 * 1000, // 24 hours
|
|
46
|
-
key: (packageName) => `npm:${packageName}`
|
|
47
|
-
},
|
|
48
|
-
packageSize: {
|
|
49
|
-
ttl: 7 * 24 * 60 * 60 * 1000, // 7 days (package size stable)
|
|
50
|
-
key: (packageName) => `size:${packageName}`
|
|
51
|
-
},
|
|
52
|
-
dependencies: {
|
|
53
|
-
ttl: 24 * 60 * 60 * 1000, // 24 hours
|
|
54
|
-
key: (packageName) => `deps:${packageName}`
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
**Rationale**: Package metadata can change daily (new versions), but package size and structure are relatively stable.
|
|
60
|
-
|
|
61
|
-
## đ Workflow
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
User Query: "Tell me about the vite package"
|
|
65
|
-
â
|
|
66
|
-
1. Check Cache
|
|
67
|
-
â
|
|
68
|
-
2. If Cache Hit (< 24h old)
|
|
69
|
-
â Return cached package info
|
|
70
|
-
â
|
|
71
|
-
3. If Cache Miss or Expired
|
|
72
|
-
â Query npm registry
|
|
73
|
-
â Get package metadata
|
|
74
|
-
â Fetch size from Bundlephobia
|
|
75
|
-
â Parse dependencies
|
|
76
|
-
â Store in cache
|
|
77
|
-
â Return to user
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## đ Output Format
|
|
81
|
-
|
|
82
|
-
```typescript
|
|
83
|
-
interface NpmPackageInfo {
|
|
84
|
-
name: string
|
|
85
|
-
version: string
|
|
86
|
-
description: string
|
|
87
|
-
author: string
|
|
88
|
-
license: string
|
|
89
|
-
homepage: string
|
|
90
|
-
repository: {
|
|
91
|
-
type: string
|
|
92
|
-
url: string
|
|
93
|
-
}
|
|
94
|
-
keywords: string[]
|
|
95
|
-
dependencies?: Record<string, string>
|
|
96
|
-
devDependencies?: Record<string, string>
|
|
97
|
-
size?: {
|
|
98
|
-
gzip: string
|
|
99
|
-
size: string
|
|
100
|
-
}
|
|
101
|
-
weeklyDownloads: number
|
|
102
|
-
lastUpdated: Date
|
|
103
|
-
cacheHit: boolean
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
interface PackageComparison {
|
|
107
|
-
packages: NpmPackageInfo[]
|
|
108
|
-
comparison: {
|
|
109
|
-
smallest: string
|
|
110
|
-
largest: string
|
|
111
|
-
mostPopular: string
|
|
112
|
-
newest: string
|
|
113
|
-
}
|
|
114
|
-
recommendation: string
|
|
115
|
-
}
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## đ¯ Key Features
|
|
119
|
-
|
|
120
|
-
### 1. Package Metadata
|
|
121
|
-
- Latest version
|
|
122
|
-
- Description and keywords
|
|
123
|
-
- Author and license
|
|
124
|
-
- Repository link
|
|
125
|
-
- Weekly downloads
|
|
126
|
-
|
|
127
|
-
### 2. Size Analysis
|
|
128
|
-
- Minified size
|
|
129
|
-
- Gzip size
|
|
130
|
-
- Dependency tree size
|
|
131
|
-
- Impact on bundle size
|
|
132
|
-
|
|
133
|
-
### 3. Dependency Analysis
|
|
134
|
-
- Production dependencies
|
|
135
|
-
- Dev dependencies
|
|
136
|
-
- Peer dependencies
|
|
137
|
-
- Dependency tree visualization
|
|
138
|
-
|
|
139
|
-
### 4. Package Comparison
|
|
140
|
-
```typescript
|
|
141
|
-
function comparePackages(packages: string[]): PackageComparison {
|
|
142
|
-
const infos = await Promise.all(
|
|
143
|
-
packages.map(pkg => fetchPackageInfo(pkg))
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
return {
|
|
147
|
-
packages: infos,
|
|
148
|
-
comparison: {
|
|
149
|
-
smallest: sortBySize(infos)[0].name,
|
|
150
|
-
largest: sortBySize(infos)[infos.length - 1].name,
|
|
151
|
-
mostPopular: sortByDownloads(infos)[0].name,
|
|
152
|
-
newest: sortByDate(infos)[0].name
|
|
153
|
-
},
|
|
154
|
-
recommendation: generateRecommendation(infos)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## đ Query Examples
|
|
160
|
-
|
|
161
|
-
### Example 1: Package Information
|
|
162
|
-
```
|
|
163
|
-
User: "Tell me about vite"
|
|
164
|
-
â
|
|
165
|
-
Agent: npm-researcher
|
|
166
|
-
â
|
|
167
|
-
Query: "vite npm package info"
|
|
168
|
-
â
|
|
169
|
-
Output:
|
|
170
|
-
{
|
|
171
|
-
"name": "vite",
|
|
172
|
-
"version": "5.0.0",
|
|
173
|
-
"description": "Next generation frontend tooling",
|
|
174
|
-
"author": "Evan You",
|
|
175
|
-
"license": "MIT",
|
|
176
|
-
"size": {
|
|
177
|
-
"gzip": "56.3 kB",
|
|
178
|
-
"size": "185.2 kB"
|
|
179
|
-
},
|
|
180
|
-
"weeklyDownloads": 4250000,
|
|
181
|
-
"dependencies": {
|
|
182
|
-
"esbuild": "^0.19.0",
|
|
183
|
-
"postcss": "^8.4.0"
|
|
184
|
-
},
|
|
185
|
-
"installation": "npm install -D vite"
|
|
186
|
-
}
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Example 2: Package Comparison
|
|
190
|
-
```
|
|
191
|
-
User: "Compare webpack and vite"
|
|
192
|
-
â
|
|
193
|
-
Agent: npm-researcher
|
|
194
|
-
â
|
|
195
|
-
Query: "webpack vs vite comparison bundle size"
|
|
196
|
-
â
|
|
197
|
-
Output:
|
|
198
|
-
{
|
|
199
|
-
"packages": [webpack_info, vite_info],
|
|
200
|
-
"comparison": {
|
|
201
|
-
"smallest": "vite (56 kB gzip)",
|
|
202
|
-
"largest": "webpack (420 kB gzip)",
|
|
203
|
-
"mostPopular": "vite (4.2M weekly downloads)",
|
|
204
|
-
"fastestBuild": "vite (10-100x faster)"
|
|
205
|
-
},
|
|
206
|
-
"recommendation": "â
Use Vite for new projects (smaller, faster, modern). Use Webpack if you need extensive plugin ecosystem."
|
|
207
|
-
}
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### Example 3: Dependency Analysis
|
|
211
|
-
```
|
|
212
|
-
User: "What are express dependencies?"
|
|
213
|
-
â
|
|
214
|
-
Agent: npm-researcher
|
|
215
|
-
â
|
|
216
|
-
Query: "express npm dependencies"
|
|
217
|
-
â
|
|
218
|
-
Output:
|
|
219
|
-
{
|
|
220
|
-
"name": "express",
|
|
221
|
-
"version": "4.18.2",
|
|
222
|
-
"dependencies": {
|
|
223
|
-
"accepts": "~1.3.8",
|
|
224
|
-
"array-flatten": "1.1.1",
|
|
225
|
-
"body-parser": "1.20.1",
|
|
226
|
-
"content-disposition": "0.5.4",
|
|
227
|
-
// ... more dependencies
|
|
228
|
-
},
|
|
229
|
-
"dependencyCount": 27,
|
|
230
|
-
"totalTreeSize": "~2.1 MB",
|
|
231
|
-
"warnings": [
|
|
232
|
-
"â ī¸ Some dependencies may have security vulnerabilities",
|
|
233
|
-
"âšī¸ Consider using fastify instead (smaller, faster)"
|
|
234
|
-
]
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## đ Package Size Impact
|
|
239
|
-
|
|
240
|
-
```typescript
|
|
241
|
-
function analyzeSizeImpact(packageName: string): SizeImpact {
|
|
242
|
-
return {
|
|
243
|
-
package: packageName,
|
|
244
|
-
minified: "185.2 kB",
|
|
245
|
-
gzip: "56.3 kB",
|
|
246
|
-
impact: {
|
|
247
|
-
low: "â
Small impact on bundle size",
|
|
248
|
-
medium: "â ī¸ Moderate impact, consider code splitting",
|
|
249
|
-
high: "â Large impact, may affect load time"
|
|
250
|
-
},
|
|
251
|
-
alternatives: [
|
|
252
|
-
{ name: "alternative-1", size: "25 kB gzip" },
|
|
253
|
-
{ name: "alternative-2", size: "38 kB gzip" }
|
|
254
|
-
]
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## đ¯ Installation Guidance
|
|
260
|
-
|
|
261
|
-
### Standard Installation
|
|
262
|
-
```bash
|
|
263
|
-
# Production dependency
|
|
264
|
-
npm install package-name
|
|
265
|
-
|
|
266
|
-
# Development dependency
|
|
267
|
-
npm install -D package-name
|
|
268
|
-
|
|
269
|
-
# Global installation
|
|
270
|
-
npm install -g package-name
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### Version Specification
|
|
274
|
-
```bash
|
|
275
|
-
# Latest version
|
|
276
|
-
npm install package-name
|
|
277
|
-
|
|
278
|
-
# Specific version
|
|
279
|
-
npm install package-name@1.2.3
|
|
280
|
-
|
|
281
|
-
# Major version
|
|
282
|
-
npm install package-name@^2.0.0
|
|
283
|
-
|
|
284
|
-
# Compatible with version range
|
|
285
|
-
npm install package-name@~1.2.0
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
## âī¸ Configuration
|
|
289
|
-
|
|
290
|
-
```json
|
|
291
|
-
{
|
|
292
|
-
"agent": "npm-researcher",
|
|
293
|
-
"runMode": "background",
|
|
294
|
-
"cache": {
|
|
295
|
-
"enabled": true,
|
|
296
|
-
"ttl": 86400000
|
|
297
|
-
},
|
|
298
|
-
"sources": [
|
|
299
|
-
"https://www.npmjs.com",
|
|
300
|
-
"https://unpkg.com",
|
|
301
|
-
"https://bundlephobia.com"
|
|
302
|
-
]
|
|
303
|
-
}
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
## đĢ Error Handling
|
|
307
|
-
|
|
308
|
-
```typescript
|
|
309
|
-
async function fetchPackageInfo(packageName: string): Promise<NpmPackageInfo> {
|
|
310
|
-
try {
|
|
311
|
-
const metadata = await fetchFromNPM(packageName)
|
|
312
|
-
const size = await fetchFromBundlephobia(packageName)
|
|
313
|
-
|
|
314
|
-
return {
|
|
315
|
-
...metadata,
|
|
316
|
-
size
|
|
317
|
-
}
|
|
318
|
-
} catch (error) {
|
|
319
|
-
// Fallback to cache
|
|
320
|
-
const cached = await getFromCache(`npm:${packageName}`)
|
|
321
|
-
if (cached) {
|
|
322
|
-
return {
|
|
323
|
-
...cached,
|
|
324
|
-
warning: 'â ī¸ Using cached data (fetch failed)'
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Try scoped search
|
|
329
|
-
const searchResult = await searchNPM(packageName)
|
|
330
|
-
if (searchResult) {
|
|
331
|
-
return searchResult
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
throw new Error(`Package not found: ${packageName}`)
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
```
|
|
338
|
-
|
|
339
|
-
## đ Performance Metrics
|
|
340
|
-
|
|
341
|
-
- **Average Query Time**: ~1 second
|
|
342
|
-
- **Cache Hit Rate**: Target > 75%
|
|
343
|
-
- **Success Rate**: Target > 95%
|
|
344
|
-
|
|
345
|
-
## đ Privacy & Security
|
|
346
|
-
|
|
347
|
-
### Security Checks
|
|
348
|
-
```typescript
|
|
349
|
-
function checkSecurity(packageName: string): SecurityReport {
|
|
350
|
-
return {
|
|
351
|
-
vulnerabilities: checkKnownVulnerabilities(packageName),
|
|
352
|
-
deprecated: checkIfDeprecated(packageName),
|
|
353
|
-
licenseIssues: checkLicenseCompatibility(packageName),
|
|
354
|
-
maintenance: {
|
|
355
|
-
lastUpdate: getLastUpdateDate(packageName),
|
|
356
|
-
isActive: isActivePackage(packageName),
|
|
357
|
-
hasIssues: hasOpenSecurityIssues(packageName)
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
## đ Related Agents
|
|
364
|
-
|
|
365
|
-
- **version-checker**: Latest version information
|
|
366
|
-
- **doc-researcher**: Package documentation
|
|
367
|
-
|
|
368
|
-
## đ Related Skills
|
|
369
|
-
|
|
370
|
-
- **layer2-best-practices**: Package selection best practices
|
|
371
|
-
- **domain-web**: Frontend package recommendations
|
|
372
|
-
|
|
373
|
-
## đ References
|
|
374
|
-
|
|
375
|
-
- [NPM Registry](https://www.npmjs.com)
|
|
376
|
-
- [Bundlephobia](https://bundlephobia.com)
|
|
377
|
-
- [Unpkg](https://unpkg.com)
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
**Status**: â
Ready for implementation
|
|
382
|
-
**Priority**: đĄ Medium
|
|
383
|
-
**Dependencies**: None (can run independently)
|