Skip to content

Commit 3151fcb

Browse files
authored
Merge pull request #40 from PPeitsch/docs/agent-guidelines
[DOCS] Add AGENTS.md and WORKFLOW.md
2 parents 6c4b5d0 + bf9ca3a commit 3151fcb

2 files changed

Lines changed: 170 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# TimeTrack Development Protocol for AI Agents
2+
3+
## OS Context
4+
5+
This project is developed primarily on **Windows**. Detect the host OS and adapt commands accordingly:
6+
7+
- **Windows**: Use `.venv\Scripts\Activate.ps1`, paths with `\`
8+
- **Linux**: Use `source .venv/bin/activate`, paths with `/`
9+
10+
When in doubt, ask the user which environment they are working on.
11+
12+
---
13+
14+
## Project Overview
15+
16+
**TimeTrack** is a Flask-based web application for tracking time entry and observations.
17+
- Data persistence with SQLAlchemy and PostgreSQL/SQLite.
18+
- MVC architecture with Flask Blueprints.
19+
20+
## Build System & Tooling
21+
22+
| Tool | Purpose | Configuration |
23+
|------|---------|---------------|
24+
| **pip** | Dependency Manager | `requirements.txt`, `requirements-dev.txt` |
25+
| **black** | Code formatting | `pyproject.toml` (or default), 88 chars |
26+
| **isort** | Import sorting | `profile = "black"` |
27+
| **mypy** | Type checking | `mypy.ini` |
28+
| **pytest** | Testing | `pytest.ini` or default |
29+
30+
## Python Version Support
31+
32+
- Python 3.10, 3.11+
33+
34+
## Development Setup
35+
36+
```powershell
37+
# Create virtual environment
38+
python -m venv .venv
39+
40+
# Activate (Windows PowerShell)
41+
.venv\Scripts\Activate.ps1
42+
43+
# Install dependencies
44+
pip install -r requirements.txt
45+
pip install -r requirements-dev.txt
46+
```
47+
48+
## Code Quality Commands
49+
50+
### Formatting
51+
```powershell
52+
# Check formatting
53+
black --check app tests
54+
isort --check-only app tests
55+
56+
# Apply formatting
57+
black app tests
58+
isort app tests
59+
```
60+
61+
### Type Checking
62+
```powershell
63+
mypy app tests
64+
```
65+
66+
### Testing
67+
```powershell
68+
# Run all tests with coverage
69+
pytest tests/ -v --cov=app --cov-report=term-missing
70+
```
71+
72+
## Project Structure
73+
74+
```
75+
TimeTrack/
76+
├── app/ # Main application package
77+
│ ├── __init__.py # App factory
78+
│ ├── models/ # SQLAlchemy models
79+
│ ├── routes/ # Flask routes/blueprints
80+
│ ├── services/ # Business logic
81+
│ ├── templates/ # HTML templates
82+
│ └── static/ # CSS, JS, Images
83+
├── tests/ # Test suite
84+
├── migrations/ # Database migrations
85+
├── requirements.txt # Production dependencies
86+
├── requirements-dev.txt # Development dependencies
87+
├── run.py # Entry point
88+
└── README.md # Project overview
89+
```
90+
91+
## Key Guidelines for AI Agents
92+
93+
1. **Always run quality checks** before committing: `black`, `isort`, `mypy`, `pytest`
94+
2. **Use type hints** for all new functions and methods
95+
3. **Write tests** for new functionality
96+
4. **Follow Flask Best Practices**: application factories, blueprints.

WORKFLOW.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# TimeTrack Development Workflow
2+
3+
This document describes the standard development workflow for contributing to TimeTrack.
4+
5+
---
6+
7+
## Quick Reference
8+
9+
| Task | Command |
10+
|------|---------|
11+
| Format code | `black app tests && isort app tests` |
12+
| Check formatting | `black --check app tests && isort --check-only app tests` |
13+
| Type check | `mypy app` |
14+
| Run tests | `pytest tests/ -v` |
15+
| Run app | `flask run` or `python run.py` |
16+
17+
---
18+
19+
## 1. Environment Setup
20+
21+
### First Time Setup
22+
23+
```powershell
24+
# Clone the repository
25+
git clone <repo-url>
26+
cd TimeTrack
27+
28+
# Create virtual environment
29+
python -m venv .venv
30+
31+
# Activate virtual environment
32+
# Windows PowerShell:
33+
.venv\Scripts\Activate.ps1
34+
35+
# Install dependencies
36+
pip install -r requirements.txt
37+
pip install -r requirements-dev.txt
38+
```
39+
40+
---
41+
42+
## 2. Development Cycle
43+
44+
### Writing Code
45+
46+
1. **Make your changes** in `app/`
47+
2. **Add type hints** to all new functions
48+
3. **Write tests** in `tests/` for new functionality
49+
50+
### Code Quality Checks
51+
52+
Run these before every commit:
53+
54+
```powershell
55+
# Format code
56+
black app tests
57+
isort app tests
58+
59+
# Type checking
60+
mypy app
61+
62+
# Run tests
63+
pytest tests/ -v
64+
```
65+
66+
### Pre-Commit Checklist
67+
68+
- [ ] Code formatted with black
69+
- [ ] Imports sorted with isort
70+
- [ ] mypy passes without errors
71+
- [ ] All tests pass
72+
- [ ] New tests added for new functionality
73+
74+
---

0 commit comments

Comments
 (0)