coding-standards

A set of coding rules for a project, covering comment language, Python quote style, linting, Go formatting, submodules, debugging, and refactoring.

In plain words
What is it for?
Use it when writing comments, Python, or Go; modifying the lazyllm submodule; debugging issues; or cleaning up code after a refactor.
Why use it?
It makes code and investigations follow the project's agreed conventions and discourages guesses that have not been checked against runtime evidence.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/lazyagi/lazymind/coding-standards
Clone the repo
git clone --depth 1 https://github.com/LazyAGI/LazyMind

Made for: Cursor.

Per session 1,620 This file is loaded in full into every session.
When invoked 1,620 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01620 $0.01620
Opus 5 $0.00810 $0.00810
Sonnet 5 $0.00324 $0.00324
Haiku 4.5 $0.00162 $0.00162

Measured 2d ago against content hash db82761f585f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

coding-standards scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

### 推荐:容器内 curl 模拟
.cursor/rules/coding-standards.mdc · 126 lines

How it starts

The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Coding Standards

Comments

  • Write all comments in English.
  • Use clear, concise language.

Python

  • Prefer single quotes (') for strings when both are valid.
  • Example: msg = 'hello' not msg = "hello".
  • exec make lint after coding, run source /Users/macro/lazyllm/bin/activate if environment is not ready
  • add ${PROJECT_ROOT_DIR}/algorigtm/lazyllm to PYTHONPATH env variable

Go

  • use gofmt after modifying

Submodule

  • Modidy algorithm/lazyllm directly when you need to modify lazyllm. DO NOT modify site-pickages

Debug

When debugging, do not infer root causes from code alone. First collect evidence by adding logs, reproducing the issue, simulating requests, inspecting database records, reviewing application logs, and tracing the actual execution path. Every diagnosis should be supported by runtime evidence. Avoid speculative fixes that are not verified against observed behavior.

Refactoring Role

Whenever you refactor code, you must clean up the old implementation immediately. Remove dead code, unused functions, unused variables, obsolete comments, redundant logic, and superseded implementations. Do not keep both old and new versions of the same logic unless backward compatibility is explicitly required. The codebase should be cleaner after every refactor, not accumulate technical debt.

Tool Descriptions vs System Prompt Guidance

All behavioral instructions for a tool (when to use it, how to call it, what types it accepts, what happens after it runs) belong in the tool function's docstring. Do NOT add corresponding guidance strings to algorithm/lazymind/chat/engine/prompts/guidance.py or inject them into the system prompt.

The LLM reads tool schemas (function name + docstring) directly at inference time. Guidance strings in the system prompt duplicate this information, go stale, and add noise. Keep the docstring the single source of truth.

Guidance strings in guidance.py are reserved for cross-cutting concerns that are not specific to any single tool (e.g. image URL formatting, citation style, environment context).

Read the full file on GitHub · 126 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 126 lines · 1,620 tokens per session scan A db82761f585f

Subscribe to this mod's changes

coding-standards is a cursor rule published in the GitHub repository LazyAGI/LazyMind (74 stars, last pushed 2d ago), licensed Apache-2.0. It adds 1,620 tokens to every session, about $0.0081 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.