Skip to content
Agentmart
Submit a tool

AGENTS.md · pdm-project/pdm

AGENTS.md from pdm-project/pdm: 115 lines covering Project Overview, Core Architecture, Development Commands, Important Files and more.

Template by pdm-project

IndexedMIT★ 8,662
Write a review

Install

Works with Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Claude Code. Read the repository before you give any tool access to your data.

curl -fsSL https://raw.githubusercontent.com/pdm-project/pdm/main/AGENTS.md -o AGENTS.md

Read it and adapt it to your project before use.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

The AGENTS.md file that pdm-project/pdm (8,662 stars) keeps for coding agents. It has 115 lines in 6 sections: Project Overview; Core Architecture; Development Commands; Important Files; Common Development Tasks; Architecture Patterns. Use it as a model for your own project's instructions.

Use cases: prompt-engineering

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

What's in it

An AGENTS.md file: instructions coding agents (Codex, Cursor, Copilot, Gemini CLI and others) read before working in a repo.

For
Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Claude Code
Length
115 lines
File
AGENTS.md

Sections

  1. Project Overview
  2. Core Architecture
  3. Development Commands
  4. Important Files
  5. Common Development Tasks
  6. Architecture Patterns

First lines (shown under the repo's MIT license)

# AGENTS.md

This file provides guidance to AI coding assistants when working with code in this repository.

## Project Overview

PDM (Python Dependency Manager) is a modern Python package and dependency manager that supports the latest PEP standards (PEP 517, PEP 621). It provides fast dependency resolution, flexible plugin system, and centralized cache management similar to pnpm.

## Core Architecture

### Key Components

1. **Project Management** (`src/pdm/project/`): Handles pyproject.toml parsing, project configuration, and metadata management
2. **Dependency Resolution** (`src/pdm/resolver/`): Fast dependency resolver using resolvelib with custom optimizations for binary distributions
3. **Environment Management** (`src/pdm/environments/`): Manages Python environments (virtualenv, PEP 582, system)
4. **Installer System** (`src/pdm/installers/`): Installs and uninstalls packages into the site-packages directory with centralized cache support
5. **CLI System** (`src/pdm/cli/commands/`): Command-line interface using argparse with plugin support
6. **Repository Models** (`src/pdm/models/repositories/`): PyPI repository interaction and package finder
7. **Build System** (`src/pdm/builders/`): PEP 517 build front-end for creating wheels and sdists

### Command Entry Points

All CLI commands are in `src/pdm/cli/commands/` with command registration in `src/pdm/core.py`. Commands inherit from `BaseCommand` and use decorator patterns for common options.

## Development Commands

### Setup Development Environment
```bash
# Install development dependencies
pdm install
```

### Run Tests
```bash
# Run all tests
pdm run test

# Run tests in parallel
pdm run test -n auto
```

Most of the time, you can exclude tests with "integration" mark to save runtime:

```bash
pdm run test -n auto -m "not integration"
```

### Code Quality
```bash
# Run linting (ruff-format + codespell + mypy)
pdm run lint
```

### Documentation
```bash
# Serve documentation locally
pdm run doc
```

### Contribution Guidelines

Refer to [CONTRIBUTING.md](CONTRIBUTING.md)

## Important Files

- `pyproject.toml`: Project configuration and dependencies
- `src/pdm/core.py`: Main application entry point and command registration
- `src/pdm/project/__init__.py`: Project class managing project state
- `src/pdm/cli/commands/base.py`: Base command class for all CLI commands
- `.pre-commit-config.yaml`: Code quality hooks (ruff, mypy, codespell)

## Common Development Tasks

### Adding a New Command
1. Create new file in `src/pdm/cli/commands/`
2. Inherit from `BaseCommand`
3. Register in `src/pdm/core.py`

### Debugging Resolution Issues
- Set `PDM_DEBUG=1` environment variable for verbose output
- Check `pdm.lock` for resolved versions
- Use `pdm lock --check` to verify lock file

### Working with Lock Files

PDM uses its own lock file format (`pdm.lock`) that includes:
- Exact versions with hashes
- Environment markers
- Cross-platform support
- Group dependencies

### Update dependencies

```bash
# Add a new dependency to default group
pdm add <package_name>

# Update all dependencies
pdm update

# Remove a dependency
pdm remove <package_name>

# Add a new dependency to given group
pdm add <package_name> --group <group_name>
```

## Architecture Patterns

- **Dependency Injection**: Core class passed to commands
- **Signal System**: Event-driven architecture for plugins
- **Repository Pattern**: Abstract repository interface for package sources
- **Strategy Pattern**: Different environment backends (venv, conda, etc.)
- **Chain of Responsibility**: Middleware system for HTTP client

Signals

Stars
8,662
Forks
505
Open issues
36
Last commit (this folder)
Dec 4, 2025 (10 months ago)
Last release
Oct 19, 2026 (10 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026
Cite this page

AGENTS.md · pdm-project/pdm. Agent Mart. https://agentmart.dev/templates/pdm-project-pdm-agents-md (last updated 2026-10-24)