From 6cb19302ea0d1b67d4887e64dc8d296d4cbbbba9 Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Wed, 22 Jul 2026 14:02:15 +0200 Subject: [PATCH] fix(write-readme): read the R install path from evidence, not a default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit REFERENCE.md told a README reader to run renv::restore() on the host. For anything the R scaffolds produce that is wrong: renv::init() is the user's post-scaffold step, and renv::restore() then runs inside the image build (containerize-project/Dockerfile.r-*.tpl), so the reader's entry point is 'just build-dev' then 'just up'. The rule is now stated as evidence — justfile, Dockerfile, lockfile — with 'omit the section' as the fallback, since a bare restore is right only for a repo with a committed lockfile and no container. build-r-package pointed at a README 'Out of scope' heading that does not exist; it now names generic write-readme, which already covers r-package, and blueprint 001 for the dedicated skill. Blueprint 001 was sounded against the earlier, half-right reading and is corrected with it: the install clause now says what the Dockerfiles do, and the REFERENCE fix leaves its seam list and Out of scope, having landed here instead. Co-Authored-By: Claude Opus 4.8 --- OKF/blueprints/001-add-write-readme-r.md | 22 ++++++++++---------- skills/engineering/write-readme/REFERENCE.md | 8 ++++++- skills/scaffold/build-r-package/SKILL.md | 5 +++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/OKF/blueprints/001-add-write-readme-r.md b/OKF/blueprints/001-add-write-readme-r.md index eb09927..1fc5b30 100644 --- a/OKF/blueprints/001-add-write-readme-r.md +++ b/OKF/blueprints/001-add-write-readme-r.md @@ -30,11 +30,12 @@ A skill `skills/engineering/write-readme-r/` that: sections, license block — Apache-aware rich block, one-liner otherwise). - **Derives the install block from the project, never from a default.** - Both R scaffolds run every recipe through `docker compose run --rm - dev` and ship no `renv.lock`, so `renv::restore()` is wrong for them; - `write-readme/REFERENCE.md:38` prescribing it is drift this blueprint - corrects rather than copies. Read the justfile and the presence of a - lockfile; no evidence → omit the section and say so. + Scaffolded R projects run through `docker compose`, and their + `renv::restore()` happens at image build + (`containerize-project/Dockerfile.r-*.tpl`), so a README telling a + reader to restore on the host is wrong — the entry point is + `just build-dev` → `just up`. Read the justfile, the Dockerfile and + the lockfile; no evidence → omit the section. - Refuses to invent: empty Description → ask; no fabricated deps, recipes, authors, or URLs. Omits sections lacking source data. - Guards an existing README.md (diff + explicit confirmation). @@ -46,11 +47,10 @@ A skill `skills/engineering/write-readme-r/` that: symlink — discovery is one level deep. - `write-readme-py/SKILL.md:72` — the "not yet written" note, the only live instance of that string. -- `write-readme/SKILL.md` §See also — one line; and `REFERENCE.md:38`, - whose `renv::restore()` default is wrong for scaffolded analyses. -- `build-r-package/SKILL.md:42-43` — its suggestion fires "once it - exists", and its pointer to README *Out of scope* is already broken; - README has no such heading. +- `write-readme/SKILL.md` §See also — one line. Its `REFERENCE.md` + install rule was corrected ahead of this blueprint; inherit it. +- `build-r-package/SKILL.md:42-44` — its suggestion now points at + generic write-readme and at this blueprint; it becomes the R skill. - `build-r-analysis/SKILL.md` — mentions no README at all today; gains the suggestion its sibling already has. - `skills/loop/steer/SKILL.md` — one row, per its own closing rule. @@ -75,6 +75,6 @@ file carries. ## Out of scope - Quarto rendering, pkgdown sites, badges. - Changes to write-readme-py, and to generic write-readme beyond the - See-also line and the `REFERENCE.md:38` install correction. + See-also line. - R README generation for non-scaffolded (arbitrary) R repos — generic `write-readme` keeps those. diff --git a/skills/engineering/write-readme/REFERENCE.md b/skills/engineering/write-readme/REFERENCE.md index 39bb163..55ca143 100644 --- a/skills/engineering/write-readme/REFERENCE.md +++ b/skills/engineering/write-readme/REFERENCE.md @@ -35,8 +35,14 @@ header comment. Pipeline targets from `_targets.R`. ``` ## Installation -renv::restore() # reproduce the recorded library +just build-dev && just up # renv::restore() runs in the image build ``` +Read the install path from evidence, never from a default: a `justfile` +with Docker recipes means the container is the entry point (a +`Dockerfile` restoring `renv.lock` does the library work). Bare +`renv::restore()` is right only for a repo with a committed `renv.lock` +and no container. Neither → omit the section. + Usage = `targets::tar_make()` plus the `justfile` recipes that wrap it. ## node (`package.json`) diff --git a/skills/scaffold/build-r-package/SKILL.md b/skills/scaffold/build-r-package/SKILL.md index 59a58a1..623e534 100644 --- a/skills/scaffold/build-r-package/SKILL.md +++ b/skills/scaffold/build-r-package/SKILL.md @@ -39,8 +39,9 @@ disable-model-invocation: true > -e 'renv::init()'` to lock dependencies; then `just document` and > `just check`. Describe the change with > [`/commit-atomic-jj`](../../productivity/commit-atomic-jj/SKILL.md) when satisfied." -5. **Suggest** `/write-readme-py`'s R counterpart once it exists (not - yet — see octobot/README.md *Out of scope*). +5. **Suggest** [`/write-readme`](../../engineering/write-readme/SKILL.md), + which already covers r-package; its dedicated R counterpart is + blueprint 001, still a draft. ## Placeholders used by templates - `` — R package name (validated above).