Repository navigation
Add rolemodel:agent_docs and run it from core_setup - #233
Merged
Merged
Conversation
New apps start with AGENTS.md, a conventions index with 14 convention files, Copilot instructions pointing at them, and the surface_conventions hook that shows Claude Code the conventions matching each file it edits. The conventions were filtered from the Compass agent-docs port down to the rules every RoleModel app should start with. The hook is downloaded from RoleModel/skills' scaffold-docs skill so there is one copy to maintain. Also lists controller-patterns in the README's skills table, which #232 missed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds
rolemodel:agent_docsand runs it fromrolemodel:core_setup(androlemodel:all), so a new app starts with agent instructions and a set of conventions.What it writes
AGENTS.md, withCLAUDE.mdset to@AGENTS.md. It has a "How We Build" section (smallest change, make the change easy first, think like a Rubyist, root causes, testability, names over comments), the "Before Editing" rules, and the Verification commands core_setup's tools provide. The first sentence is a placeholder for the team to fill in.docs/CONVENTIONS.md: a one-line introduction and an index of 14 conventions, each with a<!-- paths: -->glob.docs/conventions/*.md: controllers (which sends agents to thecontroller-patternsskill), logic in models, guarded callbacks, string enums, scopes, no SQL strings, eager loading, views and forms, partial locals, Turbo before Stimulus, migrations, test layers, reproduce the bug, and system spec assertions..github/instructions/conventions.instructions.md, which points Copilot, including code review, at the conventions. There's nocopilot-instructions.md, because Copilot code review readsAGENTS.mdandCLAUDE.mddirectly..claude/hooks/surface_conventions.rb, registered in.claude/settings.json. It's downloaded fromRoleModel/skills'scaffold-docsskill so there's one copy to maintain. Because it followsmain, an upstream change reaches new apps without a gem release.Where the conventions came from
They started from the agent-docs port in RoleModel/compass#458, the original commit with 22 convention files, and were reviewed one at a time. Files specific to Compass, files the
controller-patternsskill already covers, and rules RuboCop can enforce were dropped; the rest were made generic. The RuboCop half of that work shipped in #232.Verification
AGENTS.md, that the hook is executable and registered, and that the index lists exactly the convention files installed.core_setupandallgenerator specs pass.Also adds
controller-patternsto the README's skills table forcore_setup, which #232 missed.🤖 Generated with Claude Code