ehs-ims-conventions

ehs-ims-conventions is a cursor rule for Cursor from SafetyMP/Autonomous-EHS-Management. It costs 722 tokens per session, scanned A, original, Apache-2.0.

A set of development rules for an environmental, health, and safety management application. It covers permissions, database changes, API organization, and audit records.

In plain words
What is it for?
Use it when adding or changing database schemas, tRPC API procedures, role permissions, migrations, audit logging, or compliance-related features.
Why use it?
It keeps regulated data changes consistent, permission-checked, recorded, and backed by the project's PostgreSQL database.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding or changing database schemas, tRPC API procedures, role permissions, migrations, audit logging, or compliance-related features.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/safetymp/autonomous-ehs-management/ehs-ims-conventions
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.

Clone the repo
git clone --depth 1 https://github.com/SafetyMP/Autonomous-EHS-Management

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ehs-ims-conventions

README.md
[![agentmods](https://agentmods.dev/badge/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions/github.svg)](https://agentmods.dev/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions)
Your own site
<a href="https://agentmods.dev/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions"><img src="https://agentmods.dev/badge/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ehs-ims-conventions

Your own site · 80×15
<a href="https://agentmods.dev/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions"><img src="https://agentmods.dev/badge/rules/safetymp/autonomous-ehs-management/ehs-ims-conventions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 722 This file is loaded in full into every session.
When invoked 722 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00722 $0.00722
Opus 5.5 $0.00289 $0.00289
Sonnet 5.5 $0.00144 $0.00144
Haiku 4.5 $0.00072 $0.00072

Measured 1mo ago against content hash 1fed50f14e92, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ehs-ims-conventions scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/ehs-ims-conventions.mdc · 47 lines

How it starts

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

Autonomous EHS — agent & developer conventions

Single system of record

  • PostgreSQL + Drizzle is authoritative for commitments, statuses, approvals, and audit-relevant facts.
  • Never introduce “TypeScript-only” columns or tables: every schema change needs a Drizzle migration (npm run db:generate) and a deploy path.

RBAC

  • Permission keys live in src/lib/rbac.ts (PERMISSIONS). New procedures must call assertPermission (or equivalent) with the correct key.
  • Do not bypass RBAC for “internal” routes; agent/tool callers must use the same checks with a service identity if you add one later.

tRPC

  • Routers live under src/server/trpc/routers/. Register in src/server/trpc/root.ts.
  • Prefer clear procedure names: list, get, create, update, updateStatus — match existing routers (e.g. incident, capa, document).
  • Mutations that change regulated data should write audit_log via writeAuditLog where the codebase already does for other entities.
  • Compliance- or retention-affecting work (incident lifecycle, data_retention_policy, RAG PII, COMPLIANCE.md, compliance.* routers): follow .cursor/skills/corporate-compliance-data-governance/SKILL.md and the requestable rule compliance-data-governance.

Drizzle

  • Schema: src/server/db/schema.ts. Match naming and relation patterns already used (enums, updatedAt, FK onDelete).
  • After editing schema, run npm run db:generate and commit the new SQL under drizzle/migrations/.

Tests and risky areas

  • Do not change auth session shape, proxy/dashboard auth gating, or env validation without updating Vitest and smoke E2E expectations.
  • RBAC matrices and seed scripts: changing PERMISSIONS requires scripts/seed.ts / migration of permission rows for existing orgs.

AI / LLM (when added)

  • Structured outputs: validate model JSON against Zod schemas shared with or mirrored from API inputs — never trust free-form prose into the DB without parsing.
  • Tool use: assistants must call typed tRPC or internal server handlers, not ad-hoc SQL or filesystem paths.
  • Gateway: route all provider calls through src/lib/ai/gateway.ts (or successor); no scattered fetch to model APIs.
  • Safety: tie expensive AI routes to Upstash rate limits (src/server/ratelimit.ts). Redact PII in prompts and logs where required.
  • Human-in-the-loop: do not auto-close investigations, auto-verify CAPA effectiveness, or silently commit regulatory classification without product policy.

Read the full file on GitHub · 47 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. 1mo ago First seen · 47 lines · 722 tokens per session scan A 1fed50f14e92

Subscribe to this mod's changes

ehs-ims-conventions is a cursor rule published in the GitHub repository SafetyMP/Autonomous-EHS-Management (7 stars, last pushed 5d ago), licensed Apache-2.0. It adds 722 tokens to every session, about $0.0029 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.