WeFinance: Instructions file for Codex

AGENTS.md

WeFinance AGENTS.md is an instructions file for Codex, OpenCode from calderbuild/WeFinance. It costs 1,070 tokens per session, scanned A, original, MIT.

Repository instructions for WeFinance, a Streamlit Python application for uploading bills, analysing them, and chatting with a financial adviser. They describe the project layout, setup commands, coding style, translations, and tests.

In plain words
What is it for?
Use them when adding or changing pages, financial analysis, OCR, recommendations, adviser chat, translations, or tests in WeFinance.
Why use it?
They help an agent find the right files and use the required Python environment. They also reduce mistakes such as missing translation keys or skipping important user-flow checks.

Instructions file for CodexOpenCode

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

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

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/calderbuild/WeFinance/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/calderbuild/WeFinance

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/calderbuild/wefinance/agents-md.svg)](https://agentmods.dev/instructions/calderbuild/wefinance/agents-md)
Your own site
<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>
Per session 1,070 This file is loaded in full into every session.
When invoked 1,070 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.01070 $0.01070
Opus 5 $0.00535 $0.00535
Sonnet 5 $0.00214 $0.00214
Haiku 4.5 $0.00107 $0.00107

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

Security

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.

AGENTS.md · 44 lines

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.pyadvisor_chat.py 等),遵循“单页单职责”便于扩展导航。
  • 业务能力集中在 modules/services/:前者处理分析与对话状态,后者封装 OCR、推荐与 LangChain 代理,若新增服务请同步 services/__init__.py
  • 数据模型在 models/entities.py,工具与缓存逻辑在 utils/,多语言资源放在 locales/;i18n 文案增删需保持 zh_CN.jsonen_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),使用祈使句,英文小写类型:featfixdocschore 等。
  • 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.txtenvironment.yml 同步,避免线上环境失配。

Read the full file on GitHub · 44 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. 7d ago First seen · 44 lines · 1,070 tokens per session scan A f7be8a8675e2

Subscribe to this mod's changes

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.

Related

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.

vercel/next.js · 7,296 tokens

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

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

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

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