project-graph-mcp 1.5.0 → 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/README.md +171 -31
- package/docs/img/explorer-compact.jpg +0 -0
- package/docs/img/explorer-expanded.jpg +0 -0
- package/package.json +12 -8
- package/src/.project-graph-cache.json +1 -1
- package/src/analysis/analysis-cache.js +7 -0
- package/src/analysis/complexity.js +14 -0
- package/src/analysis/custom-rules.js +36 -0
- package/src/analysis/db-analysis.js +9 -0
- package/src/analysis/dead-code.js +19 -0
- package/src/analysis/full-analysis.js +18 -0
- package/src/analysis/jsdoc-checker.js +24 -0
- package/src/analysis/jsdoc-generator.js +10 -0
- package/src/analysis/large-files.js +11 -0
- package/src/analysis/outdated-patterns.js +12 -0
- package/src/analysis/similar-functions.js +16 -0
- package/src/analysis/test-annotations.js +21 -0
- package/src/analysis/type-checker.js +8 -0
- package/src/analysis/undocumented.js +14 -0
- package/src/cli/cli-handlers.js +4 -0
- package/src/cli/cli.js +5 -0
- package/src/compact/.project-graph-cache.json +1 -0
- package/src/compact/ai-context.js +7 -0
- package/src/compact/compact-migrate.js +17 -0
- package/src/compact/compact.js +18 -0
- package/src/compact/compress.js +14 -0
- package/src/compact/ctx-to-jsdoc.js +29 -0
- package/src/compact/doc-dialect.js +30 -0
- package/src/compact/expand.js +37 -0
- package/src/compact/framework-references.js +5 -0
- package/src/compact/instructions.js +3 -0
- package/src/compact/mode-config.js +8 -0
- package/src/compact/validate-pipeline.js +9 -0
- package/src/core/event-bus.js +9 -0
- package/src/core/filters.js +14 -0
- package/src/core/graph-builder.js +12 -0
- package/src/core/parser.js +31 -0
- package/src/core/workspace.js +8 -0
- package/src/lang/lang-go.js +17 -0
- package/src/lang/lang-python.js +12 -0
- package/src/lang/lang-sql.js +23 -0
- package/src/lang/lang-typescript.js +9 -0
- package/src/lang/lang-utils.js +4 -0
- package/src/mcp/mcp-server.js +17 -0
- package/src/mcp/tool-defs.js +3 -0
- package/src/mcp/tools.js +25 -0
- package/src/network/backend-lifecycle.js +19 -0
- package/src/network/backend.js +5 -0
- package/src/network/local-gateway.js +23 -0
- package/src/network/mdns.js +13 -0
- package/src/network/server.js +10 -0
- package/src/network/web-server.js +34 -0
- package/web/.project-graph-cache.json +1 -0
- package/web/app.js +17 -0
- package/web/components/code-block.js +3 -0
- package/web/components/quick-open.js +5 -0
- package/web/dashboard-state.js +3 -0
- package/web/dashboard.html +27 -0
- package/web/dashboard.js +8 -0
- package/web/highlight.js +13 -0
- package/web/index.html +35 -0
- package/web/panels/ActionBoard/ActionBoard.css.js +1 -0
- package/web/panels/ActionBoard/ActionBoard.js +4 -0
- package/web/panels/ActionBoard/ActionBoard.tpl.js +1 -0
- package/web/panels/EventItem/EventItem.css.js +1 -0
- package/web/panels/EventItem/EventItem.js +4 -0
- package/web/panels/EventItem/EventItem.tpl.js +1 -0
- package/web/panels/ProjectItem/ProjectItem.css.js +1 -0
- package/web/panels/ProjectItem/ProjectItem.js +5 -0
- package/web/panels/ProjectItem/ProjectItem.tpl.js +1 -0
- package/web/panels/ProjectList/ProjectList.css.js +1 -0
- package/web/panels/ProjectList/ProjectList.js +4 -0
- package/web/panels/ProjectList/ProjectList.tpl.js +1 -0
- package/web/panels/SettingsPanel/.project-graph-cache.json +1 -0
- package/web/panels/SettingsPanel/SettingsPanel.css.js +1 -0
- package/web/panels/SettingsPanel/SettingsPanel.js +7 -0
- package/web/panels/SettingsPanel/SettingsPanel.tpl.js +1 -0
- package/web/panels/code-viewer.js +5 -0
- package/web/panels/ctx-panel.js +4 -0
- package/web/panels/dep-graph.js +6 -0
- package/web/panels/file-tree.js +188 -0
- package/web/panels/health-panel.js +3 -0
- package/web/panels/live-monitor.js +3 -0
- package/web/state.js +17 -0
- package/web/style.css +157 -0
- package/references/symbiote-3x.md +0 -834
- package/src/ai-context.js +0 -113
- package/src/analysis-cache.js +0 -155
- package/src/cli-handlers.js +0 -271
- package/src/cli.js +0 -95
- package/src/compact.js +0 -207
- package/src/complexity.js +0 -237
- package/src/compress.js +0 -319
- package/src/ctx-to-jsdoc.js +0 -514
- package/src/custom-rules.js +0 -584
- package/src/db-analysis.js +0 -194
- package/src/dead-code.js +0 -468
- package/src/doc-dialect.js +0 -716
- package/src/filters.js +0 -227
- package/src/framework-references.js +0 -177
- package/src/full-analysis.js +0 -470
- package/src/graph-builder.js +0 -299
- package/src/instructions.js +0 -73
- package/src/jsdoc-checker.js +0 -351
- package/src/jsdoc-generator.js +0 -203
- package/src/lang-go.js +0 -285
- package/src/lang-python.js +0 -197
- package/src/lang-sql.js +0 -309
- package/src/lang-typescript.js +0 -190
- package/src/lang-utils.js +0 -124
- package/src/large-files.js +0 -163
- package/src/mcp-server.js +0 -675
- package/src/mode-config.js +0 -127
- package/src/outdated-patterns.js +0 -296
- package/src/parser.js +0 -662
- package/src/server.js +0 -28
- package/src/similar-functions.js +0 -279
- package/src/test-annotations.js +0 -323
- package/src/tool-defs.js +0 -793
- package/src/tools.js +0 -470
- package/src/type-checker.js +0 -188
- package/src/undocumented.js +0 -259
- package/src/workspace.js +0 -70
- /package/{AGENT_ROLE.md → docs/examples/AGENT_ROLE.md} +0 -0
- /package/{AGENT_ROLE_MINIMAL.md → docs/examples/AGENT_ROLE_MINIMAL.md} +0 -0
package/src/tool-defs.js
DELETED
|
@@ -1,793 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tool Definitions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export const TOOLS = [
|
|
6
|
-
// Graph Tools
|
|
7
|
-
{
|
|
8
|
-
name: 'get_skeleton',
|
|
9
|
-
description: 'Get compact minified project overview (10-50x smaller than source). Returns legend, stats, and node summaries.',
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: 'object',
|
|
12
|
-
properties: {
|
|
13
|
-
path: {
|
|
14
|
-
type: 'string',
|
|
15
|
-
description: 'Path to scan (e.g., "src/components")',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
required: ['path'],
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'get_focus_zone',
|
|
23
|
-
description: 'Get enriched context for recently modified files. Auto-detects from git or accepts explicit file list.',
|
|
24
|
-
inputSchema: {
|
|
25
|
-
type: 'object',
|
|
26
|
-
properties: {
|
|
27
|
-
path: { type: 'string' },
|
|
28
|
-
recentFiles: {
|
|
29
|
-
type: 'array',
|
|
30
|
-
items: { type: 'string' },
|
|
31
|
-
description: 'Explicit list of files to expand',
|
|
32
|
-
},
|
|
33
|
-
useGitDiff: {
|
|
34
|
-
type: 'boolean',
|
|
35
|
-
description: 'Auto-detect from git diff',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
name: 'expand',
|
|
42
|
-
description: 'Expand a minified symbol to full details. Use "SN" for class or "SN.tP" for specific method.',
|
|
43
|
-
inputSchema: {
|
|
44
|
-
type: 'object',
|
|
45
|
-
properties: {
|
|
46
|
-
symbol: {
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Minified symbol (e.g., "SN" or "SN.tP")',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
required: ['symbol'],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
name: 'deps',
|
|
56
|
-
description: 'Get dependency tree for a symbol. Shows imports, usedBy, and calls.',
|
|
57
|
-
inputSchema: {
|
|
58
|
-
type: 'object',
|
|
59
|
-
properties: {
|
|
60
|
-
symbol: { type: 'string' },
|
|
61
|
-
},
|
|
62
|
-
required: ['symbol'],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'usages',
|
|
67
|
-
description: 'Find all usages of a symbol across the project.',
|
|
68
|
-
inputSchema: {
|
|
69
|
-
type: 'object',
|
|
70
|
-
properties: {
|
|
71
|
-
symbol: { type: 'string' },
|
|
72
|
-
},
|
|
73
|
-
required: ['symbol'],
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'get_call_chain',
|
|
78
|
-
description: 'Find the shortest call chain from one function/class to another through the dependency graph.',
|
|
79
|
-
inputSchema: {
|
|
80
|
-
type: 'object',
|
|
81
|
-
properties: {
|
|
82
|
-
from: { type: 'string', description: 'Starting symbol (e.g., "authMiddleware")' },
|
|
83
|
-
to: { type: 'string', description: 'Target symbol (e.g., "renderDashboard")' },
|
|
84
|
-
path: { type: 'string', description: 'Path to scan (optional)' }
|
|
85
|
-
},
|
|
86
|
-
required: ['from', 'to'],
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'invalidate_cache',
|
|
91
|
-
description: 'Invalidate the cached graph. Use after making code changes.',
|
|
92
|
-
inputSchema: {
|
|
93
|
-
type: 'object',
|
|
94
|
-
properties: {},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
// Test Checklist Tools
|
|
99
|
-
{
|
|
100
|
-
name: 'get_pending_tests',
|
|
101
|
-
description: 'Get list of pending tests from ## Tests sections in .ctx.md files.',
|
|
102
|
-
inputSchema: {
|
|
103
|
-
type: 'object',
|
|
104
|
-
properties: {
|
|
105
|
-
path: { type: 'string', description: 'Path to scan (e.g., "src/components")' },
|
|
106
|
-
},
|
|
107
|
-
required: ['path'],
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
name: 'mark_test_passed',
|
|
112
|
-
description: 'Mark a test step as passed. Use the test ID returned by get_pending_tests.',
|
|
113
|
-
inputSchema: {
|
|
114
|
-
type: 'object',
|
|
115
|
-
properties: {
|
|
116
|
-
testId: { type: 'string', description: 'Test ID (e.g., "togglePin.0")' },
|
|
117
|
-
},
|
|
118
|
-
required: ['testId'],
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'mark_test_failed',
|
|
123
|
-
description: 'Mark a test step as failed with a reason.',
|
|
124
|
-
inputSchema: {
|
|
125
|
-
type: 'object',
|
|
126
|
-
properties: {
|
|
127
|
-
testId: { type: 'string' },
|
|
128
|
-
reason: { type: 'string', description: 'Why the test failed' },
|
|
129
|
-
},
|
|
130
|
-
required: ['testId', 'reason'],
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: 'get_test_summary',
|
|
135
|
-
description: 'Get summary of test progress: passed, failed, pending counts.',
|
|
136
|
-
inputSchema: {
|
|
137
|
-
type: 'object',
|
|
138
|
-
properties: {
|
|
139
|
-
path: { type: 'string' },
|
|
140
|
-
},
|
|
141
|
-
required: ['path'],
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
name: 'reset_test_state',
|
|
146
|
-
description: 'Reset all test progress to start fresh.',
|
|
147
|
-
inputSchema: {
|
|
148
|
-
type: 'object',
|
|
149
|
-
properties: {},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
// Filter Configuration Tools
|
|
154
|
-
{
|
|
155
|
-
name: 'get_filters',
|
|
156
|
-
description: 'Get current filter configuration (excluded dirs, patterns, gitignore status).',
|
|
157
|
-
inputSchema: {
|
|
158
|
-
type: 'object',
|
|
159
|
-
properties: {},
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: 'set_filters',
|
|
164
|
-
description: 'Update filter configuration. Pass only fields you want to change.',
|
|
165
|
-
inputSchema: {
|
|
166
|
-
type: 'object',
|
|
167
|
-
properties: {
|
|
168
|
-
excludeDirs: {
|
|
169
|
-
type: 'array',
|
|
170
|
-
items: { type: 'string' },
|
|
171
|
-
description: 'Directories to exclude (replaces current list)',
|
|
172
|
-
},
|
|
173
|
-
excludePatterns: {
|
|
174
|
-
type: 'array',
|
|
175
|
-
items: { type: 'string' },
|
|
176
|
-
description: 'File patterns to exclude (e.g., "*.test.js")',
|
|
177
|
-
},
|
|
178
|
-
includeHidden: {
|
|
179
|
-
type: 'boolean',
|
|
180
|
-
description: 'Include hidden directories (starting with .)',
|
|
181
|
-
},
|
|
182
|
-
useGitignore: {
|
|
183
|
-
type: 'boolean',
|
|
184
|
-
description: 'Parse and use .gitignore patterns',
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: 'add_excludes',
|
|
191
|
-
description: 'Add directories to exclude list without replacing.',
|
|
192
|
-
inputSchema: {
|
|
193
|
-
type: 'object',
|
|
194
|
-
properties: {
|
|
195
|
-
dirs: {
|
|
196
|
-
type: 'array',
|
|
197
|
-
items: { type: 'string' },
|
|
198
|
-
description: 'Directories to add to exclude list',
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
required: ['dirs'],
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: 'remove_excludes',
|
|
206
|
-
description: 'Remove directories from exclude list.',
|
|
207
|
-
inputSchema: {
|
|
208
|
-
type: 'object',
|
|
209
|
-
properties: {
|
|
210
|
-
dirs: {
|
|
211
|
-
type: 'array',
|
|
212
|
-
items: { type: 'string' },
|
|
213
|
-
description: 'Directories to remove from exclude list',
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
required: ['dirs'],
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: 'reset_filters',
|
|
221
|
-
description: 'Reset filters to default configuration.',
|
|
222
|
-
inputSchema: {
|
|
223
|
-
type: 'object',
|
|
224
|
-
properties: {},
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
// Guidelines
|
|
229
|
-
{
|
|
230
|
-
name: 'get_usage_guide',
|
|
231
|
-
description: [
|
|
232
|
-
'Get the comprehensive usage guide for project-graph with examples and best practices.',
|
|
233
|
-
'Call this FIRST when planning how to analyze, navigate, or audit a codebase.',
|
|
234
|
-
'Returns practical examples and recommended workflow for each feature area.',
|
|
235
|
-
'',
|
|
236
|
-
'Available topics: navigation, analysis, testing, documentation, rules, workflow.',
|
|
237
|
-
'Omit topic to get the full guide.',
|
|
238
|
-
].join('\n'),
|
|
239
|
-
inputSchema: {
|
|
240
|
-
type: 'object',
|
|
241
|
-
properties: {
|
|
242
|
-
topic: {
|
|
243
|
-
type: 'string',
|
|
244
|
-
description: 'Optional topic filter: navigation, analysis, testing, documentation, rules, workflow',
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: 'get_agent_instructions',
|
|
251
|
-
description: 'Get coding guidelines, architectural standards, and JSDoc rules for this project.',
|
|
252
|
-
inputSchema: {
|
|
253
|
-
type: 'object',
|
|
254
|
-
properties: {},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
// Documentation Analysis
|
|
259
|
-
{
|
|
260
|
-
name: 'get_undocumented',
|
|
261
|
-
description: 'Find classes/functions missing JSDoc annotations. Use for documentation generation.',
|
|
262
|
-
inputSchema: {
|
|
263
|
-
type: 'object',
|
|
264
|
-
properties: {
|
|
265
|
-
path: {
|
|
266
|
-
type: 'string',
|
|
267
|
-
description: 'Path to scan (e.g., "src/components")',
|
|
268
|
-
},
|
|
269
|
-
level: {
|
|
270
|
-
type: 'string',
|
|
271
|
-
enum: ['tests', 'params', 'all'],
|
|
272
|
-
description: 'Strictness: tests (default) = .ctx.md checklists, params = +@param/@returns, all = +description',
|
|
273
|
-
},
|
|
274
|
-
},
|
|
275
|
-
required: ['path'],
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
-
// Code Quality
|
|
280
|
-
{
|
|
281
|
-
name: 'get_dead_code',
|
|
282
|
-
description: 'Find unused functions, classes, exports, variables, and imports (dead code). Use for cleanup.',
|
|
283
|
-
inputSchema: {
|
|
284
|
-
type: 'object',
|
|
285
|
-
properties: {
|
|
286
|
-
path: {
|
|
287
|
-
type: 'string',
|
|
288
|
-
description: 'Path to scan (e.g., "src/")',
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
required: ['path'],
|
|
292
|
-
},
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
name: 'generate_jsdoc',
|
|
296
|
-
description: 'Generate JSDoc template for a file or specific function. Returns ready-to-use JSDoc blocks.',
|
|
297
|
-
inputSchema: {
|
|
298
|
-
type: 'object',
|
|
299
|
-
properties: {
|
|
300
|
-
path: {
|
|
301
|
-
type: 'string',
|
|
302
|
-
description: 'Path to JS file',
|
|
303
|
-
},
|
|
304
|
-
name: {
|
|
305
|
-
type: 'string',
|
|
306
|
-
description: 'Optional: specific function/method name',
|
|
307
|
-
},
|
|
308
|
-
},
|
|
309
|
-
required: ['path'],
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
name: 'get_similar_functions',
|
|
314
|
-
description: 'Find functionally similar functions (potential duplicates). Returns pairs with similarity score.',
|
|
315
|
-
inputSchema: {
|
|
316
|
-
type: 'object',
|
|
317
|
-
properties: {
|
|
318
|
-
path: {
|
|
319
|
-
type: 'string',
|
|
320
|
-
description: 'Path to scan (e.g., "src/")',
|
|
321
|
-
},
|
|
322
|
-
threshold: {
|
|
323
|
-
type: 'number',
|
|
324
|
-
description: 'Minimum similarity percentage (default: 60)',
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
required: ['path'],
|
|
328
|
-
},
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
name: 'get_complexity',
|
|
332
|
-
description: 'Analyze cyclomatic complexity of functions. Identifies high-complexity code needing refactoring.',
|
|
333
|
-
inputSchema: {
|
|
334
|
-
type: 'object',
|
|
335
|
-
properties: {
|
|
336
|
-
path: {
|
|
337
|
-
type: 'string',
|
|
338
|
-
description: 'Path to scan (e.g., "src/")',
|
|
339
|
-
},
|
|
340
|
-
minComplexity: {
|
|
341
|
-
type: 'number',
|
|
342
|
-
description: 'Minimum complexity to include (default: 1)',
|
|
343
|
-
},
|
|
344
|
-
onlyProblematic: {
|
|
345
|
-
type: 'boolean',
|
|
346
|
-
description: 'Only show high/critical items',
|
|
347
|
-
},
|
|
348
|
-
},
|
|
349
|
-
required: ['path'],
|
|
350
|
-
},
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
name: 'get_large_files',
|
|
354
|
-
description: 'Find files that may need splitting. Analyzes lines, functions, classes, and exports.',
|
|
355
|
-
inputSchema: {
|
|
356
|
-
type: 'object',
|
|
357
|
-
properties: {
|
|
358
|
-
path: {
|
|
359
|
-
type: 'string',
|
|
360
|
-
description: 'Path to scan (e.g., "src/")',
|
|
361
|
-
},
|
|
362
|
-
onlyProblematic: {
|
|
363
|
-
type: 'boolean',
|
|
364
|
-
description: 'Only show warning/critical files',
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
required: ['path'],
|
|
368
|
-
},
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
name: 'get_outdated_patterns',
|
|
372
|
-
description: 'Find legacy code patterns and redundant npm dependencies (now built into Node.js 18+).',
|
|
373
|
-
inputSchema: {
|
|
374
|
-
type: 'object',
|
|
375
|
-
properties: {
|
|
376
|
-
path: {
|
|
377
|
-
type: 'string',
|
|
378
|
-
description: 'Path to scan (e.g., "src/" or ".")',
|
|
379
|
-
},
|
|
380
|
-
codeOnly: {
|
|
381
|
-
type: 'boolean',
|
|
382
|
-
description: 'Only check code patterns',
|
|
383
|
-
},
|
|
384
|
-
depsOnly: {
|
|
385
|
-
type: 'boolean',
|
|
386
|
-
description: 'Only check package.json dependencies',
|
|
387
|
-
},
|
|
388
|
-
},
|
|
389
|
-
required: ['path'],
|
|
390
|
-
},
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
name: 'get_full_analysis',
|
|
394
|
-
description: 'Run ALL code quality checks at once. Returns combined report with Health Score (0-100).',
|
|
395
|
-
inputSchema: {
|
|
396
|
-
type: 'object',
|
|
397
|
-
properties: {
|
|
398
|
-
path: {
|
|
399
|
-
type: 'string',
|
|
400
|
-
description: 'Path to scan (e.g., "src/" or ".")',
|
|
401
|
-
},
|
|
402
|
-
includeItems: {
|
|
403
|
-
type: 'boolean',
|
|
404
|
-
description: 'Include individual items in report',
|
|
405
|
-
},
|
|
406
|
-
},
|
|
407
|
-
required: ['path'],
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
name: 'get_custom_rules',
|
|
412
|
-
description: 'List all custom code analysis rules. Rules are stored in JSON files in rules/ directory.',
|
|
413
|
-
inputSchema: {
|
|
414
|
-
type: 'object',
|
|
415
|
-
properties: {},
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
{
|
|
419
|
-
name: 'set_custom_rule',
|
|
420
|
-
description: 'Add or update a custom code analysis rule. Creates ruleset if it does not exist.',
|
|
421
|
-
inputSchema: {
|
|
422
|
-
type: 'object',
|
|
423
|
-
properties: {
|
|
424
|
-
ruleSet: {
|
|
425
|
-
type: 'string',
|
|
426
|
-
description: 'Name of ruleset (e.g., "symbiote", "react", "custom")',
|
|
427
|
-
},
|
|
428
|
-
rule: {
|
|
429
|
-
type: 'object',
|
|
430
|
-
description: 'Rule definition with id, name, description, pattern, patternType, replacement, severity, filePattern',
|
|
431
|
-
},
|
|
432
|
-
},
|
|
433
|
-
required: ['ruleSet', 'rule'],
|
|
434
|
-
},
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
name: 'check_custom_rules',
|
|
438
|
-
description: 'Run custom rules analysis on a directory. Returns violations found.',
|
|
439
|
-
inputSchema: {
|
|
440
|
-
type: 'object',
|
|
441
|
-
properties: {
|
|
442
|
-
path: {
|
|
443
|
-
type: 'string',
|
|
444
|
-
description: 'Path to scan',
|
|
445
|
-
},
|
|
446
|
-
ruleSet: {
|
|
447
|
-
type: 'string',
|
|
448
|
-
description: 'Optional: specific ruleset to use',
|
|
449
|
-
},
|
|
450
|
-
severity: {
|
|
451
|
-
type: 'string',
|
|
452
|
-
description: 'Optional: filter by severity (error/warning/info)',
|
|
453
|
-
},
|
|
454
|
-
},
|
|
455
|
-
required: ['path'],
|
|
456
|
-
},
|
|
457
|
-
},
|
|
458
|
-
|
|
459
|
-
// Framework References
|
|
460
|
-
{
|
|
461
|
-
name: 'get_framework_reference',
|
|
462
|
-
description: 'Get framework-specific AI reference documentation. Auto-detects framework from project or accepts explicit name. Returns full API reference, patterns, and common mistakes as agent context.',
|
|
463
|
-
inputSchema: {
|
|
464
|
-
type: 'object',
|
|
465
|
-
properties: {
|
|
466
|
-
framework: {
|
|
467
|
-
type: 'string',
|
|
468
|
-
description: 'Framework reference name (e.g., "symbiote-3x"). If omitted, auto-detects from path.',
|
|
469
|
-
},
|
|
470
|
-
path: {
|
|
471
|
-
type: 'string',
|
|
472
|
-
description: 'Project path for auto-detection (e.g., "src/")',
|
|
473
|
-
},
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
// Database Analysis
|
|
479
|
-
{
|
|
480
|
-
name: 'get_db_schema',
|
|
481
|
-
description: 'Get database schema from SQL files. Extracts tables, columns, and types from schema.sql or migration files in the project.',
|
|
482
|
-
inputSchema: {
|
|
483
|
-
type: 'object',
|
|
484
|
-
properties: {
|
|
485
|
-
path: {
|
|
486
|
-
type: 'string',
|
|
487
|
-
description: 'Path to scan (e.g., "." or "database/")',
|
|
488
|
-
},
|
|
489
|
-
},
|
|
490
|
-
required: ['path'],
|
|
491
|
-
},
|
|
492
|
-
},
|
|
493
|
-
{
|
|
494
|
-
name: 'get_table_usage',
|
|
495
|
-
description: 'Show which functions read/write database tables. Traces SQL queries in JS/TS/Python/Go code to table references.',
|
|
496
|
-
inputSchema: {
|
|
497
|
-
type: 'object',
|
|
498
|
-
properties: {
|
|
499
|
-
path: {
|
|
500
|
-
type: 'string',
|
|
501
|
-
description: 'Path to scan (e.g., "src/")',
|
|
502
|
-
},
|
|
503
|
-
table: {
|
|
504
|
-
type: 'string',
|
|
505
|
-
description: 'Optional: filter to a specific table name',
|
|
506
|
-
},
|
|
507
|
-
},
|
|
508
|
-
required: ['path'],
|
|
509
|
-
},
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
name: 'get_db_dead_tables',
|
|
513
|
-
description: 'Find tables and columns defined in schema but never referenced in code queries. Requires .sql schema files in the project.',
|
|
514
|
-
inputSchema: {
|
|
515
|
-
type: 'object',
|
|
516
|
-
properties: {
|
|
517
|
-
path: {
|
|
518
|
-
type: 'string',
|
|
519
|
-
description: 'Path to scan (e.g., ".")',
|
|
520
|
-
},
|
|
521
|
-
},
|
|
522
|
-
required: ['path'],
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
// AI Context Tools
|
|
527
|
-
{
|
|
528
|
-
name: 'get_compressed_file',
|
|
529
|
-
description: 'Get AI-optimized compressed version of a JS source file. Terser-minified with export legend. Saves 20-55% tokens (more with heavy JSDoc).',
|
|
530
|
-
inputSchema: {
|
|
531
|
-
type: 'object',
|
|
532
|
-
properties: {
|
|
533
|
-
path: {
|
|
534
|
-
type: 'string',
|
|
535
|
-
description: 'Path to JS/MJS file',
|
|
536
|
-
},
|
|
537
|
-
beautify: {
|
|
538
|
-
type: 'boolean',
|
|
539
|
-
description: 'Readable multi-line output (default: true). Set false for maximum compression.',
|
|
540
|
-
},
|
|
541
|
-
legend: {
|
|
542
|
-
type: 'boolean',
|
|
543
|
-
description: 'Include compact export legend header (default: true)',
|
|
544
|
-
},
|
|
545
|
-
},
|
|
546
|
-
required: ['path'],
|
|
547
|
-
},
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
name: 'get_project_docs',
|
|
551
|
-
description: 'Get compact project documentation in doc-dialect format. Returns architecture, patterns, edge cases. Merges auto-generated docs with manual .context/ files.',
|
|
552
|
-
inputSchema: {
|
|
553
|
-
type: 'object',
|
|
554
|
-
properties: {
|
|
555
|
-
path: {
|
|
556
|
-
type: 'string',
|
|
557
|
-
description: 'Project root path',
|
|
558
|
-
},
|
|
559
|
-
file: {
|
|
560
|
-
type: 'string',
|
|
561
|
-
description: 'Optional: get docs for a specific file only',
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
required: ['path'],
|
|
565
|
-
},
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
name: 'generate_context_docs',
|
|
569
|
-
description: 'Generate .context/ doc-dialect files from AST. Creates rich templates with {DESCRIBE} markers. Use agent-pool with doc-enricher skill to auto-fill descriptions. Templates include function signatures, call graphs, and DB access patterns extracted from AST.',
|
|
570
|
-
inputSchema: {
|
|
571
|
-
type: 'object',
|
|
572
|
-
properties: {
|
|
573
|
-
path: {
|
|
574
|
-
type: 'string',
|
|
575
|
-
description: 'Project root path',
|
|
576
|
-
},
|
|
577
|
-
overwrite: {
|
|
578
|
-
type: 'boolean',
|
|
579
|
-
description: 'Overwrite existing .ctx files (default: false). Existing descriptions are preserved via merge.',
|
|
580
|
-
},
|
|
581
|
-
scope: {
|
|
582
|
-
description: 'Scope filter: "all" (default), "focus" (git diff — recently changed files only), or array of specific file paths.',
|
|
583
|
-
oneOf: [
|
|
584
|
-
{ type: 'string', enum: ['all', 'focus'] },
|
|
585
|
-
{ type: 'array', items: { type: 'string' } },
|
|
586
|
-
],
|
|
587
|
-
},
|
|
588
|
-
},
|
|
589
|
-
required: ['path'],
|
|
590
|
-
},
|
|
591
|
-
},
|
|
592
|
-
{
|
|
593
|
-
name: 'check_stale_docs',
|
|
594
|
-
description: 'Check which .ctx documentation files are outdated. Compares AST signature hashes to detect structural changes (new functions, renamed exports). Use for CI/CD doc health audits.',
|
|
595
|
-
inputSchema: {
|
|
596
|
-
type: 'object',
|
|
597
|
-
properties: {
|
|
598
|
-
path: {
|
|
599
|
-
type: 'string',
|
|
600
|
-
description: 'Project root path',
|
|
601
|
-
},
|
|
602
|
-
},
|
|
603
|
-
required: ['path'],
|
|
604
|
-
},
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
name: 'get_ai_context',
|
|
608
|
-
description: 'Boot AI agent context: skeleton + doc-dialect + optional compressed files in one call. Call FIRST when starting work on a new project. Returns totalTokens and savings vs reading raw source.',
|
|
609
|
-
inputSchema: {
|
|
610
|
-
type: 'object',
|
|
611
|
-
properties: {
|
|
612
|
-
path: {
|
|
613
|
-
type: 'string',
|
|
614
|
-
description: 'Project root path',
|
|
615
|
-
},
|
|
616
|
-
includeFiles: {
|
|
617
|
-
type: 'array',
|
|
618
|
-
items: { type: 'string' },
|
|
619
|
-
description: 'Specific files to include compressed (e.g., ["parser.js", "tools.js"])',
|
|
620
|
-
},
|
|
621
|
-
includeDocs: {
|
|
622
|
-
type: 'boolean',
|
|
623
|
-
description: 'Include doc-dialect documentation (default: true)',
|
|
624
|
-
},
|
|
625
|
-
includeSkeleton: {
|
|
626
|
-
type: 'boolean',
|
|
627
|
-
description: 'Include project skeleton (default: true)',
|
|
628
|
-
},
|
|
629
|
-
},
|
|
630
|
-
required: ['path'],
|
|
631
|
-
},
|
|
632
|
-
},
|
|
633
|
-
|
|
634
|
-
// JSDoc Consistency
|
|
635
|
-
{
|
|
636
|
-
name: 'check_jsdoc_consistency',
|
|
637
|
-
description: 'Validate JSDoc annotations against actual function signatures. Finds param count/name mismatches, missing @returns, type inconsistencies.',
|
|
638
|
-
inputSchema: {
|
|
639
|
-
type: 'object',
|
|
640
|
-
properties: {
|
|
641
|
-
path: {
|
|
642
|
-
type: 'string',
|
|
643
|
-
description: 'Path to scan (e.g., "src/")',
|
|
644
|
-
},
|
|
645
|
-
},
|
|
646
|
-
required: ['path'],
|
|
647
|
-
},
|
|
648
|
-
},
|
|
649
|
-
|
|
650
|
-
// Type Checker (optional tsc)
|
|
651
|
-
{
|
|
652
|
-
name: 'check_types',
|
|
653
|
-
description: 'Run TypeScript type checking on JS files with JSDoc types. Requires tsc in PATH (npm i -g typescript). Returns structured diagnostics or graceful fallback if tsc not available.',
|
|
654
|
-
inputSchema: {
|
|
655
|
-
type: 'object',
|
|
656
|
-
properties: {
|
|
657
|
-
path: {
|
|
658
|
-
type: 'string',
|
|
659
|
-
description: 'Directory to check',
|
|
660
|
-
},
|
|
661
|
-
files: {
|
|
662
|
-
type: 'array',
|
|
663
|
-
items: { type: 'string' },
|
|
664
|
-
description: 'Specific files to check (optional)',
|
|
665
|
-
},
|
|
666
|
-
maxDiagnostics: {
|
|
667
|
-
type: 'number',
|
|
668
|
-
description: 'Max diagnostics to return (default: 50)',
|
|
669
|
-
},
|
|
670
|
-
},
|
|
671
|
-
required: ['path'],
|
|
672
|
-
},
|
|
673
|
-
},
|
|
674
|
-
|
|
675
|
-
// Monorepo & Performance Tools
|
|
676
|
-
{
|
|
677
|
-
name: 'discover_sub_projects',
|
|
678
|
-
description: 'Find sub-projects in a monorepo. Scans packages/, apps/, services/, modules/, libs/, plugins/ for package.json.',
|
|
679
|
-
inputSchema: {
|
|
680
|
-
type: 'object',
|
|
681
|
-
properties: {
|
|
682
|
-
path: {
|
|
683
|
-
type: 'string',
|
|
684
|
-
description: 'Root path to scan for sub-projects',
|
|
685
|
-
},
|
|
686
|
-
},
|
|
687
|
-
required: ['path'],
|
|
688
|
-
},
|
|
689
|
-
},
|
|
690
|
-
{
|
|
691
|
-
name: 'get_analysis_summary',
|
|
692
|
-
description: 'Quick health score — runs only cached per-file metrics (complexity, undocumented, JSDoc). Much faster than get_full_analysis for large codebases.',
|
|
693
|
-
inputSchema: {
|
|
694
|
-
type: 'object',
|
|
695
|
-
properties: {
|
|
696
|
-
path: {
|
|
697
|
-
type: 'string',
|
|
698
|
-
description: 'Path to scan',
|
|
699
|
-
},
|
|
700
|
-
},
|
|
701
|
-
required: ['path'],
|
|
702
|
-
},
|
|
703
|
-
},
|
|
704
|
-
{
|
|
705
|
-
name: 'compact_project',
|
|
706
|
-
description: 'Compact all JS files in a directory — strips comments, whitespace, dead code. Preserves all names (mangle: false). Use with .ctx docs for AI-first workflow. Irreversible without git — use --dry-run first.',
|
|
707
|
-
inputSchema: {
|
|
708
|
-
type: 'object',
|
|
709
|
-
properties: {
|
|
710
|
-
path: {
|
|
711
|
-
type: 'string',
|
|
712
|
-
description: 'Directory to compact (e.g., "src/")',
|
|
713
|
-
},
|
|
714
|
-
dryRun: {
|
|
715
|
-
type: 'boolean',
|
|
716
|
-
description: 'Preview savings without modifying files (default: false)',
|
|
717
|
-
},
|
|
718
|
-
},
|
|
719
|
-
required: ['path'],
|
|
720
|
-
},
|
|
721
|
-
},
|
|
722
|
-
{
|
|
723
|
-
name: 'beautify_project',
|
|
724
|
-
description: 'Beautify/expand all JS files in a directory — formats with proper indentation. Inverse of compact_project. Preserves all names.',
|
|
725
|
-
inputSchema: {
|
|
726
|
-
type: 'object',
|
|
727
|
-
properties: {
|
|
728
|
-
path: {
|
|
729
|
-
type: 'string',
|
|
730
|
-
description: 'Directory to beautify (e.g., "src/")',
|
|
731
|
-
},
|
|
732
|
-
dryRun: {
|
|
733
|
-
type: 'boolean',
|
|
734
|
-
description: 'Preview without modifying files (default: false)',
|
|
735
|
-
},
|
|
736
|
-
},
|
|
737
|
-
required: ['path'],
|
|
738
|
-
},
|
|
739
|
-
},
|
|
740
|
-
{
|
|
741
|
-
name: 'validate_ctx_contracts',
|
|
742
|
-
description: 'Validate .ctx contracts against actual source code AST. Checks param count/names, export status, and reports mismatches. Zero-dependency alternative to tsc.',
|
|
743
|
-
inputSchema: {
|
|
744
|
-
type: 'object',
|
|
745
|
-
properties: {
|
|
746
|
-
path: { type: 'string', description: 'Project root path' },
|
|
747
|
-
strict: { type: 'boolean', description: 'Also report functions missing from .ctx (default: false)' },
|
|
748
|
-
},
|
|
749
|
-
required: ['path'],
|
|
750
|
-
},
|
|
751
|
-
},
|
|
752
|
-
{
|
|
753
|
-
name: 'edit_compressed',
|
|
754
|
-
description: 'Edit a function or class in source code by symbol name. Agent sends new code (compressed or formatted); server finds the symbol via AST, replaces it, validates syntax, and optionally beautifies. Use with get_compressed_file for token-efficient editing workflow.',
|
|
755
|
-
inputSchema: {
|
|
756
|
-
type: 'object',
|
|
757
|
-
properties: {
|
|
758
|
-
path: { type: 'string', description: 'Path to JS/MJS file' },
|
|
759
|
-
symbol: { type: 'string', description: 'Function or class name to replace' },
|
|
760
|
-
code: { type: 'string', description: 'New code for the symbol (full function/class definition)' },
|
|
761
|
-
beautify: { type: 'boolean', description: 'Beautify result after editing (default: true)' },
|
|
762
|
-
dryRun: { type: 'boolean', description: 'Preview without writing (default: false)' },
|
|
763
|
-
},
|
|
764
|
-
required: ['path', 'symbol', 'code'],
|
|
765
|
-
},
|
|
766
|
-
},
|
|
767
|
-
{
|
|
768
|
-
name: 'get_mode',
|
|
769
|
-
description: 'Get current compact code mode configuration. Returns mode (1=compact, 2=full, 3=IDE), preferences, and recommended workflow for agent.',
|
|
770
|
-
inputSchema: {
|
|
771
|
-
type: 'object',
|
|
772
|
-
properties: {
|
|
773
|
-
path: { type: 'string', description: 'Project root path' },
|
|
774
|
-
},
|
|
775
|
-
required: ['path'],
|
|
776
|
-
},
|
|
777
|
-
},
|
|
778
|
-
{
|
|
779
|
-
name: 'set_mode',
|
|
780
|
-
description: 'Set compact code mode for a project. Mode 1: store minified, edit directly. Mode 2: store full, use get_compressed_file + edit_compressed. Mode 3: IDE integration (future).',
|
|
781
|
-
inputSchema: {
|
|
782
|
-
type: 'object',
|
|
783
|
-
properties: {
|
|
784
|
-
path: { type: 'string', description: 'Project root path' },
|
|
785
|
-
mode: { type: 'number', description: 'Mode number: 1, 2, or 3' },
|
|
786
|
-
beautify: { type: 'boolean', description: 'Beautify code after edits (default: true)' },
|
|
787
|
-
autoValidate: { type: 'boolean', description: 'Auto-run .ctx validation after edits (default: false)' },
|
|
788
|
-
stripJSDoc: { type: 'boolean', description: 'Auto-strip JSDoc when compacting (default: false)' },
|
|
789
|
-
},
|
|
790
|
-
required: ['path', 'mode'],
|
|
791
|
-
},
|
|
792
|
-
},
|
|
793
|
-
];
|