sub-agent-architecture

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

A set of Korean-language architecture rules for organizing the source code of an Electron MCP server, a tool that connects agents to Electron applications.

In plain words
What is it for?
It guides the addition and refactoring of MCP tools under `src/tools/`, including when to use one file, a tool-specific folder, or a shared folder.
Why use it?
It reduces confusion about where new tools and shared code belong and keeps the package structure consistent.

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/sub-agent-architecture
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 sub-agent-architecture

README.md
[![agentmods](https://agentmods.dev/badge/rules/ohah/electron-mcp-server/sub-agent-architecture.svg)](https://agentmods.dev/rules/ohah/electron-mcp-server/sub-agent-architecture)
Your own site
<a href="https://agentmods.dev/rules/ohah/electron-mcp-server/sub-agent-architecture"><img src="https://agentmods.dev/badge/rules/ohah/electron-mcp-server/sub-agent-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 669 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.00028 $0.00669
Opus 5 $0.00014 $0.00334
Sonnet 5 $0.00006 $0.00134
Haiku 4.5 $0.00003 $0.00067

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

Security

Grade A, and why

sub-agent-architecture 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/agents/sub-agent-architecture.mdc · 51 lines

What it actually says

아키텍처 관리자 (Architecture Manager)

이 룰은 패키지 소스 구조 설계·리팩터링·새 툴/기능 추가 시 적용한다. .cursor/rules/architecture-rules.mdc 와 동일한 원칙을 지키며, 구조 결정이 필요할 때 이 에이전트를 참고한다.

0. 적용 범위

  • packages/electron-mcp-server/src/ 아래 구조.
  • 새 MCP 툴 추가, 공통 로직 추출, 파일/폴더 분리 여부 판단.

1. 원칙 요약

  1. utils 폴더를 만들지 않는다.
    툴 전용이든 여러 툴이 쓰는 공통이든, 모두 src/tools/ 아래에 둔다.

  2. 한 툴은 기본적으로 한 파일
    예: tools/window-info.ts, tools/command.ts.
    코드가 많아지면 그 툴 전용 하위 폴더를 만들고, index.ts 로 툴 등록·export 를 모은 뒤, 나머지는 같은 폴더 안에서 파일로 쪼갠다.

  3. 여러 툴이 쓰는 공통 로직
    tools/<공통이름>/index.ts 형태로 둔다.
    예: tools/electron/index.ts — CDP 앱 발견, 타겟 조회, executeInElectron 등.

2. 현재 구조 (참고)

src/
├── index.ts                 # MCP 서버 진입점, registerAllTools 호출
└── tools/
    ├── index.ts             # registerAllTools
    ├── electron/
    │   └── index.ts         # 공통: scanForElectronApps, getElectronWindowInfo, executeInElectron 등
    ├── window-info.ts       # get_electron_window_info
    ├── screenshot.ts        # take_screenshot (+ takeScreenshot export)
    └── command.ts           # send_command_to_electron

3. 판단 시 체크리스트

  • 새 로직이 한 툴에만 쓰이면 → 해당 툴 파일에 두거나, 툴이 커졌을 때만 tools/<툴이름>/ 폴더로 분리.
  • 새 로직이 두 개 이상 툴에서 쓰이면 → tools/<공통이름>/index.ts (또는 기존 tools/electron/ 등)에 추가.
  • utils/ 로 빼야 할지 고민될 때 → utils 는 쓰지 않고, tools/ 안 하위 폴더 + index.ts 로 정리.

자세한 규칙은 .cursor/rules/architecture-rules.mdc 를 따른다.

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 · 51 lines · 28 tokens per session scan A 9e634809d6dd

Subscribe to this mod's changes

sub-agent-architecture is a cursor rule published in the GitHub repository ohah/electron-mcp-server (4 stars, last pushed 5mo ago), licensed MIT. It adds 28 tokens to every session and 669 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.