Add CLAUDE.md with codebase documentation for AI assistants#8
Add CLAUDE.md with codebase documentation for AI assistants#8
Conversation
Covers project structure, development commands, CI checks, code conventions, architecture notes, and key dependencies. https://claude.ai/code/session_01TU6QNizdUvQe9WPdn7vXqG
There was a problem hiding this comment.
Pull request overview
Adds a new CLAUDE.md documentation file intended to orient AI assistants (and contributors) to the DevOops gem’s structure, workflows, conventions, and architecture.
Changes:
- Documented repository structure, development commands, and CI checks.
- Summarized code conventions and high-level architecture (Runner/ScriptsLoader, script storage, reserved names).
- Listed key dependencies and release/versioning notes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| lib/dev_oops/ | ||
| ├── dev_oops.rb # Module init, Zeitwerk setup, eager_load | ||
| ├── version.rb # VERSION constant (bump for releases) | ||
| ├── runner.rb # Thor CLI entry point, dynamic command registration | ||
| ├── scripts_loader.rb # Script discovery, config parsing, Thor::Group builders | ||
| └── commands/ | ||
| ├── edit_script.rb # Edit script JSON config | ||
| ├── edit_script_sh.rb # Edit script .sh body | ||
| ├── local_install.rb # Create local ./dev_oops directory | ||
| └── remove_script.rb # Remove a script | ||
| exe/ | ||
| └── dev_oops # Executable entry point | ||
| spec/ | ||
| └── dev_oops_spec.rb # RSpec tests | ||
| templates/ | ||
| └── empty_script.tt # JSON template for new scripts | ||
| bin/ | ||
| ├── setup # Install bundle dependencies | ||
| ├── console # IRB console with gem loaded | ||
| └── local_do # Local development runner |
There was a problem hiding this comment.
The repository tree lists lib/dev_oops/dev_oops.rb, but in this repo the gem entrypoint is lib/dev_oops.rb (top-level under lib/). Updating this section will prevent readers from looking for a non-existent file/path.
| lib/dev_oops/ | |
| ├── dev_oops.rb # Module init, Zeitwerk setup, eager_load | |
| ├── version.rb # VERSION constant (bump for releases) | |
| ├── runner.rb # Thor CLI entry point, dynamic command registration | |
| ├── scripts_loader.rb # Script discovery, config parsing, Thor::Group builders | |
| └── commands/ | |
| ├── edit_script.rb # Edit script JSON config | |
| ├── edit_script_sh.rb # Edit script .sh body | |
| ├── local_install.rb # Create local ./dev_oops directory | |
| └── remove_script.rb # Remove a script | |
| exe/ | |
| └── dev_oops # Executable entry point | |
| spec/ | |
| └── dev_oops_spec.rb # RSpec tests | |
| templates/ | |
| └── empty_script.tt # JSON template for new scripts | |
| bin/ | |
| ├── setup # Install bundle dependencies | |
| ├── console # IRB console with gem loaded | |
| └── local_do # Local development runner | |
| lib/ | |
| ├── dev_oops.rb # Gem entrypoint, Zeitwerk setup, eager_load | |
| └── dev_oops/ | |
| ├── version.rb # VERSION constant (bump for releases) | |
| ├── runner.rb # Thor CLI entry point, dynamic command registration | |
| ├── scripts_loader.rb # Script discovery, config parsing, Thor::Group builders | |
| └── commands/ | |
| ├── edit_script.rb # Edit script JSON config | |
| ├── edit_script_sh.rb # Edit script .sh body | |
| ├── local_install.rb # Create local ./dev_oops directory | |
| └── remove_script.rb # Remove a script | |
| exe/ | |
| └── dev_oops # Executable entry point | |
| spec/ | |
| └── dev_oops_spec.rb # RSpec tests | |
| templates/ | |
| └── empty_script.tt # JSON template for new scripts | |
| bin/ | |
| ├── setup # Install bundle dependencies | |
| ├── console # IRB console with gem loaded | |
| └── local_do # Local development runner |
| PRs to `main` also verify that `lib/dev_oops/version.rb` has been bumped. Pushes to `main` auto-publish to RubyGems if the version changed. | ||
|
|
There was a problem hiding this comment.
This CI description says PRs to main verify that lib/dev_oops/version.rb has been bumped, but the GitHub Actions workflow only performs the version-diff check/publish logic on pushes to main (release job). Please reword to match the actual workflow behavior.
|
|
||
| - Version is defined in `lib/dev_oops/version.rb` | ||
| - Bump the version there for any release | ||
| - CI verifies version changes on PRs to `main` and auto-publishes to RubyGems on merge |
There was a problem hiding this comment.
The Version & Release section repeats that CI verifies version changes on PRs to main, but the workflow currently checks for version changes only when running the release job on pushes to main. Please align this bullet with what CI actually does.
| - **Runner** (`runner.rb`): Main Thor CLI class. Registers built-in commands (`edit`, `edit_sh`, `rm`, `install`) and dynamically registers user-defined scripts discovered by `ScriptsLoader`. | ||
| - **ScriptsLoader** (`scripts_loader.rb`): Searches for `dev_oops/` directories from the current working directory up to `$HOME`. Loads JSON configs and builds Thor::Group subcommands for each script. Closest-to-cwd wins on name collisions. | ||
| - **Script storage:** Global scripts live in `~/.dev_oops/`. Local (project) scripts live in `./dev_oops/`. Each script has a `.json` config and a `.sh` body file. | ||
| - **Forbidden script names:** `help`, `install`, `edit`, `edit_sh`, `rm`, `local_install` — reserved for built-in commands. |
There was a problem hiding this comment.
The forbidden/reserved names list includes local_install, but the CLI registers the local directory creator under the install subcommand (and there is no local_install command registered in Runner). Consider clarifying whether local_install is a legacy alias/reserved name, or update the list to avoid confusion.
| - **Forbidden script names:** `help`, `install`, `edit`, `edit_sh`, `rm`, `local_install` — reserved for built-in commands. | |
| - **Forbidden script names:** `help`, `install`, `edit`, `edit_sh`, `rm` — reserved for built-in commands. The legacy alias name `local_install` is also reserved internally for backward compatibility and must not be used by user scripts, even though it is not exposed as a standalone CLI command. |
| | Gem | Purpose | | ||
| |-----|---------| | ||
| | `thor` | CLI framework | | ||
| | `zeitwerk` | Autoloading | | ||
| | `rspec` | Testing | | ||
| | `rubocop` | Linting | | ||
| | `prettier` | Code formatting (via Node + Ruby plugin) | |
There was a problem hiding this comment.
The Key Dependencies markdown table uses || at the start of each row/header, which renders as an extra empty column in standard Markdown. Use a single leading | for each row so the table formats correctly.
Covers project structure, development commands, CI checks,
code conventions, architecture notes, and key dependencies.
https://claude.ai/code/session_01TU6QNizdUvQe9WPdn7vXqG