fix(injector): use h2 heading and backticks in managed block#26
Conversation
The managed block injected into AGENTS.md/CLAUDE.md uses h1 (#) which breaks the document heading hierarchy since these files already have an h1 title. All other sections use h2 (##). Also use backticks instead of single quotes for the 'ocr init' CLI command to match markdown convention for inline code.
|
Thanks for raising @AlexanderWillner ! Will take a look 🙏 |
Code Review: PR #26 — fix(injector): use h2 heading and backticks in managed blockDate: 2026-04-07 VerdictAPPROVE The PR correctly fixes two formatting defects in the OCR managed block template. The h2 heading and backtick formatting changes are both correct and well-scoped. No blockers identified — the two should-fix items are pre-existing gaps surfaced by this change, not regressions introduced by it. BlockersNone. Should Fix1. Update repo's own CLAUDE.md and AGENTS.md to reflect the fixed templateFlagged by: @principal-1, @Quality-1, @ai-1, @ephemeral-1 The repo's own CLAUDE.md and AGENTS.md files still contain the old Recommended action: Run 2. Add test coverage for injector.tsFlagged by: @principal-1, @Quality-1, @ai-1, @ephemeral-1 The Recommended action: Add SuggestionsAI Workspace Conventions
Content & Tone
Future Improvements
What's Working Well
Consensus & DissentTopic: Stale repo filesReviewers: @principal-1, @Quality-1, @ai-1, @ephemeral-1
Consensus: All agree files should be updated. Severity ranges from Medium to Info — classified as Should Fix given this repo's canonical reference role. Topic: OpenSpec heading asymmetryReviewers: @principal-1, @ai-1, @ephemeral-1
Consensus: All agree h2 is correct for OCR; the asymmetry is an out-of-scope follow-up for OpenSpec. Clarifying QuestionsEvery question below was raised by a reviewer. Please address each. From @principal-1
From @Quality-1
From @ai-1
From @ephemeral-1
Individual ReviewsFull reviews available in session directory:
Session: |
Addresses code review feedback on PR spencermarx#26: - Add packages/cli/src/lib/__tests__/injector.test.ts with 11 tests covering content guards (h2 heading, backtick formatting), fresh inject, idempotent re-inject, stale-block replacement, dual-file injection, and hasOcrInstructions detection. - Regenerate the OCR managed block in this repo's CLAUDE.md and AGENTS.md to match the corrected template (h2 + backticked `ocr init`). - Normalize the OpenSpec managed block and Code Conventions heading to h2 so all top-level managed blocks share a consistent hierarchy. Co-Authored-By: claude-flow <ruv@ruv.net>
|
Hi @AlexanderWillner — thanks for this fix! I ran an OCR review on the PR and pushed one follow-up commit (3e4d01f) directly to your branch to address the should-fix items the reviewers raised. Hope that's okay; happy to revert if you'd prefer to handle them yourself. What was added:
Verification: |
spencermarx
left a comment
There was a problem hiding this comment.
Great work @AlexanderWillner. My latest comment explains the couple additions made. We're good to go on merge here 👍
Summary
#(h1) to##(h2) to avoid breaking document heading hierarchy in AGENTS.md/CLAUDE.md files that already have an h1 title'ocr init'to`ocr init`for consistent markdown inline code formattingContext
Found via OCR code review: the injected block in
packages/cli/src/lib/injector.tsuses# Open Code Review Instructionswhich creates a second h1 heading in files that already have one. All other sections in typical AGENTS.md files use##(h2). This affects markdown renderers and TOC generators.Additionally, the CLI command reference uses single quotes instead of backticks, inconsistent with standard markdown conventions for inline code.
Changes
packages/cli/src/lib/injector.ts: Two fixes inOCR_INSTRUCTION_BLOCKconstant:#→##'ocr init'→\`ocr init\`