hpo-link: Instructions file for Codex

AGENTS.md

hpo-link AGENTS.md is an instructions file for Codex, OpenCode from berntpopp/hpo-link. It costs 2,388 tokens per session, scanned A, original, MIT.

Repository guidance for hpo-link, a read-only service built around the Human Phenotype Ontology, a standardized vocabulary for describing medical features. It explains how the data-import layer and the API layer must remain separate.

In plain words
What is it for?
Working on configuration, data ingestion, SQLite database building, phenotype and gene or disease lookups, hierarchy queries, and MCP or REST interfaces without mixing data-processing responsibilities with API response handling.
Why use it?
The rules help contributors preserve the project’s architecture and data guarantees while importing ontology and gene-disease information into SQLite. They also define how errors and returned data should be handled.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is berntpopp/hpo-link's own configuration. It tells Codex and OpenCode how to work on hpo-link 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 hpo-link configures →

Reuse

Borrowing it

Nothing to install: this file belongs to berntpopp/hpo-link. 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/berntpopp/hpo-link/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/berntpopp/hpo-link

Made for: Codex, 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 hpo-link AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/berntpopp/hpo-link/agents-md/github.svg)](https://agentmods.dev/instructions/berntpopp/hpo-link/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/berntpopp/hpo-link/agents-md"><img src="https://agentmods.dev/badge/instructions/berntpopp/hpo-link/agents-md/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 hpo-link AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/berntpopp/hpo-link/agents-md"><img src="https://agentmods.dev/badge/instructions/berntpopp/hpo-link/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,388 This file is loaded in full into every session.
When invoked 2,388 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.02388 $0.02388
Opus 5.5 $0.00955 $0.00955
Sonnet 5.5 $0.00478 $0.00478
Haiku 4.5 $0.00239 $0.00239

Measured 6d ago against content hash 2187fd3b5f22, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hpo-link AGENTS.md 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 6d 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.

AGENTS.md · 173 lines

How it starts

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

Guidance for agents and contributors working in this repository.

What this is

hpo-link is an MCP + REST server that grounds phenotype work in the Human Phenotype Ontology (HPO). It builds a local SQLite database from the HPO OBO release and HPOA gene/disease annotation files, then serves read-only tools for phenotype term lookup, the is_a hierarchy, cross-ontology mapping, and gene↔phenotype↔disease association queries. It mirrors the sibling mgi-link stack/architecture.

Two planes (non-negotiable boundary)

  • Data plane — config.py, constants.py, identifiers.py, ingest/, data/, services/. Downloads the HPO release (conditional GET), atomically builds the SQLite database (terms, labels, synonyms, definitions, is_a closure, cross-references with provenance + predicate, deprecated/replaced_by, HPOA gene and disease annotations), and returns plain dicts. It raises typed exceptions from hpo_link.exceptions; it never builds error envelopes.
  • MCP plane — mcp/. Domain-agnostic scaffolding shared with siblings. run_mcp_tool (in mcp/envelope.py) owns success / _meta and converts exceptions into returned structured errors (never raised to the client).

Architecture: ingest → data DAO → services → MCP

ingest/            download (conditional GET) → lock → parser → builder (schema.sql)
data/              HpoRepository (read-only SQLite DAO)
services/          HpoService, AnnotationService, shaping, pagination, refresh
mcp/               envelope, capabilities, annotations, schemas, next_commands,
                   metrics, middleware, facade, arg_help, resources, tools/
server.py          unified REST + MCP transport (FastAPI + uvicorn)
mcp_server.py      stdio transport (Claude Desktop)

Invariants

  • Services return plain dicts; the envelope owns success/_meta and returns structured errors. 7-code error taxonomy: invalid_input, not_found, ambiguous_query, data_unavailable, rate_limited, upstream_unavailable, internal_error.
  • Every compact (default) or richer response carries _meta.next_commands (ready-to-call follow-ups); minimal is the explicit opt-out and returns only _meta = {tool, request_id}. _meta verbosity is tiered by response_mode (_shape_meta): compact keeps next_commands + capabilities_version but drops the elapsed_ms echo; standard/full add elapsed_ms.
  • Every tool declares output_schema + READ_ONLY_OPEN_WORLD annotations, and its first description sentence is a discovery summary ending with Signature: tool(args...).
  • Every tool's real output (success + error, all response modes) must validate against its own output_schema — enforced by tests/unit/test_output_schemas.py. Grouped-by-prefix payloads (xrefs, mappings) are objects keyed by prefix, not arrays; declare them as objects or the envelope leaks a raw validation error.
  • response_mode ∈ minimal | compact | standard | full. List tools also carry a pagination block (total/returned/limit/offset/truncated/next_offset); when truncated, _meta.next_commands offers a forward-page step (advance offset).
  • compact+ _meta echoes capabilities_version (a hash of the discovery contract) so warm clients can skip re-fetching get_server_capabilities (omitted in minimal).
  • Keep mcp/capabilities.py::TOOLS in sync with the registered tool set (tests/unit/test_tool_names.py enforces this).
  • Identifiers are normalised in identifiers.py (HP:NNNNNNN; external CURIEs case-folded).
  • Ground every claim in the local database and cite the HPO id + HPO release version. hpo_version is the per-call citation anchor (echoed on every non-minimal payload). The long-form recommended_citation is inlined only on standard/full payloads — term and association alike (one rule across both planes); compact/minimal carry hpo_version and defer the full citation to get_server_capabilities, which is the canonical source of record per the advertised provenance_policy.
  • structlog logs to stderr only — stdout is reserved for the stdio MCP protocol. Never print to stdout outside the CLI.
  • Files stay under 500 lines (hard cap enforced by scripts/check_file_size.py in CI).

Read the full file on GitHub · 173 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. 6d ago Changed 2187fd3b5f22
  2. 1mo ago Changed · +28 lines · +495 tokens per session df00711e0c89
  3. 1mo ago First seen · 145 lines · 1,893 tokens per session scan A 17e795c3af57

Subscribe to this mod's changes

hpo-link AGENTS.md is an instructions file published in the GitHub repository berntpopp/hpo-link (1 stars, last pushed 2d ago), licensed MIT. It adds 2,388 tokens to every session, about $0.0096 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.

Related

Other instructions, from other repositories