@lifeaitools/rdc-skills 0.35.26 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rdc",
3
- "version": "0.35.26",
3
+ "version": "0.37.0",
4
4
  "description": "RDC typed-agent dispatch skill suite for Claude Code — plan, build, review, overnight unattended builds with work-item tracking and TDD enforcement.",
5
5
  "author": {
6
6
  "name": "LIFEAI",
@@ -384,6 +384,30 @@
384
384
  "codeflow_required": true,
385
385
  "purpose": "run a structured agent-to-agent conversation"
386
386
  },
387
+ "convo": {
388
+ "name": "convo",
389
+ "slash": "rdc:convo",
390
+ "category": "dev-loop",
391
+ "usage": "rdc:convo <template> <topic>",
392
+ "args": {
393
+ "positional": [
394
+ { "name": "template", "required": true, "description": "Discussion type", "accepts": "outcome-exploration | design-comparison | troubleshooting | plan-critique | disagreement-resolution | work-handoff" },
395
+ { "name": "topic", "required": true, "description": "Bounded question or outcome", "accepts": "text" }
396
+ ],
397
+ "flags": []
398
+ },
399
+ "requires": [],
400
+ "produces": ["discussion_record", "decision_record"],
401
+ "default_model": "inherit",
402
+ "triggers": ["fair discussion", "attributed peer discussion", "discussion templates", "co-design conversation"],
403
+ "follows": [],
404
+ "leads_to": ["rdc:plan", "rdc:build"],
405
+ "sandbox_aware": true,
406
+ "output_contract": "guides/output-contract.md",
407
+ "enabled_default": true,
408
+ "codeflow_required": false,
409
+ "purpose": "conduct bounded fair discussion and record decisions using existing peer transports"
410
+ },
387
411
  "convert": {
388
412
  "name": "convert",
389
413
  "slash": "rdc:convert",
@@ -0,0 +1,56 @@
1
+ name: Lesson learned
2
+ description: A lesson from real work whose fix is not yet encoded as a guard, test or script. An issue proposes; a work item commits.
3
+ title: "[lesson] "
4
+ labels: ["lesson", "proposal"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ File this in the repository the fix belongs to. **If this repository is public, file it in LIFEAI/regen-root with the area naming this repository instead** — a lesson carries hosts, paths and ports, and a public issue cannot be unsaid. Agents submit the same form from any engine:
10
+
11
+ `node "$LIFEAI_ENV/bin/rdc-lesson.mjs" submit --repo <slug> --title "..." --what "..." --root-cause "..." --fix "..."`
12
+
13
+ A lesson whose fix is already encoded (a guard, test or script shipped with a linked commit) needs no issue; record it in that commit message.
14
+ Accepting this issue creates a work item and relabels it `accepted`; the fixing commit closes it with `Fixes #N`.
15
+ - type: textarea
16
+ id: what-happened
17
+ attributes:
18
+ label: What happened
19
+ description: The concrete situation, with evidence (exit code, file:line, command).
20
+ validations:
21
+ required: true
22
+ - type: textarea
23
+ id: root-cause
24
+ attributes:
25
+ label: Root cause
26
+ description: The evidenced cause, not a guess.
27
+ validations:
28
+ required: true
29
+ - type: textarea
30
+ id: fix
31
+ attributes:
32
+ label: The fix or rule
33
+ description: What should change so this never recurs, as a guard, test, script, or rule line.
34
+ validations:
35
+ required: true
36
+ - type: input
37
+ id: area
38
+ attributes:
39
+ label: Repository / area
40
+ description: The repository slug and the area inside it, e.g. `lifeai-env · hooks/lib` or `rdc-skills · skills/build`.
41
+ validations:
42
+ required: true
43
+ - type: input
44
+ id: encoded
45
+ attributes:
46
+ label: Encoded artifact
47
+ description: The guard, test or script that already enforces part of this fix, if any.
48
+ validations:
49
+ required: false
50
+ - type: textarea
51
+ id: evidence
52
+ attributes:
53
+ label: Evidence
54
+ description: Links to commits, logs, transcripts or work items, one per line.
55
+ validations:
56
+ required: false
package/CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## v0.37.0 — review gates run the deterministic validators, in 1–2 minutes
11
+
12
+ ### Changed
13
+ - The code-review step in `rdc:build` (9b), `rdc:fixit` (5.5), `rdc:review`
14
+ (8b), `rdc:release` and `rdc:overnight` now runs one deterministic gate,
15
+ `guides/review-gate.md`:
16
+ - `rdc-solid-score --diff <base>`;
17
+ - the repo linter on changed files (`--write`, then check);
18
+ - `tsc`;
19
+ - the touched package's tests;
20
+ - the UI spec when a route changed.
21
+
22
+ On the PRT launch build it took 9.3 s over 33 changed code files, where each
23
+ open-ended `pr-review-toolkit:code-reviewer` pass had taken 4–10 minutes. The
24
+ reviewer agent remains, but only for a named question the validators cannot
25
+ answer.
26
+ - `rdc-clean-code-score` is documented as advisory. It has no `--diff`, and in a
27
+ monorepo it needs `--project-root <package>`; its default dead-export scope ran
28
+ out of 4 GB of heap on regen-root.
29
+
30
+ ### Fixed
31
+ - `rdc-solid-score --diff` exited 2 on any diff that added a file. Git's
32
+ "exists on disk, but not in <ref>" wording was not recognized as absent at the
33
+ ref; it now is. A bad ref or a path-form mismatch is still rethrown.
34
+ - `rdc-solid-score --diff` exited 2 with ENOENT on any diff that deleted a file.
35
+ Deletions are now split out with `--diff-filter=D` and reported in a new
36
+ `removedFiles` output field.
37
+ - The README File Structure omitted `convo` (shipped in 0.36.0), which failed
38
+ `npm run test:acceptance`.
39
+
40
+ ---
41
+
10
42
  ## v0.35.11 — Design Review is explicit opt-in
11
43
 
12
44
  ### Changed
package/README.md CHANGED
@@ -321,6 +321,7 @@ skills/
321
321
  co-develop/SKILL.md (peer-aware Claude/Codex co-development)
322
322
  collab/SKILL.md (bidirectional claude.ai ↔ Claude Code relay)
323
323
  convert/SKILL.md (Office/Markdown conversion)
324
+ convo/SKILL.md (attributed discussion that converges to a decision)
324
325
  deploy/SKILL.md (Coolify ops: deploy, new, diagnose, audit)
325
326
  design/SKILL.md (RDC/Studio design, Palette Library, Rampa CLI)
326
327
  edit/SKILL.md (local website editor launcher)
@@ -8,4 +8,8 @@ description: rdc:compare-compliance <path> --diff <ref> — gate a change agains
8
8
  Use Skill tool with skill: "solid-validator", passing the path and a
9
9
  required `--diff <ref>` as args. Read `regressions` and `boundaryViolations`
10
10
  from the output — either non-empty means the change made compliance worse
11
- than the base ref, not merely "still imperfect."
11
+ than the base ref, not merely "still imperfect." `removedFiles` lists what the
12
+ change deleted; those are reported, never scored.
13
+
14
+ This is step 1 of the review gate. For the whole gate (lint, tsc, tests and UI
15
+ spec as well), follow `guides/review-gate.md`.
@@ -7,4 +7,6 @@ description: rdc:quick-check <path> — fast mechanical pass, SOLID score and bo
7
7
 
8
8
  Use Skill tool with skill: "solid-validator", passing the path as args.
9
9
  This is the mechanical-only subset — no judgment dispatch, meant to run in
10
- seconds during active editing. Use `full-analysis` before a merge.
10
+ seconds during active editing. Before a merge, run the review gate in
11
+ `guides/review-gate.md`, which takes one to two minutes. `full-analysis` is a
12
+ deeper advisory pass, not the merge gate.
package/git-sha.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "sha": "31c8a8246ec68e424893534d7da36166f52a6f73"
2
+ "sha": "15c0b76b2fa48b6ab335478041940337a84da588"
3
3
  }
@@ -5,21 +5,21 @@ system: claude-workflow
5
5
  status: active
6
6
  owner: infrastructure
7
7
  created: 2026-06-08
8
- last_reviewed: 2026-06-08
8
+ last_reviewed: 2026-09-17
9
9
  source_of_truth: true
10
10
  supersedes: []
11
11
  depends_on:
12
12
  - ".claude/rules/architectural-change-approval.md"
13
13
  - ".rdc/guides/output-contract.md"
14
- tags: [rdc, lessons-learned, skills, housekeeping, adaptive]
14
+ tags: [rdc, lessons-learned, skills, housekeeping, adaptive, github-issues]
15
15
  ---
16
16
 
17
17
  # Lessons-Learned Capture & Triage — Spec
18
18
 
19
19
  > Auto-referenced by long-running `rdc:*` skills at exit, and by `rdc:housekeeping` for triage.
20
20
  > Goal: make the fleet an **interactive adaptive modeler** — every run that teaches us
21
- > something writes it down, and the weekly housekeeping pass turns those lessons into
22
- > actual fixes (rules, skill docs, work_items).
21
+ > something records it where the fix belongs, and the weekly housekeeping pass turns those
22
+ > lessons into actual fixes (guards, tests, scripts, rule lines, work items).
23
23
 
24
24
  ---
25
25
 
@@ -28,126 +28,250 @@ tags: [rdc, lessons-learned, skills, housekeeping, adaptive]
28
28
  Lessons learned during a run (a non-obvious infra trap, a wrong assumption, a missing
29
29
  gate, a tooling gotcha) used to survive only if someone hand-wrote a memory. This system
30
30
  makes capture a **routine exit step** of every long skill, and triage a **routine phase**
31
- of the weekly housekeeping. Capture is cheap and append-only; triage is where fixes happen.
31
+ of the weekly housekeeping. Capture is cheap; triage is where fixes happen.
32
32
 
33
33
  Precedent: brochurify's `extract-verifier-rules` already does read-log → cluster →
34
34
  propose-rule for one domain. This generalizes that pattern fleet-wide.
35
35
 
36
- ---
36
+ ### Why lessons are not files any more
37
37
 
38
- ## Storage — directory of per-lesson files
38
+ Until 2026-09 every lesson was a markdown file in the capturing repository's
39
+ `.rdc/lessons/`. A census of one repository found 315 of them: 157 already enforced in code,
40
+ where the file only repeated what a guard or test already guaranteed, and 32 enforced
41
+ nowhere, sitting in a directory the owner of the fix never reads. A lesson filed where it
42
+ was noticed, rather than where it is fixed, is a lesson nobody who can fix it sees.
39
43
 
40
- Lessons live in **`.rdc/lessons/`**, one markdown file per lesson:
44
+ So the record now follows the fix:
41
45
 
42
- ```
43
- .rdc/lessons/<YYYY-MM-DD>-<skill>-<short-slug>.md
44
- ```
46
+ - **An encoded lesson needs no file.** The guard, test or script that enforces it is the
47
+ record, and the commit that shipped it carries the narrative.
48
+ - **An unencoded lesson is a GitHub issue in the repository the fix belongs to**, labelled
49
+ `lesson` + `proposal`. **An issue proposes; a work item commits.**
45
50
 
46
- - One file per lesson (NOT a single appended file) so parallel agents finishing at the
47
- same time never collide on one file in git.
48
- - `<skill>` is the capturing skill (`build`, `deploy`, `overnight`, `fixit`, `plan`,
49
- `preplan`, `review`, `release`, `collab`).
50
- - `<short-slug>` is 2–4 kebab words naming the lesson.
51
+ ---
51
52
 
52
- A run that taught nothing writes nothing — **absence is the default**. Only write a lesson
53
- when something was genuinely learned (see § When to capture).
53
+ ## When to capture (at skill exit)
54
54
 
55
- ---
55
+ A lesson exists when ANY of these were true during the run:
56
56
 
57
- ## Lesson file schema
57
+ 1. A root cause turned out to be different from the first theory (a wrong assumption).
58
+ 2. The standard/documented path didn't work and you had to do something non-obvious.
59
+ 3. A gate, check, or doc was missing and its absence cost a round.
60
+ 4. A tool/infra behaved in a surprising way (exit codes, caching, serve/PM2/webhook quirks).
61
+ 5. A hook blocked you and the block revealed a real gap (not just your mistake).
62
+
63
+ Do NOT capture: routine success, your own one-off typo, anything already fully documented
64
+ in a rule/guide, or a settled agreement (that is a Decision and belongs in the plan). If a
65
+ durable user preference or correction was involved, also write a `memory` (this spec and
66
+ memory are complementary — link them). A run that taught nothing records nothing —
67
+ **absence is the default**.
58
68
 
59
- ```markdown
60
- ---
61
- id: <YYYY-MM-DD>-<skill>-<short-slug>
62
- date: "<YYYY-MM-DD>"
63
- skill: build | deploy | overnight | fixit | plan | preplan | review | release | collab
64
- session: <session-id or short ref>
65
- scope: simple | architectural # triage routing — see § Scope gate
66
- status: open | triaged | applied | wont-fix
67
- area: infra | skill | guide | rule | schema | ui | content | other
68
- links:
69
- commits: [] # SHAs that relate to the lesson
70
- memory: [] # memory file slugs, if a memory was also written
71
- work_items: [] # work_item UUIDs spawned during triage
72
69
  ---
73
70
 
74
- ## What happened
75
- <one paragraph — the concrete situation, with evidence (exit code, file:line, command)>
71
+ ## The two outcomes
76
72
 
77
- ## Root cause
78
- <one paragraph — the evidenced cause, not a guess>
73
+ | The fix is… | Record | Where |
74
+ |---|---|---|
75
+ | **Encoded in this run** — a guard, test or script shipped, commit linked | the commit message | no file, no issue |
76
+ | **Partly encoded** — some of it ships, the rest does not | one issue, Encoded artifact filled | the repository the fix belongs to |
77
+ | **Not encoded** — a fix is known or needed but not shipped | one `lesson` + `proposal` issue | the repository the fix belongs to |
79
78
 
80
- ## The fix / rule
81
- <what should change so this never recurs: a rule edit, skill-doc line, code change,
82
- or a check. If already applied in the same run, say so and link the commit.>
83
- ```
79
+ "Encoded" means something now **fails** when the lesson is violated: a guard rule blocks it,
80
+ a test goes red, a script refuses it. A sentence added to a rule or skill document is not
81
+ encoding — prose drifts from behaviour — so a new doc-only lesson is an issue until a guard or
82
+ test carries it.
84
83
 
85
- `scope` is the single most important field — it routes triage:
84
+ **The owning repository** is the one whose code or documents change to fix it, not the one
85
+ where the run happened. A clauth behaviour found during a regen-root build is a clauth lesson.
86
86
 
87
- - **`simple`** — a doc line, a one-file fix, a config tweak, a clarifying sentence in a
88
- skill, a missing grep guard. Housekeeping applies these directly.
89
- - **`architectural`** — anything matching `.claude/rules/architectural-change-approval.md`
90
- (rule/CLAUDE.md/ARCHITECTURE.md edits, cross-cutting refactors, schema reshape, public
91
- API/MCP changes, skill-contract changes affecting multiple skills). Housekeeping does
92
- NOT apply these; it surfaces them via `AskUserQuestion` for explicit approval first.
87
+ ### Public repositories file in regen-root
93
88
 
94
- When unsure, mark `architectural`.
89
+ A lesson is written from inside the estate and routinely names hosts, ports, paths and vault
90
+ services; a public issue cannot be unsaid. **LIFEAI/rdc-skills is public**, so its lessons
91
+ default to the private monorepo: `--repo regen-root --area rdc-skills`. Likewise CodeFlow, whose
92
+ active development is regen-root `packages/codeflow`: `--repo regen-root --area codeflow`.
95
93
 
96
- ---
94
+ `rdc-lesson submit` reads the target's visibility before any write and refuses a PUBLIC
95
+ repository (exit 3) with that route. `--public-ok` overrides it for a lesson that carries no
96
+ estate detail, and even then the title and body are secret-scanned (credentials, private keys,
97
+ IP addresses, clauth `/v/<service>` paths) and refused on any hit.
97
98
 
98
- ## When to capture (at skill exit)
99
+ ---
99
100
 
100
- Write a lesson when ANY of these were true during the run:
101
+ ## Capture procedure (the exit step long skills call)
101
102
 
102
- 1. A root cause turned out to be different from the first theory (a wrong assumption).
103
- 2. The standard/documented path didn't work and you had to do something non-obvious.
104
- 3. A gate, check, or doc was missing and its absence cost a round.
105
- 4. A tool/infra behaved in a surprising way (exit codes, caching, serve/PM2/webhook quirks).
106
- 5. A hook blocked you and the block revealed a real gap (not just your mistake).
103
+ At the end of a long skill run, before the final verdict line:
107
104
 
108
- Do NOT capture: routine success, your own one-off typo, anything already fully documented
109
- in a rule/guide. If a durable user preference or correction was involved, also write a
110
- `memory` (this spec and memory are complementary — link them).
105
+ 1. Decide if anything qualifies (§ When to capture). If not, record nothing and move on.
106
+ 2. For each lesson, name the owning repository's registry slug (a `projects.json` key:
107
+ `lifeai-env`, `clauth`, `regen-root`, `regen-deploy-mgr`, …; a public repository's lesson
108
+ uses `regen-root` with `--area <repo>`, § Public repositories).
109
+ 3. **Encoded in this run** → record it in the commit message of the change that encodes it.
110
+ `rdc-lesson` prints the record (one `Key: value` line per field), opens nothing, and calls
111
+ GitHub not at all:
112
+
113
+ ```bash
114
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" submit --repo <owning slug> --encoded <guard/test/script path> \
115
+ --title "<one line>" --what "<what happened, with evidence>" \
116
+ --root-cause "<evidenced cause>" --fix "<what now enforces it>"
117
+ ```
118
+
119
+ Part of it ships and part does not → add `--partial`: the issue opens with the Encoded
120
+ artifact section filled.
121
+ 4. **Not encoded** → submit it. It opens ONE issue titled `[lesson] <title>`, labelled
122
+ `lesson` + `proposal`, in the repository the slug resolves to:
123
+
124
+ ```bash
125
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" submit --repo <owning slug> \
126
+ --title "<one line>" --what "<what happened, with evidence: command, exit code, file:line>" \
127
+ --root-cause "<evidenced cause, not a guess>" --fix "<the guard, test, script or rule that would stop it>" \
128
+ [--area <area>] [--evidence <commit/log/work-item URL> ...]
129
+ ```
130
+
131
+ - The same exact title already **open** → nothing opens; the existing URL is printed, so a
132
+ retry is safe.
133
+ - The same exact title **closed** → the lesson recurred: the new occurrence is commented on
134
+ that issue and it is reopened (`action: recurred`). A fix that did not hold is the most
135
+ important lesson there is; it must not be filed as a stranger.
136
+ - `--dry-run` shows the issue and calls nothing. An unknown flag is refused by name, so a
137
+ typo such as `--encode` never silently opens an issue.
138
+ - An unregistered slug fails and names itself; do not file the lesson in a different
139
+ repository to get past that — report it.
140
+ 5. Mention in the verdict/summary: "N lessons captured (E encoded, S submitted: <issue URLs>)".
141
+
142
+ Where `@lifeai/lifeai-env` is installed globally the command is also `rdc-lesson submit …`.
143
+ Without `$LIFEAI_ENV` (the `core` profile, or claude.ai), open the issue from the owning
144
+ repository's **Lesson learned** issue form (`.github/ISSUE_TEMPLATE/lesson.yml`); it applies
145
+ the same title prefix, labels and sections.
146
+
147
+ **Accepted residual:** two submits of the same new title at the same moment can both pass the
148
+ duplicate check and open two issues. Triage closes the later one as a duplicate of the first.
149
+
150
+ ### What the issue carries
151
+
152
+ The form and the CLI produce the same sections, in this order:
153
+
154
+ - **What happened** — the concrete situation, with evidence (exit code, file:line, command).
155
+ - **Root cause** — the evidenced cause, not a guess.
156
+ - **The fix or rule** — what should change so this never recurs.
157
+ - **Repository / area** — the owning slug and the area inside it.
158
+ - **Encoded artifact** — anything that already enforces part of the fix.
159
+ - **Evidence** — commits, logs, transcripts, work items.
111
160
 
