Skip to content

refactor(naming)!: adopt kebab-case file names - #2

Merged
stephane-segning merged 1 commit into
masterfrom
claude/kebab-case-file-naming
Aug 9, 2026
Merged

refactor(naming)!: adopt kebab-case file names#2
stephane-segning merged 1 commit into
masterfrom
claude/kebab-case-file-naming

Conversation

@stephane-segning

Copy link
Copy Markdown
Contributor

Summary

Applies the house file-naming convention: file names are kebab-case. Only file names change — no behaviour, no identifiers, no exports, no logic.

Source of truth: a direct maintainer instruction adopting kebab-case as a standing convention, consistent with the naming rules already in the repo's agent instructions (kebab-case files; PascalCase for type names, classes and React components; snake_case for Rust source per rustfmt).

Intent

Two categories of violation existed. The React component files were PascalCase, and docs/STATUS.md was capitalised. The second is the interesting one: it is not an ecosystem-mandated name, so by the letter of the rule it had to move — but it is referenced 76 times across 34 files, including a hardcoded path inside the repo's own verify-status self-check. A convention with a permanent exception for the single file everyone reads is not much of a convention, so it was renamed in full rather than exempted.

Scope

Renamed (via git mv, history preserved — all five recorded by git as true renames):

Old New
frontends/packages/ui/src/components/StatusBadge.tsx status-badge.tsx
frontends/packages/ui/src/components/StatusBadge.test.tsx status-badge.test.tsx
frontends/packages/ui/src/components/StatusBadge.stories.tsx status-badge.stories.tsx
frontends/packages/ui/src/components/PayerSheet.tsx payer-sheet.tsx
docs/STATUS.md docs/status.md

Component identifiers are unchanged. StatusBadge and PayerSheet remain PascalCase — JSX requires the identifier form, and the convention is kebab-case files with PascalCase components. Exported symbols, the Storybook title, and the describe() suite name are all untouched.

All 76 STATUS.md references updated across 34 files: .xtask/src/main.rs (the hardcoded root.join(...) path plus doc comments and error strings), both GitHub workflows, justfile, compose.e2e.yml, README.md, AGENTS.md, CLAUDE.md, 8 backend .rs doc comments, schemas/vpay.cstack, and the docs/ tree.

Deliberately not renamed — ecosystem-mandated names where a rename breaks tooling: Cargo.toml/Cargo.lock, both Dockerfiles, every README.md (GitHub renders these by name in directory listings, which applies to the six nested ones too), LICENSE, AGENTS.md, CLAUDE.md, and all dotfiles. Every .rs file keeps snake_case per rustfmt — that is the convention, not a violation of it.

Verification

just ci exits 0.

Check Before After
cargo nextest run --workspace 64 passed / 5 ignored 64 passed / 5 ignored
pnpm -r test 10 assertions 10 assertions (3 tokens + 4 api-client + 3 ui)
cargo xtask verify-status ok, 8 items ok, 8 items — now reads docs/status.md
pnpm -r build, build-storybook pass pass

The unchanged counts are the point of this table. A renamed *.test.tsx dropping out of Vitest's glob fails silently — by running fewer tests, not by erroring — so "10 assertions, still 3 from @vpay/ui" is the evidence that the renamed test file is still discovered. Same for the ignored count staying at 5.

Also confirmed: grep -rn "STATUS\.md" returns zero hits outside .git, and ls confirms the on-disk names actually changed — macOS is case-insensitive-but-case-preserving, so a rename that differs only in case can silently no-op.

Screenshots / Evidence

verify-status: ok — 8 unimplemented item(s), all declared in docs/status.md
verify: ok
     Summary [0.458s] 64 tests run: 64 passed, 5 skipped
frontends/packages/ui test:  Tests  3 passed (3)
advisories ok, bans ok, licenses ok, sources ok

Risk Assessment

Low. No behaviour changes; the diff is renames plus path-string updates.

The one consumer-visible break is docs/STATUS.mddocs/status.md, flagged as BREAKING CHANGE in the commit. External links and bookmarks to the old path will 404. GitHub does not redirect renamed files. If that matters more than the convention, this rename is the part to revert — the component renames stand alone.

Residual risk is a stale path reference somewhere grep did not reach. The substitution was STATUS\.mdstatus.md, which is safe against the unrelated STATUS: labels used elsewhere in the codebase (those carry no .md suffix). CI's docs workflow runs verify-status on any PR touching docs/**, so a broken path fails the build rather than rotting quietly.

AI Usage Declaration

AI (Claude Opus 5 via Claude Code) performed the renames and reference updates, delegated to a Sonnet sub-agent; the orchestrating session independently re-ran the full gate and verified the git-recorded renames, on-disk casing, absence of stale references, and unchanged test counts rather than accepting the agent's report.

  • A human is accountable for this change and has reviewed it.
  • Every claim here was verified by running the command, not inferred.
  • Limitations stated explicitly — see Risk Assessment.
  • No functionality was added, removed, or fabricated.

Reviewer Focus

  1. Is renaming docs/STATUS.md acceptable? It is the only judgement call here and the only breaking part. Easy to drop if you would rather keep the path stable.
  2. .xtask/src/main.rs — the hardcoded path was the one place a rename could break the repo's own honesty check.
  3. Confirm you are happy that all six README.md files were treated as ecosystem-mandated and left alone.

Applies the house file-naming convention. Only file names change; no
behaviour, no identifiers, no exports.

* React component files become kebab-case, while the components
  themselves stay PascalCase — JSX requires the identifier form, and the
  convention is kebab-case files with PascalCase components:
  StatusBadge.tsx -> status-badge.tsx (plus .test.tsx and .stories.tsx)
  PayerSheet.tsx  -> payer-sheet.tsx
* docs/STATUS.md -> docs/status.md, with all 76 references across 34
  files updated, including the hardcoded path in .xtask/src/main.rs,
  both GitHub workflows, the justfile, compose.e2e.yml, 8 backend .rs
  doc comments, and schemas/vpay.cstack.

Left unrenamed as ecosystem-mandated: Cargo.toml/Cargo.lock, both
Dockerfiles, every README.md (GitHub renders these by name in directory
listings), LICENSE, AGENTS.md, CLAUDE.md, all dotfiles. Every .rs file
keeps snake_case per rustfmt.

Verified: `just ci` exits 0. Rust 64 passed / 5 ignored and web 10
assertions, both unchanged from before the rename — the renamed
status-badge.test.tsx is still discovered by Vitest's glob, which is the
failure mode a rename fails silently on.

BREAKING CHANGE: docs/STATUS.md is now docs/status.md. External links
and bookmarks to the old path will 404, and any tooling that reads the
old path must be updated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: dbabc02

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@stephane-segning
stephane-segning merged commit 9e92d02 into master Aug 9, 2026
3 of 6 checks passed
@stephane-segning
stephane-segning deleted the claude/kebab-case-file-naming branch August 9, 2026 14:47
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.

1 participant