WxJava copilot-instructions.md

Copilot instructions for developing WxJava, a Java software development kit covering several WeChat services. They explain the required Java and Maven setup, build commands, testing approach, and repository layout.

In plain words
What is it for?
Use them to compile, package, check style, navigate the main SDK modules, and understand how tests are configured. They are relevant when changing code in the WxJava repository or preparing its pull requests.
Why use it?
They help an agent build and check the project according to its actual conventions, including its TestNG tests and its requirement for real WeChat credentials in some test configurations.

Instructions file for GitHub Copilot

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/binarywang/wxjava/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/binarywang/WxJava

Made for: GitHub Copilot.

Per session 2,031 This file is loaded in full into every session.
When invoked 2,031 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.02031 $0.02031
Opus 5 $0.01015 $0.01015
Sonnet 5 $0.00406 $0.00406
Haiku 4.5 $0.00203 $0.00203

Measured yesterday against content hash 92b71713be6a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

WxJava copilot-instructions.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 yesterday.

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.

.github/copilot-instructions.md · 203 lines

How it starts

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

Copilot Instruction

请始终使用中文生成 Pull Request 的标题、描述和提交信息

WxJava - 微信 Java SDK 开发说明

WxJava 是一个支持多种微信平台的完整 Java SDK,包含公众号、小程序、微信支付、企业微信、开放平台、视频号、企点等多种功能模块。

请始终优先参考本说明,只有在遇到与此内容不一致的意外信息时,才退而使用搜索或 bash 命令。

高效开发指南

前置条件与环境准备

  • Java 要求:JDK 8+(项目最低目标为 Java 8)
  • Maven:推荐 Maven 3.6+(已验证 Maven 3.9.11)
  • IDE:推荐使用 IntelliJ IDEA(项目针对 IDEA 优化)

引导、构建与校验

克隆仓库后按顺序执行以下命令:

# 1. 基础编译(请勿中断 - 约需 4-5 分钟)
mvn clean compile -DskipTests=true --no-transfer-progress
# 超时时间:建议设置 8 分钟以上。实际时间:约 4 分钟

# 2. 完整打包(请勿中断 - 约需 2-3 分钟)  
mvn clean package -DskipTests=true --no-transfer-progress
# 超时时间:建议设置 5 分钟以上。实际时间:约 2 分钟

# 3. 代码质量校验(请勿中断 - 约需 45-60 秒)
mvn checkstyle:check --no-transfer-progress
# 超时时间:建议设置 3 分钟以上。实际时间:约 50 秒

重要时间说明:

  • 绝对不要中断任意 Maven 构建命令
  • 编译阶段耗时最长(约 4 分钟),原因是项目包含 34 个模块
  • 后续构建会更快,因为存在增量编译
  • 始终使用 --no-transfer-progress 以减少日志噪音

测试结构

  • 测试框架:TestNG(非 JUnit)
  • 测试文件:共有 298 个测试文件
  • 默认行为:pom.xml 中默认禁用测试(<skip>true</skip>
  • 测试配置:测试需要通过 test-config.xml 提供真实的微信 API 凭据
  • 注意:没有真实微信 API 凭据请不要尝试运行测试,测试将会失败

项目结构与导航

核心 SDK 模块(主要开发区)

  • weixin-java-common/ - 通用工具与基础类(最重要)
  • weixin-java-mp/ - 公众号 SDK
  • weixin-java-pay/ - 微信支付 SDK
  • weixin-java-miniapp/ - 小程序 SDK
  • weixin-java-cp/ - 企业微信 SDK
  • weixin-java-open/ - 开放平台 SDK
  • weixin-java-channel/ - 视频号 / Channel SDK
  • weixin-java-qidian/ - 企点 SDK

框架集成模块

  • spring-boot-starters/ - Spring Boot 自动配置 starter
  • solon-plugins/ - Solon 框架插件
  • weixin-graal/ - GraalVM 本地镜像支持

配置与质量控制

  • quality-checks/google_checks.xml - Checkstyle 配置
  • .editorconfig - 代码格式规则(2 个空格等于 1 个制表)
  • pom.xml - 根级 Maven 配置

开发工作流

修改代码的流程

  1. 修改前务必先构建以建立干净基线:

    mvn clean compile --no-transfer-progress
    
  2. 遵循代码风格(由 checkstyle 强制):

    • 缩进使用 2 个空格(不要用制表符)
    • 遵循 Google Java 风格指南
    • 在 IDE 中安装 EditorConfig 插件
  3. 增量验证修改:

    # 每次修改后运行:
    mvn compile --no-transfer-progress
    mvn checkstyle:check --no-transfer-progress
    

提交修改前的必须校验

请务必按顺序完成以下校验步骤:

Read the full file on GitHub · 203 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. yesterday First seen · 203 lines · 2,031 tokens per session scan A 92b71713be6a

Subscribe to this mod's changes

WxJava copilot-instructions.md is an instructions file published in the GitHub repository binarywang/WxJava (33,051 stars, last pushed 2d ago), licensed Apache-2.0. It adds 2,031 tokens to every session, about $0.0102 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.