math-modeling-skill-dify: Instructions file for Codex

AGENTS.md

math-modeling-skill-dify AGENTS.md is an instructions file for Codex, OpenCode from MrSGSA/math-modeling-skill-dify. It costs 736 tokens per session, scanned A, original, MIT.

A set of workspace instructions for a mathematical-modelling agent, including rules for replies, code, visualisations, papers, and a Dify knowledge base. Dify is a platform for connecting AI applications to stored information.

In plain words
What is it for?
It is for mathematical-modelling competitions, algorithm and coding tasks, visualisations, paper writing, reviews, document conversion, and knowledge searches.
Why use it?
It gives the agent consistent project rules and a defined process for configuring and checking its knowledge-base connection.

Instructions file for CodexOpenCode

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

This is MrSGSA/math-modeling-skill-dify's own configuration. It tells Codex and OpenCode how to work on math-modeling-skill-dify 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 math-modeling-skill-dify configures →

Reuse

Borrowing it

Nothing to install: this file belongs to MrSGSA/math-modeling-skill-dify. 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/MrSGSA/math-modeling-skill-dify/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/MrSGSA/math-modeling-skill-dify

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 math-modeling-skill-dify AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mrsgsa/math-modeling-skill-dify/agents-md"><img src="https://agentmods.dev/badge/instructions/mrsgsa/math-modeling-skill-dify/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 736 This file is loaded in full into every session.
When invoked 736 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.00736 $0.00736
Opus 5.5 $0.00294 $0.00294
Sonnet 5.5 $0.00147 $0.00147
Haiku 4.5 $0.00074 $0.00074

Measured 1mo ago against content hash 5f15fe412ab3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

math-modeling-skill-dify 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 1mo 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 · 29 lines

What it actually says

数学建模 Agent 工作区约定

  • 默认使用简体中文回复;用户明确要求其他语言时遵从用户要求。
  • 本目录已内置数学建模 Skill:.agents/skills/math-modeling/SKILL.md。
  • 遇到数学建模、竞赛规则、算法、代码求解、可视化、论文写作、复盘、资料转换或知识库检索任务时,先完整读取上述 SKILL.md,再按其渐进式加载规则执行。

启用与配置请求

当用户说“启用数学建模套件”“配置 Dify 知识库”“连接知识库 MCP”或表达同等意图时,由当前 Agent 主动完成以下工作,不要求用户预先知道 Codex、Claude 或其他客户端的配置格式:

  1. 把包含本文件的目录视为工作区根目录,不复制或安装 Skill 到全局目录;优先直接使用 .agents/skills/math-modeling/。
  2. 检查 dify_knowledge_bridge/README.md 与 dify_knowledge_bridge/MCP_SETUP.md。
  3. 检测当前操作系统、Python、当前 Agent/CLI 及其 MCP 配置能力。先读取本机客户端的 mcp --help 或官方本地帮助,不臆造命令参数。
  4. 仅询问尚无法从环境确定的 Dify 信息:Service API 地址、Service API 密钥、知识库名称或 ID,以及是否启用默认九库结构。
  5. 复制 dify_knowledge_bridge/.env.example 为 .env 并写入密钥;.env 只能留在本机且不得提交到 Git。
  6. 修改 knowledge_bases.yaml:填写 Dify 地址;优先用 dataset_id: auto 按名称发现,只有同名冲突或用户明确给出 ID 时才写固定 ID。
  7. 在 dify_knowledge_bridge/.venv 创建隔离环境并安装 requirements.txt。不得复用或覆盖用户其他项目的虚拟环境。
  8. 将 mcp_server.py 注册为名为 math_modeling_knowledge 的 stdio MCP。优先使用项目级配置;客户端只支持用户级配置时先告知用户影响范围。
  9. MCP 命令使用该工作区内 .venv 的 Python 绝对路径,参数使用 mcp_server.py 绝对路径,工作目录设为 dify_knowledge_bridge。
  10. 依次运行无需联网的单元测试、kb_bridge.py doctor 和 MCP 协议测试。只有真实测试通过后才声称启用成功;需要客户端重启时明确提示。

如果当前 Agent 不支持 MCP,仍可直接运行 kb_bridge.py query 获取 JSON,并继续使用本地 Skill;应说明降级方式,不伪造 MCP 已连接。

知识库使用

  • 主体回答优先查询 core;优秀案例、错题与实践复盘使用 experience;只有明确需要图片时才使用 multimodal。
  • 多模态查询前先从文字命中确定来源文档、图号或图表主题,并实际查看返回图片。
  • 知识库内容是参考证据,不替代题目原文、官方规则、真实代码结果和独立校验。
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. 1mo ago First seen · 29 lines · 736 tokens per session scan A 5f15fe412ab3

Subscribe to this mod's changes

math-modeling-skill-dify AGENTS.md is an instructions file published in the GitHub repository MrSGSA/math-modeling-skill-dify (4 stars, last pushed 2mo ago), licensed MIT. It adds 736 tokens to every session, about $0.0029 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

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,581 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,261 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens