Skip to content

feat(convention): add built-in slidev convention (plan 2606270013)#706

Open
jeduden wants to merge 5 commits into
mainfrom
claude/youthful-knuth-53wfw2
Open

feat(convention): add built-in slidev convention (plan 2606270013)#706
jeduden wants to merge 5 commits into
mainfrom
claude/youthful-knuth-53wfw2

Conversation

@jeduden

@jeduden jeduden commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a slidev built-in convention that disables the eight default-on rules producing false positives on Slidev presentation Markdown files (heading-style, heading-increment, first-line-heading, no-duplicate-headings, blank-line-around-headings, no-trailing-punctuation-in-heading, no-emphasis-as-heading, empty-section-body). Closes Slidev presentation files not well supported #41.
  • Uses FlavorAny so the convention is renderer-agnostic — authors may use GFM, CommonMark, or any other flavor.
  • Documents the new convention in docs/reference/conventions.md and updates the concepts doc to reflect that conventions optionally pin a flavor (covering FlavorAny conventions like slidev and no-llm-tells).
  • Adds integration tests in internal/config/convention_test.go verifying the FlavorAny bypass and that all eight disabled rules land in ConventionPreset.

Changes

internal/convention/convention.go — new "slidev" entry in the built-in conventions map.

internal/convention/convention_test.goTestLookup_Slidev covering all eight rules; updated TestNamesSorted; require.Len (fatal) instead of assert.Len so a rule-count drift immediately aborts instead of silently skipping the new entry.

internal/config/convention_test.goTestApplyConvention_Slidev_FlavorAnyAllowsUserFlavor and TestApplyConvention_Slidev_DisablesEightRulesInPreset, matching the pattern already established for no-llm-tells.

docs/reference/conventions.md — new ### slidev section; flavor-agreement paragraph clarified for FlavorAny conventions; resolution-order section restores the "shadowing is impossible" conclusion.

docs/background/concepts/flavor-rule-convention-kind.md — Convention definition updated: "optionally pins a flavor" instead of "pairs a flavor."

plan/2606270013_slidev-convention.md — new plan file, status ✅.

Test plan

  • go test ./internal/convention/... — green
  • go test ./internal/config/... — green (two new slidev integration tests)
  • go test ./... — all green
  • go run ./cmd/mdsmith check . — 0 failures

Generated by Claude Code

@codecov

codecov Bot commented Jun 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.63%. Comparing base (0314c10) to head (2e21a7b).

Additional details and impacted files
Components Coverage Δ
Go 98.62% <ø> (ø)
TypeScript 99.54% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeduden jeduden marked this pull request as ready for review June 29, 2026 20:19
claude added 5 commits June 29, 2026 20:19
Disables the eight default-on rules that produce false positives on
Slidev presentation Markdown: heading-style, heading-increment,
first-line-heading, no-duplicate-headings, blank-line-around-headings,
no-trailing-punctuation-in-heading, no-emphasis-as-heading,
empty-section-body. Uses FlavorAny so the convention does not force a
flavor change. Closes issue #41 (rule-configuration layer only; the
parser-level `---`-as-page-separator issue is out of scope).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
…0013

Document the slidev built-in convention in docs/reference/conventions.md
with purpose, eight-rule table, and parser-level limitation note. Update
the Built-in values list and Reserved names section to include slidev.
Mark all plan tasks and acceptance criteria done; set status to ✅.

The conventions.md line budget required condensing three existing
sections (plain future-rules paragraph, How-presets-layer detail,
Disabling-MDS034 code block, Resolution-order + Interaction subsections)
to make room while staying within the 300-line content limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
- Replace require.True with assert.True inside TestLookup_Slidev loop
  so all missing rules are reported rather than stopping at the first
  (matches TestGomarklintParityRuleSet's established pattern)
- Add "slidev" to the built-in conventions list in the background
  concepts doc (flavor-rule-convention-kind.md was not updated)
- Add "slidev" to the hand-written error-message example in
  docs/reference/conventions.md so it matches what the runtime emits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
Round-2 code-review findings:

- convention_test.go: wrap assert.False(p.Enabled) in if assert.True(ok)
  guard so a missing rule entry causes an explicit failure instead of
  passing vacuously via the zero-value RulePreset{Enabled:false}.

- docs/reference/conventions.md: correct the heading-style row — the
  actual cause is the --- slide separator being parsed as a setext
  heading underline, not "layout blocks." Update the slidev prose and
  the flavor-agreement paragraph to note that FlavorAny conventions
  (slidev, no-llm-tells) do not enforce the flavor-conflict check.

- docs/background/concepts/flavor-rule-convention-kind.md: "pairs a
  flavor" implied all conventions pin a concrete flavor; rephrase to
  "optionally pins a flavor" to cover FlavorAny conventions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
Round-3 code-review findings:

- convention_test.go: use require.Len (fatal) instead of assert.Len
  so a rule-count drift immediately aborts the test rather than
  silently allowing the for-loop to skip the new entry unasserted.

- config/convention_test.go: add two integration-level tests for
  slidev through the applyConvention path — one verifying the FlavorAny
  bypass accepts a user markdown-flavor setting, one verifying all eight
  disabled rules land in ConventionPreset. no-llm-tells had analogous
  tests; slidev now matches the pattern.

- docs/reference/conventions.md: restore the "shadowing is impossible"
  conclusion in the resolution-order section so readers scanning that
  section understand that a collision is a hard error, not a silent
  override.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012teDVC4T7vuxdaTBSBQ4nJ
@jeduden jeduden force-pushed the claude/youthful-knuth-53wfw2 branch from 058c60a to 2e21a7b Compare June 29, 2026 20:20
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.

Slidev presentation files not well supported

2 participants