-
Notifications
You must be signed in to change notification settings - Fork 0
Add CLAUDE.md with codebase documentation for AI assistants #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,106 @@ | ||||||
| # CLAUDE.md — DevOops | ||||||
|
|
||||||
| ## Project Overview | ||||||
|
|
||||||
| DevOops is a Ruby gem that serves as a shell snippets/scripts manager. It helps developers organize, create, edit, run, and remove custom shell scripts via a CLI. Scripts are stored as JSON configuration files (defining arguments) paired with `.sh` body files. | ||||||
|
|
||||||
| - **Author:** Denis "Zaratan" Pasin | ||||||
| - **License:** MIT | ||||||
| - **Ruby version:** >= 2.6.0 (configured for 3.0 in `.ruby-version`) | ||||||
| - **CLI framework:** Thor | ||||||
| - **Autoloader:** Zeitwerk | ||||||
|
|
||||||
| ## Repository Structure | ||||||
|
|
||||||
| ``` | ||||||
| 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 | ||||||
| ``` | ||||||
|
|
||||||
| ## Development Commands | ||||||
|
|
||||||
| ```bash | ||||||
| # Install dependencies | ||||||
| bundle install | ||||||
| yarn install # For Prettier Ruby plugin | ||||||
|
|
||||||
| # Run tests | ||||||
| bundle exec rspec | ||||||
|
|
||||||
| # Run linter | ||||||
| bundle exec rubocop | ||||||
|
|
||||||
| # Check formatting | ||||||
| yarn prettier -c '**/*.rb' | ||||||
|
|
||||||
| # Default rake task (runs rspec) | ||||||
| bundle exec rake | ||||||
|
|
||||||
| # Interactive console | ||||||
| bin/console | ||||||
|
|
||||||
| # Run locally during development | ||||||
| bin/local_do | ||||||
| ``` | ||||||
|
|
||||||
| ## CI Checks (must pass before merge) | ||||||
|
|
||||||
| The CI pipeline (GitHub Actions) runs on Ruby 2.6, 2.7, and 3.0: | ||||||
|
|
||||||
| 1. **Linting:** `bundle exec rubocop` | ||||||
| 2. **Tests:** `bundle exec rspec` | ||||||
| 3. **Formatting:** `yarn prettier -c '**/*.rb'` | ||||||
|
|
||||||
| 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. | ||||||
|
|
||||||
|
Comment on lines
+72
to
+73
|
||||||
| ## Code Conventions | ||||||
|
|
||||||
| - **Frozen string literals:** Every Ruby file starts with `# frozen_string_literal: true` | ||||||
| - **Module structure:** All code lives under the `DevOops` module. Commands live in `DevOops::Commands` | ||||||
| - **File naming:** `snake_case.rb` — class naming: `PascalCase` | ||||||
| - **Constants:** `UPPER_CASE` (e.g., `GLOBAL_DIR`, `FORBIDDEN_NAMES`) | ||||||
| - **Linter style:** Relaxed Ruby Style + RuboCop Performance + Prettier | ||||||
| - **No monkey patching** in specs (configured in `spec_helper.rb`) | ||||||
|
|
||||||
| ## Architecture Notes | ||||||
|
|
||||||
| - **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. | ||||||
|
||||||
| - **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. |
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot
AI
Feb 13, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repository tree lists
lib/dev_oops/dev_oops.rb, but in this repo the gem entrypoint islib/dev_oops.rb(top-level underlib/). Updating this section will prevent readers from looking for a non-existent file/path.