112
161
  ---
113
162
 
114
- ## Capture procedure (the exit step long skills call)
163
+ ## Accepting a lesson (issue → work item)
115
164
 
116
- At the end of a long skill run, before the final verdict line:
165
+ An issue is a proposal. Work begins only when it is accepted:
166
+
167
+ 1. Create the work item through the work-item RPCs, naming the issue URL in its description.
168
+ 2. Link and relabel the issue:
169
+
170
+ ```bash
171
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" accept <issue-number-or-url> --repo <owning slug> --work-item <uuid>
172
+ ```
173
+
174
+ This comments `Accepted as work item <uuid>` first, then removes `proposal` and adds
175
+ `accepted`. If the relabel fails, run it again: it sees the comment and finishes the
176
+ relabel without a second comment. It refuses an issue that is not labelled `lesson`, and
177
+ does not create the work item.
117
178
 
118
- 1. Decide if anything qualifies (§ When to capture). If not, write nothing and move on.
119
- 2. For each lesson, write `.rdc/lessons/<date>-<skill>-<slug>.md` using the schema above.
120
- Set `status: open` (or `applied` if you already shipped the fix in this same run, with
121
- the commit linked).
122
- 3. Set `scope` honestly (`simple` vs `architectural`).
123
- 4. Commit the lesson file(s) on `develop` alongside the run's other commits.
124
- 5. Mention in the verdict/summary that N lessons were captured.
179
+ ## Closing a lesson
180
+
181
+ The fixing commit closes the issue with `Fixes #N` (or `Fixes LIFEAI/<repo>#N` from another
182
+ repository) — but GitHub acts on that only when the commit reaches the repository's **default
183
+ branch**. Where fixes land somewhere else first, close it explicitly once the fix is on the
184
+ integration branch:
185
+
186
+ ```bash
187
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" close <issue-number-or-url> --repo <owning slug> --commit <sha> [--reason "<text>"]
188
+ ```
189
+
190
+ It comments `Fixed by <sha>` and closes the issue as completed. This applies to **regen-root**
191
+ (default branch `main`, integration `develop`) and **regen-deploy-mgr** (default branch
192
+ `codex/regen-deploy-mgr-wp1`, which does not carry what ships). Not worth fixing → close the
193
+ issue as not planned with a one-line reason.
125
194
 
