python-code-validator: Instructions file for Gemini CLI

GEMINI.md

python-code-validator GEMINI.md is an instructions file for Gemini CLI from jkanselaar/python-code-validator. It costs 687 tokens per session, scanned A, a copy of python-code-validator AGENTS.md, MIT.

Instructions for checking Python code with a validation service during development. The checks cover syntax, style, type errors, security rules, credentials, and example-based execution.

In plain words
What is it for?
Use it when writing or changing Python files: describe the purpose, validate drafts, and execute examples in an isolated environment to confirm the behavior.
Why use it?
It catches problems after each meaningful edit and requires code examples to be tested before the code is presented.

Instructions file for Gemini CLI

Written for Gemini CLI: the file is GEMINI.md.

This is jkanselaar/python-code-validator's own configuration. It tells Gemini CLI how to work on python-code-validator 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 python-code-validator configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jkanselaar/python-code-validator. 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/jkanselaar/python-code-validator/main/GEMINI.md
Clone the repo
git clone --depth 1 https://github.com/jkanselaar/python-code-validator

Made for: Gemini CLI.

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 python-code-validator GEMINI.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jkanselaar/python-code-validator/gemini-md/github.svg)](https://agentmods.dev/instructions/jkanselaar/python-code-validator/gemini-md)
Your own site
<a href="https://agentmods.dev/instructions/jkanselaar/python-code-validator/gemini-md"><img src="https://agentmods.dev/badge/instructions/jkanselaar/python-code-validator/gemini-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 python-code-validator GEMINI.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jkanselaar/python-code-validator/gemini-md"><img src="https://agentmods.dev/badge/instructions/jkanselaar/python-code-validator/gemini-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 687 This file is loaded in full into every session.
When invoked 687 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 91% copy Near-identical to another mod 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.00687 $0.00687
Opus 5.5 $0.00275 $0.00275
Sonnet 5.5 $0.00137 $0.00137
Haiku 4.5 $0.00069 $0.00069

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

Security

Grade A, and why

python-code-validator GEMINI.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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sf https://api.statemind.ai/v1/client -o validate.py
Origin

This is a copy

91% identical to python-code-validator AGENTS.md — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

GEMINI.md · 63 lines

How it starts

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

Python you write here gets checked

Use this service the way a compiler is used: not once at the end, but at every step, and never present code that has not come back accepted.

Say what the code is for, before you write it

Turn the request into examples first — assert bitcount(127) == 7, or doctest lines — and pass them in options.examples on every call from then on. This is the only check that can fail code which parses, lints, type-checks and runs, and generated code almost never carries examples of its own: the agent that was asked knows what was asked, and nothing else does.

While you write

  • After every draft or edit of a file, call validate_python. It parses, lints (ruff), type-checks (mypy), applies an AST security policy and scans for credentials, without running anything.
  • When a function is finished, call execute_python with your examples. It runs the code in a throwaway container with no network and a read-only filesystem, and checks the examples against what it actually does. Call it again when what the code does has changed — not after renaming a variable, reformatting, or editing a comment, and never twice on the same source: the answer cannot differ, and running it costs the caller ten times what a check costs.
  • repair_python is the same repair without running anything: use it when the code is not meant to run, or when the checks alone already name the problem.

When something comes back wrong

  • Read fixed_code first. When it is filled in, the service already found and ran a program that satisfies your examples — take it. That is a proven fix, not a suggestion, and rewriting the algorithm yourself instead throws the proof away.
  • A null fixed_code means nothing could be proven, not that the call failed. Then rewrite it yourself, using the diagnostics as evidence: a python:example-mismatch says which example failed and what the code gave instead, which is the fact your next attempt has to account for.
  • Validate again after the rewrite. An unvalidated fix is a new draft.

Read the full file on GitHub · 63 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 · 63 lines · 687 tokens per session scan A 53ccc1b1ec44

Subscribe to this mod's changes

python-code-validator GEMINI.md is an instructions file published in the GitHub repository jkanselaar/python-code-validator (0 stars, last pushed 2mo ago), licensed MIT. It adds 687 tokens to every session, about $0.0027 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). It is 91% identical to python-code-validator AGENTS.md, differing in 5 lines, and is treated as a copy.

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,257 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

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 4,159 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