Skip to content

Commit 86a350c

Browse files
docs: add mandatory workflow rules for specs and implementations
Add critical section to CLAUDE.md documenting the correct process for creating new specifications and implementations. This prevents bypassing the automated GitHub Actions pipeline which causes: - Missing quality_score in metadata - Missing preview images in GCS - No impl:{library}:done labels on issues - Issues staying open when complete Includes DO/DON'T table and batch creation example. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1d98f20 commit 86a350c

1 file changed

Lines changed: 86 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,92 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
88
- **GitHub Actions workflows ARE allowed to commit/push** - When running as part of `spec-*.yml` or `impl-*.yml` workflows, creating branches, commits, and PRs is expected and required.
99
- **Always write in English** - All output text (code comments, commit messages, PR descriptions, issue comments, documentation) must be in English, even if the user writes in another language.
1010

11+
## CRITICAL: Mandatory Workflow for New Specs and Implementations
12+
13+
**NEVER bypass the automated workflow!** All specifications and implementations MUST go through the GitHub Actions pipeline.
14+
15+
### Creating New Specifications - CORRECT Process
16+
17+
```
18+
1. Create GitHub Issue with descriptive title (NO spec-id in title!)
19+
✅ "Annotated Scatter Plot with Text Labels"
20+
❌ "[scatter-annotated] Annotated Scatter Plot" ← WRONG: Don't include spec-id
21+
22+
2. Add `spec-request` label to the issue
23+
24+
3. WAIT for spec-create.yml to:
25+
- Analyze the request
26+
- Check for duplicates (will close if duplicate exists)
27+
- Assign a unique spec-id
28+
- Generate tags automatically
29+
- Create PR with specification.md and specification.yaml
30+
31+
4. Add `approved` label to the ISSUE (not the PR!)
32+
- This triggers the merge job in spec-create.yml
33+
34+
5. WAIT for automatic merge and `spec-ready` label
35+
```
36+
37+
### Generating Implementations - CORRECT Process
38+
39+
```
40+
1. After spec has `spec-ready` label, trigger bulk-generate:
41+
gh workflow run bulk-generate.yml -f specification_id=<spec-id> -f library=all
42+
43+
2. WAIT for the full pipeline to complete:
44+
impl-generate → impl-review → (impl-repair if needed) → impl-merge
45+
46+
3. DO NOT manually merge PRs!
47+
- impl-merge.yml handles merging, metadata creation, and GCS promotion
48+
- Manual merging breaks: quality_score, review data, GCS images
49+
```
50+
51+
### What You Must NEVER Do
52+
53+
| ❌ DON'T | ✅ DO INSTEAD |
54+
|----------|---------------|
55+
| Manually create `plots/{spec-id}/` directories | Let `spec-create.yml` create them |
56+
| Manually write `specification.md` files | Let `spec-create.yml` generate them |
57+
| Include `[spec-id]` in issue title | Use descriptive title only |
58+
| Add `approved` label to PRs | Add `approved` label to ISSUES |
59+
| Run `gh pr merge` on implementation PRs | Let `impl-merge.yml` handle it |
60+
| Manually create `metadata/*.yaml` files | Let `impl-merge.yml` create them |
61+
| Upload images to GCS manually | Let workflows handle GCS |
62+
63+
### Why This Matters
64+
65+
Manual intervention causes:
66+
- `quality_score: null` in metadata (no AI review)
67+
- Missing preview images in GCS production folder
68+
- No `impl:{library}:done` labels on issues
69+
- Broken database sync (missing review data)
70+
- Issues staying open when complete
71+
72+
### Batch Creation Example
73+
74+
```bash
75+
# Step 1: Create 5 issues (NO spec-id in title!)
76+
for title in "Radar Chart" "Treemap" "Sunburst Chart" "Sankey Diagram" "Chord Diagram"; do
77+
gh issue create --title "$title" --label "spec-request" --body "New plot type request"
78+
done
79+
80+
# Step 2: Wait for spec-create to process each issue
81+
# Check: gh issue list --label "spec-request" --state open
82+
83+
# Step 3: Add approved labels to ISSUES (after reviewing spec PRs)
84+
# gh api repos/OWNER/REPO/issues/NUMBER/labels -f labels[]=approved
85+
86+
# Step 4: Wait for specs to merge and get spec-ready label
87+
88+
# Step 5: Trigger bulk-generate for each spec
89+
# gh workflow run bulk-generate.yml -f specification_id=<spec-id> -f library=all
90+
91+
# Step 6: Monitor - DO NOT manually merge!
92+
# gh run list --workflow=impl-generate.yml
93+
# gh run list --workflow=impl-review.yml
94+
# gh run list --workflow=impl-merge.yml
95+
```
96+
1197
## Project Overview
1298

1399
**pyplots** is an AI-powered platform for Python data visualization that automatically discovers, generates, tests, and maintains plotting examples. The platform is specification-driven: every plot starts as a library-agnostic Markdown spec, then AI generates implementations for all supported libraries.

0 commit comments

Comments
 (0)