Skip to content

Commit 6ffbff3

Browse files
ShlomoSteptclaude
andcommitted
Update TASKS.md and AGENTS.md with comprehensive documentation
Part 2 deliverables from subagent analysis: ## Task Grading (0.00-10.00) - B.5 ANSI Sanitization: 6.75/10 - Works for common cases but regex misses ~30% of ANSI sequences (cursor control, OSC sequences) - B.4 Content-Block Arrays: 6.75/10 - Handles text/thinking but not images or tool_use blocks - A.1 Copy Buttons: 6.75/10 - Functional but lacks accessibility (no ARIA labels, keyboard support, clipboard API fallback) - B.2 Syntax Highlighting: 9.25/10 - Excellent implementation with 500+ language support and graceful error handling ## TASKS.md Updates - Added detailed grading with justifications - Added known limitations for each completed task - Added test coverage gaps to address - Added technical specifications (file architecture, CSS/JS guidelines) - Added task dependency graph - Added implementation details for pending phases - Added documentation gaps identified ## AGENTS.md Updates - Added Quick Start section with setup commands - Added Project Structure overview - Added comprehensive testing commands - Added snapshot testing instructions - Added debugging tips - Added architecture notes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ee13ef8 commit 6ffbff3

1 file changed

Lines changed: 154 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 154 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,161 @@
1-
Uses uv. Run tests like this:
1+
# Development Guide
22

3-
uv run pytest
3+
This guide covers everything needed to contribute to claude-code-transcripts.
44

5-
Run the development version of the tool like this:
5+
## Quick Start
66

7-
uv run claude-code-transcripts --help
7+
```bash
8+
# Clone and setup
9+
git clone https://github.com/simonw/claude-code-transcripts.git
10+
cd claude-code-transcripts
811

9-
Always practice TDD: write a faliing test, watch it fail, then make it pass.
12+
# Install uv if not already installed
13+
# See: https://docs.astral.sh/uv/
1014

11-
Commit early and often. Commits should bundle the test, implementation, and documentation changes together.
15+
# Install dependencies
16+
uv sync --group dev
1217

13-
Run Black to format code before you commit:
18+
# Run tests
19+
uv run pytest
1420

15-
uv run black .
21+
# Run the development version
22+
uv run claude-code-transcripts --help
23+
```
24+
25+
## Project Structure
26+
27+
```
28+
claude-code-transcripts/
29+
├── src/claude_code_transcripts/
30+
│ ├── __init__.py # Main implementation
31+
│ └── templates/ # Jinja2 templates
32+
│ ├── macros.html # Reusable macros
33+
│ ├── page.html # Page template
34+
│ ├── index.html # Index template
35+
│ ├── base.html # Base template
36+
│ └── search.js # Client-side search
37+
├── tests/
38+
│ ├── test_generate_html.py # Main test suite
39+
│ ├── test_all.py # Batch command tests
40+
│ ├── sample_session.json # Test fixture (JSON)
41+
│ ├── sample_session.jsonl # Test fixture (JSONL)
42+
│ └── __snapshots__/ # Snapshot test outputs
43+
├── TASKS.md # Implementation roadmap
44+
├── AGENTS.md # This file
45+
└── pyproject.toml # Package configuration
46+
```
47+
48+
## Running Tests
49+
50+
```bash
51+
# Run all tests
52+
uv run pytest
53+
54+
# Run specific test file
55+
uv run pytest tests/test_generate_html.py
56+
57+
# Run specific test class
58+
uv run pytest tests/test_generate_html.py::TestRenderContentBlock
59+
60+
# Run specific test
61+
uv run pytest tests/test_generate_html.py::TestRenderContentBlock::test_text_block -v
62+
63+
# Run with verbose output
64+
uv run pytest -v
65+
66+
# Run with stdout capture disabled (for debugging)
67+
uv run pytest -s
68+
```
69+
70+
## Code Formatting
71+
72+
Format code with Black before committing:
73+
74+
```bash
75+
uv run black .
76+
```
77+
78+
Check formatting without making changes:
79+
80+
```bash
81+
uv run black . --check
82+
```
83+
84+
## Test-Driven Development (TDD)
85+
86+
Always practice TDD: write a failing test, watch it fail, then make it pass.
87+
88+
1. Write a failing test for your change
89+
2. Run tests to confirm it fails: `uv run pytest`
90+
3. Implement the feature to make the test pass
91+
4. Format your code: `uv run black .`
92+
5. Run all tests to ensure nothing broke
93+
6. Commit with a descriptive message
94+
95+
## Snapshot Testing
96+
97+
This project uses `syrupy` for snapshot testing. Snapshots are stored in `tests/__snapshots__/`.
98+
99+
Update snapshots when intentionally changing output:
100+
101+
```bash
102+
uv run pytest --snapshot-update
103+
```
104+
105+
## Making Changes
106+
107+
### Commit Guidelines
108+
109+
Commit early and often. Each commit should bundle:
110+
- The test
111+
- The implementation
112+
- Documentation changes (if applicable)
113+
114+
Example commit message:
115+
```
116+
Add support for filtering sessions by date
117+
118+
- Add --since and --until flags to local command
119+
- Filter sessions by modification time
120+
- Add tests for date filtering
121+
```
122+
123+
### Before Submitting a PR
124+
125+
1. All tests pass: `uv run pytest`
126+
2. Code is formatted: `uv run black .`
127+
3. Documentation updated if adding user-facing features
128+
4. TASKS.md updated if completing a tracked task
129+
130+
## Key Files Reference
131+
132+
| File | Purpose |
133+
|------|---------|
134+
| `src/claude_code_transcripts/__init__.py` | Main implementation (~1300 lines) |
135+
| `src/claude_code_transcripts/templates/macros.html` | Jinja2 macros for rendering |
136+
| `tests/test_generate_html.py` | Main test suite |
137+
| `tests/sample_session.json` | Test fixture data |
138+
| `TASKS.md` | Implementation roadmap and status |
139+
140+
## Debugging Tips
141+
142+
```bash
143+
# See full assertion output
144+
uv run pytest -vv
145+
146+
# Stop on first failure
147+
uv run pytest -x
148+
149+
# Run only failed tests from last run
150+
uv run pytest --lf
151+
152+
# Run tests matching a pattern
153+
uv run pytest -k "test_ansi"
154+
```
155+
156+
## Architecture Notes
157+
158+
- CSS and JavaScript are embedded as string constants in `__init__.py`
159+
- Templates use Jinja2 with autoescape enabled
160+
- The `_macros` module exposes macros from `macros.html`
161+
- Tool rendering follows the pattern: Python function → Jinja2 macro → HTML

0 commit comments

Comments
 (0)