Skip to content

Commit ac88415

Browse files
committed
feat: improve code agents DX
1 parent e6bf351 commit ac88415

6 files changed

Lines changed: 1130 additions & 1054 deletions

File tree

.codex/commands/summarize.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
### Codex Session Notes
2+
3+
**Command**
4+
5+
* Run: `!summarize [slug]`
6+
7+
**Where to write**
8+
9+
* Path: `./.codex/sessions/[slug]-[date].md`
10+
* `slug`: kebab-case from the session topic (ASCII, ≤40 chars, no spaces).
11+
* `date`: `YYYY-MM-DD` in UTC.
12+
13+
**Update protocol (when `!summarize` is called)**
14+
15+
1. If the file doesn’t exist, create it with the template below and fill all placeholders.
16+
2. Update `last_updated` to the current ISO timestamp.
17+
3. Refresh **TL;DR** (≤120 words) to reflect the latest state.
18+
4. Append a new entry to **Turn log** with: role, timestamp, what changed (bullets), key code refs/paths touched.
19+
5. Extend **Actions taken**, **Decisions & rationale**, **Open questions**, **Next actions** as needed (dedupe; prefer edits over repetition).
20+
6. Keep **Running summary**\~200 words; compress older detail into Turn log.
21+
7. Never paste long code; reference files/functions/lines instead.
22+
23+
**Style rules**
24+
25+
* Be concise, factual, and action-oriented. No fluff.
26+
* Prefer bullets over prose; present tense; avoid “I”.
27+
* Use explicit file paths (`repo/file.py:func`), commands in single quotes, and UTC timestamps `[YYYY-MM-DD HH:MM]`.
28+
* No PII, secrets, tokens, or full stack traces. Link or reference instead.
29+
* Idempotent edits: do not duplicate prior bullets; update in place.
30+
* Touch only files inside this repo; create directories if missing.
31+
32+
---
33+
34+
### Standard Template (fill all placeholders)
35+
36+
```
37+
The most recent discussion I had with codex was the following. Please use these notes as informative context, so you can catch up and we can re-start the conversation accordingly.
38+
39+
topic: <short topic>
40+
slug: <kebab-case-slug>
41+
date: <YYYY-MM-DD> (UTC)
42+
last_updated: <UTC ISO 8601>
43+
participants: [user, assistant]
44+
45+
# TL;DR (≤120 words)
46+
- <single concise summary capturing goal, current state, next critical step>
47+
48+
# User desires
49+
- <succinct bullets of outcomes the user wants>
50+
51+
# Specifics of user desires (scope & constraints)
52+
- <key constraints, definitions of done, non-goals, acceptance criteria>
53+
54+
# Actions taken (chronological)
55+
1. [YYYY-MM-DD HH:MM] <what was done / command / artifact produced>
56+
2. <next step> …
57+
58+
# Decisions & rationale
59+
- [time] Decision: <decision>. Why: <brief reason/impact/tradeoffs>.
60+
61+
# Helpful hints about conversation & relevant code paths
62+
- Path: <repo/path/file.py:func> — <why it matters>
63+
- Command: '<cli args>' — <purpose>
64+
- Link: <url> — <what it answers>
65+
66+
# Open questions / risks
67+
- <unknown or risk> → <owner/next step to resolve>
68+
69+
# Next actions (checklist)
70+
- [ ] <next concrete task> (owner, expected outcome)
71+
- [ ] …
72+
73+
# Turn log (append-only)
74+
- [YYYY-MM-DD HH:MM] role=assistant — <what changed in this turn; bullets>
75+
- [YYYY-MM-DD HH:MM] role=user — <key asks/clarifications>
76+
77+
# With this context in mind, I have a follow up query:
78+
<one crisp question or instruction that advances the work>
79+
```
80+
---

.codex/sessions/.gitkeep

Whitespace-only changes.

.cursor/rules/general.mdc

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,17 @@
22
alwaysApply: true
33
---
44

5-
## 1. Environment and Dependencies
5+
## Environment and Dependencies
66
- **Tooling**: Use `uv` for all package management.
77

8-
## 2. Code Style and Formatting
9-
- **Indentation**: Strictly use 2 spaces for indentation.
10-
- **Quotes**: Use single quotes (`'`) for all strings. Use double quotes (`"`) only when a string contains a single quote.
11-
- **Naming Conventions**:
12-
- `snake_case` for all variables, functions, methods, files, and directories.
13-
- `PascalCase` for all class names (e.g., `Pydantic` models, custom exceptions).
14-
- **Boolean Variables**: Name boolean variables with an auxiliary verb prefix (e.g., `is_active`, `has_permission`, `should_send_email`).
8+
## Code Style
159

