c9093b16dc815c2b511c481ea404e89540ac525c max Mon Apr 13 15:03:20 2026 -0700 CLAUDE.md: move kent coding rules into the edit-kent-code skill Replace the full C/SQL/memory rule list with a short pointer to the edit-kent-code and make-track skills. Track-building sessions no longer pull C-specific rules into every context. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> diff --git src/CLAUDE.md src/CLAUDE.md index 42702a90090..6897cbbd563 100644 --- src/CLAUDE.md +++ src/CLAUDE.md @@ -1,16 +1,9 @@ # CLAUDE.md — UCSC Genome Browser Kent Source Tree -AI assistant guidelines for modifying the kent codebase. +For source code changes (C, JavaScript, HTML, Python, CGIs, trackDb, build system), +load the **`edit-kent-code`** skill. For building a new genome browser track +(data pipelines, trackDb stanzas, makeDocs, description pages), load the +**`make-track`** skill. -## Key Rules - -- Always search `src/inc/` and `src/lib/` for existing utility functions before writing inline parsing, conversion, or data manipulation code. The kent tree has 222+ headers covering most common operations (e.g., `htmlColor.h` for color parsing, `obscure.h` for misc utilities, `hash.h` for hash tables). Writing a new implementation when one exists leads to code review failures. -- Use `sqlSafef()` or `sqlDyStringPrintf()` for ALL SQL query construction — never `safef()` or `dyStringPrintf()`. -- Use `safef()`, `safecpy()`, `safecat()` instead of `sprintf()`, `strcpy()`, `strcat()`. -- Use `needMem()` / `AllocVar()` instead of `malloc()` — all kent code assumes zeroed memory. -- Struct `next` must be the first member for any struct used in singly-linked lists. -- Make the smallest change that achieves the goal. Do not restructure surrounding code. -- Preserve existing patterns even when a "cleaner" design is conceivable. -- After building, run binaries from `~/bin/x86_64/`, not bare command name (system PATH resolves to production binaries). -- Never use inline event handlers (`onclick`, `onchange`, `oninput`) in HTML output — CSP blocks them. Use `jsInlineF()` with `addEventListener` instead, which emits JavaScript inside a nonce-tagged script block. -- Deploy CSS and static files by running `make` in the appropriate `htdocs/` subdirectory (e.g., `cd src/hg/htdocs/style && make`). Never copy files directly to `/usr/local/apache/`. +Binaries you build from this tree install under `~/bin/$MACHTYPE/` — invoke them +from there, not by bare name (the system PATH resolves to production binaries).