|
| 1 | +# Contentstack Ruby SDK – 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-ruby](https://github.com/contentstack/contentstack-ruby) (Ruby gem `contentstack`) | |
| 10 | +| **Purpose:** | Ruby client for the Contentstack Content Delivery API (CDA): stack client, content types, entries, assets, queries, sync, and live preview. | |
| 11 | +| **Out of scope (if any):** | Management / write APIs and app-specific business logic live outside this gem. Rich-text rendering delegates to the `contentstack_utils` gem. | |
| 12 | + |
| 13 | +## Tech stack (at a glance) |
| 14 | + |
| 15 | +| Area | Details | |
| 16 | +| --- | --- | |
| 17 | +| Language | Ruby **≥ 3.3** (see `contentstack.gemspec` and `.ruby-version`; team uses **3.3.x** locally). | |
| 18 | +| Build | **Bundler** + **`contentstack.gemspec`**; `Gemfile` pulls the gemspec. | |
| 19 | +| Tests | **RSpec 3** under `spec/**/*_spec.rb`; **`spec/spec_helper.rb`** loads WebMock and SimpleCov. | |
| 20 | +| Lint / coverage | **SimpleCov** (via `spec_helper.rb`); HTML under `coverage/`. No RuboCop in this repo. **YARD** for API docs (see `rakefile.rb`, `.yardopts`). | |
| 21 | +| Runtime deps | `activesupport`, `contentstack_utils` (~> 1.2); `Gemfile` pins **nokogiri** for security alignment. | |
| 22 | + |
| 23 | +## Commands (quick reference) |
| 24 | + |
| 25 | +| Command type | Command | |
| 26 | +| --- | --- | |
| 27 | +| Install deps | `bundle install` | |
| 28 | +| Build gem | `gem build contentstack.gemspec` | |
| 29 | +| Test | `bundle exec rspec` | |
| 30 | +| Single file | `bundle exec rspec spec/path/to_spec.rb` | |
| 31 | +| Lint / format | No RuboCop or formatter in-repo; match existing `lib/` and `spec/` style. | |
| 32 | +| Docs (YARD) | `bundle exec rake yard` | |
| 33 | + |
| 34 | +**CI / automation:** `.github/workflows/check-branch.yml` (PR branch rules toward `master`), `.github/workflows/release-gem.yml` (publish on release), plus `codeql-analysis.yml`, `sca-scan.yml`, `policy-scan.yml`, `issues-jira.yml`. There is no dedicated “run RSpec on every PR” workflow in-repo—run tests locally before opening a PR. |
| 35 | + |
| 36 | +## Where the documentation lives: skills |
| 37 | + |
| 38 | +| Skill | Path | What it covers | |
| 39 | +| --- | --- | --- | |
| 40 | +| Dev workflow | `skills/dev-workflow/SKILL.md` | Branches, bundler, commands, release notes alignment. | |
| 41 | +| Ruby SDK (CDA) | `skills/contentstack-ruby-sdk/SKILL.md` | Public API, modules, errors, versioning, integration with `contentstack_utils`. | |
| 42 | +| Ruby style & layout | `skills/ruby-style/SKILL.md` | File layout, idioms, and conventions for this codebase. | |
| 43 | +| Testing | `skills/testing/SKILL.md` | RSpec, WebMock, fixtures, env vars, coverage. | |
| 44 | +| Code review | `skills/code-review/SKILL.md` | PR checklist and review expectations. | |
| 45 | +| Framework & packaging | `skills/framework/SKILL.md` | Bundler/gem packaging, HTTP stack (`Net::HTTP`), retries, optional proxy. | |
| 46 | + |
| 47 | +An index with “when to use” hints is in `skills/README.md`. |
| 48 | + |
| 49 | +## Using Cursor (optional) |
| 50 | + |
| 51 | +If you use **Cursor**, `.cursor/rules/README.md` only points to **`AGENTS.md`**—same docs as everyone else. |
0 commit comments