16-
## 3. Programming Paradigm and Structure
17-
- **Functional Approach**: Prefer pure, standalone functions. Avoid classes unless necessary.
18-
- **Class Usage Exceptions**: Use classes only for:
19-
- Data structures (Pydantic models).
20-
- Framework requirements (e.g., Django models, FastAPI routers).
21-
- Custom exception types.
22-
- **Modularity (DRY)**: Do not repeat code. Refactor any duplicated logic into reusable functions. Group related utility functions into separate modules (e.g., `utils/data_processing.py`).
10+
**Format**: 2-space indent, single quotes, `snake_case` vars/functions, `PascalCase` classes, `is_/has_/should_` booleans
2311

24-
## 4. API and Function Design
25-
- **RORO Pattern**: All service-layer functions and API endpoint handlers must follow the "Receive an Object, Return an Object" pattern.
26-
- **Data Contracts**: Use Pydantic models to define the "objects" for RORO. The input object should be a single Pydantic model, and the return value should be a single Pydantic model (or `None`).
12+
**Architecture**:
13+
- Pure functions preferred; classes for stateful operations (3+ shared params), data structures, framework requirements
14+
- RORO pattern: service functions receive/return single Pydantic objects
15+
- Single responsibility: break 150+ line functions into focused 15-25 line methods, early returns, no magic values, explicit dependencies
16+
- DRY principle: extract utility functions to eliminate code duplication when applicable
17+
- Pipeline pattern: chain transformations with clear inputs/outputs
18+
- No excessive error handling or low-value comments

AGENTS.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
# General Rules
22

3-
## 1. Environment and Dependencies
3+
## Environment and Dependencies
44
- **Tooling**: Use `uv` for all package management.
55

6-
## 2. Code Style and Formatting
7-
- **Indentation**: Strictly use 2 spaces for indentation.
8-
- **Quotes**: Use single quotes (`'`) for all strings. Use double quotes (`"`) only when a string contains a single quote.
9-
- **Naming Conventions**:
10-
- `snake_case` for all variables, functions, methods, files, and directories.
11-
- `PascalCase` for all class names (e.g., `Pydantic` models, custom exceptions).
12-
- **Boolean Variables**: Name boolean variables with an auxiliary verb prefix (e.g., `is_active`, `has_permission`, `should_send_email`).
13-
14-
## 3. Programming Paradigm and Structure
15-
- **Functional Approach**: Prefer pure, standalone functions. Avoid classes unless necessary.
16-
- **Class Usage Exceptions**: Use classes only for:
17-
- Data structures (Pydantic models).
18-
- Framework requirements (e.g., Django models, FastAPI routers).
19-
- Custom exception types.
20-
- **Modularity (DRY)**: Do not repeat code. Refactor any duplicated logic into reusable functions. Group related utility functions into separate modules (e.g., `utils/data_processing.py`).
21-
22-
## 4. API and Function Design
23-
- **RORO Pattern**: All service-layer functions and API endpoint handlers must follow the "Receive an Object, Return an Object" pattern.
24-
- **Data Contracts**: Use Pydantic models to define the "objects" for RORO. The input object should be a single Pydantic model, and the return value should be a single Pydantic model (or `None`).
6+
## Code Style
7+
8+
**Format**: 2-space indent, single quotes, `snake_case` vars/functions, `PascalCase` classes, `is_/has_/should_` booleans
9+
10+
**Architecture**:
11+
- Pure functions preferred; classes for stateful operations (3+ shared params), data structures, framework requirements
12+
- RORO pattern: service functions receive/return single Pydantic objects
13+
- Single responsibility: break 150+ line functions into focused 15-25 line methods, early returns, no magic values, explicit dependencies
14+
- DRY principle: extract utility functions to eliminate code duplication when applicable
15+
- Pipeline pattern: chain transformations with clear inputs/outputs
16+
- No excessive error handling or low-value comments
17+
18+
## Codex Commands
19+
20+
Conventions:
21+
- Any user message that **starts with** `!` is a command.
22+
- Be non-verbose. For commands, print a single status line (or a short block) on success/failure.
23+
- Use UTC timestamps. Touch only files inside this repo.
24+
- If a directory you need doesn’t exist, create it.
25+
26+
Commands:
27+
28+
- `!summarize [slug]`: Read `.codex/commands/summarize.md` for command instructions.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies = [
2121
dev = [
2222
"ipykernel>=6.30.1",
2323
"pre-commit>=4.2.0",
24-
"pyright>=1.1.404",
24+
"pyright>=1.1.405",
2525
"pytest>=8.4.1",
2626
"pytest-cov>=6.2.1",
2727
"ruff>=0.12.11",

0 commit comments

Comments
 (0)