architecture-rules

architecture-rules is a cursor rule for Cursor from ohah/electron-mcp-server. It costs 20 tokens per session (481 once invoked), scanned A, original, MIT.

A code-organization rule for an MCP server: put each tool and shared logic under a tools directory, with larger parts split into subfolders. An MCP server lets an AI agent call defined tools.

In plain words
What is it for?
Use it when adding or splitting MCP tools, deciding where shared logic belongs, and reviewing whether the source structure follows the repository's rules.
Why use it?
It keeps tool code in predictable locations and prevents shared code from being scattered in a separate utilities folder.

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/ohah/electron-mcp-server/architecture-rules
Clone the repo
git clone --depth 1 https://github.com/ohah/electron-mcp-server

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 architecture-rules

README.md
[![agentmods](https://agentmods.dev/badge/rules/ohah/electron-mcp-server/architecture-rules.svg)](https://agentmods.dev/rules/ohah/electron-mcp-server/architecture-rules)
Your own site
<a href="https://agentmods.dev/rules/ohah/electron-mcp-server/architecture-rules"><img src="https://agentmods.dev/badge/rules/ohah/electron-mcp-server/architecture-rules.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 481 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00020 $0.00481
Opus 5 $0.00010 $0.00241
Sonnet 5 $0.00004 $0.00096
Haiku 4.5 $0.00002 $0.00048

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

Security

Grade A, and why

architecture-rules 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 3d 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/architecture-rules.mdc · 36 lines

What it actually says

아키텍처 규칙 (Tools 중심)

MCP 서버 패키지(packages/electron-mcp-server/src) 구조와 코드 분리 시 적용한다.

1. utils 사용 금지

  • 툴 전용·공유 로직 모두 tools/ 아래에 둔다. utils/ 같은 별도 유틸 폴더를 만들지 않는다.
  • 여러 툴에서 쓰는 공통 로직이 있으면, tools 안에 하위 폴더를 만들고 index.ts로 노출한다.
    • 예: tools/electron/index.ts — CDP/Electron 발견·실행 등 여러 툴이 공유하는 로직.

2. tools 구조

  • 한 툴 = 한 파일 (예: tools/window-info.ts, tools/screenshot.ts, tools/command.ts).
  • 한 툴(또는 공유 모듈)의 코드가 커지면:
    • tools/<이름>/ 폴더를 만들고,
    • index.ts에서 툴 등록·외부에 필요한 것만 export 하고,
    • 나머지 구현은 같은 폴더 안의 다른 파일로 쪼갠다.
  • 예시:
    • tools/electron/index.ts — 스캔, 타겟, executeInElectron 등 export.
    • tools/screenshot.ts — take_screenshot 툴; 필요 시 나중에 tools/screenshot/index.ts + 내부 파일로 분리.

3. 정리

상황 위치
단일 MCP 툴 (코드 적음) tools/<툴이름>.ts
단일 툴이 커짐 tools/<툴이름>/index.ts + 같은 폴더 내 파일 분리
여러 툴이 쓰는 공통 로직 tools/<공통이름>/index.ts (예: tools/electron/)

utils 폴더는 만들지 않는다.

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. 3d ago First seen · 36 lines · 20 tokens per session scan A 3d352aac2ddc

Subscribe to this mod's changes

architecture-rules is a cursor rule published in the GitHub repository ohah/electron-mcp-server (4 stars, last pushed 5mo ago), licensed MIT. It adds 20 tokens to every session and 481 once invoked, about $0.0001 per session on Opus 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.