Skip to content

Commit df004b9

Browse files
TMHSDigitalclaude
andauthored
docs: codify operational lessons from recent runs into agent guidance (#71)
Fifteen shipped PRs accumulated hard-won operational rules in prompt text and PR bodies where new agents never see them. Move the durable ones into AGENTS.md (governance: squash-merge standard, smoke-jobs-don't-rerun-on- merge-SHA evidence rule, post-merge job set, Socket pending policy, DCO) and CLAUDE.md (runtime: .scratch/ binary discovery, 4.4-is-not-4.5, explicit-path staging vs the Cursor CLAUDE.md injection, contact-sheet and falsification gates, generated-HTML review precedent), state the division of labor at the top of each, and update docs/new-example-prompt.md so the canonical prompt agrees with the guidance files. Signed-off-by: fOuttaMyPaint <TMhospitalitystrategies@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 9cd1c43 commit df004b9

3 files changed

Lines changed: 104 additions & 42 deletions

File tree

AGENTS.md

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,28 @@
44

55
Guidance for AI coding agents working on the Blender Developer Tools repository.
66

7+
**Division of labor:** this file carries fleet-standard governance and workflow
8+
rules — branching, commits, merge and CI-evidence policy, release automation,
9+
authoring standards. `CLAUDE.md` carries repo-specific operational facts an
10+
agent needs at runtime — content inventory, Blender runtime discovery, git
11+
staging hazards, and the example-shipping quality gates. Read both; neither
12+
repeats the other.
13+
714
## Repository overview
815

916
Skills, rules, snippets, starter templates, and runnable smoke-gated examples
10-
for Blender Python development.
11-
The repo targets **Blender 5.1** (current stable) with a **Blender 4.5 LTS**
12-
fallback. There is no MCP server. It ships a `.cursor-plugin/plugin.json`
13-
manifest so the ecosystem drift checker classifies it as a `cursor-plugin`.
14-
This is content the AI loads when the user asks Blender questions or works on
15-
Blender add-ons in Cursor or Claude Code.
16-
17-
The content base (counts are CI-enforced against README.md and the manifest):
18-
19-
- 12 skills covering scaffolding, operators, panels, properties, mesh and
20-
bmesh, headless batch scripts, slotted-actions animation (5.x), programmatic
21-
geometry nodes, procedural materials and shaders, depsgraph and evaluated
22-
data, drivers and application handlers, and `bl_info` to Extensions
23-
Platform migration.
24-
- 6 rules encoding the most common AI anti-patterns when writing Blender
25-
Python (ops-in-loops, bmesh leaks, legacy `bl_info`-only, prop assignment,
26-
deprecated context-copy override, per-element loops over bulk mesh data).
27-
- 2 templates: `extension-addon-template` for Extensions Platform add-ons,
28-
and `headless-batch-script-template` for unattended batch jobs.
29-
- 17 snippets covering canonical patterns.
30-
- 22 examples under `examples/<name>/`: runnable scripts that assert a real
31-
API contract with deterministic checks, exit non-zero on failure, and
32-
optionally render a still via `--output`. Each is executed headless on
33-
Blender 4.5 LTS and 5.1 by `blender-smoke.yml`; its render ships in the
34-
site gallery. Anatomy and authoring rules: copy `examples/bmesh-gear/`;
35-
the render look is specified in `docs/VISUAL-STYLE.md`.
17+
for Blender Python development. The repo targets **Blender 5.1** (current
18+
stable) with a **Blender 4.5 LTS** fallback. There is no MCP server. It ships
19+
a `.cursor-plugin/plugin.json` manifest so the ecosystem drift checker
20+
classifies it as a `cursor-plugin`. This is content the AI loads when the user
21+
asks Blender questions or works on Blender add-ons in Cursor or Claude Code.
22+
23+
The content base is 12 skills, 6 rules, 2 templates, 17 snippets, and 22
24+
examples (counts are CI-enforced against README.md and the manifest). The full
25+
inventory tables and per-item purposes live in `CLAUDE.md`. Example anatomy
26+
and authoring rules: copy `examples/bmesh-gear/`; the render look is specified
27+
in `docs/VISUAL-STYLE.md`; the canonical run prompt is
28+
`docs/new-example-prompt.md`.
3629

3730
## Repository structure
3831

@@ -46,7 +39,8 @@ Blender-Developer-Tools/
4639
scripts/build_gallery.py # generates docs/gallery/ (stdlib only)
4740
scripts/site/ # vendored landing-page build (build_site.py + template)
4841
docs/gallery/ # committed generated gallery pages + hero assets
49-
.github/workflows/ # validate, blender-smoke, drift-check, release, pages, label-sync
42+
docs/new-example-prompt.md # canonical example-creation prompt
43+
.github/workflows/ # validate, blender-smoke, drift-check, release, pages, label-sync, stale
5044
.github/dependabot.yml
5145
AGENTS.md, CLAUDE.md, README.md, ROADMAP.md, CHANGELOG.md
5246
CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md
@@ -56,7 +50,8 @@ Blender-Developer-Tools/
5650

5751
## Branching and commit model
5852

59-
- Single `main` branch. No develop or release branches.
53+
- Single `main` branch. No develop or release branches. Work on a focused
54+
feature branch off an up-to-date `main`. Never force-push or bypass hooks.
6055
- Conventional commits drive the auto-release workflow. It scans the commit subjects since
6156
the last tag and releases only when at least one is release-worthy:
6257
- `feat:` triggers a minor bump
@@ -67,7 +62,37 @@ Blender-Developer-Tools/
6762
bump. A mixed push still releases if any commit in range is a `feat:`/`fix:`.
6863
- `[skip ci]` in the head commit still bypasses the workflow entirely. With the commit-type
6964
gate above it is now an optional override, not a requirement for non-release commits.
70-
- Commit messages should describe the why, not the what.
65+
- Commit messages should describe the why, not the what, and carry a DCO
66+
`Signed-off-by:` trailer matching the commit author (see CONTRIBUTING.md).
67+
- Stage with explicit paths only — never `git add -A` or `git add .`. The
68+
reason is a repo-specific hazard documented in `CLAUDE.md` § Git staging.
69+
70+
## Merge policy and CI evidence
71+
72+
- **Squash-merge with branch deletion is the standard.** The PR becomes one
73+
commit on `main`; delete the remote feature branch after merge, then
74+
fast-forward local `main`.
75+
- **Smoke jobs do not re-run on the merge SHA.** `blender-smoke.yml` triggers
76+
on `pull_request` (plus a weekly schedule and manual dispatch) — there is no
77+
`push` trigger. The correct post-merge evidence for example changes is:
78+
both Blender smoke jobs (4.5 LTS and 5.1) passed on the PR head SHA that
79+
became the sole squash-merged commit, with the actual binary versions
80+
confirmed in the job logs.
81+
- **Post-merge, verify green on `main`:** Release (`release.yml`), Validate
82+
(`validate.yml`), Ecosystem drift check (`drift-check.yml`), and Deploy
83+
GitHub Pages (`pages.yml`; paths-filtered, so it does not trigger for every
84+
change).
85+
- **Socket Security checks** ("Socket Security: Project Report" and "Socket
86+
Security: Pull Request Alerts") run on PRs via the Socket GitHub App. No
87+
override policy has been decided: a pending or failing Socket check is
88+
unresolved — wait before merging.
89+
- **Release-owned fields are never hand-edited:** `VERSION`, `CHANGELOG.md`,
90+
the CLAUDE.md `**Version:**` line, the ROADMAP.md `**Current:**` line, and
91+
the manifest `"version"` in `.cursor-plugin/plugin.json`. Generated gallery
92+
pages under `docs/gallery/` are regenerated via `scripts/build_gallery.py`,
93+
never hand-edited.
94+
- **Evidence over assertion:** PR bodies must label what was proven by live
95+
run versus established by inspection only.
7196

7297
## Blender version targeting
7398

@@ -80,7 +105,8 @@ Blender-Developer-Tools/
80105

81106
When a 4.x and 5.x API genuinely diverge, skills must show both code paths,
82107
not just the 5.x one. The `slotted-actions-animation` skill is the load-bearing
83-
example.
108+
example. Local binary discovery and version-reporting rules are in
109+
`CLAUDE.md` § Blender runtime discovery.
84110

85111
## Skills
86112

CLAUDE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
66

7+
**Division of labor:** this file carries repo-specific operational facts an agent needs at runtime — content inventory, Blender runtime discovery, git staging hazards, and the example-shipping quality gates. `AGENTS.md` carries fleet-standard governance and workflow rules — branching, commits, merge and CI-evidence policy, release automation, authoring standards. Read both; neither repeats the other.
8+
79
## Project Overview
810

911
The **Blender Developer Tools** repository is at **v0.19.1**. It packages skills, rules, snippets, starter templates, and runnable smoke-gated examples for Blender Python development with Cursor and Claude Code. Coverage targets **Blender 5.1** (current stable) with **Blender 4.5 LTS** fallback. There is no MCP server; content is consumed directly by the AI when working in Blender add-on or scripting projects.
@@ -93,6 +95,30 @@ a `blender-smoke.yml` step, a README gallery row, hero webp (1280×720) in
9395
`docs/gallery/assets/` + preview webp (1200×675), then run `python scripts/build_gallery.py`.
9496
Renders must conform to the gallery look spec at `docs/VISUAL-STYLE.md`.
9597

98+
## Blender Runtime Discovery
99+
100+
- Local Blender binaries: check `.scratch/` at the repo root **first** — some machines have no system Blender install, and a prior agent run downloads official releases there (e.g. `.scratch/5.1/blender-5.1.x-.../blender[.exe]`). Then check system installs. Do not probe blindly; locate the binary, run it, and state the **exact binary path and the version the binary itself reports** in every report.
101+
- **5.1 is the local check version. 4.5 LTS is exercised by CI when unavailable locally.** 4.4 is not a substitute for 4.5 and must never be reported as 4.5.
102+
- If `.scratch/` lacks a needed version, download an official release from download.blender.org into it. `.scratch` is gitignored.
103+
- In scripts, version-branch on the `bpy.app.version` tuple, never on `bpy.app.version_string` — it reads e.g. `"4.5.11 LTS"`, not bare semver.
104+
105+
## Git Staging
106+
107+
Stage with **explicit paths only** — never `git add -A` or `git add .`. Cursor agent sessions inject a local guidance block into the working-copy `CLAUDE.md`; a bulk add sweeps it into the commit. It manifests as a `CLAUDE.md` hunk in `git diff` that you did not author (the file can be dirty before you touch anything). Leave it unstaged, and never stage `CLAUDE.md` unless you deliberately edited it.
108+
109+
## Quality Gates for Example Runs
110+
111+
- `docs/VISUAL-STYLE.md` is the **binding** render standard; deviations are defects.
112+
- **Contact-sheet gate:** composite the candidate hero beside the pinned calibration set — currently `armature-bend`, `damped-track-aim`, `bmesh-gear` — commit the composite under `docs/gallery/contact-sheets/`, link it in the PR body, and report per-criterion verdicts (stage darkness, wedge warmth, subject fill, saturation, thumbnail legibility) including mean luminance versus the calibration images. A claim without the committed composite is not acceptable evidence. The pinned set is updated (here and in `docs/new-example-prompt.md`) when a new example outclasses a member; the longer "calibration references" list in `docs/VISUAL-STYLE.md` is a style reference, not this contact-sheet set.
113+
- **Falsification:** every check must be proven to fail once — break the contract, observe the non-zero exit, restore — with the probe and the measured error reported in the PR body. An assertion that cannot fail witnesses nothing.
114+
- **After gallery regeneration** (`python scripts/build_gallery.py`), read the **generated HTML** character by character — the `<img alt>` text and witnesses callouts in `docs/gallery/index.html` and `docs/gallery/<name>/index.html` — not just `examples/gallery.json`. Precedent: the `teaches.split(".")[0]` bug truncated 14/21 card alts at dotted API paths like `bmesh.ops` while the source JSON looked fine (fixed in PR #68).
115+
116+
## Example-Run Process
117+
118+
- The canonical example-creation prompt lives at `docs/new-example-prompt.md`; keep it in agreement with this file and `AGENTS.md`.
119+
- The `ROADMAP.md` "Candidate pool" section is the subject source for example runs: remove a subject when it ships, and restock with subjects identified but not built.
120+
- PR bodies label what was proven by live run versus established by inspection only (see `AGENTS.md` § Merge policy and CI evidence for the merge and post-merge verification rules).
121+
96122
## Development Workflow
97123

98124
This is a content repository, no build step for skills/rules/snippets/templates — edit

docs/new-example-prompt.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ candidate pool in sync: remove the shipped subject, and add any promising subjec
7474
you identified but did not build. Do not hand-edit release-owned version fields or
7575
generated pages; use the repository's generator.
7676

77-
Run the new example's check-only path on both supported Blender versions, render and
78-
visually inspect its final image, regenerate the gallery, and run all relevant repository
77+
Run the new example's check-only path on both supported Blender versions. Locate local
78+
Blender binaries by checking `.scratch/` at the repo root first — prior runs download
79+
official releases there and some machines have no system install; download an official
80+
release into it if a needed version is missing (it is gitignored) — then system installs.
81+
Do not probe blindly; state the exact binary path and the version the binary itself
82+
reports for every run. Render and visually inspect the final image, regenerate the
83+
gallery, and run all relevant repository
7984
validation. If Blender 4.5 is unavailable locally, say so precisely and use the repository's
8085
4.5 CI job—do not substitute another version and report it as 4.5. If the render path
8186
requires an engine or device unavailable locally (Cycles on a GPU-less host), say so and
@@ -96,10 +101,12 @@ Contact-sheet gate (required before shipping the still): place the new hero besi
96101
the pinned calibration set — currently `armature-bend`, `damped-track-aim`,
97102
`bmesh-gear` — and compare stage darkness, wedge warmth, subject fill, saturation,
98103
and thumbnail legibility side by side. Do not ship until the new image holds up in
99-
that lineup—not merely "looks fine alone." Update this named set in this prompt
100-
whenever a new example outclasses one of them. One successful render command is not
101-
proof that the image is good, and neither is the second. Report that the
102-
contact-sheet comparison was done against those three references.
104+
that lineup—not merely "looks fine alone." Update this named set (here and in
105+
`CLAUDE.md`) whenever a new example outclasses one of them. One successful render
106+
command is not proof that the image is good, and neither is the second. Commit the
107+
composite under `docs/gallery/contact-sheets/`, link it in the PR body, and report
108+
per-criterion verdicts including mean luminance versus the calibration images — a
109+
claim without the committed composite is not acceptable evidence.
103110

104111
After implementation and local verification:
105112

@@ -111,16 +118,19 @@ After implementation and local verification:
111118
it once), visual notes, and an exact test plan. Label explicitly what was proven by
112119
live run versus established by inspection only.
113120
4. Watch every attached PR check, including validation, manifest/count checks, ecosystem
114-
drift, security checks, and Blender 4.5/5.1 smoke jobs. Investigate and fix failures
115-
within this change's scope, push fixes, and repeat until all checks pass.
121+
drift, Socket Security checks, and Blender 4.5/5.1 smoke jobs. Investigate and fix
122+
failures within this change's scope, push fixes, and repeat until all checks pass. A
123+
pending or failing Socket check is unresolved — wait before merging.
116124
5. Review PR comments and requested changes. Apply valid feedback and re-run affected
117125
checks. Do not merge with unresolved failures or requested changes.
118-
6. Once the PR is mergeable and green, merge it using the repository's normal merge
119-
strategy and delete the remote feature branch.
126+
6. Once the PR is mergeable and green, squash-merge it and delete the remote feature
127+
branch.
120128
7. Wait for any automated release/version-sync commit triggered by the merge, then
121129
fast-forward local `main` to `origin/main`, and verify main HEAD is green including
122-
all post-merge jobs (release, validate, drift, pages deploy). Do not hand-edit
123-
release-owned version fields.
130+
all post-merge jobs (Release, Validate, Ecosystem drift check, Deploy GitHub Pages).
131+
The smoke jobs are pull_request-triggered and do not re-run on the merge SHA: the
132+
post-merge evidence is that both smoke jobs passed on the PR head SHA that became
133+
the sole squash-merged commit. Do not hand-edit release-owned version fields.
124134
8. Confirm the final working tree is clean and report the PR URL, merge commit, resulting
125135
version (if released), measured check values, and checks completed.
126136

0 commit comments

Comments
 (0)