MarkdownView AGENTS.md

MarkdownView AGENTS.md is an instructions file for Codex, OpenCode from keitaoouchi/MarkdownView. It costs 722 tokens per session, scanned A, original, MIT.

A technical guide to MarkdownView, an iOS component that displays Markdown text as formatted content. It maps the Swift and web-based parts used for rendering, styling, syntax highlighting, and link handling.

In plain words
What is it for?
Use it when modifying Markdown rendering, styles, syntax highlighting, SwiftUI integration, plugins, or link and height events in the MarkdownView project.
Why use it?
It gives a coding agent a quick map of the rendering system without requiring it to trace every implementation detail. This helps changes stay consistent with how the component and its bundled web files work together.

Instructions file for CodexOpenCode

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

About the project

MarkdownView is an iOS component that displays Markdown as styled HTML inside an application. It is for Swift developers building UIKit or SwiftUI apps that need rendered Markdown with features such as code highlighting, links, themes, and custom styling.

keitaoouchi/MarkdownView · 2,177 stars · on GitHub

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/keitaoouchi/markdownview/agents-md
Clone the repo
git clone --depth 1 https://github.com/keitaoouchi/MarkdownView

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 MarkdownView AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/keitaoouchi/markdownview/agents-md.svg)](https://agentmods.dev/instructions/keitaoouchi/markdownview/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/keitaoouchi/markdownview/agents-md"><img src="https://agentmods.dev/badge/instructions/keitaoouchi/markdownview/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 722 This file is loaded in full into every session.
When invoked 722 The same file — it is already loaded in full.
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.1 $0.00722 $0.00722
Opus 5 $0.00361 $0.00361
Sonnet 5 $0.00144 $0.00144
Haiku 4.5 $0.00072 $0.00072

Measured 6d ago against content hash 35da9e716c2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

MarkdownView 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 · 68 lines

How it starts

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

AGENTS

Purpose

  • This document is a technical map for quickly understanding which components render Markdown and how they relate to each other.
  • It is written at a high level of abstraction, avoiding implementation details, to remain resilient to change.

Technical Components

  • UIKit Layer
    • MarkdownView (UIView)
      • Internal: WKWebView
      • Role: Loads web assets (HTML/CSS/JS) and renders Markdown
      • Input: Markdown string, options (CSS/Plugins/Stylesheets, styled flag)
      • Output/Events: Render completion (height notification), link tap events
  • Web Layer (Bundled Assets)
    • HTML: styled.html / non_styled.html
      • Role: Base HTML for rendering (toggles between styled and unstyled)
    • JS: main-core.js (core bundle, 15 languages, inlined into HTML), main-extended.js (97 additional languages, lazy-loaded), main.js (full bundle for tests)
      • Role: Markdown-to-HTML conversion using markdown-it and highlight.js, provides the window.renderMarkdown API, measures height and notifies native side
    • CSS: main-core.css (inlined into HTML at build time)
      • Role: Default styles (applied via styled.html)
  • SwiftUI Layer
    • MarkdownUI (UIViewRepresentable)
      • Role: Bridge that makes MarkdownView usable from SwiftUI
      • I/O: Passes SwiftUI data (Markdown string) to the UIKit side; receives events (link taps, render completion) via closures

Relationships (Data/Event Flow Overview)

  1. Initialization / Configuration
  • MarkdownView creates a WKWebView and configures the UserContentController
  • Loads HTML (styled / non-styled) and web assets (JS/CSS) from the bundle
  1. Markdown Delivery
  • Native code (Swift/SwiftUI) passes a Markdown string to MarkdownView
  • MarkdownView forwards the string to the JS entry point (window.renderMarkdown) as a payload
  1. Web-Side Rendering
  • main.js converts Markdown to HTML using markdown-it and highlight.js
  • After DOM update, measures the document height
  1. Bidirectional Events
  • Web → Native
    • Notifies height changes via messages (intrinsic size update, render completion event)
    • Link taps are delegated to native for handling via WKNavigationDelegate
  • Native → Web
    • Additional CSS / plugins / external stylesheets can be injected as UserScripts

Read the full file on GitHub · 68 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 First seen · 68 lines · 722 tokens per session scan A 35da9e716c2a

Subscribe to this mod's changes

MarkdownView AGENTS.md is an instructions file published in the GitHub repository keitaoouchi/MarkdownView (2,177 stars, last pushed 1mo ago), licensed MIT. It adds 722 tokens to every session, about $0.0036 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-30.

Related

Other instructions, from other repositories