huasheng_editor: Instructions file for Codex

AGENTS.md

huasheng_editor AGENTS.md is an instructions file for Codex, OpenCode from alchaincyf/huasheng_editor. It costs 4,664 tokens per session, scanned A, original, MIT.

Instructions for a browser-based Markdown editor made for publishing articles in WeChat Official Accounts, a Chinese publishing platform. They describe Markdown preview, preset visual themes, and pasted-image handling.

In plain words
What is it for?
Use them when changing Markdown rendering, article styles, live preview, or image pasting and copying into WeChat.
Why use it?
They give a coding agent the project context needed to work on the editor without rediscovering how Markdown, themes, and stored images are handled.

Instructions file for CodexOpenCode

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

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

Reuse

Borrowing it

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alchaincyf/huasheng_editor/agents-md.svg)](https://agentmods.dev/instructions/alchaincyf/huasheng_editor/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/alchaincyf/huasheng_editor/agents-md"><img src="https://agentmods.dev/badge/instructions/alchaincyf/huasheng_editor/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 4,664 This file is loaded in full into every session.
When invoked 4,664 The same file — it is already loaded in full.
Security scan A 1 finding. 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.04664 $0.04664
Opus 5 $0.02332 $0.02332
Sonnet 5 $0.00933 $0.00933
Haiku 4.5 $0.00466 $0.00466

Measured 8d ago against content hash ba08edaa6abc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

huasheng_editor AGENTS.md scanned grade A with 1 finding 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 8d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(src);
Origin

Copies of this mod

2 near-identical copies found in the catalogue:

AGENTS.md · 498 lines

How it starts

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

公众号 Markdown 编辑器

一个专为微信公众号设计的 Markdown 编辑器,支持实时预览和一键复制富文本格式到公众号后台。

项目概述

这是一个纯前端的 Markdown 编辑器,可以将标准 Markdown 文本转换为适合微信公众号的富文本格式。支持 13 种精心设计的样式主题,每种主题都针对公众号的阅读体验进行了优化。

核心功能

1. Markdown 渲染

  • 使用 markdown-it 进行 Markdown 解析
  • 支持完整的 Markdown 语法(标题、列表、引用、代码块、表格等)
  • 实时预览渲染结果

2. 样式系统

提供 13 种预设样式主题:

  • 经典公众号系列:默认、技术、优雅、深度阅读
  • 传统媒体系列:杂志风格、纽约时报、金融时报、Jony Ive
  • 现代数字系列:Wired 连线、Medium 长文、Apple 极简、Anthropic Claude、AI Coder 特调

每个样式都包含完整的元素定义(标题、段落、列表、引用、代码、表格、图片等)

3. 图片处理系统(⭐ 核心功能)

技术架构概览

本编辑器采用自定义图片协议 + 压缩 + IndexedDB 存储的创新方案,彻底解决了图片粘贴的所有痛点:

用户粘贴图片(任何来源)
    ↓
ImageCompressor 压缩(Canvas API)
    ├─ 最大尺寸:1920x1920px
    ├─ 压缩质量:85%
    ├─ GIF/SVG 不压缩(保持动画/矢量)
    └─ 智能对比:压缩后更大则用原图
    ↓
生成唯一 ID(img-timestamp-random)
    ↓
ImageStore 存储到 IndexedDB
    ├─ 数据库名:WechatEditorImages
    ├─ 存储:Blob + 元数据
    └─ 持久化:刷新不丢失
    ↓
编辑器插入短链接:![图片名](img://img-xxx)
    ↓
渲染预览时:
    ├─ 从 IndexedDB 读取 Blob
    ├─ 创建 Object URL
    ├─ 替换 img:// 为 blob:
    └─ 缓存 Object URL(避免重复读取)
    ↓
复制到公众号时:
    ├─ 检测 data-image-id 属性
    ├─ 从 IndexedDB 读取原始 Blob
    ├─ 转为 Base64
    └─ 替换 img 的 src
核心组件
1. ImageStore 类(app.js:9-213)

负责 IndexedDB 操作的核心类:

class ImageStore {
  constructor() {
    this.dbName = 'WechatEditorImages';
    this.storeName = 'images';
    this.version = 1;
  }

  // 核心方法:
  async init()                        // 初始化 IndexedDB
  async saveImage(id, blob, metadata) // 保存图片
  async getImage(id)                  // 获取图片(返回 Object URL)
  async getImageBlob(id)              // 获取 Blob(用于复制时转 Base64)
  async deleteImage(id)               // 删除图片
  async getAllImages()                // 获取所有图片列表
  async getTotalSize()                // 计算总存储大小
}

数据结构

{
  id: 'img-1736966400000-abc123def',
  blob: Blob,                    // 压缩后的图片 Blob
  name: '图片名',
  originalSize: 2500000,         // 原始大小(字节)
  compressedSize: 487300,        // 压缩后大小
  compressionRatio: '81',        // 压缩率(%)
  mimeType: 'image/jpeg',
  createdAt: 1736966400000
}

Read the full file on GitHub · 498 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. 8d ago First seen · 498 lines · 4,664 tokens per session scan A ba08edaa6abc

Subscribe to this mod's changes

huasheng_editor AGENTS.md is an instructions file published in the GitHub repository alchaincyf/huasheng_editor (741 stars, last pushed 2mo ago), licensed MIT. It adds 4,664 tokens to every session, about $0.0233 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). 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

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

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 · 6,785 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,296 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,469 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, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens