agentsys 5.6.4 → 5.7.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.
Files changed (39) hide show
  1. package/.claude-plugin/marketplace.json +6 -17
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.kiro/agents/exploration-agent.json +1 -1
  4. package/.kiro/agents/implementation-agent.json +1 -1
  5. package/.kiro/agents/map-validator.json +2 -2
  6. package/.kiro/agents/perf-orchestrator.json +1 -1
  7. package/.kiro/agents/planning-agent.json +1 -1
  8. package/.kiro/skills/perf-code-paths/SKILL.md +1 -1
  9. package/.kiro/skills/perf-theory-gatherer/SKILL.md +1 -1
  10. package/.kiro/skills/repo-intel/SKILL.md +63 -0
  11. package/AGENTS.md +3 -3
  12. package/CHANGELOG.md +20 -0
  13. package/README.md +85 -87
  14. package/lib/binary/version.js +1 -1
  15. package/lib/repo-map/converter.js +130 -0
  16. package/lib/repo-map/index.js +117 -74
  17. package/lib/repo-map/installer.js +38 -172
  18. package/lib/repo-map/updater.js +16 -474
  19. package/meta/skills/maintain-cross-platform/SKILL.md +5 -5
  20. package/package.json +3 -3
  21. package/scripts/fix-graduated-repos.js +2 -2
  22. package/scripts/generate-docs.js +10 -13
  23. package/scripts/graduate-plugin.js +1 -1
  24. package/scripts/preflight.js +4 -4
  25. package/scripts/validate-cross-platform-docs.js +2 -2
  26. package/site/content.json +12 -19
  27. package/site/index.html +44 -12
  28. package/site/ux-spec.md +1 -1
  29. package/.kiro/skills/repo-mapping/SKILL.md +0 -83
  30. package/lib/repo-map/concurrency.js +0 -29
  31. package/lib/repo-map/queries/go.js +0 -27
  32. package/lib/repo-map/queries/index.js +0 -100
  33. package/lib/repo-map/queries/java.js +0 -38
  34. package/lib/repo-map/queries/javascript.js +0 -55
  35. package/lib/repo-map/queries/python.js +0 -24
  36. package/lib/repo-map/queries/rust.js +0 -73
  37. package/lib/repo-map/queries/typescript.js +0 -38
  38. package/lib/repo-map/runner.js +0 -1364
  39. package/lib/repo-map/usage-analyzer.js +0 -407
