init: detect Ruby and runtime version pinning files#95
Draft
malmckay wants to merge 1 commit into
Draft
Conversation
Add Gemfile/gems.rb to Step 2 manifest discovery and a new Step 3 for runtime version pinning files (.ruby-version, .nvmrc, .python-version, .tool-versions, rust-toolchain.toml, mise.toml). Require generated rule files to include a "Runtime / Toolchain" section with the exact activation command (e.g. `rvm use $(cat .ruby-version)`) when a pinning file is present, so coding agents activate the pinned runtime before running language-specific tooling. Closes block#94
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #94.
What this changes
Two surgical edits to
src/templates/init_rule.md— the Goose recipe template thatai-rules inituses to scan a repo and draft its first rule file.Step 2 (manifests): add
Gemfile, gems.rbto the list and instruct the recipe to read theruby ""directive.Step 3 (new): "Detect runtime version pinning" — finds
.ruby-version,.nvmrc,.node-version,.python-version,.tool-versions,rust-toolchain.toml,mise.toml; cross-references with manifest declarations; and — if present — requires the generated rule file to include a "Runtime / Toolchain" section with the exact activation command.Adds "Runtime / Toolchain" to the recommended-sections list, with rationale: agents that skip this default to
/usr/bin/rubyand hit syntax / gem-resolution errors against modern Ruby code.Renumbers the existing Steps 4–7 to keep the sequence contiguous.
Why
The current template lists
package.json, Cargo.toml, go.mod, pyproject.toml, Makefile, ...but never mentions Ruby. Every Ruby service that runsai-rules initproduces anexample.mdwith no Ruby-version guidance, so agents default to system Ruby (often macOS 2.6.x) and fail on modern syntax.The same gap exists for any repo pinning Node/Python/Rust via a side-channel pinning file when the manifest itself doesn't carry the version.
Default version managers recommended
Picked to match the most common Block/macOS dev-environment setups:
.ruby-version.nvmrc/.node-version.python-version.tool-versionsrust-toolchain.tomlRecipe is instructed to detect what the user actually has on
$PATHviacommand -vand prefer that.Test plan
ai-rules initon a Ruby repo with.ruby-version→ generated file includes a "Runtime / Toolchain" section withrvm use $(cat .ruby-version)..nvmrc→ section recommendsnvm use..tool-versions+Gemfile) → section prefers asdf/mise and mentions both languages.Filing as draft for maintainer review of the template wording before promoting.