Skip to content

docs(claude): prune AI instructions to principles + conservative-maintainer rules#1541

Merged
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:claude-md-prune
Jun 6, 2026
Merged

docs(claude): prune AI instructions to principles + conservative-maintainer rules#1541
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:claude-md-prune

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

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.md — new "How to Work Here" section framing the repo's three load-bearing constraints (four CI-gated compilers, silent failure modes, toolchain-first), plus conservative-maintainer rules against over-engineering: smallest correct change, diff discipline, no-bloat list, test justification criteria, and a before/after-editing protocol with a ~100-net-line stop rule.
  • .claude/rules/common-pitfalls.md — now holds only the silent-failure traps documented nowhere else (buff_size routing, eqn_idx, GPU_LOOP silent-serial on Cray/AMD, CASE_OPT_PARAMS rebuild trap, QPVF_IDX_VARS mismatch, checker placement, golden-file discipline).
  • Deleted 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 into common-pitfalls.md.

Rationale

  • Capable models follow project-specific facts and gotchas far better than restated general philosophy; what they don't need is a second, unchecked copy of content the lint-gated docs already maintain. Most facts now live in exactly one place, and the bulk of them in docs that lint_docs.py freshness-checks on every precheck/CI run — making the instructions much harder to go stale.
  • The .github/workflows/claude-code-review.yml glob (.claude/rules/*.md) needs no change.

Type of change

  • Documentation update

How has this been tested?

  • ./mfc.sh precheck (all 7 checks pass, including doc-reference and spell checks; runs via pre-commit hook)

Checklist

  • I ran ./mfc.sh format before committing my code
  • This PR does not introduce any repeated code

@sbryngelson sbryngelson marked this pull request as ready for review June 6, 2026 02:58
Copilot AI review requested due to automatic review settings June 6, 2026 02:58
@sbryngelson sbryngelson enabled auto-merge (squash) June 6, 2026 02:58
@sbryngelson sbryngelson disabled auto-merge June 6, 2026 02:58
@sbryngelson sbryngelson merged commit d5cd2df into MFlowCode:master Jun 6, 2026
36 checks passed
@sbryngelson sbryngelson deleted the claude-md-prune branch June 6, 2026 02:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md to focus on silent-failure traps (indexing, GPU macro pitfalls, parameter gotchas, golden-file discipline).
  • Deletes three .claude/rules/*.md files whose content is now either moved into common-pitfalls.md or replaced by pointers to docs/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 thread CLAUDE.md
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants