Skip to content

Document the diff-block convention in CLAUDE.md - #203

Merged
ilanazholobovsky merged 1 commit into
mainfrom
docs-diff-block-convention
Aug 27, 2026
Merged

Document the diff-block convention in CLAUDE.md#203
ilanazholobovsky merged 1 commit into
mainfrom
docs-diff-block-convention

Conversation

@ilanazholobovsky

Copy link
Copy Markdown
Collaborator

Closes the open decisions on TW-1804.

Oliver's diff support (#145) merged on 19 Aug and is live, but only on the CodePush page, and nothing tells an author — human or agent — when to reach for it. The docs currently show "edit a file you already have" three different ways (bare ..., // ...existing, commented placeholders), and diff blocks are a fourth.

Two changes:

  1. Adds diff to the Prism language list in CLAUDE.md, which Add diff language to Prism syntax highlighting #145 made stale — as written, CLAUDE.md tells authors diff isn't available when it is (verified: docusaurus.config.ts line 1521 includes it).
  2. Adds a short convention: diff block for editing a file the reader already has, full snippet for a new or whole file, one convention per page.

The copy-paste question from TW-1804 is resolved by the rule rather than by code: copying a diff block does include the +/- characters, but a snippet meant to be pasted whole shouldn't be a diff block in the first place.

No retrofit in this PR. A survey of the 12 pages still using the older notations is on TW-1804; the proposal there is to apply the convention going forward and clean up opportunistically, rather than open 12 PRs for no reader-visible gain.

Green-light or discard — either is a decision, and the ticket has been open since July waiting for one.

Closes the open decisions on TW-1804.

Oliver's `diff` support (#145) merged on 19 Aug and is live, but only on the CodePush page, and nothing tells an author — human or agent — when to reach for it. The docs currently show "edit a file you already have" three different ways (bare `...`, `// ...existing`, commented placeholders), and diff blocks are a fourth.

Two changes:

1. Adds `diff` to the Prism language list in CLAUDE.md, which #145 made stale — as written, CLAUDE.md tells authors `diff` isn't available when it is (verified: docusaurus.config.ts line 1521 includes it).
2. Adds a short convention: diff block for editing a file the reader already has, full snippet for a new or whole file, one convention per page.

The copy-paste question from TW-1804 is resolved by the rule rather than by code: copying a diff block does include the `+`/`-` characters, but a snippet meant to be pasted whole shouldn't be a diff block in the first place.

No retrofit in this PR. A survey of the 12 pages still using the older notations is on TW-1804; the proposal there is to apply the convention going forward and clean up opportunistically, rather than open 12 PRs for no reader-visible gain.

Green-light or discard — either is a decision, and the ticket has been open since July waiting for one.
@github-actions

Copy link
Copy Markdown

@ilanazholobovsky
ilanazholobovsky merged commit 6cc5db7 into main Aug 27, 2026
2 checks passed
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