Metadata-Version: 2.3
Name: prompt-diary
Version: 0.1.0a1
Summary: Review user prompts for evidence-backed improvement in AI coding collaboration.
Requires-Dist: typer>=0.25.1
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Prompt Diary

Prompt Diary prepares bounded, redacted workspaces from local assistant session history and generates evidenced prompt diary reports that help users review and improve how they collaborate with AI coding agents.

The tool targets Python 3.10 and newer. The package exposes `report` and `prompt-diary`
console commands after installation.

## Usage

Install the command as an isolated uv tool:

```bash
uv tool install .
```

Then run:

```bash
report --help
prompt-diary --help
report prepare --date 2026-05-12 --timezone Asia/Shanghai
report generate --date 2026-05-12 --timezone Asia/Shanghai
```

During development, `uv sync` installs the project into the local `.venv`; use `uv run` to
execute the command from that environment:

```bash
uv run report --help
```

## Development

This project uses [`uv`](https://docs.astral.sh/uv/) for Python version, environment, dependency, build, and release workflows.

### Environment

Set up the development environment:

```bash
uv sync
```

Run the CLI from the project environment:

```bash
uv run report --help
```

### Dependencies

Add runtime dependencies with:

```bash
uv add <package>
```

Add development-only dependencies with:

```bash
uv add --dev <package>
```

### Build And Release

Build source and wheel distributions:

```bash
uv build
```

Publish release artifacts only after the package metadata and target registry are configured:

```bash
uv publish
```

### Type Checking

Type checking uses [`basedpyright`](https://docs.basedpyright.com/latest/configuration/command-line/). The project config enables strict mode for `src` and `tests`.
Add type annotations by best effort for new and changed code. This is a hard rule: prefer
explicit, checkable types whenever they improve clarity or allow basedpyright to verify behavior.
Use accurate types when possible instead of relying on repeated validation. At module boundaries,
parse untrusted or loosely structured inputs into precise internal types, then pass those types
through the rest of the code. Do not validate a value and then continue passing the original
loose representation when a richer type, dataclass, `TypedDict`, `NewType`, enum, or other
structured representation can preserve the invariant for callers and the type checker.

```bash
uv run basedpyright
```

### Tests

Tests use [`pytest`](https://docs.pytest.org/). The pytest config lives in `pyproject.toml`
and uses strict config and marker validation.

```bash
uv run pytest
```

### Linting And Formatting

Linting and formatting use [`ruff`](https://docs.astral.sh/ruff/). Ruff is configured for Python 3.10.
The lint rule set is explicit and intentionally broader than Ruff's defaults, covering imports,
modernization, bug-prone patterns, datetime safety, security checks, pathlib usage, pytest style,
exception handling, and simplification rules.

```bash
uv run ruff check
uv run ruff format --check
uv run ruff format
```

### Pre-Submit Checks

Before submitting changes, run:

```bash
uv run ruff check
uv run ruff format --check
uv run basedpyright
uv run pytest
uv build
```
