DMAF: Instructions file for Codex

AGENTS.md

DMAF AGENTS.md is an instructions file for Codex, OpenCode from yhyatt/DMAF. It costs 2,828 tokens per session, scanned A, original, MIT.

A set of instructions for working on DMAF, a system that moves WhatsApp photos and videos through face recognition into Google Photos. It explains the system's design and development setup.

In plain words
What is it for?
It helps agents find their way around the codebase, understand the media-processing pipeline, and follow the project's development quickstart.
Why use it?
It gives a coding agent the project context it needs before changing code, reducing the risk of misunderstanding how the parts fit together.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions Claude Code; built for openclaw.

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

Reuse

Borrowing it

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/yhyatt/dmaf/agents-md/github.svg)](https://agentmods.dev/instructions/yhyatt/dmaf/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/yhyatt/dmaf/agents-md"><img src="https://agentmods.dev/badge/instructions/yhyatt/dmaf/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for DMAF AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/yhyatt/dmaf/agents-md"><img src="https://agentmods.dev/badge/instructions/yhyatt/dmaf/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,828 This file is loaded in full into every session.
When invoked 2,828 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.02828 $0.02828
Opus 5.5 $0.01131 $0.01131
Sonnet 5.5 $0.00566 $0.00566
Haiku 4.5 $0.00283 $0.00283

Measured 1mo ago against content hash 24483da6f556, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

DMAF 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 1mo 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Tests live in `tests/test_mcp_server.py` — all tools mocked via `patch("subprocess.run")`.
AGENTS.md · 282 lines

How it starts

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

DMAF — Coding Agent Guide

For Claude Code, GitHub Copilot, Cursor, and any other AI coding assistant. Read this before touching anything. It will save you hours.


What This Is

DMAF (Don't Miss A Face) — WhatsApp media → face recognition → Google Photos.

Photos and videos arrive from WhatsApp groups, get staged in a GCS bucket, a Cloud Run job scans them with face recognition, and matched media (people you care about) gets uploaded to Google Photos automatically.


Architecture

WhatsApp groups
      │  (photos/videos from other group members)
      ▼
OpenClaw Gateway          ← unofficial WhatsApp Web client (Baileys)
  ~/.openclaw/media/inbound/
      │  (system cron, every 30 min, zero LLM cost)
      ▼
GCS staging bucket        ← gs://your-bucket/
  gs://your-project-whatsapp-media/
      │  (Cloud Scheduler, hourly)
      ▼
Cloud Run Job: dmaf-scan  ← Docker image from Cloud Build
      │  scans each file, face recognition against known_people/
      │  two-layer dedup via Firestore (path + content SHA-256)
      ▼
Google Photos             ← matched faces only, organised into named album

Key constraint: OpenClaw's self-chat protection means your OWN sent photos never reach the pipeline. Only photos sent by others in groups are captured.


Codebase Map

src/dmaf/
├── __main__.py          # CLI entrypoint + Uploader class (on_match / on_match_video)
├── config.py            # Pydantic Settings — all config fields with defaults + docs
├── watcher.py           # Core scan loop: scan_and_process_once, _process_image_file,
│                        #   _process_video_file, NewImageHandler base class
├── video_processor.py   # iter_frames (generator), find_face_in_video (early exit)
├── gcs_watcher.py       # GCS helpers: list_gcs_images, list_gcs_videos,
│                        #   download_gcs_blob, cleanup_temp_file
├── database.py          # SQLiteDatabase (local dev) + FirestoreDatabase (cloud)
│                        #   Both implement: seen, add_file_with_score, mark_uploaded
├── known_refresh.py     # Auto-add high-quality matched frames to known_people
├── alerting/
│   ├── alert_manager.py # AlertManager: batches events, sends email on schedule
│   └── templates.py     # format_error_alert, format_borderline_alert
│                        #   _format_ts(ts, tz_name) — configurable timezone
├── face_recognition/    # Backend factory: dlib, InsightFace, AuraFace
├── google_photos/       # upload_bytes, create_media_item, ensure_album
└── utils/               # retry decorator, sha256_of_file, etc.

deploy/
├── README.md            # Full GCP deployment walkthrough
├── setup-secrets.md     # ALL credentials setup (start here for a new deployment)
└── openclaw-integration.md  # OpenClaw → GCS media sync setup

tests/                   # pytest — mirrors src/dmaf structure
config.cloud.yaml.example  # Annotated config template
cloudbuild.yaml          # Cloud Build: docker build + push to GCR

Read the full file on GitHub · 282 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. 1mo ago First seen · 282 lines · 2,828 tokens per session scan A 24483da6f556

Subscribe to this mod's changes

DMAF AGENTS.md is an instructions file published in the GitHub repository yhyatt/DMAF (3 stars, last pushed 7mo ago), licensed MIT. It adds 2,828 tokens to every session, about $0.0113 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

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 · 9,649 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,549 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens