docs(claude): prune AI instructions to principles + conservative-maintainer rules#1541
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR restructures the repository’s Claude instruction set by consolidating “how to work here” guidance into CLAUDE.md and moving truly silent-failure “gotchas” into a single .claude/rules/common-pitfalls.md, while deleting duplicated instruction files that overlap with CI/lint-gated documentation.
Changes:
- Replaces “Working Style” with a more principle-driven “How to Work Here” section and refreshes command/workflow guidance in
CLAUDE.md. - Refactors
.claude/rules/common-pitfalls.mdto focus on silent-failure traps (indexing, GPU macro pitfalls, parameter gotchas, golden-file discipline). - Deletes three
.claude/rules/*.mdfiles whose content is now either moved intocommon-pitfalls.mdor replaced by pointers todocs/documentation/*.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
CLAUDE.md |
Consolidates maintainer-mode workflow principles, updated command guidance, and pointers to lint-enforced sources of truth. |
.claude/rules/common-pitfalls.md |
Centralizes the “silent failure” traps (indexing, GPU macro usage, parameters, tests) into one short reference. |
.claude/rules/parameter-system.md |
Deleted; prior content is replaced by pointers and selected gotchas moved into common-pitfalls.md. |
.claude/rules/gpu-and-mpi.md |
Deleted; GPU/MPI guidance is now primarily referenced via docs/documentation/gpuParallelization.md plus key silent-failure warnings in common-pitfalls.md. |
.claude/rules/fortran-conventions.md |
Deleted; forbidden-pattern details now point to toolchain/mfc/lint_source.py and lint-gated documentation. |
Comment on lines
+124
to
+126
| `wp` = working precision (computation); `stp` = storage precision (field arrays and I/O). | ||
| Both double by default; `--single` → both single; `--mixed` → wp=double, stp=half — so | ||
| wp/stp mixing is a silent precision bug, not a style issue. `scalar_field%sf` and all new |
Comment on lines
+63
to
+65
| - Tests are generated programmatically in `toolchain/mfc/test/cases.py` (parameter | ||
| modifications on `BASE_CFG` via the `CaseGeneratorStack` push/pop pattern); test UUID = | ||
| CRC32 of the trace string; `./mfc.sh test -l` lists all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prunes the Claude Code instruction files from ~3,300 words across 5 files to ~1,600 words across 2 files, shifting from exhaustive inventories toward principles backed by concrete reasons.
What changed
.claude/rules/common-pitfalls.md— now holds only the silent-failure traps documented nowhere else (buff_sizerouting,eqn_idx,GPU_LOOPsilent-serial on Cray/AMD,CASE_OPT_PARAMSrebuild trap,QPVF_IDX_VARSmismatch, checker placement, golden-file discipline).fortran-conventions.md,parameter-system.md,gpu-and-mpi.md— their content either duplicated the lint-gated user docs (contributing.md,gpuParallelization.md,testing.md,case.md) and is replaced by pointers, or was a unique gotcha and moved intocommon-pitfalls.md.Rationale
lint_docs.pyfreshness-checks on every precheck/CI run — making the instructions much harder to go stale..github/workflows/claude-code-review.ymlglob (.claude/rules/*.md) needs no change.Type of change
How has this been tested?
./mfc.sh precheck(all 7 checks pass, including doc-reference and spell checks; runs via pre-commit hook)Checklist
./mfc.sh formatbefore committing my code