Skip to content

Commit 7bcfe53

Browse files
jmjavacursoragent
andcommitted
chore: track Cursor agent rules in git
- .gitignore: ignore .cursor/* except .cursor/rules/*.mdc (no API keys in rules) - Add docgen-tools-only and no-asset-edits (scene-spec / declarative Manim) Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a947643 commit 7bcfe53

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: All doc/demo asset generation goes through docgen CLI and approved wrappers—never Cursor-authored outputs.
3+
alwaysApply: true
4+
---
5+
6+
# Documentation and demo generation: tools only
7+
8+
**Rule:** Anything that **generates** documentation assets, dogfood config, narration, scenes, audio, composed video, catalogs, or other pipeline outputs must be produced by **docgen** (CLI and library) plus **repo-documented scripts** that invoke it (e.g. `docs/demos/_regenerate-docgen-config.sh`, `_full-reset-regenerate.sh`). **Do not** use the editor to paste or rewrite generated files to “fix” the pipeline.
9+
10+
**Allowed for Cursor / humans**
11+
12+
- Edit **inputs** Git is meant to carry: **`docgen.yaml`** (review YAML diff after **`docgen yaml-generate`**), per-function manifests, hints, tests, fixtures, static `docs/*.md` that are not tool outputs.
13+
- Edit **docgen implementation** under `src/` (or equivalent package root): new flags, commands, merge logic, validators—so the **tool** can do what you need.
14+
- Run commands: `docgen …`, bundle shell scripts, tests.
15+
16+
**Dogfood (`docs/demos`):** **`docgen.yaml`** is the only bundle config—same as downstream. Run **`docgen yaml-generate`** (this repo: **`docs/demos/_regenerate-docgen-config.sh`**) to merge tool defaults and sync **`manim_scene_generation.segments`** from **`visual_map`**; do not keep a second “source” YAML. Manim diagram segments: use **`docgen scene-spec-generate`** / **`scene-compile`** and committed **`animations/specs/*.scene.yaml`**, not hand-edited **`scenes.py`** for those blocks.
17+
18+
**If the right command does not exist:** implement it in **docgen** (or a thin wrapper script committed to the repo), then use it—do not bypass with manual file edits.

‎.cursor/rules/no-asset-edits.mdc‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
description: Documentation assets are produced by docgen + OpenAI; Cursor never edits them by hand. No hardcoded segment numbers, scene classes, tape names, or fixture paths in `src/docgen/` or non-test docs.
3+
alwaysApply: true
4+
---
5+
6+
# Tool-only asset generation; no hardcoded segment / fixture references
7+
8+
## Three categories
9+
10+
A. **Cursor edits OK** (code, tests, wrappers, rules, top-level docs):
11+
- `src/docgen/**`
12+
- `tests/**`
13+
- `docs/demos/_*.sh`
14+
- `.cursor/rules/**`
15+
- `AGENTS.md`, root `README.md`, `docs/demo-function.md`, `docs/yaml-generate.md`, `docs/session-notes*.md`
16+
- `milestones/**`
17+
18+
B. **Hand-authored INPUTS / fixtures** (Cursor edits OK; **never** deleted by `clean-bundle` / reset; **not** LLM outputs):
19+
- `docs/demos/terminal/*.tape` — VHS sources
20+
- `docs/demos/scripts/*.py` — Playwright capture drivers (matched to segments by id-in-filename)
21+
- `fixtures/**` — Playwright/Vite/etc. test apps; presence and project-type detected generically. The raw `*.spec.{ts,tsx,js,jsx,mjs}` files inside are the **input** to `docgen per-function-generate`.
22+
- `docs/demos/narration/README.md`
23+
24+
C. **LLM/tool OUTPUTS — Cursor MUST NOT edit; only `docgen` (CLI/library) + OpenAI may produce:**
25+
- `docs/demos/docgen.yaml` (owner: `docgen yaml-generate`)
26+
- `docs/demos/narration/*.md` excluding `README.md` (owner: `docgen narration-generate`)
27+
- `docs/demos/animations/scenes.py`, `docs/demos/animations/timing.json` (owner: `docgen scene-generate`, **`docgen scene-compile`**, **`docgen scene-spec-generate`**, pipeline)
28+
- `docs/demos/animations/specs/*.scene.yaml` — declarative Manim scene specs (owner: **`docgen scene-spec-generate`** with optional hand curation; compiled into `scenes.py` via **`docgen scene-compile`**)
29+
- `docs/demos/audio/*.mp3` (owner: `docgen tts`)
30+
- `docs/demos/per-function/*.docgen.yaml` and sibling `*.html` (owner: `docgen per-function-generate` — generated from raw Playwright specs in `fixtures/**`; wiped + regenerated each reset)
31+
- `docs/demos/recordings/**` including `recordings/per-function/<slug>/*` and top-level aliases (owner: `docgen generate-all` and `docgen demo-function` driven by `_rebuild-per-function.sh`)
32+
33+
If a generator can't produce shippable output yet, **fix the generator** under `src/docgen/**`. Never paste/edit a category-C file to bridge the gap.
34+
35+
## No hardcoded segments or fixtures
36+
37+
`docgen` itself contains **no** hardcoded segment numbers, scene class names, tape filenames, or fixture paths. Discovery only:
38+
39+
- Segments → from `narration/<NN>-*.md` filenames.
40+
- VHS → from `terminal/<segment_stem>.tape` presence.
41+
- Playwright capture → from `scripts/*.py` whose filename contains the segment id.
42+
- Manim → from `class …Scene` definitions in `animations/scenes.py`, in source order.
43+
- Playwright projects (for `discover_tests.roots`) → from any directory with `@playwright/test` / `playwright` in `package.json` or a `playwright.config.{js,ts,mjs,cjs}`.
44+
45+
Tests are exempt: concrete ids and class names there are intentional test data.

‎.gitignore‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ build/
1515

1616
.idea/
1717
.vscode/
18-
.cursor/
18+
# Cursor: track `.cursor/rules/*.mdc` only; ignore other workspace data (un-ignore must follow ignore)
19+
.cursor/*
20+
!.cursor/rules/
21+
!.cursor/rules/*.mdc
1922
*.swp
2023
*.swo
2124

0 commit comments

Comments
 (0)