From b5b231eb29d9dc4233bc98c509ab604e0e3bbd95 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Tue, 28 Jul 2026 09:29:31 -0700 Subject: [PATCH 1/7] Add .claude skills and MCP config from rails_template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pull the `.claude` tree from sethherr/rails_template and adapt each skill to this app: pr (+ /pr command), frontend-screenshots, github-upload-image-to-pr, frontend-conventions, rspec-testing, integration-testing, merge-conflicts, and sandbox-test-setup. Every concrete claim was verified against this codebase — the template's seeded users, `Form::Combobox`, `amount_display`, site footer, and `spec/integration/` don't exist here, so those sections were corrected or removed. Also register the playwright MCP server via .mcp.json, and narrow the .gitignore entry from `.claude/*` to `.claude/settings.local.json` so the skills are actually tracked. Co-Authored-By: Claude --- .claude/commands/pr.md | 6 + .claude/settings.json | 3 + .claude/skills/frontend-conventions/SKILL.md | 86 +++++ .claude/skills/frontend-screenshots/SKILL.md | 91 +++++ .../skills/github-upload-image-to-pr/SKILL.md | 184 +++++++++++ .../references/headless-relogin.md | 36 ++ .claude/skills/integration-testing/SKILL.md | 171 ++++++++++ .claude/skills/merge-conflicts/SKILL.md | 42 +++ .claude/skills/pr/SKILL.md | 91 +++++ .claude/skills/pr/references/screenshots.md | 96 ++++++ .claude/skills/rspec-testing/SKILL.md | 197 +++++++++++ .claude/skills/sandbox-test-setup/SKILL.md | 310 ++++++++++++++++++ .../sandbox-test-setup/assets/cdn_server.py | 34 ++ .gitignore | 3 +- .mcp.json | 14 + agents.md | 17 +- 16 files changed, 1377 insertions(+), 4 deletions(-) create mode 100644 .claude/commands/pr.md create mode 100644 .claude/settings.json create mode 100644 .claude/skills/frontend-conventions/SKILL.md create mode 100644 .claude/skills/frontend-screenshots/SKILL.md create mode 100644 .claude/skills/github-upload-image-to-pr/SKILL.md create mode 100644 .claude/skills/github-upload-image-to-pr/references/headless-relogin.md create mode 100644 .claude/skills/integration-testing/SKILL.md create mode 100644 .claude/skills/merge-conflicts/SKILL.md create mode 100644 .claude/skills/pr/SKILL.md create mode 100644 .claude/skills/pr/references/screenshots.md create mode 100644 .claude/skills/rspec-testing/SKILL.md create mode 100644 .claude/skills/sandbox-test-setup/SKILL.md create mode 100644 .claude/skills/sandbox-test-setup/assets/cdn_server.py create mode 100644 .mcp.json diff --git a/.claude/commands/pr.md b/.claude/commands/pr.md new file mode 100644 index 00000000..f15e41da --- /dev/null +++ b/.claude/commands/pr.md @@ -0,0 +1,6 @@ +--- +description: Create or update a pull request (delegates to the `pr` skill) +allowed-tools: Skill +--- + +Invoke the `pr` skill to handle this request. The skill covers both creating a new PR and updating an existing one's description, including frontend screenshot capture when the diff warrants it. diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 00000000..9e4442c7 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,3 @@ +{ + "enabledMcpjsonServers": ["playwright"] +} diff --git a/.claude/skills/frontend-conventions/SKILL.md b/.claude/skills/frontend-conventions/SKILL.md new file mode 100644 index 00000000..62df5c96 --- /dev/null +++ b/.claude/skills/frontend-conventions/SKILL.md @@ -0,0 +1,86 @@ +--- +name: frontend-conventions +description: >- + Frontend conventions for this project — the `Form::Group`/`Form::Input` + components for form fields, the `twlink` class for basic links, the + `number_display` helper for numbers, the `UI::Time::Component` for times, + the UI component library rule (buttons are `UI::Button`/`UI::ButtonLink` + — check `app/components/ui/` and `app/components/form/` before + hand-rolling markup), the shared collapse helpers for showing/hiding + elements, and ViewComponent rules (keyword arguments, instance + variables, `helpers.` prefix in templates). Trigger when adding or modifying views + (`.html.erb`), view components, Stimulus controllers, Tailwind classes, + or any frontend code that touches styling or interactivity. **Also + trigger before any `mcp__playwright__browser_take_screenshot` call** — + this skill defines the required `tmp/` filename rule so screenshots + don't land in the project root. Stimulus.js is the JavaScript framework. +--- + +# Frontend conventions + +This project uses **Stimulus.js** for JavaScript interactivity and **Tailwind CSS** for styling. + +The `bin/dev` command runs `bin/rails tailwindcss:watch` (see `Procfile.dev`) to build and update Tailwind CSS. JS is served directly via importmap (`config/importmap.rb`, `app/javascript/`) — there's no separate JS build step. + +**Format ERB before committing.** After editing any `.html.erb`, run `bin/lint ` — it runs `herb-format`, which reflows long `class` attributes and normalizes ERB. CI does *not* run the herb steps (`.github/workflows/ci.yml` only calls `standardrb`, `rubocop`, and `bin/brakeman`), so unformatted ERB won't fail the build — run `bin/lint` anyway to keep formatting consistent. It needs `yarn install` to have run, since the herb tools come from `devDependencies`. + +## Standard classes and helpers + +- Form fields should be rendered through `Form::Group::Component` (label + input, `app/components/form/group`) or `Form::Input::Component` directly (`app/components/form/input`) — not hand-rolled ``/`