Skip to content

repo-intel: Cannot find module '@agentsys/lib' when invoking from Node.js #320

@avifenesh

Description

@avifenesh

Summary

When trying to use repo-intel programmatically via Node.js (as the skill instructions suggest), the require('@agentsys/lib') call fails with MODULE_NOT_FOUND.

Reproduction

const { getPluginRoot } = require('@agentsys/lib/cross-platform');
const pluginRoot = getPluginRoot('repo-intel');
const binary = require('@agentsys/lib').binary;
const repoIntel = require(`${pluginRoot}/lib/repo-intel`);

(async () => {
  await repoIntel.update('.');
})();

Error:

Error: Cannot find module '@agentsys/lib/cross-platform'

Environment

  • OS: Windows 11 Pro (win32-x64)
  • Node.js: v22.22.0
  • Claude Code: latest
  • Plugin: @agentsys/repo-intel 1.0.0
  • agent-analyzer binary: 0.1.0 (reports 0.1.0 but minimum 0.3.0 required per config)

Details

  • The @agentsys/lib package is not installed as a dependency of the plugin - it's not in package.json dependencies
  • The lib/repo-intel/index.js requires @agentsys/lib but there's no node_modules containing it
  • The binary itself works fine when invoked directly: ~/.agent-sh/bin/agent-analyzer.exe repo-intel init .
  • The binary module exists in the audit-project plugin at lib/binary/index.js but not as a shared npm module

Workaround

Invoke the binary directly instead of using the JS wrapper:

~/.agent-sh/bin/agent-analyzer.exe repo-intel init .
~/.agent-sh/bin/agent-analyzer.exe repo-intel query hotspots --map-file .claude/repo-intel.json .

Expected

Either:

  1. @agentsys/lib should be bundled with the plugin, or
  2. The skill instructions should document direct binary invocation as the primary method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions