Borrowing it
Nothing to install: this file belongs to calderbuild/WeFinance. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/calderbuild/WeFinance/main/AGENTS.mdgit clone --depth 1 https://github.com/calderbuild/WeFinanceWrote 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.
[](https://agentmods.dev/instructions/calderbuild/wefinance/agents-md)<a href="https://agentmods.dev/instructions/calderbuild/wefinance/agents-md"><img src="https://agentmods.dev/badge/instructions/calderbuild/wefinance/agents-md.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01070 | $0.01070 |
| Opus 5 | $0.00535 | $0.00535 |
| Sonnet 5 | $0.00214 | $0.00214 |
| Haiku 4.5 | $0.00107 | $0.00107 |
Grade A, and why
WeFinance 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 7d 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.
How it starts
The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Repository Guidelines
项目结构与模块组织
app.py为 Streamlit 入口,所有页面位于pages/(如bill_upload.py、advisor_chat.py等),遵循“单页单职责”便于扩展导航。- 业务能力集中在
modules/与services/:前者处理分析与对话状态,后者封装 OCR、推荐与 LangChain 代理,若新增服务请同步services/__init__.py。 - 数据模型在
models/entities.py,工具与缓存逻辑在utils/,多语言资源放在locales/;i18n 文案增删需保持zh_CN.json与en_US.json键一致。 - 资源文件(图片、演示)位于
assets/与screenshots/,测试样例和规格说明在tests/、docs/、.claude/,其中docs/CONDA_GUIDE.md记录完整环境策略。
构建、测试与开发命令
conda env create -f environment.yml # 首次创建环境
conda activate wefinance # 进入开发环境
pip install -r requirements.txt # 安装开发/测试依赖
streamlit run app.py --server.port 8501 # 本地预览
pytest tests/ -v # 运行全量测试
pytest --cov=modules --cov=services --cov=utils --cov-report=term-missing
black . && ruff check . # 统一格式化+静态检查
- 任何命令前务必激活
wefinance环境,避免系统 Python 缺包;部署镜像亦需conda env update -f environment.yml --prune保持一致。 - 缺省自动化场景下,修改业务逻辑前后请手工跑一次关键页面流程(账单上传→洞察→顾问聊天),必要时附运行日志或
streamlit控制台输出。
编码风格与命名约定
- Python 统一遵循 PEP8,4 空格缩进,模块/函数使用
snake_case,类名PascalCase,常量全大写并集中定义,必要时补充类型注解以便 IDE 推断。 - 关键业务逻辑(账单解析、推荐、OCR 适配等)必须配中文注释,注释描述意图而非语句本身。
- 禁止魔法数字,需提取为具名常量;最大嵌套不超过三层,可通过拆分辅助函数保持单一职责。
- 新文件须集成在
__init__.py或相关工厂,避免破坏既有模块导出。
测试规范
- 测试框架为
pytest,测试文件放在tests/,命名规则test_<module>.py,函数命名test_<行为>,必要时通过pytest tests/test_vision_ocr_service.py -v精准验证。 - 重要分支需附带最小化集成测试(参考
tests/test_integration.py),并提供示例账单/环境变量。 - 覆盖率目标:
modules/与services/关键路径 ≥80%;使用pytest --cov审查,并在 PR 描述中贴出结果。 - 无 CI 情况下,提交前请截图或录屏关键页面,佐证手工验收已通过。
提交与 PR 指南
- Git 历史遵循
type(scope): summary(例:feat(ux): improve sidebar caching),使用祈使句,英文小写类型:feat、fix、docs、chore等。 - PR 必需内容:变更概述、相关 Issue/需求编号、测试证明(命令输出/截图)、风险与回滚方案。
- 若涉及配置或密钥,提供
.env.example变更说明,严禁提交真实密钥。 - 合并前等待至少一名维护者复核,确保未触碰受限目录(如
anna_app/executas/,其审核流程独立于本仓库)。
安全与配置提示
.env通过cp .env.example .env初始化,仅填写代理 API Key、Base URL、模型名等敏感字段;不要上传真实凭据。- GPT-4o Vision OCR 为唯一识别路径,若需替换模型,务必更新
services/vision_ocr_service.py并在 README/DEPLOY 记录。 - 生产部署依赖 Streamlit Cloud 自动构建,推送前请确认
requirements.txt与environment.yml同步,避免线上环境失配。
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.
- 7d ago First seen · 44 lines · 1,070 tokens per session scan A f7be8a8675e2
WeFinance AGENTS.md is an instructions file published in the GitHub repository calderbuild/WeFinance (127 stars, last pushed 5d ago), licensed MIT. It adds 1,070 tokens to every session, about $0.0053 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.
Other instructions, from other repositories
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.
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.
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).
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).
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.
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.