|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +This is a Python CLI tool with a D3.js frontend that generates interactive network visualizations of GitHub contributors. The CLI fetches data from GitHub, generates CSVs, and builds a static site for deployment. |
| 8 | + |
| 9 | +## Commands |
| 10 | + |
| 11 | +### Development |
| 12 | + |
| 13 | +```bash |
| 14 | +# Install dependencies |
| 15 | +uv sync |
| 16 | + |
| 17 | +# Run CLI commands |
| 18 | +uv run contributor-network data # Fetch contribution data from GitHub |
| 19 | +uv run contributor-network csvs # Generate CSVs from JSON |
| 20 | +uv run contributor-network build # Build static site to dist/ |
| 21 | +uv run contributor-network discover # Find new repositories |
| 22 | +uv run contributor-network list-contributors # Display all contributors |
| 23 | +``` |
| 24 | + |
| 25 | +### Quality Checks |
| 26 | + |
| 27 | +```bash |
| 28 | +# Run all checks (as in CI) |
| 29 | +uv run ruff format --check . |
| 30 | +uv run ruff check . |
| 31 | +uv run mypy |
| 32 | + |
| 33 | +# Auto-fix formatting and lint issues |
| 34 | +uv run ruff format . |
| 35 | +uv run ruff check --fix . |
| 36 | + |
| 37 | +# Run tests |
| 38 | +uv run pytest |
| 39 | +uv run pytest tests/test_config.py::test_function_name # Single test |
| 40 | +``` |
| 41 | + |
| 42 | +## Architecture |
| 43 | + |
| 44 | +**Data flow**: GitHub API → Python CLI → JSON files → CSV files → D3.js visualization |
| 45 | + |
| 46 | +- `src/contributor_network/cli.py` - Click-based CLI with 5 subcommands |
| 47 | +- `src/contributor_network/config.py` - Pydantic models for TOML configuration |
| 48 | +- `src/contributor_network/models.py` - Data models (Link, Repository) |
| 49 | +- `src/contributor_network/client.py` - GitHub API client wrapper |
| 50 | +- `index.js` - D3.js visualization (vanilla JS, no build step) |
| 51 | +- `templates/` - Jinja2 HTML templates |
| 52 | +- `config.toml`, `veda.toml` - Repository and contributor configuration |
| 53 | + |
| 54 | +## Code Style |
| 55 | + |
| 56 | +- Use `ruff` for linting and formatting |
| 57 | +- Type hints required (mypy runs in CI) |
| 58 | +- Pydantic for data validation |
| 59 | +- Click for CLI commands |
0 commit comments