diff --git a/README.md b/README.md index 01c946f..8520ea0 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,11 @@ skill list. scenarios as the unit of work. - **diagnose** — six-phase bug hunt: feedback loop → reproduce → hypothesise → instrument → fix with regression test → cleanup. -- **grill-with-docs** — docs-anchored Socratic interview; updates - `CONTEXT.md` inline, offers ADRs only on the three-of-three rule. +- **grill-with-docs** — user-invoked router that runs `grill-me` using + `domain-modeling` on an existing codebase. +- **domain-modeling** — actively build / sharpen a project's domain + model — challenge terms, update `CONTEXT.md` inline, offer ADRs only + on the three-of-three rule. - **r-style** — Tidyverse + `box::use` + `dtplyr` standards with paired good/bad sibling docs (`box.md`, `tidyverse.md`, `dtplyr.md`). - **dev-python** — orchestrate the full Python workflow (implement → @@ -90,7 +93,7 @@ afternoon. (matches the strength of `jj-atomic/examples.md`). - **`grill-me` needs a filled dialogue.** Add `grill-me/example.md` — a short Q-by-Q transcript on a vague task that resolves into a - one-paragraph statement, mirroring `grill-with-docs/examples-r.md`. + one-paragraph statement, mirroring `domain-modeling/examples-r.md`. Makes the plan-only vs docs-anchored distinction obvious at a glance. - **Python siblings for `bdd` / `diagnose`.** R has `tests-r.md`, `mocking-r.md`, `feedback-loops-r.md`, etc. Python equivalents diff --git a/skills/engineering/bdd/SKILL.md b/skills/engineering/bdd/SKILL.md index df0a59a..c78d501 100644 --- a/skills/engineering/bdd/SKILL.md +++ b/skills/engineering/bdd/SKILL.md @@ -95,4 +95,4 @@ first run, refactoring while red, dropping an untestable scenario. ## See also - [../diagnose/SKILL.md](../diagnose/SKILL.md) — chasing an existing bug? Run `/diagnose` first; phase 5 hands back here for the regression test. -- [../grill-with-docs/SKILL.md](../grill-with-docs/SKILL.md) — run before step 0 so scenarios use canonical `CONTEXT.md` vocabulary. +- [../domain-modeling/SKILL.md](../domain-modeling/SKILL.md) — run before step 0 so scenarios use canonical `CONTEXT.md` vocabulary. diff --git a/skills/engineering/diagnose/SKILL.md b/skills/engineering/diagnose/SKILL.md index 447190e..601c01c 100644 --- a/skills/engineering/diagnose/SKILL.md +++ b/skills/engineering/diagnose/SKILL.md @@ -95,5 +95,5 @@ Then ask: **what would have prevented this bug?** - [../bdd/SKILL.md](../bdd/SKILL.md) — phase 5 is a bdd cycle. - [../bdd/refactoring-r.md](../bdd/refactoring-r.md) — file architectural follow-ups here. -- [../grill-with-docs/SKILL.md](../grill-with-docs/SKILL.md) — phase 3 +- [../domain-modeling/SKILL.md](../domain-modeling/SKILL.md) — phase 3 hypothesis names should use canonical terms from `CONTEXT.md`. diff --git a/skills/engineering/grill-with-docs/ADR-FORMAT.md b/skills/engineering/domain-modeling/ADR-FORMAT.md similarity index 98% rename from skills/engineering/grill-with-docs/ADR-FORMAT.md rename to skills/engineering/domain-modeling/ADR-FORMAT.md index 510a94a..b79929c 100644 --- a/skills/engineering/grill-with-docs/ADR-FORMAT.md +++ b/skills/engineering/domain-modeling/ADR-FORMAT.md @@ -76,4 +76,4 @@ All three must hold. If any one is missing, skip the ADR. --- _Format adapted from -._ +._ diff --git a/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md b/skills/engineering/domain-modeling/CONTEXT-FORMAT.md similarity index 98% rename from skills/engineering/grill-with-docs/CONTEXT-FORMAT.md rename to skills/engineering/domain-modeling/CONTEXT-FORMAT.md index f01dbe4..772b544 100644 --- a/skills/engineering/grill-with-docs/CONTEXT-FORMAT.md +++ b/skills/engineering/domain-modeling/CONTEXT-FORMAT.md @@ -77,4 +77,4 @@ to. If unclear, ask. --- _Format adapted from -._ +._ diff --git a/skills/engineering/domain-modeling/SKILL.md b/skills/engineering/domain-modeling/SKILL.md new file mode 100644 index 0000000..5ebdae6 --- /dev/null +++ b/skills/engineering/domain-modeling/SKILL.md @@ -0,0 +1,93 @@ +--- +name: domain-modeling +description: Actively build and sharpen a project's domain model — challenge fuzzy terms, propose canonical names, update CONTEXT.md inline as terms resolve, and offer ADRs only on the three-of-three rule. Use when the user says "domain model", "/domain-modeling", "pin down vocabulary", "canonical name for X", "is my language right", "what should this term be", "record this as an ADR", or another skill needs to maintain the domain model. +--- + +# domain-modeling + +## When to use +- User says "domain model", "/domain-modeling", "pin down vocabulary", + "canonical name", "is my language right", "what should this term be", + "record an ADR". +- A non-trivial design conversation is *changing* the model — proposing + new terms, retiring old ones, recording a hard-to-reverse decision. +- A sibling skill (`diagnose` hypothesis names, `bdd` Given/When/Then + language) needs to consume the canonical glossary actively. + +## Active vs reading +This skill is for when you're **changing** the model — challenging +terms, inventing scenarios, writing the glossary as it crystallises. +Merely *reading* `CONTEXT.md` for canonical vocabulary is a one-line +habit any skill can do; that's not this skill. + +## Protocol + +1. **Codebase first.** If the answer is on disk — `box::use` imports, + `tar_meta()`, function signatures, an existing `CONTEXT.md` — read + instead of asking. +2. **Challenge against the glossary.** When the user's term contradicts + `CONTEXT.md`, surface it: *"Your glossary defines 'target' as a + `tar_target`; you seem to mean a therapeutic target. Which?"* +3. **Sharpen fuzzy language.** Propose a canonical term and record losers + under `_Avoid_`. *"You're saying 'account' — do you mean Customer or + User? Different things."* +4. **Stress-test with concrete scenarios.** Invent edge cases that force + the user to pin down boundaries. *"What does the target return when + no tissue passes the threshold?"* +5. **Cross-reference with code.** If a stated mechanism contradicts the + code, name file and line. *"`_targets.R:14` sets `format = 'qs2'` — + that contradicts the parquet write you just described."* +6. **Update `CONTEXT.md` inline.** One term resolved → one edit. Never + batched. Format: see [CONTEXT-FORMAT.md](CONTEXT-FORMAT.md). +7. **Offer ADRs sparingly** (three-of-three rule, see + [ADR-FORMAT.md](ADR-FORMAT.md)). Default is *no*. + +## File layout the skill expects + +``` +/ +├── CONTEXT.md # single-context default +├── CONTEXT-MAP.md # only when ≥2 obvious sub-roots exist +├── docs/adr/ +│ └── 0001-.md +└── src/ (or R/, app/, ...) +``` + +Create files **lazily** — only when there's a real first thing to write. +No `CONTEXT.md` yet? Create it when the first term is resolved. No +`docs/adr/`? Create it when the first ADR is needed. Confirm the *first* +write to any new file in the repo before proceeding. + +If `CONTEXT-MAP.md` exists at root, the repo is in **multi-context mode**. +Default is single-context. Switch only when you observe **≥ 2 obvious +sub-roots** (e.g. `R/ingest/`, `R/analysis/`, `R/report/`; or +`src/ordering/`, `src/billing/`). On the second resolved term that clearly +belongs to one of them, propose `CONTEXT-MAP.md` at the root + +per-context `CONTEXT.md` under each sub-root. + +## Language references — R + +- [examples-r.md](examples-r.md) — full worked transcript in a + targets-pipeline style repo (the "what is a target?" conflict), plus + the resulting `CONTEXT.md` skeleton and what does *not* belong in it. + +## Guardrails +- **Never** record general programming concepts in `CONTEXT.md` (timeouts, + utility patterns, language idioms). Only domain-specific terms. +- **Never** write implementation details into `CONTEXT.md`. It's a + glossary, not a spec. +- **Never** open an ADR unless all three of {hard to reverse, surprising + without context, real trade-off} are true. When in doubt, don't. +- **Never** create a `CONTEXT.md` / `docs/adr/` in the repo without + confirming the first such write. + +## See also +- [../grill-with-docs/SKILL.md](../grill-with-docs/SKILL.md) — the + user-invoked router that pairs this skill with a Socratic interview. +- [../bdd/SKILL.md](../bdd/SKILL.md) — once vocabulary is pinned, the + Given/When/Then scenarios should use the canonical terms. +- [../diagnose/SKILL.md](../diagnose/SKILL.md) — hypothesis names in + diagnose post-mortems should match `CONTEXT.md` terminology. +- [../../productivity/grill-me/SKILL.md](../../productivity/grill-me/SKILL.md) + — plan-only Socratic interview, no docs. The interview engine the + router uses. diff --git a/skills/engineering/grill-with-docs/examples-r.md b/skills/engineering/domain-modeling/examples-r.md similarity index 70% rename from skills/engineering/grill-with-docs/examples-r.md rename to skills/engineering/domain-modeling/examples-r.md index bd9e007..6e65a4d 100644 --- a/skills/engineering/grill-with-docs/examples-r.md +++ b/skills/engineering/domain-modeling/examples-r.md @@ -1,7 +1,6 @@ # Worked example — R / bookdown / targets -A short transcript of a `/grill-with-docs` session in a targets-pipeline -style repo, followed by the `CONTEXT.md` skeleton it would produce. +Transcript of a `/domain-modeling` session in a targets-pipeline repo; ends with the `CONTEXT.md` skeleton it produces. ## The conflict: "target" @@ -24,8 +23,6 @@ User: *"The pipeline one."* User: *"yes"* -Agent edits `CONTEXT.md` inline (see skeleton below). - > **Q3.** "One per tissue" — by tissue do you mean the `tissue` column in > the MODB metadata (`R/indication/get_modb_bulk_config.R:42`) or the > single-cell `cell.type` axis (`Rmd/indication2_rmd/expression_sc.Rmd`)? @@ -60,18 +57,8 @@ Hands cleanly to `/bdd` once locked. > `targets`' invalidation. Did you mean to bypass the cache, or use the > default `qs2` format? -## When `CONTEXT-MAP.md` kicks in - -This repo has three obvious sub-roots (`R/indication1/`, `R/indication2/`, -`R/indication3/`) *and* three corresponding `Rmd/` trees. On the second -resolved term that clearly belongs to one of them, the agent proposes a -`CONTEXT-MAP.md` at the root and a per-context `CONTEXT.md` under each -`R//`. Single-context users (most R packages) never see this. - ## Resulting `CONTEXT.md` skeleton -After Q1–Q5 above, the agent has written: - ```md # target-assessment-report @@ -101,16 +88,12 @@ A MODB bulk dataset identified by `DS`, configured under _Avoid_: cohort, study, sample set. ``` -Note: zero implementation details. No mention of `dplyr`, no function -signatures. `CONTEXT.md` is a glossary; design notes belong in ADRs. +Note: zero implementation details; `CONTEXT.md` is a glossary, design notes belong in ADRs. ## What would *not* get written -- "We use `box::use` for module imports" → general R idiom, not domain- - specific. Out. -- "The CR expression chapter knits in ~45 seconds" → operational - detail, not glossary material. Could become an ADR if a deliberate - trade-off ("we knit per-chapter to keep render time bounded") drove it. -- "We cache targets with `qs2`" → ADR-worthy if there was a real choice - (qs2 vs RDS vs parquet); glossary-worthy if the *word* "cache" needs - disambiguating. Often both. +- `box::use` for module imports — general R idiom, out. +- "knits in ~45s" — operational detail; ADR-worthy only if a deliberate + trade-off drove it. +- "we cache targets with `qs2`" — ADR if there was a real choice (qs2 vs + RDS vs parquet); glossary if the word "cache" needs disambiguating. diff --git a/skills/engineering/grill-with-docs/SKILL.md b/skills/engineering/grill-with-docs/SKILL.md index ade990c..1a95d0b 100644 --- a/skills/engineering/grill-with-docs/SKILL.md +++ b/skills/engineering/grill-with-docs/SKILL.md @@ -1,87 +1,16 @@ --- name: grill-with-docs -description: Interview the user about a plan, cross-checking every term against the repo's CONTEXT.md / glossary and the code itself; update CONTEXT.md inline as terms resolve; offer ADRs only when the decision is hard to reverse, surprising, and the result of a real trade-off. Use when the user says "grill with docs", "/grill-with-docs", "stress-test this plan", "challenge my plan against the codebase", "is my language right", or wants to align a design with the project's domain vocabulary before implementation. +description: A relentless interview to stress-test a plan against the codebase, recording canonical terms and architectural decisions as they crystallise. Use when the user says "grill with docs", "/grill-with-docs", "stress-test this plan", "challenge against the codebase", or wants to align a design with the project's domain vocabulary before implementation. +disable-model-invocation: true --- # grill-with-docs -## When to use -- User says "grill with docs", "/grill-with-docs", "stress-test this plan", - "challenge against the codebase", "align my language". -- A non-trivial plan is on the table and the repo has (or should have) - domain vocabulary worth pinning down. -- Skip when no codebase exists yet — use [`/grill-me`](../../productivity/grill-me/SKILL.md) - instead (plan-only ambiguity removal). +User-invoked router. Run [grill-me](../../productivity/grill-me/SKILL.md) +(the Socratic interview) **using** [domain-modeling](../domain-modeling/SKILL.md) +(the active glossary / ADR discipline) — interview the user about the +plan, and update `CONTEXT.md` and `docs/adr/` as terms and decisions +crystallise. -## Protocol - -1. **One question at a time.** Wait for the answer before the next. -2. **Codebase first.** If the answer is on disk — `box::use` imports, - `tar_meta()`, function signatures, an existing `CONTEXT.md` — read - instead of asking. -3. **Challenge against the glossary.** When the user's term contradicts - `CONTEXT.md`, surface it: *"Your glossary defines 'target' as a - `tar_target`; you seem to mean a therapeutic target. Which?"* -4. **Sharpen fuzzy language.** Propose a canonical term and record losers - under `_Avoid_`. *"You're saying 'account' — do you mean Customer or - User? Different things."* -5. **Stress-test with concrete scenarios.** Invent edge cases that force - the user to pin down boundaries. *"What does the target return when - no tissue passes the threshold?"* -6. **Cross-reference with code.** If a stated mechanism contradicts the - code, name file and line. *"`_targets.R:14` sets `format = 'qs2'` — - that contradicts the parquet write you just described."* -7. **Update `CONTEXT.md` inline.** One term resolved → one edit. Never - batched. Format: see [CONTEXT-FORMAT.md](CONTEXT-FORMAT.md). -8. **Offer ADRs sparingly** (three-of-three rule, see - [ADR-FORMAT.md](ADR-FORMAT.md)). Default is *no*. - -## File layout the skill expects - -``` -/ -├── CONTEXT.md # single-context default -├── CONTEXT-MAP.md # only when ≥2 obvious sub-roots exist -├── docs/adr/ -│ └── 0001-.md -└── src/ (or R/, app/, ...) -``` - -Create files **lazily** — only when there's a real first thing to write. -No `CONTEXT.md` yet? Create it when the first term is resolved. No -`docs/adr/`? Create it when the first ADR is needed. Confirm the *first* -write to any new file in the repo before proceeding. - -### Single vs multi-context -- **Default: single.** One `CONTEXT.md` at the root. -- **Switch to multi** only when you observe **≥ 2 obvious sub-roots** in - the repo (e.g. `R/ingest/`, `R/analysis/`, `R/report/`; or `src/ordering/`, - `src/billing/`). On the second resolved term that clearly belongs to - one of them, propose `CONTEXT-MAP.md` at the root + per-context - `CONTEXT.md` under each sub-root. - -## Language references — R - -- [examples-r.md](examples-r.md) — full worked transcript in a - targets-pipeline style repo (the "what is a target?" conflict), plus - the resulting `CONTEXT.md` skeleton and what does *not* belong in it. - -## Guardrails -- **Never** monologue. One question, wait, then the next. -- **Never** record general programming concepts in `CONTEXT.md` (timeouts, - utility patterns, language idioms). Only domain-specific terms. -- **Never** write implementation details into `CONTEXT.md`. It's a - glossary, not a spec. -- **Never** open an ADR unless all three of {hard to reverse, surprising - without context, real trade-off} are true. When in doubt, don't. -- **Never** create a `CONTEXT.md` / `docs/adr/` in the repo without - confirming the first such write. - -## See also -- [../bdd/SKILL.md](../bdd/SKILL.md) — once vocabulary is pinned, - the Given/When/Then scenarios should use the canonical terms. -- [../diagnose/SKILL.md](../diagnose/SKILL.md) — hypothesis names in - diagnose post-mortems should match `CONTEXT.md` terminology. -- [../../productivity/grill-me/SKILL.md](../../productivity/grill-me/SKILL.md) - — plan-only sibling. No codebase needed; no docs updated. Use that one - for greenfield, this one for established repos. +Skip when no codebase exists yet — use [grill-me](../../productivity/grill-me/SKILL.md) +alone (plan-only). diff --git a/skills/engineering/sieve/SKILL.md b/skills/engineering/sieve/SKILL.md index 52c6a98..d6917c6 100644 --- a/skills/engineering/sieve/SKILL.md +++ b/skills/engineering/sieve/SKILL.md @@ -81,5 +81,5 @@ describe`), not per keystroke — otherwise it fights iteration. audit. The sieve judges entry; winnow clears the field. - [`../../productivity/jj-atomic/SKILL.md`](../../productivity/jj-atomic/SKILL.md) — the seal where the sieve fires. -- [`../../productivity/grill-with-docs/SKILL.md`](../../productivity/grill-with-docs/SKILL.md) +- [`../grill-with-docs/SKILL.md`](../grill-with-docs/SKILL.md) — Socratic siblings; grill the requirement, then sieve the code. diff --git a/skills/productivity/plan-project/SKILL.md b/skills/productivity/plan-project/SKILL.md index e6e0507..73495de 100644 --- a/skills/productivity/plan-project/SKILL.md +++ b/skills/productivity/plan-project/SKILL.md @@ -47,7 +47,7 @@ description: Kick off a greenfield project with a research-backed Socratic inter 6. **Write `docs/Roadmap.md`** when answers stop moving decisions — skeleton below. Confirm before writing if it's the first file in `docs/`. -7. **ADRs** only by the three-of-three rule from grill-with-docs +7. **ADRs** only by the three-of-three rule from domain-modeling (hard to reverse ∧ surprising ∧ real trade-off). Default no. ## Roadmap.md skeleton @@ -78,7 +78,7 @@ description: Kick off a greenfield project with a research-backed Socratic inter ## See also - [update-project](../update-project/SKILL.md) — agile sibling: revises the roadmap this skill produced as the project teaches you things. -- [grill-with-docs](../../engineering/grill-with-docs/SKILL.md) — vocabulary +- [domain-modeling](../../engineering/domain-modeling/SKILL.md) — vocabulary protocol this skill delegates to. - [grill-me](../grill-me/SKILL.md) — lighter sibling: ambiguity removal without docs output.