Skip to content

zydo/agent-readable-ts

Repository files navigation

agent-readable-ts

CI npm

agent-readable-ts helps coding agents inspect the live public surface of a TypeScript or JavaScript API before they write code against it.

Library authors can add agent-oriented usage rules next to a class, object, or function. Consumers call agentHelp(target) or the agent-readable-ts CLI to get compact Markdown with the real callable surface plus any author-supplied behavioral notes.

To let your coding agent automatically call agentHelp() before using an unfamiliar API, install the companion skill:

npx skills add zydo/skills --skill agent-readable
import { agentHelp } from "agent-readable-ts";

class Sensor {
  calibrate(offset: number): void {}
  read(): number {
    return 0;
  }

  agentNotes(): string {
    return "- Call `calibrate()` once during setup, before `read()`.";
  }
}

console.log(agentHelp(new Sensor()));

Install

npm install agent-readable-ts

For one-off CLI use:

npx agent-readable-ts commander
npm exec -- agent-readable-ts commander:Command
pnpm dlx agent-readable-ts ./src/widget.ts:Widget

See Getting Started for full install and CLI usage.

Documentation

Other Languages

  • Python: agent-readable provides the same idea for Python packages and classes.

License

MIT