@@ -52,7 +52,7 @@ const CATEGORY_MAP = {
52
52
  'deslop': 'Cleanup',
53
53
  'sync-docs': 'Cleanup',
54
54
  'drift-detect': 'Analysis',
55
- 'repo-map': 'Analysis',
55
+ 'repo-intel': 'Analysis',
56
56
  'learn': 'AI Collaboration',
57
57
  'agnix': 'Linting',
58
58
  'consult': 'AI Collaboration',
@@ -60,10 +60,10 @@ const CATEGORY_MAP = {
60
60
  'skillers': 'AI Collaboration',
61
61
  'web-ctl': 'Web',
62
62
  'ship': 'Release',
63
- 'git-map': 'Analysis',
64
63
  'onboard': 'Onboarding',
65
64
  'can-i-help': 'Onboarding',
66
- 'audit-project': 'Code Review'
65
+ 'audit-project': 'Code Review',
66
+ 'glidemq': 'Message Queues'
67
67
  };
68
68
 
69
69
  // Static skill definitions for cross-repo plugins (not discoverable locally)
@@ -91,7 +91,7 @@ const STATIC_SKILLS = [
91
91
  { plugin: 'deslop', name: 'deslop' },
92
92
  { plugin: 'sync-docs', name: 'sync-docs' },
93
93
  { plugin: 'drift-detect', name: 'drift-analysis' },
94
- { plugin: 'repo-map', name: 'repo-mapping' },
94
+ { plugin: 'repo-intel', name: 'repo-intel' },
95
95
  { plugin: 'consult', name: 'consult' },
96
96
  { plugin: 'debate', name: 'debate' },
97
97
  { plugin: 'learn', name: 'learn' },
@@ -100,7 +100,6 @@ const STATIC_SKILLS = [
100
100
  { plugin: 'ship', name: 'release' },
101
101
  { plugin: 'skillers', name: 'skillers-compact' },
102
102
  { plugin: 'skillers', name: 'recommend' },
103
- { plugin: 'git-map', name: 'git-mapping' },
104
103
  { plugin: 'onboard', name: 'onboard' },
105
104
  { plugin: 'can-i-help', name: 'can-i-help' },
106
105
  { plugin: 'audit-project', name: 'audit-project' },
@@ -118,7 +117,7 @@ const PURPOSE_MAP = {
118
117
  'audit-project': 'Multi-agent code review',
119
118
  'deslop': 'AI slop cleanup',
120
119
  'drift-detect': 'Plan drift detection',
121
- 'repo-map': 'AST repo mapping',
120
+ 'repo-intel': 'Unified static analysis',
122
121
  'sync-docs': 'Documentation sync',
123
122
  'learn': 'Topic research and learning guides',
124
123
  'agnix': 'Agent config linting',
@@ -126,7 +125,6 @@ const PURPOSE_MAP = {
126
125
  'debate': 'Multi-perspective debate analysis',
127
126
  'web-ctl': 'Browser automation for AI agents',
128
127
  'skillers': 'Workflow pattern learning',
129
- 'git-map': 'Git history analysis',
130
128
  'onboard': 'Codebase onboarding',
131
129
  'can-i-help': 'Contributor guidance'
132
130
  };
@@ -177,9 +175,9 @@ function generateCommandsTable(commands) {
177
175
  const COMMAND_ORDER = [
178
176
  'next-task', 'agnix', 'ship', 'deslop', 'perf',
179
177
  'drift-detect', 'audit-project', 'enhance',
180
- 'repo-map', 'sync-docs', 'learn', 'consult',
178
+ 'repo-intel', 'sync-docs', 'learn', 'consult',
181
179
  'debate', 'web-ctl', 'release', 'skillers',
182
- 'git-map', 'onboard', 'can-i-help'
180
+ 'onboard', 'can-i-help'
183
181
  ];
184
182
 
185
183
  // Command descriptions for the table (short, human-written summaries)
@@ -192,7 +190,7 @@ function generateCommandsTable(commands) {
192
190
  'drift-detect': 'Compare plan vs implementation',
193
191
  'audit-project': 'Multi-agent iterative code review',
194
192
  'enhance': 'Plugin, agent, and prompt analyzers',
195
- 'repo-map': 'AST-based repository map',
193
+ 'repo-intel': 'Unified static analysis - git history, AST symbols, project metadata',
196
194
  'sync-docs': 'Sync documentation with code changes',
197
195
  'learn': 'Research topics, create learning guides',
198
196
  'consult': 'Cross-tool AI consultation',
@@ -200,7 +198,6 @@ function generateCommandsTable(commands) {
200
198
  'web-ctl': 'Browser automation for AI agents',
201
199
  'release': 'Versioned release with ecosystem detection',
202
200
  'skillers': 'Workflow pattern learning and automation',
203
- 'git-map': 'Git history analysis: hotspots, coupling, ownership, bus factor',
204
201
  'onboard': 'Codebase orientation for newcomers',
205
202
  'can-i-help': 'Match contributor skills to project needs'
206
203
  };
@@ -258,7 +255,7 @@ function generateSkillsTable(skills) {
258
255
 
259
256
  // Defined category order
260
257
  const categoryOrder = [
261
- 'Workflow', 'Enhancement', 'Performance', 'Cleanup',
258
+ 'Workflow', 'Message Queues', 'Enhancement', 'Performance', 'Cleanup',
262
259
  'Code Review', 'AI Collaboration', 'Onboarding',
263
260
  'Web', 'Release', 'Analysis', 'Linting', 'Other'
264
261
  ];
@@ -391,7 +388,7 @@ function generateAgentCounts(agents, plugins) {
391
388
  */
392
389
  // Static counts for cross-repo plugins not discoverable locally
393
390
  const STATIC_PLUGIN_COUNT = 19;
394
- const STATIC_AGENT_COUNT = 38;
391
+ const STATIC_AGENT_COUNT = 47;
395
392
 
396
393
  function updateSiteContent(plugins, agents, skills) {
397
394
  const contentPath = path.join(ROOT_DIR, 'site', 'content.json');
@@ -25,7 +25,7 @@ const TODAY = new Date().toISOString().slice(0, 10);
25
25
 
26
26
  const PLUGINS = [
27
27
  'next-task', 'ship', 'enhance', 'deslop', 'learn', 'consult',
28
- 'debate', 'drift-detect', 'repo-map', 'sync-docs', 'audit-project',
28
+ 'debate', 'drift-detect', 'repo-intel', 'sync-docs', 'audit-project',
29
29
  'perf', 'agnix'
30
30
  ];
31
31
 
@@ -39,7 +39,7 @@ const CHECKLIST_PATTERNS = {
39
39
  'new-skill': ['plugins/*/skills/'],
40
40
  'new-lib-module': ['lib/'],
41
41
  'release': ['package.json'],
42
- 'repo-map': ['plugins/repo-map/', 'lib/repo-map/'],
42
+ 'repo-intel': ['plugins/repo-intel/', 'lib/repo-map/'],
43
43
  'opencode-plugin': ['adapters/opencode-plugin/'],
44
44
  'cross-platform': [] // triggered when any plugin/ or lib/ file changes
45
45
  };
@@ -68,9 +68,9 @@ const MANUAL_CHECKS = {
68
68
  'Test on Claude Code, OpenCode, and Codex CLI',
69
69
  'Create git tag and push'
70
70
  ],
71
- 'repo-map': [
72
- 'Verify ast-grep detection works',
73
- 'Test repo-map update with added/modified/deleted files'
71
+ 'repo-intel': [
72
+ 'Verify agent-analyzer binary is available',
73
+ 'Test repo-intel update with added/modified/deleted files'
74
74
  ],
75
75
  'opencode-plugin': [
76
76
  'Test plugin with OpenCode locally',
@@ -72,7 +72,7 @@ const REQUIRED_FEATURES = [
72
72
  '/enhance',
73
73
  '/audit-project',
74
74
  '/drift-detect',
75
- '/repo-map',
75
+ '/repo-intel',
76
76
  '/perf',
77
77
  '/sync-docs'
78
78
  ];
@@ -110,7 +110,7 @@ function validateCommandPrefixes() {
110
110
 
111
111
  // Check for wrong prefix usage
112
112
  const wrongPrefix = platform === 'codex' ? '/' : '$';
113
- const commandPattern = new RegExp(`${wrongPrefix}(next-task|ship|deslop|enhance|audit-project|drift-detect|repo-map|perf|sync-docs)`, 'g');
113
+ const commandPattern = new RegExp(`${wrongPrefix}(next-task|ship|deslop|enhance|audit-project|drift-detect|repo-intel|perf|sync-docs)`, 'g');
114
114
 
115
115
  const matches = content.match(commandPattern);
116
116
  if (matches && matches.length > 0) {
package/site/content.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "https://agent-sh.github.io/agentsys",
6
6
  "repo": "https://github.com/agent-sh/agentsys",
7
7
  "npm": "https://www.npmjs.com/package/agentsys",
8
- "version": "5.6.4",
8
+ "version": "5.7.0",
9
9
  "author": "Avi Fenesh",
10
10
  "author_url": "https://github.com/avifenesh"
11
11
  },
@@ -28,12 +28,12 @@
28
28
  "suffix": ""
29
29
  },
30
30
  {
31
- "value": "38",
31
+ "value": "47",
32
32
  "label": "Agents",
33
33
  "suffix": ""
34
34
  },
35
35
  {
36
- "value": "39",
36
+ "value": "38",
37
37
  "label": "Skills",
38
38
  "suffix": ""
39
39
  },
@@ -145,11 +145,11 @@
145
145
  "category": "analysis"
146
146
  },
147
147
  {
148
- "name": "/repo-map",
149
- "tagline": "AST symbol and import mapping",
150
- "description": "Builds a cached map of exports, functions, classes, and imports via ast-grep. Tools like drift-detect and planners use it instead of re-scanning the repo every time.",
151
- "example": "/repo-map init",
152
- "category": "maintenance"
148
+ "name": "/repo-intel",
149
+ "tagline": "Unified static analysis for AI agents",
150
+ "description": "Git history intelligence, AST symbol mapping, and project metadata in one plugin. 20 query types backed by a Rust binary. 9 plugins consume the data automatically.",
151
+ "example": "/repo-intel init",
152
+ "category": "analysis"
153
153
  },
154
154
  {
155
155
  "name": "/sync-docs",
@@ -200,13 +200,6 @@
200
200
  "example": "/skillers compact",
201
201
  "category": "learning"
202
202
  },
203
- {
204
- "name": "/git-map",
205
- "tagline": "Git history intelligence for AI agents",
206
- "description": "21 queries backed by a Rust binary: hotspots, coupling, ownership, bus factor, bugspots, area health, AI detection, test gaps, doc drift, and more. Cached, incrementally updatable. 9 plugins consume the data automatically.",
207
- "example": "/git-map query hotspots",
208
- "category": "analysis"
209
- },
210
203
  {
211
204
  "name": "/onboard",
212
205
  "tagline": "Oriented in any codebase in 3 minutes",
@@ -356,8 +349,8 @@
356
349
  }
357
350
  ],
358
351
  "agents": {
359
- "total": 38,
360
- "file_based": 28,
352
+ "total": 47,
353
+ "file_based": 37,
361
354
  "role_based": 10,
362
355
  "by_model": [
363
356
  {
@@ -449,8 +442,8 @@
449
442
  "description": "For PR operations and issue discovery"
450
443
  },
451
444
  {
452
- "name": "ast-grep (sg)",
453
- "description": "For /repo-map generation"
445
+ "name": "agent-analyzer",
446
+ "description": "For /repo-intel static analysis (installed automatically)"
454
447
  }
455
448
  ],
456
449
  "optional": [
package/site/index.html CHANGED
@@ -192,7 +192,7 @@
192
192
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-5" id="tab-5" tabindex="-1" data-index="5">/drift-detect</button>
193
193
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-6" id="tab-6" tabindex="-1" data-index="6">/audit-project</button>
194
194
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-7" id="tab-7" tabindex="-1" data-index="7">/enhance</button>
195
- <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-8" id="tab-8" tabindex="-1" data-index="8">/repo-map</button>
195
+ <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-8" id="tab-8" tabindex="-1" data-index="8">/repo-intel</button>
196
196
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-9" id="tab-9" tabindex="-1" data-index="9">/sync-docs</button>
197
197
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-10" id="tab-10" tabindex="-1" data-index="10">/learn</button>
198
198
  <button class="tabs__tab" role="tab" aria-selected="false" aria-controls="tab-panel-11" id="tab-11" tabindex="-1" data-index="11">/consult</button>
@@ -354,21 +354,21 @@
354
354
  </div>
355
355
 
356
356
  <div class="tabs__panel" role="tabpanel" id="tab-panel-8" aria-labelledby="tab-8" hidden>
357
- <h3 class="tabs__panel-name">/repo-map</h3>
358
- <p class="tabs__panel-tagline">AST symbol and import mapping</p>
357
+ <h3 class="tabs__panel-name">/repo-intel</h3>
358
+ <p class="tabs__panel-tagline">Unified static analysis for AI agents</p>
359
359
  <ul class="tabs__panel-features">
360
- <li>Cached file-to-symbols map via ast-grep</li>
361
- <li>Exports, functions, classes, import graph</li>
362
- <li>Used by drift-detect and planners automatically</li>
363
- <li>Incremental updates for large repos</li>
360
+ <li>Git history intelligence: hotspots, coupling, ownership, bus factor</li>
361
+ <li>AST symbols: exports, functions, classes, imports</li>
362
+ <li>9 plugins consume repo-intel data automatically</li>
363
+ <li>Incremental updates, 20 query types</li>
364
364
  </ul>
365
365
  <div class="code-block">
366
- <button class="code-block__copy" aria-label="Copy code to clipboard" data-code="/repo-map init # First-time map generation
367
- /repo-map update # Incremental update">
366
+ <button class="code-block__copy" aria-label="Copy code to clipboard" data-code="/repo-intel init # First-time scan
367
+ /repo-intel query hotspots # Most active files">
368
368
  <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"/></svg>
369
369
  </button>
370
- <pre><code><span class="code-prompt">$</span> /repo-map init <span class="code-comment"># First-time map generation</span>
371
- <span class="code-prompt">$</span> /repo-map update <span class="code-comment"># Incremental update</span></code></pre>
370
+ <pre><code><span class="code-prompt">$</span> /repo-intel init <span class="code-comment"># First-time scan</span>
371
+ <span class="code-prompt">$</span> /repo-intel query hotspots <span class="code-comment"># Most active files</span></code></pre>
372
372
  </div>
373
373
  </div>
374
374
 
@@ -556,6 +556,38 @@
556
556
  </div>
557
557
  </section>
558
558
 
559
+ <!-- ===== BENCHMARKS ===== -->
560
+ <section class="philosophy" id="benchmarks" aria-labelledby="bench-title">
561
+ <div class="philosophy__inner">
562
+ <h2 class="philosophy__title anim-fade-up" id="bench-title">Benchmarks</h2>
563
+ <p class="philosophy__subtitle anim-fade-up" data-delay="100">Structured prompts and enriched context do more for output quality than model tier.</p>
564
+
565
+ <div class="philosophy__grid">
566
+ <div class="philosophy__card anim-fade-up" data-delay="0">
567
+ <div class="philosophy__card-icon">
568
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><line x1="12" y1="20" x2="12" y2="10"/><line x1="18" y1="20" x2="18" y2="4"/><line x1="6" y1="20" x2="6" y2="16"/></svg>
569
+ </div>
570
+ <h3 class="philosophy__card-title">Sonnet + AgentSys beats raw Opus</h3>
571
+ <p class="philosophy__card-desc">Sonnet + agentsys: <span class="text-accent">$0.66</span>, 6,084 tokens, specific recommendations. Raw Opus: $1.10, 2,841 tokens, generic output. <span class="text-accent">40% cheaper, 2x more output.</span></p>
572
+ </div>
573
+ <div class="philosophy__card anim-fade-up" data-delay="100">
574
+ <div class="philosophy__card-icon">
575
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg>
576
+ </div>
577
+ <h3 class="philosophy__card-title">Model tier matters less</h3>
578
+ <p class="philosophy__card-desc">With agentsys, Sonnet matches Opus quality. Pipeline structure captures the gains. <span class="text-accent">73-83% cost reduction</span> with equivalent outcomes.</p>
579
+ </div>
580
+ <div class="philosophy__card anim-fade-up" data-delay="200">
581
+ <div class="philosophy__card-icon">
582
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>
583
+ </div>
584
+ <h3 class="philosophy__card-title">Invest in pipeline, not model spend</h3>
585
+ <p class="philosophy__card-desc">Better prompts, richer context, enforced phases - these compound in ways that model upgrades alone don't. Tested on real tasks against <a href="https://github.com/avifenesh/glide-mq" class="text-accent">glide-mq</a>.</p>
586
+ </div>
587
+ </div>
588
+ </div>
589
+ </section>
590
+
559
591
  <!-- ===== AGENTS & SKILLS ===== -->
560
592
  <section class="agents-skills" id="agents-skills" aria-labelledby="as-title">
561
593
  <div class="agents-skills__inner">
@@ -681,7 +713,7 @@
681
713
  <div class="skill-group__items">
682
714
  <span class="skill-card">deslop</span>
683
715
  <span class="skill-card">drift-analysis</span>
684
- <span class="skill-card">repo-mapping</span>
716
+ <span class="skill-card">repo-intel</span>
685
717
  <span class="skill-card">sync-docs</span>
686
718
  <span class="skill-card">learn-topic</span>
687
719
  <span class="skill-card">agnix-lint</span>
package/site/ux-spec.md CHANGED
@@ -265,7 +265,7 @@ Done. Task to merged PR in 12 minutes.
265
265
  - On mobile: naturally scrollable, slight gradient fade on right edge to indicate scrollability (20px gradient from transparent to section background)
266
266
 
267
267
  ### Tab Order
268
- `/next-task`, `/ship`, `/deslop`, `/perf`, `/drift-detect`, `/audit-project`, `/enhance`, `/repo-map`, `/sync-docs`, `/learn`, `/agnix`
268
+ `/next-task`, `/ship`, `/deslop`, `/perf`, `/drift-detect`, `/audit-project`, `/enhance`, `/repo-intel`, `/sync-docs`, `/learn`, `/agnix`
269
269
 
270
270
  (Most impactful first: the full workflow command, then the shipper, then individual tools)
271
271
 
@@ -1,83 +0,0 @@
1
- ---
2
- name: repo-mapping
3
- description: "Use when user asks to \"create repo map\", \"generate repo map\", \"update repo map\", \"repo map status\", or \"map symbols/imports\". Builds and validates an AST-based repo map using ast-grep."
4
- argument-hint: "[action] [--force]"
5
- ---
6
-
7
- # Repo Mapping Skill
8
-
9
- Build and maintain a cached AST-based map of repository symbols and imports using ast-grep.
10
-
11
- ## Parse Arguments
12
-
13
- ```javascript
14
- const args = '$ARGUMENTS'.split(' ').filter(Boolean);
15
- const action = args.find(a => !a.startsWith('--')) || 'status';
16
- const force = args.includes('--force');
17
- ```
18
-
19
- ## Primary Responsibilities
20
-
21
- 1. **Generate map** on demand (`/repo-map init`)
22
- 2. **Update map** incrementally (`/repo-map update`)
23
- 3. **Check status** and staleness (`/repo-map status`)
24
- 4. **Validate output** with the map-validator agent
25
-
26
- ## Core Data Contract
27
-
28
- Repo map is stored in the platform state directory:
29
-
30
- - Claude Code: `.claude/repo-map.json`
31
- - OpenCode: `.opencode/repo-map.json`
32
- - Codex CLI: `.codex/repo-map.json`
33
-
34
- Minimal structure:
35
-
36
- ```json
37
- {
38
- "version": "1.0.0",
39
- "generated": "2026-01-25T12:00:00Z",
40
- "updated": "2026-01-25T12:05:00Z",
41
- "git": { "commit": "abc123", "branch": "main" },
42
- "project": { "languages": ["typescript", "python"] },
43
- "stats": { "totalFiles": 142, "totalSymbols": 847 },
44
- "files": {
45
- "src/auth/login.ts": {
46
- "hash": "deadbeef1234abcd",
47
- "language": "typescript",
48
- "symbols": { "exports": [], "functions": [], "classes": [] },
49
- "imports": [ { "source": "./utils", "kind": "named" } ]
50
- }
51
- }
52
- }
53
- ```
54
-
55
- ## Behavior Rules
56
-
57
- - **Never** run ast-grep without user approval if it is not installed
58
- - **Never** install dependencies without explicit user consent
59
- - **Always** validate map output with `map-validator` after init/update
60
- - **Prefer** incremental update unless map is stale or history rewritten
61
-
62
- ## When to Suggest Repo Map
63
-
64
- If a user asks for drift detection, documentation alignment, or repo analysis and repo-map is missing:
65
-
66
- ```
67
- Repo map not found. For better analysis, run:
68
- /repo-map init
69
- ```
70
-
71
- ## Staleness Signals
72
-
73
- - Map commit not found (rebased)
74
- - Branch changed
75
- - Git hooks marked stale
76
- - Commits behind HEAD
77
-
78
- ## Output Expectations
79
-
80
- Keep outputs concise:
81
-
82
- - **init/update**: file count, symbol count, commit, warnings
83
- - **status**: staleness, commits behind, last updated
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- async function runWithConcurrency(items, limit, worker) {
4
- if (!Array.isArray(items) || items.length === 0) {
5
- return [];
6
- }
7
-
8
- const maxConcurrency = Math.max(1, Math.min(items.length, Math.floor(limit) || 1));
9
- const results = new Array(items.length);
10
- let cursor = 0;
11
-
12
- async function runWorker() {
13
- while (true) {
14
- const index = cursor;
15
- cursor += 1;
16
- if (index >= items.length) {
17
- return;
18
- }
19
- results[index] = await worker(items[index], index);
20
- }
21
- }
22
-
23
- await Promise.all(Array.from({ length: maxConcurrency }, () => runWorker()));
24
- return results;
25
- }
26
-
27
- module.exports = {
28
- runWithConcurrency
29
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * Go query patterns for ast-grep
3
- */
4
-
5
- 'use strict';
6
-
7
- module.exports = {
8
- exports: [],
9
- functions: [
10
- { pattern: 'func $NAME($$$) { $$$ }', nameVar: 'NAME' },
11
- { pattern: 'func ($$$) $NAME($$$) { $$$ }', nameVar: 'NAME' }
12
- ],
13
- classes: [],
14
- types: [
15
- { pattern: 'type $NAME struct { $$$ }', nameVar: 'NAME' },
16
- { pattern: 'type $NAME interface { $$$ }', nameVar: 'NAME' },
17
- { pattern: 'type $NAME = $$$', nameVar: 'NAME' }
18
- ],
19
- constants: [
20
- { pattern: 'const $NAME = $$$', nameVar: 'NAME' },
21
- { pattern: 'const $NAME $TYPE = $$$', nameVar: 'NAME' }
22
- ],
23
- imports: [
24
- { pattern: 'import $SOURCE', sourceVar: 'SOURCE', kind: 'import' },
25
- { pattern: 'import $NAME $SOURCE', sourceVar: 'SOURCE', kind: 'import' }
26
- ]
27
- };
@@ -1,100 +0,0 @@
1
- /**
2
- * Language-specific query patterns for ast-grep
3
- *
4
- * @module lib/repo-map/queries
5
- */
6
-
7
- 'use strict';
8
-
9
- const path = require('path');
10
-
11
- const javascript = require('./javascript');
12
- const typescript = require('./typescript');
13
- const python = require('./python');
14
- const rust = require('./rust');
15
- const go = require('./go');
16
- const java = require('./java');
17
-
18
- /**
19
- * Get query patterns for a language
20
- * @param {string} language - Language name
21
- * @returns {Object|null}
22
- */
23
- function getQueriesForLanguage(language) {
24
- switch (language) {
25
- case 'javascript':
26
- case 'js':
27
- case 'node':
28
- return javascript;
29
- case 'typescript':
30
- case 'ts':
31
- return typescript;
32
- case 'python':
33
- case 'py':
34
- return python;
35
- case 'rust':
36
- return rust;
37
- case 'go':
38
- return go;
39
- case 'java':
40
- return java;
41
- default:
42
- return null;
43
- }
44
- }
45
-
46
- /**
47
- * Get base ast-grep language identifier
48
- * @param {string} language - Language name
49
- * @returns {string}
50
- */
51
- function getSgLanguage(language) {
52
- switch (language) {
53
- case 'javascript':
54
- case 'js':
55
- case 'node':
56
- return 'javascript';
57
- case 'typescript':
58
- case 'ts':
59
- return 'typescript';
60
- case 'python':
61
- case 'py':
62
- return 'python';
63
- case 'rust':
64
- return 'rust';
65
- case 'go':
66
- return 'go';
67
- case 'java':
68
- return 'java';
69
- default:
70
- return 'javascript';
71
- }
72
- }
73
-
74
- /**
75
- * Get ast-grep language identifier based on file extension
76
- * @param {string} filePath - File path
77
- * @param {string} language - Language name
78
- * @returns {string}
79
- */
80
- function getSgLanguageForFile(filePath, language) {
81
- const ext = path.extname(filePath).toLowerCase();
82
-
83
- if (language === 'javascript') {
84
- if (ext === '.jsx') return 'jsx';
85
- return 'javascript';
86
- }
87
-
88
- if (language === 'typescript') {
89
- if (ext === '.tsx') return 'tsx';
90
- return 'typescript';
91
- }
92
-
93
- return getSgLanguage(language);
94
- }
95
-
96
- module.exports = {
97
- getQueriesForLanguage,
98
- getSgLanguage,
99
- getSgLanguageForFile
100
- };
@@ -1,38 +0,0 @@
1
- /**
2
- * Java query patterns for ast-grep
3
- */
4
-
5
- 'use strict';
6
-
7
- module.exports = {
8
- exports: [
9
- { pattern: 'public class $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
10
- { pattern: 'public interface $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
11
- { pattern: 'public enum $NAME { $$$ }', kind: 'class', nameVar: 'NAME' },
12
- { pattern: 'public record $NAME($$$) { $$$ }', kind: 'class', nameVar: 'NAME' },
13
- { pattern: 'public $RET $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
14
- { pattern: 'public static $RET $NAME($$$) { $$$ }', kind: 'function', nameVar: 'NAME' },
15
- { pattern: 'public $RET $NAME($$$);', kind: 'function', nameVar: 'NAME' }
16
- ],
17
- functions: [
18
- { pattern: 'public $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
19
- { pattern: 'public static $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
20
- { pattern: 'protected $RET $NAME($$$) { $$$ }', nameVar: 'NAME' },
21
- { pattern: 'private $RET $NAME($$$) { $$$ }', nameVar: 'NAME' }
22
- ],
23
- classes: [
24
- { pattern: 'class $NAME { $$$ }', nameVar: 'NAME' },
25
- { pattern: 'interface $NAME { $$$ }', nameVar: 'NAME' },
26
- { pattern: 'enum $NAME { $$$ }', nameVar: 'NAME' },
27
- { pattern: 'record $NAME($$$) { $$$ }', nameVar: 'NAME' }
28
- ],
29
- types: [],
30
- constants: [
31
- { pattern: 'public static final $TYPE $NAME = $$$;', nameVar: 'NAME' },
32
- { pattern: 'static final $TYPE $NAME = $$$;', nameVar: 'NAME' }
33
- ],
34
- imports: [
35
- { pattern: 'import $SOURCE;', sourceVar: 'SOURCE', kind: 'import' },
36
- { pattern: 'import static $SOURCE;', sourceVar: 'SOURCE', kind: 'import' }
37
- ]
38
- };