agentleFS
spuentespspuentesp/lain/.github/copilot-instructions.md

lain

Copilot instructions9 starsChanged 2 months agoMITView on GitHub

You have access to the Lain MCP server (tool prefix mcp__lain__). Lain indexes the current workspace and exposes tools for structural queries, semantic search, and code navigation. Reach for lain when the question is about structure, not single lines: - "Where should I start reading this codebase?" - "What does X depend on?" / "Who calls X?" - "If I change X, what else breaks?" - "Where do we do X?" (semantic search by meaning) - "What is this function/class…

The file

We split this copilot-instructions.md into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are 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.

  • 4

    Very specific

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

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

    Semantic search needs a query model: if get_health reports no embedding model, semantic_search will not work — fall back to explain_symbol …

    line 70
  2. Very specific:

    Don't use semantic_search with literal symbol names.

    line 74
  3. Very specific:

    Don't call lain tools against a path outside the workspace.

    line 75
  4. Very specific:

    Don't repeatedly call get_health.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
copilot-instructions.md

LAIN — Codebase Intelligence

You have access to the Lain MCP server (tool prefix mcp__lain__). Lain indexes the current workspace and exposes tools for structural queries, semantic search, and code navigation.

When to use lain

Reach for lain when the question is about structure, not single lines:

  • "Where should I start reading this codebase?"
  • "What does X depend on?" / "Who calls X?"
  • "If I change X, what else breaks?"
  • "Where do we do X?" (semantic search by meaning)
  • "What is this function/class doing?"
  • "Is there unused code?"
  • "What files change together?"
  • "Which test covers X?" / "What's untested?"

Skip lain for simple file reads, single-line grep, or trivial edits.

The most useful tools

ToolWhen to use it
get_healthFirst call in any session. Returns the resolved workspace, node counts, and status.
find_anchors"Where should I start reading?" — most-called, most-stable symbols.
list_entry_pointsFind main()s and entry points.
explore_architectureHigh-level module/file tree.
get_blast_radius"If I change X, what breaks?" — transitive callers.
trace_dependency"What does X depend on?" — callees + imports.
get_call_chainSpecific call path between two symbols.
semantic_searchFind code by meaning (e.g. "rate limiting", "retry logic"). Body excerpts included.
explain_symbol"What is this symbol?" — source + callers + callees + anchor.
get_code_snippetRead the exact source of a symbol by id.
find_dead_codeUnused definitions (filters false positives).
get_coupling_radar"What files change with X?" (co-change history).
get_cross_runtime_callersCross-language callers (e.g. Python → Rust FFI).
find_test_file / find_untested_functions / get_coverage_summaryTest discovery and coverage.
get_file_diff / get_commit_historyGit operations on the workspace.

Workflows

"I'm new here, where do I start?"

  1. get_health — confirm the workspace resolved correctly.
  2. find_anchors limit=5 — top entry points.
  3. explain_symbol <top anchor> — understand it.
  4. get_blast_radius <top anchor> — see what depends on it.

"I'm about to refactor X"

  1. get_blast_radius <X> — who will break.
  2. get_coupling_radar <X> — what else usually changes with it.
  3. find_test_file <X> (or find_untested_functions) — what's already covered.
  4. Make the change, then re-run get_blast_radius to verify no surprises.

"Where do we do X?" (semantic)

  1. semantic_search query="<natural language>" limit=5 — get candidates with body excerpts.
  2. explain_symbol <top result> — read it in context.

"What calls X?" / "What does X call?"

  • Callers (incoming): get_blast_radius <X>
  • Callees (outgoing): trace_dependency <X>

"Read this symbol"

  • explain_symbol <X> for full context, or get_code_snippet <X> for raw source.

Caveats

  • First-call latency: the very first tool call after a fresh server start can take 5–10s (model warmup). Don't panic.
  • Workspace scope: bound to the git repository you opened this session in (auto-discovered from the working directory). Lain cannot analyze a different repo.
  • Semantic search needs a query model: if get_health reports no embedding model, semantic_search will not work — fall back to explain_symbol / find_anchors and the query language.

Don't

  • Don't use semantic_search with literal symbol names; use natural language describing the concept.
  • Don't call lain tools against a path outside the workspace.
  • Don't repeatedly call get_health; once per session is enough.

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.