(MODULES-11829, MODULES-11830) Add synced CLAUDE.md.erb with Linux + Windows specifics#642
(MODULES-11829, MODULES-11830) Add synced CLAUDE.md.erb with Linux + Windows specifics#642imaqsood wants to merge 1 commit into
Conversation
d6daa55 to
b4cb1f0
Compare
|
Question regarding Opt-out for modules with an existing CLAUDE.md
|
The merge-base changed after approval.
c697470 to
72fef79
Compare
david22swan
left a comment
There was a problem hiding this comment.
Overall this looks to be a solid framework, but as said in my first comment, having it enforced as a singular truth would limit its effect by preventing Claude from customising it with specific information unique to each Module.
I feel this would be better suited as a one time run in order to get the framework in place, or as a part of moduleroot_init so that it is included with newly created modules.
Honestly, as I see it this would be best as an opt in file for the moduleroot and a default file for moduleroot_init, ensuring that it is automaticall added to any new modules created and that for existing modules, you can manually choose to add it in and then update it to match what the Module needs.
There was a problem hiding this comment.
Pull request overview
Adds a new CLAUDE.md template to the PDK-managed module root so CAT-supported modules receive a synced contributor/Claude conventions file during pdk convert / pdk update.
Changes:
- Introduces
moduleroot/CLAUDE.md.erbwith standardized guidance on project layout, common commands, testing, style, and review policy. - Implements OS-conditional rendering to include “Linux specifics” and/or “Windows specifics” sections based on
metadata.json(@configs['module_metadata']['operatingsystem_support']).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Respond to review on #642: - Move CLAUDE.md.erb from moduleroot/ (force-synced on every pdk update) to moduleroot_init/ so it is a one-time default: new modules get it and own it, existing modules are never overwritten (per @david22swan). This also removes the clobber risk for the 5 modules that hand-maintain a CLAUDE.md -- no .sync.yml opt-out needed. moduleroot_init needs no config_defaults entry. - Reframe the header from "do not edit" to "starting point, tailor it to this repo" -- the file is meant to carry module-specific detail, not stay generic. - Drop `has_linux ||= !has_windows`: it mislabelled AIX/Solaris/Darwin-only modules as Linux (@Copilot). Empty/unknown metadata still defaults to Linux. - Keep RuboCop under bundler: `bundle exec rubocop -A`, not bare `rubocop -a` (@Copilot). - Note facts come from facterdb via rspec-puppet-facts/on_supported_os (@david22swan). - Mention spec_helper_acceptance.rb(+_local) for Litmus setup (@david22swan). - Note that rules needing enforcement should be backed by runtime hooks in .claude/, since prose alone can be treated as suggestions (@david22swan). Validated with PDK 3.4.0: pdk new module deploys the file (owned, customizable); pdk update leaves an existing module's copy untouched. Pure ASCII, ERB balanced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the reviews — addressed in the two follow-up commits. Summary:
Scope note: this PR now also carries the MODULES-11830 Windows-specifics expansion (the separate stacked PR is being closed and folded in here). Validated with PDK 3.4.0: |
Respond to review on #642: - Move CLAUDE.md.erb from moduleroot/ (force-synced on every pdk update) to moduleroot_init/ so it is a one-time default: new modules get it and own it, existing modules are never overwritten (per @david22swan). This also removes the clobber risk for the 5 modules that hand-maintain a CLAUDE.md -- no .sync.yml opt-out needed. moduleroot_init needs no config_defaults entry. - Reframe the header from "do not edit" to "starting point, tailor it to this repo" -- the file is meant to carry module-specific detail, not stay generic. - Drop `has_linux ||= !has_windows`: it mislabelled AIX/Solaris/Darwin-only modules as Linux (@Copilot). Empty/unknown metadata still defaults to Linux. - Keep RuboCop under bundler: `bundle exec rubocop -A`, not bare `rubocop -a` (@Copilot). - Note facts come from facterdb via rspec-puppet-facts/on_supported_os (@david22swan). - Mention spec_helper_acceptance.rb(+_local) for Litmus setup (@david22swan). - Note that rules needing enforcement should be backed by runtime hooks in .claude/, since prose alone can be treated as suggestions (@david22swan). Validated with PDK 3.4.0: pdk new module deploys the file (owned, customizable); pdk update leaves an existing module's copy untouched. Pure ASCII, ERB balanced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
3772d7b to
6795912
Compare
Respond to review on #642: - Move CLAUDE.md.erb from moduleroot/ (force-synced on every pdk update) to moduleroot_init/ so it is a one-time default: new modules get it and own it, existing modules are never overwritten (per @david22swan). This also removes the clobber risk for the 5 modules that hand-maintain a CLAUDE.md -- no .sync.yml opt-out needed. moduleroot_init needs no config_defaults entry. - Reframe the header from "do not edit" to "starting point, tailor it to this repo" -- the file is meant to carry module-specific detail, not stay generic. - Drop `has_linux ||= !has_windows`: it mislabelled AIX/Solaris/Darwin-only modules as Linux (@Copilot). Empty/unknown metadata still defaults to Linux. - Keep RuboCop under bundler: `bundle exec rubocop -A`, not bare `rubocop -a` (@Copilot). - Note facts come from facterdb via rspec-puppet-facts/on_supported_os (@david22swan). - Mention spec_helper_acceptance.rb(+_local) for Litmus setup (@david22swan). - Note that rules needing enforcement should be backed by runtime hooks in .claude/, since prose alone can be treated as suggestions (@david22swan). Validated with PDK 3.4.0: pdk new module deploys the file (owned, customizable); pdk update leaves an existing module's copy untouched. Pure ASCII, ERB balanced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
6795912 to
aea7507
Compare
Respond to review on #642: - Move CLAUDE.md.erb from moduleroot/ (force-synced on every pdk update) to moduleroot_init/ so it is a one-time default: new modules get it and own it, existing modules are never overwritten (per @david22swan). This also removes the clobber risk for the 5 modules that hand-maintain a CLAUDE.md -- no .sync.yml opt-out needed. moduleroot_init needs no config_defaults entry. - Reframe the header from "do not edit" to "starting point, tailor it to this repo" -- the file is meant to carry module-specific detail, not stay generic. - Drop `has_linux ||= !has_windows`: it mislabelled AIX/Solaris/Darwin-only modules as Linux (@Copilot). Empty/unknown metadata still defaults to Linux. - Keep RuboCop under bundler: `bundle exec rubocop -A`, not bare `rubocop -a` (@Copilot). - Note facts come from facterdb via rspec-puppet-facts/on_supported_os (@david22swan). - Mention spec_helper_acceptance.rb(+_local) for Litmus setup (@david22swan). - Note that rules needing enforcement should be backed by runtime hooks in .claude/, since prose alone can be treated as suggestions (@david22swan). Validated with PDK 3.4.0: pdk new module deploys the file (owned, customizable); pdk update leaves an existing module's copy untouched. Pure ASCII, ERB balanced. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
aea7507 to
35aeb59
Compare
…root_init Ship a module-shaped CLAUDE.md so CAT-supported modules get a conventions file Claude reads before touching code. Delivers both MODULES-11829 (the template + Linux specifics) and MODULES-11830 (Windows specifics). - Lives in moduleroot_init/ (not moduleroot/), so it is a one-time default: new modules get it via `pdk new module` / `pdk convert` and own it -- `pdk update` never overwrites it, and modules that already hand-maintain a CLAUDE.md are never clobbered. - OS-conditional via the module's metadata.json, read as @configs['module_metadata']['operatingsystem_support'] with rescue fallbacks (same convention as moduleroot_init/CHANGELOG.md.erb / README.md.erb). Renders "Linux specifics" and/or "Windows specifics"; empty/unknown metadata defaults to Linux. - Linux: package providers (apt/yum/dnf/zypper), systemd vs init, paths/SELinux, Litmus-on-Docker. Windows: Chocolatey/MSI + SCM services + ACL/paths, DSC resource patterns, PowerShell exec idioms, scheduled_task semantics, native-extension gotchas, and Windows Litmus/WinRM/reboot notes. - Common content: project layout, rake commands, rspec-puppet (facterdb via rspec-puppet-facts/on_supported_os), coverage, litmus/beaker (incl. spec_helper_acceptance.rb), Ruby style (rubocop strict, run under bundle exec), Gemfile gem sourcing + version-pin env vars, type/provider DSL gotchas, task-module conventions, metadata.json, CI/nightly logs, outcome-based review policy, and project rules paired with .claude runtime hooks. - Header frames it as a starting point to tailor per repo, not an immutable file. - Pure ASCII (PDK's diff engine raises invalid-byte-sequence on non-ASCII under a non-UTF-8 locale). Validated with PDK 3.4.0: `pdk new module` deploys the file (owned, customizable); `pdk update` leaves an existing copy untouched; renders Linux/Windows sections per metadata.json; ERB balanced, no leftover tags. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35aeb59 to
abaa7b2
Compare
david22swan
left a comment
There was a problem hiding this comment.
LGTM
Are we waiting on the CoPilot pr or is that to be ignored?
What
Adds a synced, OS-aware
CLAUDE.mdtemplate to pdk-templates so CAT-supported modules get a conventions file Claude reads before touching code. This PR now delivers two artifacts:moduleroot/CLAUDE.md.erbtemplate + the Linux specifics section.Jira: MODULES-11829, MODULES-11830 (epic MODULES-11828, S2 maturity for CAT modules).
How
metadata.json, read via@configs['module_metadata']['operatingsystem_support']withrescuefallbacks — the same convention already used inmoduleroot_init/CHANGELOG.md.erb/README.md.erb.## Linux specificsand/or## Windows specificsbased on the module's supported OS. Multi-OS modules get both; empty/unknown metadata defaults to Linux.execidioms,scheduled_tasksemantics, native-extension Ruby gotchas, and Windows Litmus/acceptance (real VMs, WinRM, reboots).metadata.jsonconventions, CI/nightly logs, outcome-based review policy, project rules.invalid byte sequence in US-ASCIIon non-ASCII under a non-UTF-8 locale.Testing
Validated locally with PDK 3.4.0:
## Linux specificsonly for a Linux-only module (lvm), both sections for a Linux+Windows module (concat), and the full Windows subsections (DSC / scheduled_task / native-ext / Litmus) for a Windows-supporting module.<%tags.🤖 Generated with Claude Code