selectools-development

A set of project rules for writing, testing, documenting, and releasing Python code.

In plain words
What is it for?
Use it when adding features or fixing bugs, including the required source files, tests, examples, documentation, and checks.
Why use it?
It gives contributors one clear standard to follow and helps catch errors before changes are committed.

Cursor rule for Cursor

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 rules/johnnichev/selectools/selectools-development
Clone the repo
git clone --depth 1 https://github.com/johnnichev/selectools

Made for: Cursor.

Per session 581 This file is loaded in full into every session.
When invoked 581 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.00581 $0.00581
Opus 5 $0.00291 $0.00291
Sonnet 5 $0.00116 $0.00116
Haiku 4.5 $0.00058 $0.00058

Measured yesterday against content hash 7df06fbd8ee5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

selectools-development 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 yesterday.

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.

.cursor/rules/selectools-development.mdc · 54 lines

How it starts

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

Selectools Development Rules

Code Conventions

  • Python 3.9+, line length 100, Black + isort formatting
  • Explicit types everywhere, no any — mypy enforced on src/
  • No narration comments — only explain non-obvious intent
  • Source layout: src/selectools/, tests in tests/
  • Pre-commit hooks: black, isort, flake8, mypy, bandit, yaml check (--unsafe for mkdocs)

Testing Requirements

  • Every new feature needs unit tests + integration tests
  • Every bug fix needs a regression test in tests/agent/test_regression.py
  • Use mock providers for unit tests, never real API calls
  • Use RecordingProvider pattern to verify exact args passed to providers
  • E2E tests use @pytest.mark.e2e (skipped in CI)
  • Run pytest tests/ -x -q and confirm ALL pass before any commit
  • Update model count assertions when adding/removing models

Feature Completeness Checklist

Every feature MUST include ALL of:

  1. Source code in src/selectools/
  2. Public exports in __init__.py
  3. Unit tests in tests/
  4. Example script in examples/NN_name.py
  5. Module doc in docs/modules/NAME.md
  6. Section in notebooks/getting_started.ipynb
  7. Entry in docs/index.md feature table
  8. Navigation entry in mkdocs.yml
  9. Links from relevant existing docs

Release Process

  1. Create feature branch: git checkout -b feat/<name>
  2. Implement + test + document (all checklist items above)
  3. Bump version in __init__.py + pyproject.toml
  4. Update: CHANGELOG.md, README.md ("What's New"), ROADMAP.md
  5. Update hardcoded counts (models, tests, examples) across ALL docs
  6. mkdocs build to verify no broken links
  7. Commit, push, PR, merge to main
  8. Tag: git tag -a vX.Y.Z
  9. Push tags, build, publish to PyPI
  10. Verify GitHub Pages auto-deploys

Common Pitfalls

  • Provider stream()/astream() MUST pass tools param
  • ToolCall objects must not be stringified in streaming
  • OpenAI newer models need max_completion_tokens not max_tokens
  • response_msg.content can be None — always use or ""
  • MkDocs links outside docs/ must use absolute GitHub URLs

Read the full file on GitHub · 54 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. yesterday First seen · 54 lines · 581 tokens per session scan A 7df06fbd8ee5

Subscribe to this mod's changes

selectools-development is a cursor rule published in the GitHub repository johnnichev/selectools (11 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 581 tokens to every session, about $0.0029 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.