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.
npx agentmods add rules/wiggitywhitney/mcp-commit-story/pyproject-dependenciesgit clone --depth 1 https://github.com/wiggitywhitney/mcp-commit-storyWrote 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.
[](https://agentmods.dev/rules/wiggitywhitney/mcp-commit-story/pyproject-dependencies)<a href="https://agentmods.dev/rules/wiggitywhitney/mcp-commit-story/pyproject-dependencies"><img src="https://agentmods.dev/badge/rules/wiggitywhitney/mcp-commit-story/pyproject-dependencies.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00872 |
| Opus 5 | $0.00000 | $0.00436 |
| Sonnet 5 | $0.00000 | $0.00174 |
| Haiku 4.5 | $0.00000 | $0.00087 |
Grade A, and why
pyproject-dependencies 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 5d 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.
What it actually says
pyproject.toml Dependency Management
-
Critical Rule: All Production Dependencies Must Be in pyproject.toml
- CI environment ONLY installs from
pyproject.tomlmain dependencies section - Never rely on
requirements.txtor other dependency files for production code - Dev dependencies go in
[project.optional-dependencies.dev]section
- CI environment ONLY installs from
-
When to Update pyproject.toml Dependencies:
- Every time you add a new import statement in production code (
src/directory) - When adding new test dependencies that import external packages
- Before committing code that uses new libraries
- When CI fails with ModuleNotFoundError but tests pass locally
- Every time you add a new import statement in production code (
-
Common CI Failure Pattern Recognition:
# CI Error Pattern: ModuleNotFoundError: No module named 'some_package' # But locally: tests pass ✅ # Root Cause: Package installed locally but missing from pyproject.toml # Solution: Add to main dependencies section -
Dependency Addition Checklist:
# ✅ DO: When you add imports like this from opentelemetry.exporter.prometheus import PrometheusMetricReader from opentelemetry.instrumentation.requests import RequestsInstrumentor # ✅ DO: Immediately add to pyproject.toml dependencies = [ "opentelemetry-exporter-prometheus>=0.54b0", "opentelemetry-instrumentation-requests>=0.41b0", ] -
Version Specification Best Practices:
- Research actual available versions on PyPI before specifying
- Don't assume version patterns across related packages (e.g., OpenTelemetry packages have different schemes)
- Check for yanked versions if you get "no matching distribution" errors
- Use conservative version constraints (
>=X.Y.Z) rather than exact pins for libraries
-
Local vs CI Environment Differences:
- Local development often has extra packages from manual installs, requirements.txt, or previous environments
- CI is clean and only installs what's explicitly declared in pyproject.toml
- Always test dependency changes with a clean virtual environment when possible
- Push dependency updates immediately after adding new imports to catch issues early
-
Error Resolution Workflow:
- CI fails with ModuleNotFoundError → Check if package is in pyproject.toml main dependencies
- Local tests pass but CI fails → Almost always a missing dependency issue
- "No matching distribution found" → Check available versions on PyPI, look for yanked versions
- Import works locally → Verify the package name and version in pyproject.toml
-
Prevention Strategy:
- Add dependencies BEFORE writing the import when possible
- Use
pip install package-nameAND update pyproject.toml when adding new packages - Review imports in every commit to ensure corresponding dependencies exist
- Test in clean environments periodically to catch environment drift
-
Examples from This Project:
# ❌ DON'T: Add imports without updating pyproject.toml from opentelemetry.exporter.prometheus import PrometheusMetricReader # CI will fail! # ✅ DO: Add import AND update pyproject.toml from opentelemetry.exporter.prometheus import PrometheusMetricReader # In pyproject.toml: "opentelemetry-exporter-prometheus>=0.54b0" -
Historical Issues Resolved:
- Auto-instrumentation packages (requests, aiohttp, asyncio, logging instrumentors)
- Prometheus exporter with version specification corrections
- Pattern: Code worked locally, CI failed on import, fixed by adding to pyproject.toml
This rule prevents the "works on my machine" problem that has caused multiple CI failures in this project.
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.
- 5d ago First seen · 82 lines · 0 tokens per session scan A 9ab27a34ddd5
pyproject-dependencies is a cursor rule published in the GitHub repository wiggitywhitney/mcp-commit-story (15 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 872 tokens. 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.
Other cursor rules, from other repositories
python_tests
We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.
python-llm-ml-workflow-cursorrules-prompt-file
Cursor rules for Python LLM & ML development with workflow integration.
python
Python best practices and patterns for modern software development with Flask and SQLite.
python-containerization-cursorrules-prompt-file
Cursor rules for Python development with containerization integration.
django
Definitive guidelines for writing maintainable, performant, and secure Django applications, emphasizing modern best practices, clear code organization, and efficient patterns.
rich
Definitive guidelines for building robust, maintainable, and visually appealing Python CLI applications using the rich library.