yi_leetcode_show AGENTS.md

yi_leetcode_show AGENTS.md is an instructions file for Codex, OpenCode from yihong0618/yi_leetcode_show. It costs 1,817 tokens per session, scanned A, original, MIT.

Project-specific instructions for working on yi_leetcode_show, a React website that turns LeetCode Python solutions into playable algorithm animations.

In plain words
What is it for?
Use it when adding a LeetCode problem, preparing its Python solutions, building animation frames, or changing the static frontend.
Why use it?
It gives coding agents the project’s structure and rules, reducing mistakes when changing pages, adding problems, or editing visualizations.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yihong0618/yi_leetcode_show/agents-md.svg)](https://agentmods.dev/instructions/yihong0618/yi_leetcode_show/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/yihong0618/yi_leetcode_show/agents-md"><img src="https://agentmods.dev/badge/instructions/yihong0618/yi_leetcode_show/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,817 This file is loaded in full into every session.
When invoked 1,817 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 $0.01817 $0.01817
Opus 5 $0.00908 $0.00908
Sonnet 5 $0.00363 $0.00363
Haiku 4.5 $0.00182 $0.00182

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

Security

Grade A, and why

yi_leetcode_show 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 5d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 154 lines

How it starts

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

LeetCode Show Agent Guide

项目目标

  • 这是一个纯前端项目,用 React + Vite + TypeScript 构建,并部署到 GitHub Pages。
  • 项目目标是把 LeetCode 的 Python 题解做成可播放的算法原理动画。
  • 当前交互全部在浏览器里完成,不依赖后端。
  • Python 运行依赖浏览器端的 Pyodide,因此这里的参考解法和可执行代码都统一按 Python 3 处理。

当前结构

  • 题目入口列表在 src/content/problems.ts
  • 每道题实现为一个 ProblemDefinition,类型定义在 src/types.ts
  • 当前示例题文件是 src/content/partitionLabels.ts,新增题目时优先参考它。
  • 页面入口在 src/App.tsx
  • 动画面板和参考代码高亮在 src/components/AnimationPlayer.tsx
  • 右侧变量面板在 src/components/FrameVariablesPanel.tsx
  • 可运行 Python 编辑区在 src/components/CodeWorkbench.tsx

核心约束

  • 只收录 Python 3 解法。
  • 每道题最多挂 5 个参考解法。
  • 参考解法尽量附上明确来源链接。
  • 只有在能确认公开原始来源时,才能标注为“灵神”或其他作者原解;无法确认时要写成“手工整理”或类似表述。
  • 页面是静态站方案,新增功能时不要引入后端依赖。
  • 动画高亮不是实时 Python 调试,它由动画帧里的 codeStep 驱动。
  • 右侧变量面板展示的是动画帧状态,不是用户自定义 Python 的真实局部变量。

新增题目的标准流程

  1. 复制 src/content/partitionLabels.ts 的结构,新建一个题目文件,例如 src/content/<slug>.ts
  2. 补全 ProblemDefinition 的基础信息:
    • id
    • title
    • slug
    • difficulty
    • prompt
    • summary
    • algorithmNotes
    • inputLabel
    • defaultInput
    • leetcodeUrl
    • defaultSolutionId
    • pythonEntry
  3. 为这道题准备 solutions
  4. 实现 buildVisualization(input),让它返回完整的 ProblemVisualization
  5. src/content/problems.ts 中导出并注册这道题。
  6. 本地运行并确认题目可切换、动画可播放、参考解法可切换。

新增题目时必须满足的数据约定

  • solutions 的每一项都必须符合 SolutionDefinition
  • defaultSolutionId 必须命中 solutions 中真实存在的一个解法。
  • pythonEntry 需要和浏览器执行约定一致:
    • 优先兼容 class Solution + 指定方法。
    • 同时允许备用函数名,例如 solve(s)
  • buildVisualization(input) 必须返回:
    • inputValue
    • expectedOutput
    • lastOrder
    • frames

动画帧设计约定

  • 当前通用阶段只有 4 个:preprocessscanclosedone
  • AnimationFrame.codeStep 现在直接复用这 4 个阶段名。
  • 动画下方参考代码的高亮,完全依赖当前帧的 codeStep 和当前解法的 highlightLines
  • 如果新题需要更细的代码高亮阶段,不要先硬改页面文案,先评估是否要扩展 CodeStep 类型和所有题目的 highlightLines
  • 变量面板依赖 AnimationFrame 里的字段,例如:
    • currentIndex
    • currentChar
    • rangeStart
    • rangeEnd
    • result
    • closedSegments
    • mappedChars
    • lastMap
  • 如果新题的讲解需要额外变量,优先扩展 AnimationFrame 结构,再同步更新变量面板,而不是在组件里写特判字符串。

Read the full file on GitHub · 154 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. 5d ago First seen · 154 lines · 1,817 tokens per session scan A 0d3ffcfb344c

Subscribe to this mod's changes

yi_leetcode_show AGENTS.md is an instructions file published in the GitHub repository yihong0618/yi_leetcode_show (11 stars, last pushed 5mo ago), licensed MIT. It adds 1,817 tokens to every session, about $0.0091 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.