PanWatch AGENTS.md

PanWatch AGENTS.md is an instructions file for Codex, OpenCode from TNT-Likely/PanWatch. It costs 817 tokens per session, scanned A, original, MIT.

A project guide for PanWatch, a web application with Python agents and data collectors, a FastAPI backend, and a React and TypeScript frontend. It explains the repository layout, commands, coding style, and testing expectations.

In plain words
What is it for?
Adding agents or data collectors, changing the backend or frontend, running development and production builds, building Docker images, and following the project's testing and naming rules.
Why use it?
It gives a coding agent the project-specific rules needed to change the right part of the application and run its builds or development servers correctly.

Instructions file for CodexOpenCode

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/tnt-likely/panwatch/agents-md
Clone the repo
git clone --depth 1 https://github.com/TNT-Likely/PanWatch

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tnt-likely/panwatch/agents-md.svg)](https://agentmods.dev/instructions/tnt-likely/panwatch/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tnt-likely/panwatch/agents-md"><img src="https://agentmods.dev/badge/instructions/tnt-likely/panwatch/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 817 This file is loaded in full into every session.
When invoked 817 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.00817 $0.00817
Opus 5 $0.00409 $0.00409
Sonnet 5 $0.00163 $0.00163
Haiku 4.5 $0.00082 $0.00082

Measured 3d ago against content hash 29b949e9be12, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

PanWatch 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 3d 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 · 45 lines

How it starts

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

Repository Guidelines

Project Structure & Module Organization

  • src/agents/ — Agent implementations (business logic). Add new agents here.
  • src/collectors/ — Data collectors (quotes, kline, news, etc.).
  • src/core/ — Core utilities (AI client, notifier, scheduler helpers).
  • src/web/ — FastAPI app (models, API routes, DB setup).
  • frontend/ — React + TypeScript (Vite + Tailwind). UI lives in frontend/src/.
  • prompts/ — Prompt templates used by agents.
  • config/, data/ — Config files and runtime data (persisted at DATA_DIR).
  • server.py — Backend entrypoint; also registers agents and data sources.
  • tests/ — Placeholder for backend tests.
  • build.sh, Dockerfile — Build frontend and container images.

Build, Test, and Development Commands

  • Backend (dev): make dev-api(自动 venv+依赖+uvicorn reload,监听 :8000);或手动 python server.py
  • Frontend (dev): make dev-web(自动 pnpm install+dev,served on http://localhost:5183)。
  • Frontend (build): cd frontend && pnpm install --frozen-lockfile && pnpm build.
  • Docker image: ./build.sh <version> (copies frontend/dist to ./static and builds image).
  • Run via Docker: docker run -d -p 8000:8000 -v panwatch_data:/app/data sunxiao0721/panwatch:latest.
  • Tests (backend): add pytest tests under tests/ then run pytest.

Coding Style & Naming Conventions

  • Python: PEP 8, 4-space indent, type hints required for new code. Files snake_case.py, classes PascalCase, functions/vars snake_case.
  • Agents: implement in src/agents/*.py, register in server.py (AGENT_REGISTRY) and seed config in seed_agents().
  • Collectors: place in src/collectors/, keep stateless; return typed dataclasses.
  • TypeScript: components PascalCase.tsx in frontend/src/, hooks use- prefix, utilities camelCase.ts.
  • Prompts: one prompt file per agent in prompts/ (e.g., daily_report.txt).

Testing Guidelines

  • Backend: structure tests as tests/test_<module>.py; prefer fast, isolated unit tests around agents, collectors, and core.
  • Coverage: target meaningful coverage for new modules (no strict threshold yet, but include happy-path and error cases).
  • Fixtures: use factory helpers for DB models; avoid network calls (mock collectors and AI clients).

Read the full file on GitHub · 45 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. 3d ago First seen · 45 lines · 817 tokens per session scan A 29b949e9be12

Subscribe to this mod's changes

PanWatch AGENTS.md is an instructions file published in the GitHub repository TNT-Likely/PanWatch (876 stars, last pushed 5d ago), licensed MIT. It adds 817 tokens to every session, about $0.0041 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.