- Language: Python 3.14+
- Package manager: uv (for deps, builds, runs, and tool installs)
- Build backend: hatchling
- Source layout:
src/aipm/ - CLI framework: click + rich
- Task runner: just (
.justfile)
- Use
uvfor all Python project management, builds, and running - Never use
piporpip installdirectly — alwaysuv sync,uv run, oruv tool install - Run commands via
just <target>oruv run <command>
- Linter: ruff (
uv run ruff check src/ tests/) - Formatter: ruff (
uv run ruff format src/ tests/) - Type checker: ty (
uv run ty check src/) - Fix all lint and format issues before committing
- Follow the ruff rule set configured in
pyproject.toml(E, W, F, I, N, UP, B, SIM, RUF) - Line length: 120 characters max
- Framework: pytest
- Test directory:
tests/ - Always run the tests after making changes:
uv run pytest tests/ -v - Add tests for every new feature or command
- Tests use a
work_dirfixture (fromconftest.py) that creates directories undertests/.tmp/<test_name>/for easy debugging - Use
CliRunnerfrom click for testing CLI commands - Run all checks with:
just check - For each error log that the user pastes in the chat, that was not covered by tests before, add a regression test case
- Update
README.mdfor new options, commands, and features - Keep the command reference table in the README in sync with the CLI
- Update the project structure section when adding new directories or file types
- Use
from __future__ import annotationsin every module - Type-annotate all function signatures
- Use lazy imports inside click command functions (import the command handler inside the function body)
- Use
rich.console.Consolefor user-facing output - Use
click.prompt/click.confirmfor interactive input - Prefer
pathlib.Pathoveros.path - Use dataclasses for configuration and data structures
src/aipm/
├── __init__.py # Package version
├── cli.py # Click CLI entry point and command registration
├── config.py # aipm.toml config loading/saving
├── horizons.py # Time horizon constants, inference, validation
├── utils.py # Git helpers, sanitization, markdown formatting
├── commands/ # One module per command
│ ├── init.py
│ ├── add.py
│ ├── sync.py
│ ├── diff.py
│ ├── plan.py
│ ├── summary.py
│ ├── commit.py
│ ├── check.py
│ ├── report.py
│ └── ticket.py
└── sources/ # Issue source backends
├── base.py # Abstract base class + Ticket dataclass
├── jira_source.py
└── github_source.py