langsmith-cli
AGENTS.md9 starsChanged 4 months agoMITView on GitHub
SYSTEM INSTRUCTION: You are acting as a Senior Python Engineer. You are building langsmith-cli, a high-performance tool that must serve both human developers and other AI agents. CRITICAL: Read and adhere to the following 5 Engineering Standards. Deviations will be rejected. ❌ Bad (Weak): ✅ Good (Strong): The CLI must start instantly. * RULE: Modules imported on the ordinary CLI startup path MUST NOT have top-level imports of heavy libraries (langsmith, pandas, pydantic, rich). * RULE: Heavy imports must be…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 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.
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
REQUIRED: Treat LangSmith SDK objects as strict contracts.
- Very specific: line 11
REQUIRED: When handling dictionaries, define TypedDict or Pydantic models immediately.
- Distinctive: line 69
Do not mix data fetching with data printing.
- Very specific: line 73
Context Safety: All commands must support a --json flag that bypasses the View Layer entirely for AI consumption.
- Very specific: line 79
REQUIRED: Import and catch specific exception types from langsmith.utils or httpx.
- Very specific: line 85
Output Strategy: Default json output should be "sparse." Do not dump full trace blobs (20kb+) unless explicitly requested.
- Very specific: line 86
Skill Maintenance: If you modify the CLI arguments, you MUST update skills/langsmith/SKILL.md to reflect the changes immediately.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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.
Files
SYSTEM INSTRUCTION: You are acting as a Senior Python Engineer. You are building
langsmith-cli, a high-performance tool that must serve both human developers and other AI agents.CRITICAL: Read and adhere to the following 5 Engineering Standards. Deviations will be rejected.
1. 🛡️ Type Safety & Data Integrity (Zero Tolerance for Weak Types)
The Golden Rule: We prefer "Fail Fast" over "Fail Silently."
- FORBIDDEN: usage of
getattr(),hasattr(), orobj.get("key", default)unless we're dealing with truly dynamic data (unlikely). - FORBIDDEN: "Stringly typed" logic (e.g.,
if type == "error"). Use Enums. - REQUIRED: Treat LangSmith SDK objects as strict contracts. Access attributes directly (e.g.,
run.inputs). If an attribute is missing, the code should crash so we catch API changes immediately. - REQUIRED: When handling dictionaries, define
TypedDictor Pydantic models immediately. Do not pass rawdictobjects around.
❌ Bad (Weak):
# Hiding bugs with defensive coding
name = getattr(run, "name", "Unknown")
status = run.dict().get("status")
✅ Good (Strong):
# Relying on the SDK contract
name: str = run.name
# Using Enums for logic
if run.status == RunStatus.ERROR:
...
2. ⚡ Performance: The "100ms" Rule
The CLI must start instantly.
- RULE: Modules imported on the ordinary CLI startup path MUST NOT have
top-level imports of heavy libraries (
langsmith,pandas,pydantic,rich). - RULE: Heavy imports must be placed inside the command/getter, or in a dedicated operation-only module that is itself imported lazily after the user invokes that feature. This explicitly allows strict Pydantic contract modules for operation-specific logic without charging their import cost to unrelated CLI commands.
❌ Bad (Eager):
import langsmith # Loads 50MB of code at startup
from rich.console import Console
@click.command()
def list(): ...
✅ Good (Lazy):
import click # Lightweight, okay at top level
def get_client() -> "Client":
from langsmith import Client # Loads only when needed
return Client()
3. 🏗️ Architecture: Pure Logic vs. View
Do not mix data fetching with data printing.
- Logic Layer: Functions that return Pydantic models or strongly typed objects. They must never
print(). - View Layer: Functions that take data and render it (Rich Tables or JSON).
- Context Safety: All commands must support a
--jsonflag that bypasses the View Layer entirely for AI consumption.
4. 🧹 Error Handling
- DISCOURAGED: Catching
Exceptionbroadly. Use specific exception types. - FORBIDDEN: Matching errors by string (e.g.,
if "not found" in str(e)). - REQUIRED: Import and catch specific exception types from
langsmith.utilsorhttpx.
5. 🤖 Context Efficiency (The "Plugin" Standard)
This tool is a Claude Plugin. Optimization for token usage is paramount.
- Output Strategy: Default
jsonoutput should be "sparse." Do not dump full trace blobs (20kb+) unless explicitly requested. - Skill Maintenance: If you modify the CLI arguments, you MUST update
skills/langsmith/SKILL.mdto reflect the changes immediately.
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
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.

