agentleFS
liustackliustack/modlens/AGENTS.md

modlens

AGENTS.md4.1k starsChanged 4 months agoMITView on GitHub

Provide the modlens CLI tool that converts image sources (local path or remote URL) into structured text evidence for non-vision LLM workflows. The contract: an image the user hands over is read once, and that read leaves text later turns can quote. The image is in the conversation because the user pasted it, dropped a path, or gave a URL. Visual parsing is the only job. Web search and page fetching live in modsearch.

  • Reads credentials
  • Installs packages

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 8 mentionsSep 2026: 5 mentionsOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the liustack/modlens repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about liustack/modlens

The biggest 5 of 15 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 15

Talked about on GitHub and Bluesky (15 times).

On GitHub · 14

9 more on GitHub
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before creating a new doc, run pnpm docs:list to review the existing index.

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Project Overview (for AI Agent)

Goal

Provide the modlens CLI tool that converts image sources (local path or remote URL) into structured text evidence for non-vision LLM workflows.

Scope

The contract: an image the user hands over is read once, and that read leaves text later turns can quote. The image is in the conversation because the user pasted it, dropped a path, or gave a URL.

Do not add:

  • a camera, screenshot capture, or hotkeys
  • CDP, or holding a browser session
  • computer-use (screen plus keyboard and mouse)
  • a pixel toolbox (grounding, crop, pixel-diff, reconstructing a UI)
  • bounding boxes or confidence scores (dropped from the schema on purpose)

Visual parsing is the only job. Web search and page fetching live in modsearch.

Technical Approach

  • Six vision providers behind one interface (src/providers/index.ts). Subprocess providers implement buildInvocation + parseOutput (antigravity-cli, claude-cli, kimi-cli); in-process API providers implement execute (gemini-api, openai, anthropic). antigravity-cli is the zero-config default, and kimi-cli runs only when named, since it spends a subscription.
  • Schema-enforced JSON output wherever the backend allows: --json-schema on the Claude and Antigravity CLIs (kimi-cli has no such flag and uses the template), responseJsonSchema on gemini-api, a forced tool call on anthropic. The openai route uses a template-instance prompt (weak gateways echo raw schemas back) plus shape validation that fails loudly.
  • Layered config: CLI flags > ~/.modlens/config.json (managed by modlens config init/set/show, 0600, masked rendering) > built-ins. Since 3.17.0 a provider's settings come from one source, whole: the file when it mentions that provider, the bound environment variables (GEMINI_API_KEY, GEMINI_BASE_URL, OPENAI_API_KEY, OPENAI_BASE_URL, ANTHROPIC_API_KEY, ANTHROPIC_BASE_URL) when it does not. They used to merge field by field, and an endpoint and a key are one credential, so drawing halves from two places built a pairing that existed in neither. apiKey (file or env) accepts a comma-separated list and rotates after auth, rate-limit, or quota failures. Quota cooldown state lives in ~/.modlens/state.json. MODLENS_MODEL, MODLENS_HARNESS and the proxy conventions are unaffected.
  • Vendor knobs pass through, they are not modelled: <provider>.extraBody (or --extra-body) deep-merges a JSON object into the request body of the three API providers, which is how thinking gets turned off. No per-vendor table lives in the code, because the spelling differs per gateway and a wrong guess either 400s or is ignored silently. The fields carrying the image, the prompt, and the schema are reserved (src/util/extraBody.ts).
  • Paste recovery across harnesses: modlens recover-paste pulls pasted image bytes out of local session storage (pastes never hit a regular temp file). It supports Claude Code and Pi (JSONL transcripts) and OpenCode (SQLite), detects Codex and defers to its on-disk temp files, and scopes to the harness it runs inside via process ancestry. Exact targeting via --session, else newest-image-timestamp scanning. Storage layouts are each harness's internals, so treat this as best-effort.
  • Single responsibility: visual parsing only. Web search and page fetching live in modsearch.
pnpm install

Code Organization

src/
├── main.ts           # CLI entry: analyze (default), guard, recover-paste, doctor, config, state subcommands
├── analyzer.ts       # orchestration: input resolution, config merge, provider dispatch
├── config.ts         # layered config load/set/show/init
├── cooldown.ts       # quota cooldown store at ~/.modlens/state.json
├── doctor.ts         # offline diagnostics: Node, provider readiness, selection, harness, config perms
├── prompt.ts         # vision prompt (local/remote agent modes + inline api mode)
├── schema.ts         # vision result JSON schema (single source of truth)
├── imageInput.ts     # base64/mime helpers (local + remote image bytes)
├── util/json.ts      # shared JSON helpers (parse, extract, truncate)
├── guard/            # invocation guard (issue #15): rules (deny globs), modelSniff (active model from session storage), index (signal precedence)
├── recoverPaste/     # paste recovery: adapters/{claude,pi,opencode}, detect, jsonl, index
└── providers/
    ├── index.ts        # provider interface + registry (5 providers + aliases)
    ├── antigravity.ts  # agy subprocess provider
    ├── claudeCli.ts    # claude subprocess provider (Read-only tools)
    ├── geminiApi.ts    # Gemini Developer API
    ├── openaiCompat.ts # any OpenAI-compatible multimodal endpoint
    └── anthropicApi.ts # Claude API (forced tool call)

Tests are co-located: modules get an adjacent *.test.ts (vitest), the CLI assembly in main.ts included. A few pure-data modules such as schema.ts carry none, since there is no behavior to pin. The CLI is exposed via dist/main.js (vite lib build, Node built-ins auto-externalized).

Skills Directory

skills/modlens/
├── SKILL.md                    # triggering + per-harness path finding + workflow
└── references/
    ├── output-schema.md        # output contract
    └── configure.md            # per-provider setup recipes the agent can execute

CLI Usage

modlens -i screenshot.png                     # default provider (antigravity-cli)
modlens -i screenshot.png -p gemini-api       # fastest free route (5-10s)
modlens recover-paste --session <uuid>        # Claude Code pasted-image recovery
modlens doctor                                # offline config/routing diagnosis (--json for machine output)
modlens config show

Verification

  • pnpm typecheck && pnpm test for unit-level checks; pnpm build must produce a single dist/main.js.
  • Real end-to-end runs consume the user's provider quota (agy, API keys, Claude subscription). Ask before running them in bulk.

Evals

  • Every experiment leaves a reproducible artifact. evals/ holds seed cases (evals/cases/<id>/case.json) and a runner (pnpm eval, or pnpm eval --dry-run to validate without a provider call). Each live run writes one evidence artifact per case to evals/results/<date>/ (git-ignored), recording the command, tool version and commit, provider and model, input SHA-256, raw output, expected points and scoring, latency, usage, and any error or degradation. Format and fields are documented in evals/README.md.
  • Evals are local and on-demand: they spend real quota and never run in CI. The runner only checks containment and schema shape; whether a model obeyed a prompt injection is a human read of the artifact.

Operational Docs (docs/)

  1. Operational docs use front-matter metadata (summary, read_when).
  2. Before creating a new doc, run pnpm docs:list to review the existing index.
  3. Existing docs: troubleshooting (every error this CLI prints, with causes and fixes), harness-setup (how a pasted image reaches the model in each harness), security (recovered-image privacy, permissions passed to engines, untrusted image content), testing, commit, research-gemini-claude-skills (historical, Gemini CLI era).

.gitignore must include

  • node_modules/
  • dist/
  • skills/**/outputs/
  • common logs/cache/system files

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.