A template for building AI Agents in Python.
├── src/
│ ├── agent.py # Main agent loop
│ ├── tools.py # Tool definitions
│ └── config.py # Configuration
├── scripts/
│ ├── setup_hooks.sh # One-time hook installer
│ ├── log_hook.py # AI tool hook handler
│ └── submit_log.py # Submits logs on git push
├── requirements.txt
├── .env.example
├── AGENTS.md # Rules for using AI coding agents
├── JOURNAL.md # Weekly journal — product journey & learnings
└── WORKLOG.md # Technical decisions, task assignments, brainstorming
git clone <repo-url>
cd <repo>
# Install git pre-push hook (required, run once)
bash scripts/setup_hooks.shcp .env.example .envOpen .env and fill in your ANTHROPIC_API_KEY. The AI_LOG_* variables are pre-filled.
python -m venv venv
source venv/bin/activate # Linux/Mac
# or: venv\Scripts\activate # Windows
pip install -r requirements.txt
python -m src.agentUpdate JOURNAL.md at the end of every week to document your product-building journey:
- Features shipped
- AI tools used and how they helped
- Hardest problem of the week and how you solved it
- What you'd do differently
- Plan for next week
JOURNAL.md must be updated before each PR. It is your learning record for the course.
Update WORKLOG.md whenever your team makes a technical decision or changes direction:
- Technical decisions — why did you choose this approach over alternatives?
- Task assignments — who does what, by when
- Brainstorming — options considered, pros/cons, conclusion
- Important bugs — root cause and fix
See each file for the format and examples.
Codex tren Windows thuong ghi prompt vao file global ~/.codex/history.jsonl. Repo nay sync tu file do vao .ai-log/session.jsonl (JSONL) va (neu co AI_LOG_SERVER) se submit khi git push.
- Dang ky session hien tai cho repo (1 lan cho moi session)
python scripts\submit_log_codex.py register --latest- Sync prompt tu history vao repo (khong can push)
python scripts\submit_log_codex.py sync
Get-Content .ai-log\session.jsonl -Tail 20- Tu dong sync + submit khi
git push
- Cai hook (PowerShell):
powershell -ExecutionPolicy Bypass -File scripts\setup_hooks.ps1- Neu may ban khong ghi duoc vao
.git/hooks, dung hook shareable:
git config core.hooksPath .githooks- (Khong khuyen khich) Sync tat ca session
python scripts\submit_log_codex.py sync --allPrompts and tool calls are automatically logged when you use any supported AI tool (Claude Code, Cursor, Codex, Gemini, Copilot). No manual steps needed after running setup_hooks.sh.
See AGENTS.md for details.