From 4b9b9f8281782d6b89697bbe50bc6506cc8bc22e Mon Sep 17 00:00:00 2001 From: Lukasz Boryn Date: Wed, 22 Jul 2026 13:50:57 +0200 Subject: [PATCH] docs(blueprint): sound 001 and correct what it rested on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 001 predates the loop build-out and carried no sounded: stamp. Sounding it against live code broke two of its claims. The R scaffolds do not ship without a README generator — generic write-readme already detects DESCRIPTION and _targets.R and extracts both — so the gap is depth, not coverage, and the blueprint now says so and must earn its keep against that path. And renv::restore() is wrong for scaffolded R projects, which run through docker compose and ship no lockfile; the default traces to write-readme/REFERENCE.md:38, which the blueprint now corrects instead of copying. Seams went from two files to seven — the symlink, the steer row and the README entries that today's conventions require. Verify became runnable: every 'just' recipe the README documents must exist in the justfile, and no renv line may appear without a lockfile. Status stays draft. Stamped sounded: 2026-07-22. Co-Authored-By: Claude Opus 4.8 --- OKF/blueprints/001-add-write-readme-r.md | 76 +++++++++++++++++------- 1 file changed, 53 insertions(+), 23 deletions(-) diff --git a/OKF/blueprints/001-add-write-readme-r.md b/OKF/blueprints/001-add-write-readme-r.md index 7077a6a..eb09927 100644 --- a/OKF/blueprints/001-add-write-readme-r.md +++ b/OKF/blueprints/001-add-write-readme-r.md @@ -2,17 +2,23 @@ type: Blueprint status: draft traces-to: README.md §Roadmap ("write-readme-r" gap); write-readme-py/SKILL.md §Out of scope +sounded: 2026-07-22 --- # 001 — add write-readme-r skill ## Justification -Named gap in `README.md` §Roadmap and declared out of scope in -`skills/engineering/write-readme-py/SKILL.md` with its interface already -sketched there: "reading `DESCRIPTION` for packages and `_targets.R` + -`index.qmd` for analyses is the planned interface". R scaffolds -(`build-r-package`, `build-r-analysis`) currently ship without a README -generator, unlike their Python sibling. +Named gap in `README.md:231-234` §Roadmap and declared out of scope in +`skills/engineering/write-readme-py/SKILL.md:72-74`, with its interface +already sketched there: "reading `DESCRIPTION` for packages and +`_targets.R` + `index.qmd` for analyses is the planned interface". + +The gap is **depth, not coverage**: generic `write-readme` already +detects both R types (`write-readme/SKILL.md:23-24`) and extracts their +fields (`write-readme/REFERENCE.md:22-40`). What R lacks is what +`write-readme-py` gives Python — a template, the Saduko license block, +and justfile-derived usage. A dedicated skill must earn its place +against that generic path, or fold into it. ## Contract A skill `skills/engineering/write-readme-r/` that: @@ -20,31 +26,55 @@ A skill `skills/engineering/write-readme-r/` that: Title, Description, License, Authors@R); `_targets.R` → r-analysis (sources: `reports/index.qmd` title/description + `justfile`). - Materialises `README.md` from a template following write-readme-py's - Saduko-style layout (logo block, install via `renv::restore()`, - justfile-derived usage sections, license block — Apache-aware rich - block, one-liner otherwise). + Saduko-style layout (logo block, install block, justfile-derived usage + 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. - 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). - Stops on `jj diff` for review; never commits. ## Seams touched -- New skill folder only: `skills/engineering/write-readme-r/{SKILL.md, - readme-r.template.md}`. -- One-line "See also" additions in: `write-readme/SKILL.md`, - `write-readme-py/SKILL.md`, `build-r-package/SKILL.md`, - `build-r-analysis/SKILL.md` (replacing the "not yet written" notes). +- New skill folder: `skills/engineering/write-readme-r/{SKILL.md, + readme-r.template.md}`, plus its `~/.claude/skills/write-readme-r` + 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. +- `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. +- `README.md` §Skills engineering list, §Roadmap (the item is spent). ## Verify -In a scratch dir scaffolded by `/build-r-package` (fixtures acceptable): -running the skill's process against its `DESCRIPTION` + `justfile` -produces a `README.md` whose every install/usage command exists verbatim -in the justfile, and whose license block matches the DESCRIPTION License -field. Check: `grep -c 'just ' README.md` equals the number of documented -recipes; no invented content on manual read-through. +From a fixture r-package (`DESCRIPTION.tpl` + `justfile.tpl` copied out +of `skills/scaffold/build-r-package/`), run the skill, then: + +```sh +comm -23 <(grep -o 'just [a-z-]*' README.md | sed 's/just //' | sort -u) \ + <(grep -oE '^[a-z-]+:' justfile | tr -d ':' | sort -u) +grep -c 'renv::restore' README.md +``` + +Expect empty output from `comm` — every recipe the README documents +exists in the justfile — and `0` from the grep, since the fixture has no +lockfile. Then read the README once: the License block must match +`DESCRIPTION`'s License field, and nothing may appear that no source +file carries. ## Out of scope - Quarto rendering, pkgdown sites, badges. -- Changes to write-readme-py or the generic write-readme beyond the - See-also lines. -- R README generation for non-scaffolded (arbitrary) R repos. +- Changes to write-readme-py, and to generic write-readme beyond the + See-also line and the `REFERENCE.md:38` install correction. +- R README generation for non-scaffolded (arbitrary) R repos — generic + `write-readme` keeps those.