Replication Driven Research
brycewang-stanford/Auto-Empirical-Research-Skills
A skill your agent uses when starting empirical analysis, creating a data pipeline, generating results, or when data or model specifications change.
Build a new read model following project conventions (event handlers, tests, migration, configuration)
$ npx skills add RailsEventStore/ecommerce --skill read-model -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install RailsEventStore/ecommerce read-model --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/read-model .claude/skills/read-model && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .claude/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-modelType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add RailsEventStore/ecommerce --skill read-model -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install RailsEventStore/ecommerce read-model --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/read-model .agents/skills/read-model && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .agents/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add RailsEventStore/ecommerce --skill read-model -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install RailsEventStore/ecommerce read-model --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/read-model .cursor/skills/read-model && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .cursor/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/RailsEventStore/ecommerce.git --path .claude/skills/read-model--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add RailsEventStore/ecommerce --skill read-model -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install RailsEventStore/ecommerce read-model --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/read-model .gemini/skills/read-model && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .gemini/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install RailsEventStore/ecommerce read-modelInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add RailsEventStore/ecommerce --skill read-model -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/read-model .github/skills/read-model && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .github/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add RailsEventStore/ecommerce --skill read-model -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install RailsEventStore/ecommerce read-model --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/RailsEventStore/ecommerce.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/read-model .opencode/skills/read-model && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "read-model" agent skill from https://github.com/RailsEventStore/ecommerce/tree/master/.claude/skills/read-model into .opencode/skills/read-model/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "read-model", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
read-modelBuild a new read model following project conventions (event handlers, tests, migration, configuration)
Read Model is an agent skill from RailsEventStore/ecommerce. Build a new read model following project conventions (event handlers, tests, migration, configuration)
Its SKILL.md is about 3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Testing & QA. The repository describes itself as: Application with CQRS and Event Sourcing built on Rails and Rails Event Store. The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 42c6c23. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
railsmakebundleFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Read Model loads about 3k tokens when it runs. Until then it costs about 28 tokens; SKILL.md has 1,060 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from RailsEventStore/ecommerce at commit 42c6c23, republished under its MIT licence (© RailsEventStore). 1,060 words, ~3,005 tokens.
.claude/skills/read-model/SKILL.md (or your agent's skills folder).Use this skill when asked to create a new read model or add event handlers to an existing read model in any Rails application under apps/.
Determine which app the read model belongs to. Default is apps/rails_application/ unless the user specifies another app (e.g. apps/crm/, apps/todo_mvc/). All paths below are relative to the target app directory.
Before writing any code, clarify:
Feed vs PublicFeed, Timeline vs HomeTimeline), and renaming later touches the directory, module, test, cover/.mutant.yml entries, controller references and Configuration wiring. Propose one or two candidate names with a one-line rationale (what UI view / query it serves, and how it contrasts with sibling read models), then let the user confirm or override. Do not derive the name silently from the events or the feature description.Catalog::ProductAdded, Ordering::OrderPlaced)Create a single test file at test/{module_name}/{module_name}_test.rb (relative to the app directory).
Test file conventions:
# test/{module_name}/{module_name}_test.rb
require "test_helper"
module ModuleName
class ModuleNameTest < InMemoryTestCase
cover "ModuleName*"
def test_record_created
create_record(record_id)
assert_equal(1, ModuleName.facade_method(store_id).count)
end
def test_record_updated
create_record(record_id)
create_record(other_record_id)
update_record(record_id, "new value")
result = ModuleName.facade_method(store_id).find_by!(uid: record_id)
assert_equal("new value", result.attribute)
assert_nil(ModuleName.facade_method(store_id).find_by!(uid: other_record_id).attribute)
end
private
def event_store
Rails.configuration.event_store
end
def record_id
@record_id ||= SecureRandom.uuid
end
def other_record_id
@other_record_id ||= SecureRandom.uuid
end
def store_id
@store_id ||= SecureRandom.uuid
end
def create_record(rid, sid = store_id)
event_store.publish(DomainContext::RecordCreated.new(data: { record_id: rid }))
event_store.publish(Stores::RecordRegistered.new(data: { record_id: rid, store_id: sid }))
end
def update_record(rid, value)
event_store.publish(DomainContext::RecordUpdated.new(data: { record_id: rid, value: value }))
end
end
endTest rules:
InMemoryTestCasecover "ModuleName*" for mutation testingrails_application, override configure to load only the read model's own configuration:def configure(event_store, _command_bus)
ModuleName::Configuration.new.call(event_store)
endtodo_mvc), the full Configuration is loaded in before_setup — no override needed if the app only has a few read modelsevent_store.publish(event) to trigger handlersassert_equal(expected, actual) with parentheses alwaysStores::*Registered events for store assignment, Crm::CustomerRegistered before customer assignment, etc.create_record, register_customer) to express realistic event sequencesfind_by → Model.update! mutationsEcommerce::Configuration or Processes::Configuration to pass, that's a smell — the test is probably using run_command instead of publishing events directly, or the read model depends on another read model# db/migrate/YYYYMMDDHHMMSS_create_{table_name}.rb
class CreateTableName < ActiveRecord::Migration[8.0]
def change
create_table :{table_name} do |t|
t.uuid :some_uuid_column
t.string :name
t.decimal :amount
t.timestamps
end
end
endRun rails db:migrate after creating.
Everything goes in one file: app/read_models/{module_name}/configuration.rb. It contains:
private_constantThree patterns exist in the codebase:
Use when events require different handling logic. All handlers go in a single EventHandler class using case event.
# app/read_models/{module_name}/configuration.rb
module ModuleName
class Record < ApplicationRecord
self.table_name = "table_name"
end
private_constant :Record
def self.facade_method(store_id)
Record.where(store_id: store_id)
end
class EventHandler
def call(event)
case event
when DomainContext::RecordCreated
Record.create!(uid: event.data.fetch(:record_id))
when Stores::RecordRegistered
find_record(event).update!(store_id: event.data.fetch(:store_id))
when DomainContext::RecordUpdated
find_record(event).update!(attribute: event.data.fetch(:attribute))
end
end
private
def find_record(event)
Record.find_by!(uid: event.data.fetch(:record_id))
end
end
class Configuration
def call(event_store)
event_store.subscribe(EventHandler.new, to: [
DomainContext::RecordCreated,
Stores::RecordRegistered,
DomainContext::RecordUpdated
])
end
end
endinitialize)Use when the read model is a simple projection that copies event attributes to a single table.
# app/read_models/{module_name}/configuration.rb
module ModuleName
class Record < ApplicationRecord
self.table_name = "table_name"
end
private_constant :Record
def self.facade_method(id)
Record.where(some_column: id)
end
class Configuration
def initialize(event_store)
@read_model = SingleTableReadModel.new(event_store, Record, :record_id)
@event_store = event_store
end
def call
@read_model.subscribe_create(DomainContext::RecordCreated)
@read_model.subscribe_copy(DomainContext::NameSet, :name)
@read_model.subscribe_copy(DomainContext::PriceSet, :price)
end
end
endSome older read models still use one class per event type in separate files. When modifying these, prefer consolidating into Pattern A.
event.data.fetch(:key), never event.data[:key] or event[:key]case event — no separate files per event typefind_by! for record lookups — records must exist because events follow the real application flow (e.g., OfferDrafted always comes before OrderRegistered)find_by with &. safe navigation — this hides bugs. If a record is missing, it means the test or event flow is wrong, not that the handler should silently skipreturn unless record guards — use find_by! insteadfind_* methods as private helpers for reusabilityWhen a read model copies data from one entity into another table (e.g., customer name into an order header), always store the entity's ID alongside the denormalized value. This allows updates by ID rather than by name or other mutable attributes.
customer_id) to the table that stores denormalized data, not just the display value (e.g., customer_name)Bad — matching by old name:
when Crm::CustomerRenamed
old_name = customer.name
customer.update!(name: event.data.fetch(:name))
Deal.where(customer_name: old_name).update_all(customer_name: event.data.fetch(:name))Good — matching by ID:
when Crm::CustomerRenamed
Customer.find_by!(customer_id: event.data.fetch(:customer_id)).update!(name: event.data.fetch(:name))
Deal.where(customer_id: event.data.fetch(:customer_id)).update_all(customer_name: event.data.fetch(:name))Add the read model to lib/configuration.rb:
For Pattern A:
def enable_{module_name}_read_model(event_store)
ModuleName::Configuration.new.call(event_store)
endFor Pattern B:
def enable_{module_name}_read_model(event_store)
ModuleName::Configuration.new(event_store).call
endCall the method from def call(event_store, command_bus).
Add the module to the app's .mutant.yml under matcher.subjects:
matcher:
subjects:
- ModuleName*Add ModuleName::Configuration#call and ModuleName::Rendering::* to matcher.ignore.
Run in this order:
rails test test/{module_name}/ - unit tests for the new read modelrails test test/integration/ - integration tests still passmake test - all tests greenRAILS_ENV=test bundle exec mutant run "ModuleName*" - 100% mutation scorereturn unless guards — always use find_by!, never find_by with &.EntityName with entity_uid + name). This keeps the read model self-contained. Another approach worth considering is a SummaryEvent — an event built from other events that carries all the necessary data, so the read model handler receives everything it needs in a single event without any lookups.private_constant for ActiveRecord classescase event routing — all in configuration.rb© RailsEventStore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/read-model of RailsEventStore/ecommerce.
Open the folder on GitHubat commit 42c6c23
Read Model next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Read Model this skillRailsEventStore/ecommerce | 507 | — | ~3k | Automated safety check: Pass | MIT | |
| Replication Driven Researchbrycewang-stanford/Auto-Empirical-Research-Skills | 4.5k | — | ~1.7k | Automated safety check: Pass | Custom licence | |
| Web Application Testinganthropics/skills | 180k | 51 repos | ~966 | Automated safety check: Pass | Apache-2.0 | |
| Diagnosing Bugsfossasia/eventyay-interpretation | 1.6k | 32 repos | ~2.1k | Automated safety check: Pass | Apache-2.0 | |
| TDDpietheinstrengholt/rssmonster | 564 | 30 repos | ~906 | Automated safety check: Pass | MIT | |
| MongoDB Source Connector E2E Harnessairbytehq/airbyte | 22k | — | ~1.9k | Automated safety check: Pass | Custom licence |
brycewang-stanford/Auto-Empirical-Research-Skills
A skill your agent uses when starting empirical analysis, creating a data pipeline, generating results, or when data or model specifications change.
anthropics/skills
Tests local web applications with Python Playwright scripts, checking frontend behavior, capturing screenshots and reading browser console logs.
fossasia/eventyay-interpretation
Diagnosis loop for hard bugs and performance regressions. An agent skill from fossasia/eventyay-interpretation.
pietheinstrengholt/rssmonster
Test-driven development. An agent skill from pietheinstrengholt/rssmonster.
airbytehq/airbyte
Starts a throwaway MongoDB 7.0 replica set and runs the Airbyte spec, check, discover and read commands against source-mongodb-v2 images for local end-to-end testing.
airbytehq/airbyte
Stands up a throwaway local SQL Server 2022 backend, applies SQL fixtures and runs Airbyte spec, check, discover and read against source-mssql images.
RailsEventStore/ecommerce
Create atomic git commits following project conventions. An agent skill from RailsEventStore/ecommerce.
RailsEventStore/ecommerce
Create a controller with commands, read model queries, routes, and integration tests
RailsEventStore/ecommerce
Create a new domain bounded context with aggregates, commands, events, and handlers
RailsEventStore/ecommerce
Scaffold a new Rails app with event sourcing, following project conventions (todomvc as reference)
RailsEventStore/ecommerce
Plan a new feature end-to-end — impact analysis across all layers, start-from-the-middle slicing into deployable steps, then delegating to /domain, /read-model, /controller skills
RailsEventStore/ecommerce
Upgrade Rails framework to a newer version following the smooth upgrade methodology
Categories
Build a new read model following project conventions (event handlers, tests, migration, configuration). Read Model is an agent skill from RailsEventStore/ecommerce.
Read Model fits situations like: testing & QA work in your project.
Run `npx skills add RailsEventStore/ecommerce --skill read-model -a claude-code`. Or copy the skill folder (.claude/skills/read-model in RailsEventStore/ecommerce) into .claude/skills/read-model in your project. Claude Code loads it when a task matches its description.
Run `npx skills add RailsEventStore/ecommerce --skill read-model -a codex`. Or copy the skill folder (.claude/skills/read-model in RailsEventStore/ecommerce) into .agents/skills/read-model in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RailsEventStore/ecommerce --skill read-model -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/read-model, .gemini/skills/read-model, .github/skills/read-model and .opencode/skills/read-model in your project.
Going by SKILL.md and its folder, Read Model needs the command-line tools its instructions call (rails, make and bundle).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Read Model is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Read Model: Replication Driven Research (brycewang-stanford/Auto-Empirical-Research-Skills, 4.5k stars), Web Application Testing (anthropics/skills, 180k stars), Diagnosing Bugs (fossasia/eventyay-interpretation, 1.6k stars) and TDD (pietheinstrengholt/rssmonster, 564 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
RailsEventStore (a GitHub organization) maintains it in RailsEventStore/ecommerce, which has 507 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 21, 2026.
Source: RailsEventStore/ecommerce on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.