126
195
  ---
127
196
 
128
197
  ## Triage procedure (rdc:housekeeping, weekly)
129
198
 
130
- `rdc:housekeeping` adds a **Lessons triage** phase:
199
+ `rdc:housekeeping` runs a **Lessons triage** phase over open lesson issues:
200
+
201
+ ```bash
202
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" list --state open # every registered repository
203
+ node "$LIFEAI_ENV/bin/rdc-lesson.mjs" list --repo <slug> --json # one repository, machine-readable
204
+ ```
205
+
206
+ Every registered repository is listed, skipped because its issues are switched off (reported,
207
+ not a failure), or **NOT listed** — no GitHub repository resolves, or the read failed. NOT
208
+ listed is named on stderr and in `--json` `skipped` with its reason, `complete` is false, and
209
+ the command exits 1. Treat that as an incomplete triage, never as "no lessons there".
210
+
211
+ 1. Cluster open `proposal` issues by area + root-cause similarity (dedupe repeats into one fix;
212
+ close the duplicates as duplicates, linking the survivor). A reopened `recurred` issue goes
213
+ first: its fix did not hold.
214
+ 2. Decide each cluster's scope:
215
+ - **simple** — a one-file fix, a config tweak, a missing grep guard, a test.
216
+ - **architectural** — anything matching `.claude/rules/architectural-change-approval.md`
217
+ (rule/CLAUDE.md/ARCHITECTURE.md edits, cross-cutting refactors, schema reshape, public
218
+ API/MCP changes, skill-contract changes affecting multiple skills). When unsure, it is
219
+ architectural.
220
+ 3. Route per the mode below.
221
+ 4. Work the conversion backlog (§ Existing `.rdc/lessons/` files) with whatever capacity is left.
222
+ 5. Summarize in the housekeeping report: open / recurred / accepted / closed-fixed /
223
+ closed-won't-fix counts with issue URLs, plus backlog files converted and remaining.
224
+
225
+ ### Attended mode (default — a human is present)
226
+
227
+ - **simple** → accept it (§ Accepting), apply the fix directly as a guard/test/script, commit
228
+ with `Fixes #N` (or close it with `rdc-lesson close`, § Closing).
229
+ - **architectural** → do NOT edit. Present the issue + options via `AskUserQuestion` (per
230
+ `architectural-change-approval.md`). On approval, accept it and apply via the correct
231
+ lifecycle (rdc-skills tag/push for skills; cited commit for rules). If deferred, accept it so
232
+ the work item carries it.
233
+ - **Not worth fixing** → close the issue as not planned with a one-line reason.
234
+
235
+ ### Triage procedure — UNATTENDED weekly mode
236
+
237
+ No human present (overnight / cron / `rdc:overnight`) — never run `AskUserQuestion`:
238
+
239
+ - **Per-difficulty model routing** (reuses the `rdc:build` table): clustering and scope
240
+ triage → `claude-sonnet-5`; mechanical apply → `claude-haiku-4-5`; harder multi-file or
241
+ migration fix → `claude-sonnet-5`; design/architectural fix → `claude-opus-5`.
242
+ - **simple** → accept, apply directly or via `rdc:fixit`, commit with `Fixes #N` or close with
243
+ `rdc-lesson close`.
244
+ - **architectural with a single clear correct fix** (records an already-learned lesson —
245
+ "add a gate", "encode X as a test") → accept, route through `rdc:plan` → `rdc:build` (or
246
+ `rdc:fixit` if genuinely under 5 files).
247
+ - **architectural and genuinely ambiguous** (multiple valid approaches, real tradeoffs) → write
248
+ a `human_items` row (`item_type='decision'`, options in `suggested_agent_prompt`,
249
+ `source_type='lesson'`, `source_fingerprint` = the issue URL for dedupe), accept the issue
250
+ against a linked work item, and leave the decision for the morning. This is the asynchronous
251
+ equivalent of the attended interview.
252
+
253
+ Issues are closed, never deleted — a closed issue with its fixing commit, or its won't-fix
254
+ reason, is the audit trail.
255
+
256
+ ---
257
+
258
+ ## Existing `.rdc/lessons/` files — the conversion backlog
131
259
 
