fix(write-readme): read the R install path from evidence, not a default

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 <noreply@anthropic.com>
This commit is contained in:
Łukasz Boryń 2026-07-22 14:02:15 +02:00
parent 4b9b9f8281
commit 6cb19302ea
3 changed files with 21 additions and 14 deletions

View File

@ -30,11 +30,12 @@ A skill `skills/engineering/write-readme-r/` that:
sections, license block — Apache-aware rich block, one-liner sections, license block — Apache-aware rich block, one-liner
otherwise). otherwise).
- **Derives the install block from the project, never from a default.** - **Derives the install block from the project, never from a default.**
Both R scaffolds run every recipe through `docker compose run --rm Scaffolded R projects run through `docker compose`, and their
dev` and ship no `renv.lock`, so `renv::restore()` is wrong for them; `renv::restore()` happens at image build
`write-readme/REFERENCE.md:38` prescribing it is drift this blueprint (`containerize-project/Dockerfile.r-*.tpl`), so a README telling a
corrects rather than copies. Read the justfile and the presence of a reader to restore on the host is wrong — the entry point is
lockfile; no evidence → omit the section and say so. `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, - Refuses to invent: empty Description → ask; no fabricated deps,
recipes, authors, or URLs. Omits sections lacking source data. recipes, authors, or URLs. Omits sections lacking source data.
- Guards an existing README.md (diff + explicit confirmation). - 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. symlink — discovery is one level deep.
- `write-readme-py/SKILL.md:72` — the "not yet written" note, the only - `write-readme-py/SKILL.md:72` — the "not yet written" note, the only
live instance of that string. live instance of that string.
- `write-readme/SKILL.md` §See also — one line; and `REFERENCE.md:38`, - `write-readme/SKILL.md` §See also — one line. Its `REFERENCE.md`
whose `renv::restore()` default is wrong for scaffolded analyses. install rule was corrected ahead of this blueprint; inherit it.
- `build-r-package/SKILL.md:42-43` — its suggestion fires "once it - `build-r-package/SKILL.md:42-44` — its suggestion now points at
exists", and its pointer to README *Out of scope* is already broken; generic write-readme and at this blueprint; it becomes the R skill.
README has no such heading.
- `build-r-analysis/SKILL.md` — mentions no README at all today; gains - `build-r-analysis/SKILL.md` — mentions no README at all today; gains
the suggestion its sibling already has. the suggestion its sibling already has.
- `skills/loop/steer/SKILL.md` — one row, per its own closing rule. - `skills/loop/steer/SKILL.md` — one row, per its own closing rule.
@ -75,6 +75,6 @@ file carries.
## Out of scope ## Out of scope
- Quarto rendering, pkgdown sites, badges. - Quarto rendering, pkgdown sites, badges.
- Changes to write-readme-py, and to generic write-readme beyond the - 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 - R README generation for non-scaffolded (arbitrary) R repos — generic
`write-readme` keeps those. `write-readme` keeps those.

View File

@ -35,8 +35,14 @@ header comment. Pipeline targets from `_targets.R`.
``` ```
## Installation ## 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. Usage = `targets::tar_make()` plus the `justfile` recipes that wrap it.
## node (`package.json`) ## node (`package.json`)

View File

@ -39,8 +39,9 @@ disable-model-invocation: true
> -e 'renv::init()'` to lock dependencies; then `just document` and > -e 'renv::init()'` to lock dependencies; then `just document` and
> `just check`. Describe the change with > `just check`. Describe the change with
> [`/commit-atomic-jj`](../../productivity/commit-atomic-jj/SKILL.md) when satisfied." > [`/commit-atomic-jj`](../../productivity/commit-atomic-jj/SKILL.md) when satisfied."
5. **Suggest** `/write-readme-py`'s R counterpart once it exists (not 5. **Suggest** [`/write-readme`](../../engineering/write-readme/SKILL.md),
yet — see octobot/README.md *Out of scope*). which already covers r-package; its dedicated R counterpart is
blueprint 001, still a draft.
## Placeholders used by templates ## Placeholders used by templates
- `<package-name>` — R package name (validated above). - `<package-name>` — R package name (validated above).