prompt-diary 0.1.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: prompt-diary
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Review user prompts for evidence-backed improvement in AI coding collaboration.
|
|
5
|
+
Requires-Dist: typer>=0.25.1
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# Prompt Diary
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
The tool targets Python 3.10 and newer. The package exposes `report` and `prompt-diary`
|
|
14
|
+
console commands after installation.
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
Install the command as an isolated uv tool:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv tool install .
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then run:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
report --help
|
|
28
|
+
prompt-diary --help
|
|
29
|
+
report prepare --date 2026-05-12 --timezone Asia/Shanghai
|
|
30
|
+
report generate --date 2026-05-12 --timezone Asia/Shanghai
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
During development, `uv sync` installs the project into the local `.venv`; use `uv run` to
|
|
34
|
+
execute the command from that environment:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uv run report --help
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Development
|
|
41
|
+
|
|
42
|
+
This project uses [`uv`](https://docs.astral.sh/uv/) for Python version, environment, dependency, build, and release workflows.
|
|
43
|
+
|
|
44
|
+
### Environment
|
|
45
|
+
|
|
46
|
+
Set up the development environment:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
uv sync
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Run the CLI from the project environment:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
uv run report --help
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Dependencies
|
|
59
|
+
|
|
60
|
+
Add runtime dependencies with:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
uv add <package>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Add development-only dependencies with:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uv add --dev <package>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Build And Release
|
|
73
|
+
|
|
74
|
+
Build source and wheel distributions:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv build
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Publish release artifacts only after the package metadata and target registry are configured:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
uv publish
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Type Checking
|
|
87
|
+
|
|
88
|
+
Type checking uses [`basedpyright`](https://docs.basedpyright.com/latest/configuration/command-line/). The project config enables strict mode for `src` and `tests`.
|
|
89
|
+
Add type annotations by best effort for new and changed code. This is a hard rule: prefer
|
|
90
|
+
explicit, checkable types whenever they improve clarity or allow basedpyright to verify behavior.
|
|
91
|
+
Use accurate types when possible instead of relying on repeated validation. At module boundaries,
|
|
92
|
+
parse untrusted or loosely structured inputs into precise internal types, then pass those types
|
|
93
|
+
through the rest of the code. Do not validate a value and then continue passing the original
|
|
94
|
+
loose representation when a richer type, dataclass, `TypedDict`, `NewType`, enum, or other
|
|
95
|
+
structured representation can preserve the invariant for callers and the type checker.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
uv run basedpyright
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Tests
|
|
102
|
+
|
|
103
|
+
Tests use [`pytest`](https://docs.pytest.org/). The pytest config lives in `pyproject.toml`
|
|
104
|
+
and uses strict config and marker validation.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
uv run pytest
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Linting And Formatting
|
|
111
|
+
|
|
112
|
+
Linting and formatting use [`ruff`](https://docs.astral.sh/ruff/). Ruff is configured for Python 3.10.
|
|
113
|
+
The lint rule set is explicit and intentionally broader than Ruff's defaults, covering imports,
|
|
114
|
+
modernization, bug-prone patterns, datetime safety, security checks, pathlib usage, pytest style,
|
|
115
|
+
exception handling, and simplification rules.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
uv run ruff check
|
|
119
|
+
uv run ruff format --check
|
|
120
|
+
uv run ruff format
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Pre-Submit Checks
|
|
124
|
+
|
|
125
|
+
Before submitting changes, run:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
uv run ruff check
|
|
129
|
+
uv run ruff format --check
|
|
130
|
+
uv run basedpyright
|
|
131
|
+
uv run pytest
|
|
132
|
+
uv build
|
|
133
|
+
```
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Prompt Diary
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
The tool targets Python 3.10 and newer. The package exposes `report` and `prompt-diary`
|
|
6
|
+
console commands after installation.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Install the command as an isolated uv tool:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
uv tool install .
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Then run:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
report --help
|
|
20
|
+
prompt-diary --help
|
|
21
|
+
report prepare --date 2026-05-12 --timezone Asia/Shanghai
|
|
22
|
+
report generate --date 2026-05-12 --timezone Asia/Shanghai
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
During development, `uv sync` installs the project into the local `.venv`; use `uv run` to
|
|
26
|
+
execute the command from that environment:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv run report --help
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Development
|
|
33
|
+
|
|
34
|
+
This project uses [`uv`](https://docs.astral.sh/uv/) for Python version, environment, dependency, build, and release workflows.
|
|
35
|
+
|
|
36
|
+
### Environment
|
|
37
|
+
|
|
38
|
+
Set up the development environment:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv sync
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run the CLI from the project environment:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
uv run report --help
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Dependencies
|
|
51
|
+
|
|
52
|
+
Add runtime dependencies with:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
uv add <package>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Add development-only dependencies with:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
uv add --dev <package>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Build And Release
|
|
65
|
+
|
|
66
|
+
Build source and wheel distributions:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uv build
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Publish release artifacts only after the package metadata and target registry are configured:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
uv publish
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Type Checking
|
|
79
|
+
|
|
80
|
+
Type checking uses [`basedpyright`](https://docs.basedpyright.com/latest/configuration/command-line/). The project config enables strict mode for `src` and `tests`.
|
|
81
|
+
Add type annotations by best effort for new and changed code. This is a hard rule: prefer
|
|
82
|
+
explicit, checkable types whenever they improve clarity or allow basedpyright to verify behavior.
|
|
83
|
+
Use accurate types when possible instead of relying on repeated validation. At module boundaries,
|
|
84
|
+
parse untrusted or loosely structured inputs into precise internal types, then pass those types
|
|
85
|
+
through the rest of the code. Do not validate a value and then continue passing the original
|
|
86
|
+
loose representation when a richer type, dataclass, `TypedDict`, `NewType`, enum, or other
|
|
87
|
+
structured representation can preserve the invariant for callers and the type checker.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
uv run basedpyright
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Tests
|
|
94
|
+
|
|
95
|
+
Tests use [`pytest`](https://docs.pytest.org/). The pytest config lives in `pyproject.toml`
|
|
96
|
+
and uses strict config and marker validation.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv run pytest
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Linting And Formatting
|
|
103
|
+
|
|
104
|
+
Linting and formatting use [`ruff`](https://docs.astral.sh/ruff/). Ruff is configured for Python 3.10.
|
|
105
|
+
The lint rule set is explicit and intentionally broader than Ruff's defaults, covering imports,
|
|
106
|
+
modernization, bug-prone patterns, datetime safety, security checks, pathlib usage, pytest style,
|
|
107
|
+
exception handling, and simplification rules.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
uv run ruff check
|
|
111
|
+
uv run ruff format --check
|
|
112
|
+
uv run ruff format
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Pre-Submit Checks
|
|
116
|
+
|
|
117
|
+
Before submitting changes, run:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
uv run ruff check
|
|
121
|
+
uv run ruff format --check
|
|
122
|
+
uv run basedpyright
|
|
123
|
+
uv run pytest
|
|
124
|
+
uv build
|
|
125
|
+
```
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "prompt-diary"
|
|
3
|
+
version = "0.1.0a1"
|
|
4
|
+
description = "Review user prompts for evidence-backed improvement in AI coding collaboration."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"typer>=0.25.1",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[project.scripts]
|
|
12
|
+
prompt-diary = "prompt_diary.cli:main"
|
|
13
|
+
report = "prompt_diary.cli:main"
|
|
14
|
+
|
|
15
|
+
[build-system]
|
|
16
|
+
requires = ["uv_build>=0.11.6,<0.12"]
|
|
17
|
+
build-backend = "uv_build"
|
|
18
|
+
|
|
19
|
+
[tool.basedpyright]
|
|
20
|
+
include = ["src", "tests"]
|
|
21
|
+
pythonVersion = "3.10"
|
|
22
|
+
typeCheckingMode = "strict"
|
|
23
|
+
reportMissingTypeStubs = false
|
|
24
|
+
|
|
25
|
+
[tool.pytest.ini_options]
|
|
26
|
+
minversion = "9.0"
|
|
27
|
+
testpaths = ["tests"]
|
|
28
|
+
addopts = [
|
|
29
|
+
"--strict-config",
|
|
30
|
+
"--strict-markers",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[tool.ruff]
|
|
34
|
+
line-length = 100
|
|
35
|
+
target-version = "py310"
|
|
36
|
+
src = ["src", "tests"]
|
|
37
|
+
extend-exclude = ["export_codex_user_history.py"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff.lint]
|
|
40
|
+
select = [
|
|
41
|
+
# pycodestyle
|
|
42
|
+
"E",
|
|
43
|
+
"W",
|
|
44
|
+
# Pyflakes
|
|
45
|
+
"F",
|
|
46
|
+
# isort
|
|
47
|
+
"I",
|
|
48
|
+
# pyupgrade
|
|
49
|
+
"UP",
|
|
50
|
+
# flake8-bugbear
|
|
51
|
+
"B",
|
|
52
|
+
# flake8-builtins
|
|
53
|
+
"A",
|
|
54
|
+
# flake8-unused-arguments
|
|
55
|
+
"ARG",
|
|
56
|
+
# flake8-blind-except
|
|
57
|
+
"BLE",
|
|
58
|
+
# flake8-comprehensions
|
|
59
|
+
"C4",
|
|
60
|
+
# mccabe
|
|
61
|
+
"C90",
|
|
62
|
+
# flake8-datetimez
|
|
63
|
+
"DTZ",
|
|
64
|
+
# eradicate
|
|
65
|
+
"ERA",
|
|
66
|
+
# flake8-boolean-trap
|
|
67
|
+
"FBT",
|
|
68
|
+
# flake8-logging
|
|
69
|
+
"LOG",
|
|
70
|
+
# flake8-logging-format
|
|
71
|
+
"G",
|
|
72
|
+
# flake8-no-pep420
|
|
73
|
+
"INP",
|
|
74
|
+
# pep8-naming
|
|
75
|
+
"N",
|
|
76
|
+
# Perflint
|
|
77
|
+
"PERF",
|
|
78
|
+
# flake8-pie
|
|
79
|
+
"PIE",
|
|
80
|
+
# Pylint convention, error, and warning rules.
|
|
81
|
+
"PLC",
|
|
82
|
+
"PLE",
|
|
83
|
+
"PLW",
|
|
84
|
+
# flake8-pytest-style
|
|
85
|
+
"PT",
|
|
86
|
+
# flake8-use-pathlib
|
|
87
|
+
"PTH",
|
|
88
|
+
# flake8-return
|
|
89
|
+
"RET",
|
|
90
|
+
# flake8-raise
|
|
91
|
+
"RSE",
|
|
92
|
+
# flake8-bandit
|
|
93
|
+
"S",
|
|
94
|
+
# flake8-simplify
|
|
95
|
+
"SIM",
|
|
96
|
+
# flake8-type-checking
|
|
97
|
+
"TC",
|
|
98
|
+
# flake8-tidy-imports
|
|
99
|
+
"TID",
|
|
100
|
+
# tryceratops
|
|
101
|
+
"TRY",
|
|
102
|
+
# flake8-2020
|
|
103
|
+
"YTT",
|
|
104
|
+
# Ruff-specific rules
|
|
105
|
+
"RUF",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[tool.ruff.lint.per-file-ignores]
|
|
109
|
+
"tests/**" = [
|
|
110
|
+
# Allow pytest assertions in tests.
|
|
111
|
+
"S101",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
[tool.ruff.lint.isort]
|
|
115
|
+
known-first-party = ["prompt_diary"]
|
|
116
|
+
|
|
117
|
+
[tool.ruff.lint.mccabe]
|
|
118
|
+
max-complexity = 10
|
|
119
|
+
|
|
120
|
+
[tool.ruff.format]
|
|
121
|
+
quote-style = "double"
|
|
122
|
+
indent-style = "space"
|
|
123
|
+
line-ending = "lf"
|
|
124
|
+
|
|
125
|
+
[dependency-groups]
|
|
126
|
+
dev = [
|
|
127
|
+
"basedpyright>=1.39.4",
|
|
128
|
+
"pytest>=9.0.3",
|
|
129
|
+
"ruff>=0.15.12",
|
|
130
|
+
]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"""Typer command-line entrypoint for Prompt Diary."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Annotated
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from prompt_diary import __version__
|
|
10
|
+
|
|
11
|
+
app = typer.Typer(
|
|
12
|
+
add_completion=False,
|
|
13
|
+
help="Prepare and generate evidence-backed prompt diary reports.",
|
|
14
|
+
invoke_without_command=True,
|
|
15
|
+
no_args_is_help=True,
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
DateOption = Annotated[str | None, typer.Option(help="Target local date in YYYY-MM-DD format.")]
|
|
19
|
+
TodayOption = Annotated[bool, typer.Option(help="Target the current local day.")]
|
|
20
|
+
TimezoneOption = Annotated[
|
|
21
|
+
str | None,
|
|
22
|
+
typer.Option(help="IANA timezone name, e.g. Asia/Shanghai."),
|
|
23
|
+
]
|
|
24
|
+
ForceOption = Annotated[bool, typer.Option(help="Recreate an existing workspace.")]
|
|
25
|
+
VersionOption = Annotated[
|
|
26
|
+
bool,
|
|
27
|
+
typer.Option("--version", help="Show the version and exit.", is_eager=True),
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@app.callback()
|
|
32
|
+
def app_callback(*, version: VersionOption = False) -> None:
|
|
33
|
+
"""Prompt Diary command group."""
|
|
34
|
+
if version:
|
|
35
|
+
typer.echo(__version__)
|
|
36
|
+
raise typer.Exit
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@app.command()
|
|
40
|
+
def prepare(
|
|
41
|
+
*,
|
|
42
|
+
date: DateOption = None,
|
|
43
|
+
today: TodayOption = False,
|
|
44
|
+
timezone: TimezoneOption = None,
|
|
45
|
+
force: ForceOption = False,
|
|
46
|
+
) -> None:
|
|
47
|
+
"""Prepare a prompt diary workspace."""
|
|
48
|
+
_fail_not_implemented("prepare", date, today, timezone, force)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@app.command()
|
|
52
|
+
def generate(
|
|
53
|
+
*,
|
|
54
|
+
date: DateOption = None,
|
|
55
|
+
today: TodayOption = False,
|
|
56
|
+
timezone: TimezoneOption = None,
|
|
57
|
+
) -> None:
|
|
58
|
+
"""Generate and validate a prompt diary report."""
|
|
59
|
+
_fail_not_implemented("generate", date, today, timezone)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _fail_not_implemented(command: str, *_options: object) -> None:
|
|
63
|
+
typer.echo(f"Error: {command!r} is not implemented yet", err=True)
|
|
64
|
+
raise typer.Exit(2)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def main() -> None:
|
|
68
|
+
app()
|