rb:init

A setup workflow for a Ruby, Rails, and Grape development add-on that detects the project stack and records project-specific notes in CLAUDE.md.

In plain words
What is it for?
Use it when first configuring the add-on or updating its project notes so later planning, coding, checking, and review follow the repository's setup.
Why use it?
It gives the coding agent the context it needs about the project's queues, database layer, and folder structure.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/slbug/claude-ruby-grape-rails/init
Any agent
npx skills add slbug/claude-ruby-grape-rails --skill init
Clone the repo
git clone --depth 1 https://github.com/slbug/claude-ruby-grape-rails

Made for: Claude Code, Codex.

Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,591 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00048 $0.03591
Opus 5 $0.00024 $0.01795
Sonnet 5 $0.00010 $0.00718
Haiku 4.5 $0.00005 $0.00359

Measured 2d ago against content hash e0a3d56cd0e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

rb:init scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

in `~/.claude/settings.json`:
plugins/ruby-grape-rails/skills/init/SKILL.md · 284 lines

How it starts

The opening of the file, as written. The whole thing — 284 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Plugin Initialization

Write a managed block of project-specific stack notes into the project's CLAUDE.md. Do NOT write Iron Laws or Advisory Preferences into CLAUDE.mdinject-rules.sh delivers them at runtime on SessionStart + SubagentStart.

Block-reach contract:

Consumer Sees CLAUDE.md block?
Main session (interactive Claude) YES
Subagent spawned WITHOUT omitClaudeMd: true YES
Specialist subagent with omitClaudeMd: true (most reviewers/analyzers) NO — relies on inject-rules.sh SubagentStart for Iron Laws + Preferences only; no stack notes

Plan the block content for main-session skill bodies (/rb:plan, /rb:review, /rb:verify, /rb:work). Do NOT inject content needed by specialist subagents into this block; surface it through their per-agent prompt or the inject-rules.sh runtime payload.

Usage

  • /rb:init — Fresh install
  • /rb:init --update — Update existing managed block

Detect the Stack

Check the project before writing anything.

Detection rules:

  1. Always run ${CLAUDE_PLUGIN_ROOT}/bin/detect-stack first.
  2. Prefer exact *_VERSION values from that script when writing the managed-block header.
  3. Use plain detected only as a last resort when a direct gem is present but no resolved lockfile version is available.
  4. Never use broad substring regexes like /rails \(([^)]+)\)/ against raw Gemfile.lock; they can falsely match gems such as rubocop-rails.
  5. Read these detector keys before deciding what ORM/package guidance to inject:
    • ORM: DETECTED_ORMS, PRIMARY_ORM
    • Rails shape: RAILS_COMPONENTS, FULL_RAILS_APP
    • Ruby: RUBY_VERSION (placeholder source). INTERPRETER_RUBY_VERSION is informational only — emitted when interpreter differs from project pin.
    • Packages: PACKAGE_LAYOUT, PACKAGE_LOCATIONS, HAS_PACKWERK, PACKAGE_QUERY_NEEDED
  6. If PACKAGE_QUERY_NEEDED=true, ask the user: No Packwerk detected. Do you have something similar implemented? Provide modules/packages location and their stack/ORM.
  7. If DETECTED_ORMS contains BOTH active_record AND sequel (mixed-ORM repo), run the MIXED_ORM_SECTION interview (per ${CLAUDE_SKILL_DIR}/references/conditional-sections.md § "MIXED_ORM_SECTION") regardless of PACKAGE_QUERY_NEEDED value. detect-stack does NOT emit per-package ORM ownership — interview is the only source. Skip when only one ORM detected.
  8. Do not reimplement stack detection inline in chat or ad-hoc Ruby snippets. detect-stack is the source of truth.
  9. If ${CLAUDE_PLUGIN_ROOT}/bin/detect-stack is missing or fails, STOP and explain that plugin stack detection is unavailable instead of inventing a fallback parser.

Read the full file on GitHub · 284 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 284 lines · 48 tokens per session scan B e0a3d56cd0e6

Subscribe to this mod's changes

rb:init is a skill published in the GitHub repository slbug/claude-ruby-grape-rails (7 stars, last pushed 3d ago), licensed MIT. It adds 48 tokens to every session and 3,591 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.