Skip to content

Commit 159586a

Browse files
TMHSDigitalclaude
andcommitted
docs: add Adding an Example to CONTRIBUTING and sync the PR checklist
CONTRIBUTING sent contributors to an examples section that did not exist, so the gates Validate and the gallery build enforce (examples/skills.json, the 640 card) were documented only in agent-facing files. The new section lists every step and links docs/new-example-prompt.md; the PR template's example line now names the skills.json entry and the card. The template layout and rule-length guidance now match what ships. Closes #522 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LpkeXRvikhJZSVGBFM91Dv Signed-off-by: TM Hospitality Strategies <TMHospitalityStrategies@gmail.com>
1 parent 26482a8 commit 159586a

2 files changed

Lines changed: 36 additions & 4 deletions

File tree

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Merge evidence is the PR-head 5.2 + 4.5 smoke jobs (state the versions from thos
2828
- [ ] Explicit paths only (`git add` never `-A` / `.`). Leave unstaged Cursor-injected `CLAUDE.md` hunks.
2929
- [ ] Counts in `README.md` match disk if content was added or removed (`validate-counts`).
3030
- [ ] Manifest arrays list every new skill / rule / snippet / template / example / showcase piece (`validate-manifest`). Do not touch the `"version"` line.
31-
- [ ] New example: `gallery.json`, `tests/smoke/catalog.json` row, README row, hero/preview webp, `python scripts/build_gallery.py`, framing / contact-sheet gates as in `CLAUDE.md`.
31+
- [ ] New example: `tests/smoke/catalog.json` row with a falsifier, `examples/skills.json` entry + `python scripts/build_examples_index.py`, README count. Rendered examples also: `gallery.json` entry with `alt`, hero + `-hero-640.webp` card + preview webp, `python scripts/build_gallery.py`, framing / contact-sheet gates ([CONTRIBUTING.md](../CONTRIBUTING.md#adding-an-example)).
3232
- [ ] Every new check was falsified once (break it, non-zero exit, restore) — or this PR has no new check.
3333
- [ ] DCO `Signed-off-by:` on every commit ([CONTRIBUTING.md](../CONTRIBUTING.md)).
3434
- [ ] No credentials, business emails, or local filesystem paths.

‎CONTRIBUTING.md‎

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ The fastest useful contributions are small and need no Blender run:
1717
Then: fork, branch, `uv sync`,
1818
`uv run python tests/run_all.py`, and open a PR with a DCO sign-off (`git commit -s`;
1919
see the end of this file). Examples and showcase pieces have more gates
20-
(falsifiers, exit-code tables, renders); read their sections first.
20+
(falsifiers, exit-code tables, renders); read
21+
[Adding an Example](#adding-an-example) or
22+
[Adding a Showcase Piece](#adding-a-showcase-piece) first.
2123

2224
## Getting Started
2325

@@ -64,10 +66,12 @@ rules/
6466
snippets/
6567
<snippet-name>.py
6668
templates/
67-
<template-name>/
69+
extension-addon-template/ # an add-on: manifest + package
6870
blender_manifest.toml
6971
__init__.py
7072
README.md
73+
headless-batch-script-template/ # a script: script.py + README.md
74+
ai-asset-pipeline-template/ # a script: pipeline.py + README.md
7175
examples/
7276
gallery.json
7377
<example-name>/
@@ -127,7 +131,7 @@ showcase/
127131
too narrow means the rule silently stops firing, which is worse than
128132
over-applying. Record the scope in the `CLAUDE.md` rules table to match.
129133

130-
3. Write 30 to 80 lines: the anti-pattern, a code example showing it wrong, a code example showing it right, and a short "Why it matters" section.
134+
3. Keep it focused (the shipped rules run about 70 to 170 lines): the anti-pattern, a code example showing it wrong, a code example showing it right, and a short "Why it matters" section.
131135

132136
## Adding a Snippet
133137

@@ -140,6 +144,34 @@ showcase/
140144
1. Add a directory under `templates/`, e.g. `templates/headless-batch-script-template/`.
141145
2. Include all files needed for an immediate copy-paste starting point. For add-on templates, include `blender_manifest.toml`, `__init__.py`, and a brief `README.md`.
142146

147+
## Adding an Example
148+
149+
An example is a runnable headless script that asserts one API contract and
150+
exits non-zero when it breaks. The full procedure, render standard and gates
151+
are in [`docs/new-example-prompt.md`](docs/new-example-prompt.md) and
152+
`CLAUDE.md` § Examples; copy the anatomy of `examples/bmesh-gear/`. Every
153+
example needs:
154+
155+
1. `examples/<kebab-name>/` with the script and a README that has an exit-code
156+
table (`0` pass, `1` uncaught exception, `2` argparse usage, checks from
157+
`3` up) and a falsifier: a flag that breaks the contract so one named check
158+
exits with its own code.
159+
2. A `tests/smoke/catalog.json` row with at least one falsifier
160+
(`{"args": ["--your-flag"], "expect_exit": N}`). `tests/check_smoke_catalog.py`
161+
rejects a row without one.
162+
3. An `examples/skills.json` entry naming the skills it proves, then
163+
`python scripts/build_examples_index.py` (Validate fails on a missing entry).
164+
4. **Rendered examples only** (when the contract is visible in pixels): an
165+
`examples/gallery.json` entry with an `alt` sentence, a 1280x720 hero
166+
webp in `docs/gallery/assets/`, its 640x360 card `<name>-hero-640.webp`
167+
(`python scripts/make_thumbs.py`; the gallery build exits 5 without it), a
168+
1200x675 preview webp, the framing gate on the `--output` path, a
169+
committed contact sheet, then `python scripts/build_gallery.py`.
170+
`python scripts/render_hero.py --blender PATH --only NAME` writes all three
171+
webps. A **check-only** example skips this step and stays out of
172+
`gallery.json`.
173+
5. Update the README example count (`validate-counts`).
174+
143175
## Adding a Showcase Piece
144176

145177
Read [`showcase/README.md`](showcase/README.md) first. Showcase asserts

0 commit comments

Comments
 (0)