Skip to content

CLAUDE.md: add ~100-line source file length convention#910

Merged
d-morrison merged 2 commits into
mainfrom
claude/claude-md-file-length-convention
Jun 16, 2026
Merged

CLAUDE.md: add ~100-line source file length convention#910
d-morrison merged 2 commits into
mainfrom
claude/claude-md-file-length-convention

Conversation

@d-morrison

Copy link
Copy Markdown
Owner

Summary

Adds a single File Structure guideline to CLAUDE.md:

  • Aim to keep source files under ~100 lines; split longer files into named subfiles

Why

A review on #843 requested (1) decomposing the 462-line _sec_double_integrals.qmd into focused subfiles, and (2) recording the ~100-line size convention in CLAUDE.md.

The decomposition is handled in #843. This convention change is kept in its own dedicated PR per the CLAUDE.md rule that "Workflow / .github / CI / infra changes go in their own dedicated PRs — never mix them with book-content PRs."

Scope

One-line documentation change to CLAUDE.md; no .qmd/.R/content touched, so no render/lint/spell run is required.

https://claude.ai/code/session_01NQSLJmjMN22RpwpgJ6Lw6u


Generated by Claude Code

Adds a File Structure guideline to keep source files under ~100 lines
and split longer files into named subfiles, matching the decomposition
practice requested in review and applied in PR #843.

Kept as its own dedicated PR per the CLAUDE.md rule that meta/infra
changes don't mix with book-content PRs.

https://claude.ai/code/session_01NQSLJmjMN22RpwpgJ6Lw6u
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 48s —— View job


Code Review

  • Gather context
  • Review the change
  • Post findings

Overall verdict: The change is correct and achieves its stated goal cleanly. Two minor clarity suggestions below.

CLAUDE.md line 39 (new line):

- Aim to keep source files under ~100 lines; split longer files into named subfiles

Finding 1 — Scope ambiguity: "source files" is unqualified, but the surrounding bullets are all .qmd-specific, and the split mechanism (_subfiles/) is a .qmd-only concept. It's not clear whether this convention is also intended for .R files in R/. A 100-line cap would be unusually tight for R package code. Consider scoping it explicitly: Aim to keep .qmd source files under ~100 lines; split longer files into named subfiles.

Finding 2 — "named subfiles" is slightly vague: The project already has a well-established _subfiles/ directory for this purpose. Saying split longer files into \_subfiles/`` (using the actual directory name) ties the convention to the project's existing structure and removes any ambiguity about where the splits should go.

Both are non-blocking suggestions. The change as written is still accurate and useful.

Address review on #910: qualify 'source files' as '.qmd' (a 100-line
cap is too tight for R package code in R/), and name the established
_subfiles/ directory as the split target.

https://claude.ai/code/session_01NQSLJmjMN22RpwpgJ6Lw6u
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 44s —— View job


Code Review

  • Gather context
  • Review the change
  • Post findings

Overall verdict: The change is correct, cleanly scoped, and ready to merge. Both findings from the prior review have been resolved by commit 29ceaa0.


CLAUDE.md, line 39 (added):

- Aim to keep `.qmd` source files under ~100 lines; split longer files into named subfiles in `_subfiles/`

Prior findings — now resolved:

  • Scope ambiguity.qmd is now explicitly qualified. ✓
  • "named subfiles" is vague_subfiles/ is now named in the line. ✓

One non-blocking suggestion — bullet ordering:

The File Structure section currently reads:

- Subfiles (`_subfiles/`) must NOT begin with a section heading…
- Link to `.qmd` source files, not rendered `.html` files
- Aim to keep `.qmd` source files under ~100 lines; split longer files into named subfiles in `_subfiles/`
- `_extensions/` is vendored third-party code…

The new bullet references _subfiles/, so placing it directly after the existing _subfiles/ heading rule (bullet 1) would group all _subfiles/-related guidance together. As-is the ordering is fine — this is cosmetic only and does not block merge.

Fix ordering →

@d-morrison d-morrison marked this pull request as ready for review June 16, 2026 06:33
@d-morrison d-morrison merged commit 38a7cca into main Jun 16, 2026
4 checks passed
@d-morrison d-morrison deleted the claude/claude-md-file-length-convention branch June 16, 2026 06:34
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Claude finished @d-morrison's task in 1m 45s —— View job


Code Review

  • Gather context
  • Review the change
  • Post findings

Overall verdict: The change is correct, minimal, and achieves its stated goal. The PR is already merged. No blocking issues found.

The change — CLAUDE.md, line 39:

- Aim to keep `.qmd` source files under ~100 lines; split longer files into named subfiles in `_subfiles/`

Findings:

No blocking issues. One non-blocking cosmetic note:

Bullet ordering (cosmetic): The File Structure section now reads:

1. Subfiles (`_subfiles/`) must NOT begin with a section heading…
2. Link to `.qmd` source files, not rendered `.html` files
3. Aim to keep `.qmd` source files under ~100 lines; split longer files into named subfiles in `_subfiles/`  ← new
4. `_extensions/` is vendored third-party code…

Bullets 1 and 3 both reference _subfiles/. Moving bullet 3 to position 2 would group all _subfiles/-related guidance together. This is purely cosmetic — the current ordering is clear and accurate as-is.

Fix ordering →

Note: No inline review comment tool was available in this session, so findings are posted here rather than as line-level PR comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants