docs: fix typos and reformat tables in CLAUDE.md

Fix "Prever" typo, add Windows WSL test runner command, and align
Markdown table columns for readability.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-30 14:14:38 +02:00
parent 85428826a0
commit a8d5f205db
+11 -4
View File
@@ -77,14 +77,15 @@ Run vendor/bin/phpunit after each change to confirm tests stay green.
**Common anti-patterns** **Common anti-patterns**
| Wrong prompt | Why it breaks TDD | Correct prompt | | Wrong prompt | Why it breaks TDD | Correct prompt |
|---|---|---| | ------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------ |
| "Write tests for this feature" | Claude implements first, then fits tests to it | "Write **failing** tests for [feature]. Stop before any implementation." | | "Write tests for this feature" | Claude implements first, then fits tests to it | "Write **failing** tests for [feature]. Stop before any implementation." |
| "Add tests and implementation" | Loses the design feedback of failing tests | Two separate prompts: Red, then Green | | "Add tests and implementation" | Loses the design feedback of failing tests | Two separate prompts: Red, then Green |
| "Make the tests pass" | Encourages skipping to a green state | "Implement the minimum to make the failing tests pass." | | "Make the tests pass" | Encourages skipping to a green state | "Implement the minimum to make the failing tests pass." |
| Combining Red + Green in one request | No failing baseline | Always separate the two phases | | Combining Red + Green in one request | No failing baseline | Always separate the two phases |
### Running tests ### Running tests
Prever to use the tests in `docker compose exec graph`
Prefer to use the tests in `docker compose exec graph`
```bash ```bash
# Run full suite # Run full suite
@@ -100,6 +101,12 @@ vendor/bin/phpunit tests/Unit/Service/SvgRendererTest.php
vendor/bin/phpunit --filter it_renders vendor/bin/phpunit --filter it_renders
``` ```
On Windows, run via WSL (If Docker Desctop is not):
```powershell
wsl -e bash -c "cd /mnt/g/_DEV/repos/git-contribution-graph && docker compose exec graph vendor/bin/phpunit --testdox 2>&1"
```
### Auto-run hook ### Auto-run hook
Add to `.claude/settings.json` to run PHPUnit automatically after every file edit: Add to `.claude/settings.json` to run PHPUnit automatically after every file edit:
@@ -132,7 +139,7 @@ Workflow files live in [.gitea/workflows/](.gitea/workflows/). This project uses
**Current workflows:** **Current workflows:**
| File | Trigger | Purpose | | File | Trigger | Purpose |
|---|---|---| | -------------------- | ---------------- | --------------------------------------------------------- |
| `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry | | `docker-publish.yml` | Push tag `*.*.*` | Build & push multi-arch image to Gitea container registry |
## Docker ## Docker
@@ -210,7 +217,7 @@ GET /graph.svg?theme=dark|light
## Environment variables ## Environment variables
| Variable | Required | Notes | | Variable | Required | Notes |
|---|---|---| | ------------------------------------------ | ---------- | -------------------------------------------- |
| `APP_SECRET` | Yes | 32+ char random string | | `APP_SECRET` | Yes | 32+ char random string |
| `GITHUB_USER` / `GITHUB_TOKEN` | For GitHub | Token scope: `read:user` | | `GITHUB_USER` / `GITHUB_TOKEN` | For GitHub | Token scope: `read:user` |
| `GITLAB_USER` / `GITLAB_TOKEN` | For GitLab | Token scopes: `read_user`, `read_api` | | `GITLAB_USER` / `GITLAB_TOKEN` | For GitLab | Token scopes: `read_user`, `read_api` |