nhplug-sdk AGENTS.md

Repository-specific instructions for building with nhplug-sdk, a Python package for the NH Investment & Securities Open API, including its files, installation, and source documentation.

In plain words
What is it for?
Adding REST API calls, handling response codes and repeated requests, using WebSocket subscriptions, applying rate limits, and working with instrument master data.
Why use it?
They explain which code and domain documents are authoritative and prevent agents from using the wrong package paths, examples, or API conventions.

Instructions file for CodexOpenCode

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 instructions/plug-openapi/nhplug-sdk/agents-md
Clone the repo
git clone --depth 1 https://github.com/PLUG-OpenAPI/nhplug-sdk

Made for: Codex, OpenCode.

Per session 4,633 This file is loaded in full into every session.
When invoked 4,633 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.04633 $0.04633
Opus 5 $0.02316 $0.02316
Sonnet 5 $0.00927 $0.00927
Haiku 4.5 $0.00463 $0.00463

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

Security

Grade A, and why

nhplug-sdk AGENTS.md 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.

| **SDK 없이** 원시 호출(urllib·requests) | [snippets/standalone/README.md](https://github.com/PLUG-OpenAPI/nhplug-sdk/blob/main/snippets/standalone/README.md) |
AGENTS.md · 147 lines

How it starts

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

AGENTS.md — NH투자증권 Open API 개발 규칙 (AI 에이전트용)

이 저장소로 개발하는 AI 코딩 에이전트(Antigravity·Cursor·Claude Code 등)는 아래 규칙을 따른다.

설치 — pip install nhplug (패키지명 nhplug, 저장소명 nhplug-sdk)

  • 배포되는 것: nhplug(코어) · nhplug.realtime(WebSocket) · nhplug.instruments(종목마스터 파서 + .h 28종).
  • 배포되지 않는 것: snippets/ examples/ pipeline/ guides/ — 저장소를 clone 해서 참고한다.
  • pip install "nhplug[instruments]" 로 pandas 를 함께 설치하면 마스터가 DataFrame 으로 온다.
  • ⚠️ 저장소 경로 instruments/ 는 설치 시에만 nhplug/instruments/ 로 매핑된다(package-dir). 헤더 .h 의 GitHub 링크가 포털에 게시돼 있어 저장소 경로를 옮기면 안 된다.

저장소 개요

  • nhplug/ : 공용 클라이언트(토큰 발급·캐시, Input_0 봉투, 헤더 자동) + realtime.py. 새 코드는 이걸 재사용한다.
  • snippets/ : 기능 단위 실행 샘플(기능당 폴더 = 호출.py + chk_검증.py). 특정 기능 구현 시 참고.
  • examples/ : 카테고리 통합 예제.
  • pipeline/ : 설계→검증→실행 파이프라인 골격.
  • docs/ : 도메인 명세의 로컬 사본 위치(scripts/fetch_docs.py 로 받음, 커밋 안 함). 정본은 도메인 URL(아래).

🗺️ 파일 지도 — 무엇을 알고 싶을 때 어디를 여는가

⚠️ GitHub 은 폴더 목록(/tree/)을 크롤러에 막아 둔다. 아래 링크로 직접 열어야 한다. 파일 목록이 필요하면 이 표와 README 「구성」 절을 본다.

알고 싶은 것 열어볼 파일
REST 호출 · rsp_cd 판정 · 연속조회 · 유량 스로틀 nhplug/client.py
WebSocket 구독 · 포트 라우팅 · 서버 한도 · TLS nhplug/realtime.py
토큰 발급·캐시 · 호스트 가드 · 브랜드 판정 nhplug/auth.py
오류 분류(config·auth·rate_limit·business…) nhplug/errors.py
.env 탐색 순서 nhplug/_env.py
실시간 채널 27종 · tr_key 대응표 docs/realtime_channels.md
종목마스터 28종 목록 · 파서 사용법 instruments/README.md
.mst 파싱 구현 instruments/master.py
SDK 없이 원시 호출(urllib·requests) snippets/standalone/README.md
계좌구분(acct_type) 판정 예제 snippets/common/list_accounts
실시간 구독 예제·검증 snippets/krstock/realtime_execution
AI IDE 규칙 파일(고객 배포용) templates/README.md
설치부터 첫 실행까지 절차 guides/antigravity.md
대화로 조회(MCP 서버) nhplug-mcp

Read the full file on GitHub · 147 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 · 147 lines · 4,633 tokens per session scan A 43a947d8bcb6

Subscribe to this mod's changes

nhplug-sdk AGENTS.md is an instructions file published in the GitHub repository PLUG-OpenAPI/nhplug-sdk (8 stars, last pushed 4d ago), licensed MIT. It adds 4,633 tokens to every session, about $0.0232 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-31.

Related

Other instructions, from other repositories

machine-learning-for-trading copilot-instructions.md

Instructions for stefan-jansen/machine-learning-for-trading, covering repository conventions for code review, prose and comment style, notebooks, data schema and results and dataframes.

stefan-jansen/machine-learning-for-trading · 592 tokens

xalpha AGENTS.md

Instructions for refraction-ray/xalpha, covering xalpha agent platform guidelines, 1. the agentic workflow, 2. core compatibility contracts, 3. data scraping & api resilience and 4. local caching.

refraction-ray/xalpha · 917 tokens

metatrader-mcp-server CLAUDE.md

Instructions for ariadng/metatrader-mcp-server, covering claude development guide - metatrader mcp server, project overview, architecture (3 packages), 1. metatraderclient - core mt5 library and 2. metatradermcp - mcp server.

ariadng/metatrader-mcp-server · 1,867 tokens

thai-personal-finance-planner CLAUDE.md

Claude Code instructions for satasuk03/thai-personal-finance-planner, covering claude.md, quick orientation for claude, before you start editing, where you'll be tempted to do the wrong thing and "i'll just add this section to skill.md".

satasuk03/thai-personal-finance-planner · 1,354 tokens

thai-personal-finance-planner AGENTS.md

AGENTS.md instructions for satasuk03/thai-personal-finance-planner, covering agents.md, what this repository is, architecture in one diagram, directory map and how a contribution flows.

satasuk03/thai-personal-finance-planner · 3,378 tokens

krx-cli CLAUDE.md

Claude Code instructions for kyo504/krx-cli, covering claude.md, core principles, development notes, workflow orchestration and 1. plan mode default.

kyo504/krx-cli · 608 tokens