Skip to content

Commit 9925c4a

Browse files
committed
Add localized referenced to symlinked files
1 parent ee5d99d commit 9925c4a

6 files changed

Lines changed: 1212 additions & 6 deletions

File tree

skills/build-strata-application-form/SKILL.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Extends an existing Strata Rails app (typically scaffolded by the `build-strata-
1111

1212
**Scope (currently):** application forms only. Other Strata features (cases, business processes, tasks) are out of scope for this skill.
1313

14-
**TDD is mandatory.** Every step that produces or modifies Ruby code (model, migration, controller, views, routes) must follow the `test-driven-development` skill: write a failing RSpec spec, run `make test` to watch it fail, write minimal Ruby, run `make test` to watch it pass, then `make lint`. Generator output (model stubs, migration stubs, scaffold view specs) is NOT a substitute — replace generator-stub specs with real failing specs before adding behavior. See [`references/test-driven-development.md`](../../references/test-driven-development.md).
14+
**TDD is mandatory.** Every step that produces or modifies Ruby code (model, migration, controller, views, routes) must follow the `test-driven-development` skill: write a failing RSpec spec, run `make test` to watch it fail, write minimal Ruby, run `make test` to watch it pass, then `make lint`. Generator output (model stubs, migration stubs, scaffold view specs) is NOT a substitute — replace generator-stub specs with real failing specs before adding behavior. See [`references/test-driven-development.md`](references/test-driven-development.md).
1515

1616
## Step 1: Confirm intent
1717

@@ -84,7 +84,7 @@ Save the chosen flag as `<AGENT_FLAG>` (may be empty).
8484

8585
Before installing any gems, confirm the active Ruby matches what the project requires. Mismatched Ruby is a common cause of confusing `bundle install` failures.
8686

87-
**Follow the shared reference: [`references/ruby-version-check.md`](../../references/ruby-version-check.md)** (relative to the repo root of this skills repository).
87+
**Follow the shared reference: [`references/ruby-version-check.md`](references/ruby-version-check.md)**.
8888

8989
It walks through:
9090

@@ -223,7 +223,7 @@ Loop back to Step 9 if attribute changes are needed. Only proceed once every che
223223
- Required-attribute validations the rule file specifies
224224
- Status transitions (`in_progress``submitted`) and the immutability rule (no edits after `submitted`)
225225

226-
Run `make test` and confirm these specs **fail** (model doesn't exist yet). See [`references/test-driven-development.md`](../../references/test-driven-development.md) — do not skip the watch-it-fail step.
226+
Run `make test` and confirm these specs **fail** (model doesn't exist yet). See [`references/test-driven-development.md`](references/test-driven-development.md) — do not skip the watch-it-fail step.
227227

228228
**10e. Generate the model:**
229229

@@ -285,7 +285,7 @@ Save the answer as `<ENTRY_POINT>`. Do not invent — if the user is unclear, as
285285

286286
## Step 13: Generate views and wire up the entry point (TDD)
287287

288-
Follow the **generated `application_form` rule file's recipe** for views (controllers, views, routes). Apply TDD throughout — see [`references/test-driven-development.md`](../../references/test-driven-development.md).
288+
Follow the **generated `application_form` rule file's recipe** for views (controllers, views, routes). Apply TDD throughout — see [`references/test-driven-development.md`](references/test-driven-development.md).
289289

290290
**13a. Write failing request and system specs FIRST.** Cover at least:
291291

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Ruby Version Check (shared reference)
2+
3+
**Purpose:** verify the active Ruby matches what a Rails project requires before installing gems or running generators. Mismatched Ruby is a common cause of confusing `bundle install` and `bin/rails` failures.
4+
5+
**Used by:** any skill that touches a Rails project's gems, runs Rails generators, or runs `make test` / `make lint`. Reference this file from `<RAILS_DIR>` (the located Rails app directory) — all paths below are relative to it.
6+
7+
## Step A: Determine the required version
8+
9+
Check, in order:
10+
11+
1. `<RAILS_DIR>/.ruby-version` (one line, e.g. `3.3.4`)
12+
2. `<RAILS_DIR>/Gemfile` for a `ruby "X.Y.Z"` line
13+
3. `<RAILS_DIR>/.tool-versions` for a `ruby X.Y.Z` line (asdf)
14+
15+
Save the required version as `<REQUIRED_RUBY>`. If none of those files specify a Ruby version, skip the rest — there is no version to enforce.
16+
17+
## Step B: Compare against the active Ruby
18+
19+
```sh
20+
ruby -v
21+
```
22+
23+
If the major.minor.patch matches `<REQUIRED_RUBY>` → done. Continue with the calling skill.
24+
25+
If it does not match → continue to Step C.
26+
27+
## Step C: Ask which version manager the user uses
28+
29+
> **Your active Ruby is `<active>` but the project requires `<REQUIRED_RUBY>`. Which Ruby version manager do you use? (rbenv / asdf / rvm / chruby / other)**
30+
31+
## Step D: Switch to the required version
32+
33+
First check whether the version is installed; if not, install it. Then activate it.
34+
35+
| Manager | Check installed | Install if missing | Activate |
36+
|---------|-----------------|--------------------|----------|
37+
| **rbenv** | `rbenv versions \| grep -q <REQUIRED_RUBY>` | `rbenv install <REQUIRED_RUBY>` | `rbenv local <REQUIRED_RUBY>` (run inside `<RAILS_DIR>`) |
38+
| **asdf** | `asdf list ruby \| grep -q <REQUIRED_RUBY>` | `asdf install ruby <REQUIRED_RUBY>` | `asdf local ruby <REQUIRED_RUBY>` (run inside `<RAILS_DIR>`) |
39+
| **rvm** | `rvm list strings \| grep -q <REQUIRED_RUBY>` | `rvm install <REQUIRED_RUBY>` | `rvm use <REQUIRED_RUBY>` |
40+
| **chruby** | `chruby \| grep -q <REQUIRED_RUBY>` | install via `ruby-install <REQUIRED_RUBY>` (tell user if `ruby-install` is missing) | `chruby <REQUIRED_RUBY>` |
41+
| **other / unsure** ||| Stop. Ask the user to switch manually, then confirm before continuing. |
42+
43+
Notes:
44+
45+
- `rbenv install` / `asdf install ruby` may take several minutes (compiling Ruby). Tell the user before running.
46+
- After activating, **re-run `ruby -v`** to confirm. If still mismatched (shell hasn't picked up the new version), stop and ask the user to open a new shell or `source` their rc file.
47+
- Do not run `sudo` for any of these — version managers are per-user.
48+
49+
## Step E: Verify Bundler is available
50+
51+
```sh
52+
bundle -v
53+
```
54+
55+
If `bundle` is missing → `gem install bundler`. Then continue with the calling skill.
56+
57+
## Common pitfalls
58+
59+
| Problem | Fix |
60+
|---------|-----|
61+
| `ruby -v` still old after `rbenv local` | Open a new shell, or run `eval "$(rbenv init -)"` in current shell |
62+
| `asdf install ruby <ver>` fails with build errors | User missing build deps (openssl, readline). Direct them to asdf-ruby README. |
63+
| Multiple version managers installed (e.g. rbenv + asdf) | Ask which one is authoritative; mixing causes silent shadowing |
64+
| `.ruby-version` and `Gemfile` disagree | `.ruby-version` wins for the version manager; Gemfile `ruby` line is enforced by Bundler. Ask user to reconcile. |

0 commit comments

Comments
 (0)