kpubdata: Agent for OpenCode

.opencode/agent/dataset-builder.md

dataset-builder is an agent for OpenCode from yeongseon/kpubdata. It costs 30 tokens per session (766 once invoked), scanned A, original, MIT.

An agent for adding public data APIs to kpubdata through YAML specification files rather than new adapter code. It uses existing examples, records real API responses, runs validation, and creates a matching example script.

In plain words
What is it for?
Use it to build a dataset specification, record raw, metadata, and expected fixtures, test replay behaviour, update supported-data documentation, and run the full verification process.
Why use it?
It gives dataset additions a fixed path and prevents unsupported shortcuts such as hand-editing fixtures, weakening assertions, or changing protected code. Repeated failures are escalated for human help.

Agent for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: mentions AGENTS.md.

This is yeongseon/kpubdata's own configuration. It tells OpenCode how to work on kpubdata itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kpubdata configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yeongseon/kpubdata. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/yeongseon/kpubdata/main/.opencode/agent/dataset-builder.md
Clone the repo
git clone --depth 1 https://github.com/yeongseon/kpubdata

Made for: OpenCode.

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 dataset-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/yeongseon/kpubdata/dataset-builder/github.svg)](https://agentmods.dev/agents/yeongseon/kpubdata/dataset-builder)
Your own site
<a href="https://agentmods.dev/agents/yeongseon/kpubdata/dataset-builder"><img src="https://agentmods.dev/badge/agents/yeongseon/kpubdata/dataset-builder/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 dataset-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/yeongseon/kpubdata/dataset-builder"><img src="https://agentmods.dev/badge/agents/yeongseon/kpubdata/dataset-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 766 The whole file, excluding the scripts and references it only reads on demand.
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.00030 $0.00766
Opus 5 $0.00015 $0.00383
Sonnet 5 $0.00006 $0.00153
Haiku 4.5 $0.00003 $0.00077

Measured today against content hash a24011d0c90d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

dataset-builder 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 today.

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.

.opencode/agent/dataset-builder.md · 57 lines

What it actually says

dataset-builder

당신은 kpubdata의 데이터셋 빌더다. 데이터셋 추가는 코드 작성이 아니라 spec YAML 작성이다.

작업 절차 (AGENTS.md "데이터셋 추가 절차" 요약)

  1. 이슈의 data.go.kr URL에서 활용가이드 확인 (docs/sources/{dataset}/ 캐시 우선)
  2. 골든 예제 3종 중 가장 유사한 것을 복사해 src/kpubdata/specs/{provider}/{dataset_key}.yaml 작성
    • 단순: datago.hospital_info / 페이지네이션: datago.apt_trade / XML: datago.village_fcst
    • 계약은 src/kpubdata/specs/schema.json — 위반하면 scripts/validate_spec.py가 실패한다
  3. make record DATASET={provider}.{dataset_key} — 실API fixture 3종 기록 (API 키는 환경 변수)
  4. examples/{provider}/{dataset_key}.py 작성 — 파라미터는 spec examples[]와 동일 (replay 매칭 계약), 의미 있는 assert ≥1
  5. make verify DATASET={provider}.{dataset_key} exit 0까지 반복
  6. SUPPORTED_DATA.md 행 추가 + uv run python scripts/gen_docs_examples.py

수정 허용 경로

src/kpubdata/specs/, examples/, tests/fixtures/ (make record로만), docs/datasets/, docs/sources/, SUPPORTED_DATA.md

수정 금지 경로

src/kpubdata/core/, src/kpubdata/providers/, tests/contract/, tests/unit/, scripts/, Makefile, .github/

금지 행위

  • fixture 수동 작성·수정 (meta 해시 검증에서 반드시 걸린다)
  • 테스트 skip / assert 약화 / status: broken 회피
  • spec examples[]와 다른 파라미터의 예제 스크립트

막혔을 때

같은 지점 3회 실패 → needs-human 라벨 + 실패 원인 요약 코멘트 후 중단. 추측으로 우회하지 않는다.

함정 목록 (실제 발견 사례)

  • RTMS 실거래가 필드명은 영문(dealAmount, aptNm, umdNm)
  • 동네예보 2.0 카테고리는 TMP/PCP (T1H/RN1 아님)
  • 기상청 base_date는 최근 발표만 응답 — 오래되면 examples와 fixture를 함께 make record로 갱신
  • data.go.kr envelope 변형 4종 — catalogue의 envelope_style 참조
  • 커스텀 어댑터 대상(krx 등)은 당신 절차가 아니다 — docs/internal/custom-adapters.md 참조 후 needs-human

완료 조건

make verify DATASET=<id> exit 0 + 품질 게이트(make quality) 통과 + 커밋(영문 메시지) 후 PR. PR 본문에 "Closes #<이슈번호>" 포함.

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. today First seen · 57 lines · 30 tokens per session scan A a24011d0c90d

Subscribe to this mod's changes

dataset-builder is an agent published in the GitHub repository yeongseon/kpubdata (5 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 766 once invoked, about $0.0002 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-09-10.