132
- 1. Read all `.rdc/lessons/*.md` with `status: open`.
133
- 2. Cluster by `area` + root-cause similarity (dedupe repeats into one fix).
134
- 3. For each cluster:
135
- - `scope: simple` → apply the fix directly (rule line, skill-doc edit, config, guard),
136
- commit it, set the lesson(s) `status: applied` and link the commit.
137
- - `scope: architectural` → do NOT edit. Present the issue + options via
138
- `AskUserQuestion` (per `architectural-change-approval.md`). On approval, apply via the
139
- correct lifecycle (rdc-skills tag/push for skills; cited commit for rules) and set
140
- `status: applied`. If deferred, set `status: triaged` and spawn a `work_item`.
141
- - Not worth fixing → `status: wont-fix` with a one-line reason.
142
- 4. Summarize in the housekeeping report: captured / applied / escalated / deferred counts.
260
+ Files written under the old procedure are retired by state: an encoded lesson's file is
261
+ deleted and links to it point at the enforcing artifact; an unencoded one becomes an issue in
262
+ its owning repository. **The files that remain — doc-only lessons and product lessons — are a
263
+ backlog to convert, not a place to capture.** Each is done when a guard or test carries it:
264
+ ship that artifact, point any live link at it, and delete the file in the same commit.
143
265
 
144
- Lessons are never silently deleted — `applied` and `wont-fix` files stay as the audit trail.
266
+ Housekeeping lists the remaining `.rdc/lessons/*.md` files for exactly that purpose and
267
+ reports the count converted and remaining. Nothing new is written there: a new lesson — a
268
+ doc-only one included — is an issue (§ Capture procedure).
145
269
 
146
270
  ---
147
271
 
148
272
  ## Skills that capture (the long-running set)
149
273
 
150
- `build` · `deploy` · `overnight` · `fixit` · `plan` · `preplan` · `review` · `release` · `collab`
274
+ `build` · `overnight` · `fixit` · `plan` · `preplan` · `review` · `release` · `collab` ·
275
+ `onramp`
151
276
 
152
- Each references this spec from a final "§ Capture lessons" step. A Stop-hook backstop warns
153
- when one of these skills ends a run with findings but no new `.rdc/lessons/` file.
277
+ Each references this spec from a final "§ Capture lessons" step.