Skip to content

Commit 502373c

Browse files
docs: refactor documentation and fix inconsistencies (#3178)
## Summary - Refactored documentation structure for clarity and accuracy - Fixed inconsistencies between docs and actual workflow implementations - Translated German text to English - Updated outdated references ## Key Changes ### Documentation Fixes - **docs/contributing.md**: Fixed GitHub link (`your-repo` → `MarkusNeusinger/pyplots`) - **docs/workflows/overview.md**: - Fixed quality score logic (`>= 90, or >= 50 after 3 attempts`) - Fixed metadata creation workflow (impl-generate creates, impl-review updates, impl-merge does NOT create) - **docs/database.md**: Corrected quality reports location (metadata files, not GitHub Issues) - **docs/plot-types-catalog.md**: Translated German descriptions to English ### Instruction Files - **CLAUDE.md**: Fixed quality reports references (metadata, not GitHub Issues) - **copilot-instructions.md**: Updated quality score label description - **prompts/README.md**: Fixed workflow names and file paths - `gen-library-impl.yml` → `impl-generate.yml` - `gen-update-plot.yml` → `impl-repair.yml` - `bot-ai-review.yml` → `impl-review.yml` - `spec.md` → `specification.md` ### New Files - **docs/development.md**: New human-focused development guide (separated from CLAUDE.md which is AI-only) ## Test plan - [x] All documentation references verified against actual code - [x] Workflow diagrams match actual workflow implementations - [x] No broken internal links 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2e3e7ac commit 502373c

File tree

114 files changed

+1075
-3909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1075
-3909
lines changed

.claude/commands/prime.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ git ls-files
1010

1111
@README.md
1212
@pyproject.toml
13-
@docs/vision.md
14-
@docs/workflow.md
15-
@docs/architecture/repository.md
13+
@docs/concepts/vision.md
14+
@docs/workflows/overview.md
15+
@docs/reference/repository.md
1616

1717
## Read and Execute
1818

.github/copilot-instructions.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This file provides guidance to GitHub Copilot when working with code in this rep
3838
**Supported Libraries** (9 total):
3939
- matplotlib, seaborn, plotly, bokeh, altair, plotnine, pygal, highcharts, lets-plot
4040

41-
**Core Principle**: Community proposes plot ideas via GitHub Issues → AI generates code → Multi-LLM quality checks → Deployed.
41+
**Core Principle**: Community proposes plot ideas via GitHub Issues → AI generates code → AI quality review → Deployed.
4242

4343
## Development Setup
4444

@@ -135,8 +135,8 @@ Examples: `scatter-basic`, `scatter-color-mapped`, `bar-grouped-horizontal`, `he
135135
### PR Labels (set by workflows)
136136

137137
- **`approved`** - Human approved specification for merge
138-
- **`ai-approved`** - AI quality check passed (score >= 90)
139-
- **`ai-rejected`** - AI quality check failed (score < 90)
138+
- **`ai-approved`** - AI quality check passed (score >= 90, or >= 50 after 3 attempts)
139+
- **`ai-rejected`** - AI quality check failed (score < 90), triggers repair loop
140140
- **`quality:XX`** - Quality score (e.g., `quality:92`)
141141

142142
**Specification Lifecycle:**
@@ -146,8 +146,8 @@ Examples: `scatter-basic`, `scatter-color-mapped`, `bar-grouped-horizontal`, `he
146146

147147
**Implementation PR Lifecycle:**
148148
```
149-
[open] → impl-review → ai-approved → impl-merge → impl:{library}:done
150-
→ ai-rejected → impl-repair (×3)
149+
[open] → impl-review → ai-approved (≥90) → impl-merge → impl:{library}:done
150+
→ ai-rejected (<90) → impl-repair (×3) → ai-approved (≥50) or failed (<50)
151151
```
152152

153153
## Code Standards
@@ -205,8 +205,7 @@ plt.savefig('plot.png', dpi=300, bbox_inches='tight')
205205

206206
### Anti-Patterns to Avoid
207207

208-
- No `preview.png` files in repository (use GCS)
209-
- No `quality_report.json` files (use GitHub Issues)
208+
- No `preview.png` files in repository (stored in GCS)
210209
- No hardcoded API keys (use environment variables)
211210

212211
## Tech Stack

.github/workflows/spec-create.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
6. **Create specification files:**
118118
- Read template: `prompts/templates/specification.md`
119119
- Read metadata template: `prompts/templates/specification.yaml`
120-
- Read tagging guide: `docs/concepts/tagging-system.md`
120+
- Read tagging guide: `docs/reference/tagging-system.md`
121121
- Create directory: `plots/{specification-id}/`
122122
- Create: `plots/{specification-id}/specification.md` (follow template structure)
123123
- Create: `plots/{specification-id}/specification.yaml` with:
@@ -213,7 +213,7 @@ jobs:
213213
6. **Create specification files:**
214214
- Read template: `prompts/templates/specification.md`
215215
- Read metadata template: `prompts/templates/specification.yaml`
216-
- Read tagging guide: `docs/concepts/tagging-system.md`
216+
- Read tagging guide: `docs/reference/tagging-system.md`
217217
- Create directory: `plots/{specification-id}/`
218218
- Create: `plots/{specification-id}/specification.md` (follow template structure)
219219
- Create: `plots/{specification-id}/specification.yaml` with:

CLAUDE.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ done
109109
- **highcharts** - Interactive web charts, stock charts (requires license for commercial use)
110110
- **lets-plot** - ggplot2 grammar of graphics by JetBrains, interactive
111111

112-
**Core Principle**: Community proposes plot ideas via GitHub Issues → AI generates code → Multi-LLM quality checks → Deployed.
112+
**Core Principle**: Community proposes plot ideas via GitHub Issues → AI generates code → AI quality review → Deployed.
113113

114114
## Essential Commands
115115

@@ -261,7 +261,7 @@ Example: `plots/scatter-basic/` contains everything for the basic scatter plot.
261261

262262
1. **Repository Pattern**: Data access layer in `core/repositories/`
263263
2. **Async Everything**: FastAPI + SQLAlchemy async + asyncpg
264-
3. **Clean Repo**: Only production code in git. Quality reports → GitHub Issues. Preview images → GCS.
264+
3. **Clean Repo**: Only production code in git. Quality reports → `metadata/{library}.yaml`. Preview images → GCS.
265265
4. **Issue-Based Workflow**: GitHub Issues as state machine for plot lifecycle
266266

267267
### Metadata System
@@ -399,8 +399,8 @@ gs://pyplots-images/
399399
- **Plotting**: matplotlib, seaborn, plotly, bokeh, altair, plotnine, pygal, highcharts, lets-plot
400400
- **Package Manager**: uv (fast Python installer)
401401
- **Infrastructure**: Google Cloud Run, Cloud SQL, Cloud Storage
402-
- **Automation**: GitHub Actions (code workflows) + n8n Cloud (external services)
403-
- **AI**: Claude (code generation), Vertex AI (multi-LLM quality checks)
402+
- **Automation**: GitHub Actions
403+
- **AI**: Claude (code generation + quality review)
404404

405405
## Code Standards
406406

@@ -475,7 +475,6 @@ uv run python -c "from core.database import is_db_configured; print(is_db_config
475475
- Implementation code (full Python source)
476476
- Implementation metadata (library, variant, quality score, generation info from metadata/*.yaml)
477477
- GCS URLs for preview images
478-
- Social media promotion queue
479478

480479
**What's in Repository** (source of truth):
481480
- Everything in `plots/{specification-id}/`:
@@ -486,7 +485,6 @@ uv run python -c "from core.database import is_db_configured; print(is_db_config
486485

487486
**What's NOT Stored in DB**:
488487
- Preview images (in GCS)
489-
- Detailed quality reports (in GitHub Issues, summary in metadata)
490488

491489
**Migrations**: Managed with Alembic
492490
```bash
@@ -511,8 +509,7 @@ The `prompts/` directory contains AI agent prompts for code generation, quality
511509
| `plot-generator.md` | Base rules for all plot implementations |
512510
| `library/*.md` | Library-specific rules (9 files) |
513511
| `quality-criteria.md` | Definition of code/visual quality |
514-
| `quality-evaluator.md` | Multi-LLM evaluation prompt |
515-
| `auto-tagger.md` | Automatic tagging across 5 dimensions |
512+
| `quality-evaluator.md` | AI quality evaluation prompt |
516513
| `spec-validator.md` | Validates plot request issues |
517514
| `spec-id-generator.md` | Assigns unique spec IDs |
518515

@@ -918,12 +915,12 @@ pytest --pdb # Debug on failure
918915

919916
## Key Documentation Files
920917

921-
- **docs/development.md**: Development setup, testing, deployment
922-
- **docs/workflow.md**: Automation flows (Discovery → Deployment → Social)
923-
- **docs/specs-guide.md**: How to write plot specifications
924-
- **docs/architecture/repository.md**: Directory structure
925-
- **docs/architecture/api.md**: API endpoints reference
926-
- **docs/architecture/database.md**: Database schema
918+
- **docs/contributing.md**: How to add/improve specs and implementations
919+
- **docs/workflows/overview.md**: Automation flows and label system
920+
- **docs/concepts/vision.md**: Product vision
921+
- **docs/reference/repository.md**: Directory structure
922+
- **docs/reference/api.md**: API endpoints reference
923+
- **docs/reference/database.md**: Database schema
927924
- **prompts/README.md**: AI agent prompt system
928925

929926
## Project Philosophy
@@ -932,5 +929,5 @@ pytest --pdb # Debug on failure
932929
- **Spec improvements over code fixes**: If a plot has issues, improve the spec, not the code
933930
- **Your data first**: Examples work with real user data, not fake data
934931
- **Community-driven**: Anyone can propose plots via GitHub Issues
935-
- **Multi-LLM quality**: Claude + Gemini + GPT ensure quality (score ≥90 required)
936-
- **Full transparency**: All feedback documented in GitHub Issues, not hidden in repo files
932+
- **AI quality review**: Claude evaluates quality (≥90 instant merge, <90 repair loop, ≥50 minimum)
933+
- **Full transparency**: All quality feedback stored in repository (`metadata/{library}.yaml`)

README.md

Lines changed: 22 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
maintains plotting examples. Browse hundreds of plots across all major Python libraries - matplotlib, seaborn, plotly,
1919
bokeh, altair, plotnine, pygal, highcharts, and lets-plot.
2020

21-
**Community-driven, AI-maintained** - Propose plot ideas via GitHub Issues, AI generates the code, multi-LLM quality
21+
**Community-driven, AI-maintained** - Propose plot ideas via GitHub Issues, AI generates the code, automated quality
2222
checks ensure excellence. Zero manual coding required.
2323

2424
---
@@ -29,37 +29,11 @@ checks ensure excellence. Zero manual coding required.
2929
- **Compare libraries** - View matplotlib, seaborn, plotly side-by-side for the same plot
3030
- **Always current** - AI agents continuously update examples with latest library versions
3131
- **Natural language search** - Find plots by asking "show correlation between variables"
32-
- **Multi-LLM quality checks** - Claude + Gemini + GPT ensure every plot meets quality standards
32+
- **AI quality review** - Claude evaluates every plot against quality standards (score ≥ 50 required)
3333
- **Open source** - Community proposes ideas via Issues, AI generates the code
3434

3535
---
3636

37-
## Quick Start
38-
39-
```bash
40-
# Clone repository
41-
git clone https://github.com/MarkusNeusinger/pyplots.git
42-
cd pyplots
43-
44-
# Install dependencies with uv (fast!)
45-
curl -LsSf https://astral.sh/uv/install.sh | sh
46-
uv sync --all-extras
47-
48-
# Database setup (optional - API works without DB in limited mode)
49-
cp .env.example .env
50-
# Edit .env with your DATABASE_URL
51-
52-
# Run migrations
53-
uv run alembic upgrade head
54-
55-
# Start backend
56-
uv run uvicorn api.main:app --reload
57-
58-
# Visit http://localhost:8000/docs
59-
```
60-
61-
---
62-
6337
## Architecture
6438

6539
**Specification-first design**: Every plot starts as a Markdown spec (library-agnostic), then AI generates
@@ -81,9 +55,9 @@ plots/scatter-basic/
8155

8256
**Issue-based workflow**: GitHub Issues as state machine for plot lifecycle. Status tracked via live-updating table (no sub-issues). Each library generates in parallel, creating PRs to a feature branch.
8357

84-
**AI quality review**: Claude evaluates generated plots (score ≥ 90 required). Automatic feedback loops (max 3 attempts per library). Quality scores flow via PR labels → per-library metadata files.
58+
**AI quality review**: Claude evaluates generated plots. Score ≥ 90 → immediate merge. Score < 90 → repair loop (max 3 attempts). After 3 attempts: ≥ 50 → merge, < 50 → failed.
8559

86-
See [docs/architecture/](docs/architecture/) for details.
60+
See [docs/reference/](docs/reference/) for details.
8761

8862
---
8963

@@ -97,9 +71,9 @@ See [docs/architecture/](docs/architecture/) for details.
9771

9872
**Infrastructure**: Google Cloud Run • Cloud SQL • Cloud Storage
9973

100-
**Automation**: GitHub Actions • n8n Cloud Pro
74+
**Automation**: GitHub Actions
10175

102-
**AI**: Claude (Code Max) • Vertex AI (Multi-LLM)
76+
**AI**: Claude (code generation + quality review)
10377

10478
---
10579

@@ -115,31 +89,28 @@ Most plotting libraries are fully open source. Note these exceptions:
11589

11690
```
11791
pyplots/
118-
├── plots/ # Plot-centric directories (spec + metadata + implementations)
119-
│ └── {spec-id}/
120-
│ ├── specification.md
121-
│ ├── specification.yaml
122-
│ ├── metadata/
123-
│ └── implementations/
92+
├── plots/ # Plot specs + metadata + implementations
12493
├── prompts/ # AI agent prompts
125-
├── core/ # Shared business logic
12694
├── api/ # FastAPI backend
127-
├── app/ # React frontend (Vite + MUI)
128-
├── tests/ # Test suite (pytest)
129-
└── docs/ # Documentation
95+
├── app/ # React frontend
96+
├── core/ # Shared business logic
97+
├── automation/ # Workflow scripts (sync, labels)
98+
├── tests/ # Test suite (unit, integration, e2e)
99+
├── alembic/ # Database migrations
100+
├── docs/ # Documentation
101+
└── .github/workflows/ # GitHub Actions
130102
```
131103

132-
**For detailed structure and file organization**, see [Repository Structure](docs/architecture/repository.md)
104+
**For details**, see [Repository Structure](docs/reference/repository.md)
133105

134106
---
135107

136108
## Documentation
137109

138-
- **[Vision](docs/vision.md)** - Product vision and mission
139-
- **[Workflow](docs/workflow.md)** - Automation flows (Discovery → Deployment → Social Media)
140-
- **[Development](docs/development.md)** - Local setup, testing, deployment
141-
- **[Specs Guide](docs/specs-guide.md)** - How to write plot specifications
142-
- **[Architecture](docs/architecture/)** - API, database, repository structure
110+
- **[Vision](docs/concepts/vision.md)** - Product vision and mission
111+
- **[Contributing](docs/contributing.md)** - How to add/improve specs and implementations
112+
- **[Workflows](docs/workflows/overview.md)** - Automation flows and label system
113+
- **[Reference](docs/reference/)** - API, database, repository structure
143114

144115
---
145116

@@ -160,32 +131,19 @@ We welcome contributions! **All code is AI-generated** - you propose ideas, AI i
160131
2. AI generates spec, creates feature branch
161132
3. Maintainer reviews and adds `approved` label
162133
4. 9 library implementations generate in parallel (tracked via live status table)
163-
5. AI quality review per library (score ≥ 90 required)
134+
5. AI quality review per library (≥ 90 instant, < 90 repair loop, ≥ 50 final threshold)
164135
6. Auto-merge to feature branch, then to main
165136

166137
**Important**: Don't submit code directly! If a plot has quality issues, it means the spec needs improvement, not the
167138
code.
168139

169-
See [development.md](docs/development.md) for details.
140+
See [contributing.md](docs/contributing.md) for details.
170141

171142
---
172143

173144
## Development
174145

175-
```bash
176-
# Install dependencies (uv is a fast Python package installer)
177-
uv sync --all-extras
178-
179-
# Run tests
180-
uv run pytest
181-
182-
# Start backend
183-
uv run uvicorn api.main:app --reload
184-
```
185-
186-
**For detailed development setup, testing, and code quality tools**, see [Development Guide](docs/development.md)
187-
188-
**Python versions**: 3.10+ | **Coverage target**: 90%+
146+
See **[Development Guide](docs/development.md)** for local setup instructions.
189147

190148
---
191149

0 commit comments

Comments
 (0)