t1k:rsi
| Field | Value |
|---|---|
| Module | t1k-kit-feedback |
| Version | 2.14.39 |
| Effort | high |
| Tools | AskUserQuestion, Bash, Edit, Glob, Grep, Read, Skill, Task, Write |
Keywords: lesson ledger, propagate lesson, recursive self-improvement, rsi, self-improve
How to invoke
Section titled “How to invoke”/t1k:rsi[review|apply|audit|gotchas] [--days=N|--max=N|--dry-run]RSI — Recursive Self-Improvement
Section titled “RSI — Recursive Self-Improvement”A fix to a kit-owned skill/rule/agent/hook is not done until the CREATOR artifact for that kind
carries the lesson, so the same class of mistake is never authored again. This skill is the
procedure; t1k-rsi-reviewer is its canonical executor.
No rival pipeline. The pending-skill-updates.jsonl lesson queue IS the ledger of what happened.
The ## Lessons ledger section in each creator’s validation checklist is the durable record of what
we learned. There is no third store — never create one. (The gotcha ledger under ledger/gotchas/ holds gotcha text,
not lessons, and is not a rival: references/ledger-benchmark.md.)
| Mode | Writes? | Does |
|---|---|---|
review | No | Read pending rows, classify each, name the creator target. Report only. |
apply | Yes | Append ledger lines to the named creator checklists and ship per § Shipping. |
audit | No | git log --grep fix commits over N days vs the ledgers; report unpropagated fixes and stale ledger lines. |
gotchas | Stamp / prune only (auto-merge PR) | Benchmark the gotcha ledger against a diff or transcript: stamp entries seen caught or violated, propose pruning those unseen for 30 days. |
Details: references/review.md · references/apply.md · references/audit.md · references/ledger-benchmark.md.
The queue (read it, never re-implement it)
Section titled “The queue (read it, never re-implement it)”The queue path comes from the existing lib — do not hand-roll a second resolver:
bun -e "const{tryResolveQueuePath}=require('./.claude/hooks/lib/queue-write.cjs');console.log(tryResolveQueuePath('rsi')||'unavailable')"Rows are JSONL; each carries ts, type, fingerprint, kit, skill, payload, sessionId,
submitted. Every P1-authored row also carries kind (skill|rule|agent|hook), fixSignals
(commitType, issueRefs, fixWords), sessionCount, and dedupCount — read kind directly, do
not re-derive it. A row may also carry an optional observedModel (canonical model id from the
transcript); references/gotcha-tags.md says how it becomes a [model-weakness: …] tag. A row queued before P1 landed predates the field; references/review.md § 3 gives
the file-path fallback for that legacy shape, and the report says “derived (legacy row)” when it was
used, never “read”.
Classify (the reviewer’s decision — never a hook’s)
Section titled “Classify (the reviewer’s decision — never a hook’s)”Hooks emit facts; this skill decides. For each row answer three questions:
- Is it a fix? A behavior correction, not a preference or a fresh feature.
- Is it recurrable? Would the same class of mistake be authored again by someone following the current creator artifact? No → drop it, report the drop and why.
- Root-cause class — exactly one of:
| Class | Meaning | Route |
|---|---|---|
missing-checklist-item | The creator checklist never asked | append ledger line to that creator |
wrong-default | The artifact steers toward the mistake | append ledger line to that creator |
doc-drift | Prose disagrees with the code | append ledger line to that creator |
missing-rule | No rule binds the behavior at all | delegate to t1k-rules-manager (optional module t1k-maintainer; not installed: t1k-kit-developer) — never write the rule here |
missing-gate | Only a mechanism can hold it | file an issue on theonekit-release-action — never write the gate inline |
Then name the creator target by the row’s kind:
kind | Creator target |
|---|---|
| skill | skills/t1k-skill-creator/references/validation-checklist.md |
| rule | skills/t1k-rule-creator/references/validation-checklist.md |
| agent | skills/t1k-agent-creator/references/validation-checklist.md |
| hook | skills/t1k-hook-creator/references/validation-checklist.md |
Ledger line format (SSOT)
Section titled “Ledger line format (SSOT)”Appended under the target checklist’s ## Lessons ledger:
- [YYYY-MM-DD] <one line, the lesson> — evidence: <fingerprint|PR|issue>One line. The lesson is an instruction to a future author, not a story about the past — “never X
without Y”, not “we once forgot Y”. Incident narrative belongs in that creator’s docs/ companion.
Shipping (apply only)
Section titled “Shipping (apply only)”- Kit source repo → branch + PR. Consumer project →
/t1k:sync-back. - Write back to the row:
{fingerprint, submitted:true, prUrl, rsi:{class,target}}. - Commit body carries
rsi-evidence: <fingerprint>— this is also the loop guard’s opt-out signal.
Guardrails
Section titled “Guardrails”Rate limits. One frame per 24h per project; ≤3 creator edits and 1 PR per run; autoFix from
t1k-config-core.json → rsi (apply by default — writes the ledger + opens a --auto PR). The
kill-switch is propose: it reverts every write to a diff-only proposal that writes nothing.
Loop prevention. RSI never ingests its own output. A row is skipped when its path is under
skills/t1k-*-creator/**, skills/t1k-rsi/**, agents/t1k-*-manager.md, or agents/t1k-rsi-*;
when MR_SPAWNED=1; or when the commit body carries rsi-evidence:.
Auto-merge boundary (full-auto by default; the one hard exception is self-machinery):
| Change | Path |
|---|---|
Any kit-owned change — checklist body, references/ prose, a rule, agent frontmatter, hook .cjs, or config | PR with gh pr merge --auto armed |
skills/t1k-rsi/** except skills/t1k-rsi/ledger/**, agents/t1k-rsi-reviewer.md, or a creator’s own creator | human PR, no --auto — RSI never modifies itself |
skills/t1k-rsi/ledger/** — the gotcha ledger (stamps, prunes, migrations): data, not machinery | PR with gh pr merge --auto armed, like any kit-owned change |
This is full-auto: with rsi.autoFix: "apply" (the shipped default), a rule / agent-frontmatter /
hook / config fix opens a --auto PR and merges on green CI, no human in the loop. The kill-switch
is rsi.autoFix: "propose" — set it and every write reverts to a diff-only proposal that writes
nothing. The self-machinery row is a loop-safety guardrail and is NOT relaxed by full-auto: a
self-improvement engine that rewrites its own machinery unattended is a self-corruption / infinite-loop
risk, so it stays a human PR regardless of autoFix.
RSI never modifies itself. skills/t1k-rsi/** and agents/t1k-rsi-reviewer.md change only by
human PR — report the need, do not author the edit. The ONE carve-out is skills/t1k-rsi/ledger/**: it holds gotcha
data (entries, last-seen, hits), not procedure, so stamping and pruning it is an ordinary auto-merge PR. Nothing
else under skills/t1k-rsi/ is relaxed.
Escalation
Section titled “Escalation”The same class hitting the same target ≥rsi.escalationThreshold times in 30 days means prose
failed. Open an [rsi-escalation] issue demanding a mechanism (hook, gate, or doctor check). More
prose is not the answer at that point.
Anti-patterns
Section titled “Anti-patterns”- Building a second ledger, a new hook rivalling auto-lesson, or a cron job (design § “Do NOT build”).
- Writing a gate inline instead of filing it on
theonekit-release-action. - Writing a rule file directly instead of spawning
t1k-rules-manager(optional modulet1k-maintainer; not installed:t1k-kit-developer). - Propagating a non-recurrable one-off — that is churn, not learning.
- Editing a creator artifact’s own creator, or anything under
t1k-rsi*.
Kit-owned artifacts only: .claude/skills/**, .claude/modules/*/rules/**, .claude/agents/*.md,
.claude/hooks/*.cjs. End-user application code is out of scope — route it to the registered
implementer role.