|
| 1 | +# Contentstack Utils Ruby – Agent guide |
| 2 | + |
| 3 | +**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**. |
| 4 | + |
| 5 | +## What this repo is |
| 6 | + |
| 7 | +| Field | Detail | |
| 8 | +|--------|--------| |
| 9 | +| **Name:** | [contentstack/contentstack-utils-ruby](https://github.com/contentstack/contentstack-utils-ruby) | |
| 10 | +| **Purpose:** | Ruby gem that renders Contentstack rich text and JSON RTE (including GraphQL-shaped payloads) to HTML, with pluggable rendering via `ContentstackUtils::Model::Options` subclasses. | |
| 11 | +| **Out of scope (if any):** | This package does not ship an HTTP client or stack SDK; it pairs with the separate Contentstack Ruby delivery client for entry data and `_embedded_items`. | |
| 12 | + |
| 13 | +## Tech stack (at a glance) |
| 14 | + |
| 15 | +| Area | Details | |
| 16 | +|------|---------| |
| 17 | +| Language | Ruby **≥ 3.1** (see `contentstack_utils.gemspec` and `.ruby-version` for local dev) | |
| 18 | +| Build | **Bundler** + **RubyGems**; `contentstack_utils.gemspec`, `Gemfile` | |
| 19 | +| Tests | **RSpec**; specs under `spec/**/*_spec.rb`, loaded via `spec/spec_helper.rb` | |
| 20 | +| Lint / coverage | No RuboCop in-repo; **SimpleCov** in `spec/spec_helper.rb`; API docs via **YARD** (`.yardopts`, `rake yard`) | |
| 21 | +| Runtime deps | **activesupport** (7.x), **nokogiri** (HTML / XML for legacy RTE strings) | |
| 22 | + |
| 23 | +## Commands (quick reference) |
| 24 | + |
| 25 | +| Command type | Command | |
| 26 | +|--------------|---------| |
| 27 | +| Install deps | `bundle install` | |
| 28 | +| Build (default task) | `bundle exec rake` (runs **spec**) | |
| 29 | +| Test | `bundle exec rake spec` or `bundle exec rspec` | |
| 30 | +| Docs | `bundle exec rake yard` | |
| 31 | + |
| 32 | +**CI / automation:** There is no dedicated workflow that runs `rspec` on every push; local verification is `bundle exec rake`. Other workflows include branch checks (PRs into `master`), release publish, CodeQL, policy/SCA scans—see `.github/workflows/`. |
| 33 | + |
| 34 | +## Where the documentation lives: skills |
| 35 | + |
| 36 | +| Skill | Path | What it covers | |
| 37 | +|-------|------|----------------| |
| 38 | +| Code review | `skills/code-review/SKILL.md` | PR checklist for this gem | |
| 39 | +| Contentstack Utils SDK | `skills/contentstack-utils/SKILL.md` | Public API, models, CDA vs GQL paths, versioning | |
| 40 | +| Development workflow | `skills/dev-workflow/SKILL.md` | Branches, Bundler/Rake, gem build, workflows | |
| 41 | +| Framework & packaging | `skills/framework/SKILL.md` | Gemspec, dependencies, Ruby version, release | |
| 42 | +| Ruby style and layout | `skills/ruby-style/SKILL.md` | Module layout, naming, matching existing code | |
| 43 | +| Testing | `skills/testing/SKILL.md` | RSpec layout, mocks, SimpleCov, WebMock | |
| 44 | + |
| 45 | +An index with “when to use” hints is in `skills/README.md`. |
| 46 | + |
| 47 | +## Using Cursor (optional) |
| 48 | + |
| 49 | +If you use **Cursor**, **`.cursor/rules/README.md`** is the only file under `.cursor/rules`; it points to **`AGENTS.md`**—same docs as everyone else. |
0 commit comments