release: Koiz, one lesson base for every project
@@ -0,0 +1,45 @@
|
||||
# How Koiz works
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-how-it-works.png" alt="Four objects in a row on a marble table: a stack of thin marble leaves, the open ledger with a gold pin through its page, one thicker leaf, and the gate plate with a rectangular opening" width="100%"></p>
|
||||
|
||||
Three things are kept apart on purpose, because mixing them is what makes lesson bases rot.
|
||||
|
||||
## Capture is cheap, deterministic and machine-only
|
||||
|
||||
When a session closes, a `SessionEnd` hook hands the instrument the transcript that is already on your disk. The instrument reads it for the things a disk can prove: commands that failed, exit codes, gates that refused, how many attempts a task took.
|
||||
|
||||
Two kinds of noise never reach the base. A watchdog that did its job is not a failure, so a blocker that fired is skipped. Evidence shorter than three meaningful words is skipped as well: an unpinned lesson built from a fragment would later stop a night run over nothing.
|
||||
|
||||
Capture is idempotent. Reading the same transcript twice does not double the records, because each candidate carries a fingerprint and a repeat raises a counter instead of adding a line.
|
||||
|
||||
## Storage appends and never rewrites
|
||||
|
||||
The journal at `~/.claude/koiz/lessons.jsonl` is append-only. The state of the base is the result of replaying the journal from the beginning, which means every record keeps its history and nothing is silently edited away.
|
||||
|
||||
A record carries what broke, how to reproduce it, why it happened, what closes it, the project, the date and a validity interval. A lesson that stopped applying is closed by date rather than deleted. It is not a lie, it simply no longer holds, and the reason it was closed stays readable next to it.
|
||||
|
||||
The base has a budget, three hundred active lessons by default. The ceiling is the point: without one, a base grows forever and nobody ever collapses anything.
|
||||
|
||||
## Collapse is a separate, deliberate pass
|
||||
|
||||
Merging on write is expensive and loses data, so it is a command of its own. `collapse` looks for lessons that repeat the same shape, proposes one rule that covers them, and shows exactly which records it would fold. `collapse --dry` shows the proposal and changes nothing.
|
||||
|
||||
## Pinning is what makes this a tool rather than a diary
|
||||
|
||||
Every record has a pin field with five legal values: `hook`, `deny`, an instrument, a test, or nothing. Home-made values are refused. A pin without a reference to a file or a command is refused too, because a mechanism nobody can open is not a mechanism.
|
||||
|
||||
"Nothing" is legal and honest. It means the mechanism does not exist yet.
|
||||
|
||||
## The gate turns the base into pressure
|
||||
|
||||
`node scripts/koiz.mjs gate` exits non-zero when a lesson came back and is still pinned to nothing. Put it in a nightly script or a pre-push hook and the base starts holding you to your own conclusions. There are two honest ways out: close the repeat with a mechanism, or admit the rule does not work and close it by date. A deferral needs a date and a reason.
|
||||
|
||||
## One base, every project
|
||||
|
||||
The key is the class of the error, not the name of the repository. A lesson captured while you worked on a mobile app is found from a legal-practice project, because the thing that broke was the path handling, not the app.
|
||||
|
||||
That is why the journal lives outside any project tree. A base that sits inside one repository only ever warns the people already standing in that repository, which is the one place the lesson is least needed.
|
||||
|
||||
## Why the self-test is trusted
|
||||
|
||||
`scripts/koiz-mutate.mjs` breaks nineteen rules of the instrument one at a time and demands that the self-test fail every single time. A mutation that survives means the check was not checking. The first run of that gate found a real defect: the instrument exited zero on a symlinked path instead of refusing.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Как работает Койз
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-how-it-works.png" alt="Четыре предмета в ряд на мраморном столе: стопка тонких мраморных листов, раскрытый свод с золотой шпилькой сквозь страницу, один лист потолще и плита с прорезанным проемом" width="100%"></p>
|
||||
|
||||
Три вещи разведены сознательно: именно их смешение и гноит базы уроков.
|
||||
|
||||
## Съем дешевый, детерминированный и машинный
|
||||
|
||||
На закрытии сессии хук `SessionEnd` отдает прибору транскрипт, который и так лежит на вашем диске. Прибор читает оттуда то, что можно доказать с диска: упавшие команды, коды возврата, отказы ворот, число попыток на задачу.
|
||||
|
||||
Два вида шума до базы не доходят. Сработавший сторож провалом не считается, поэтому отказ блокера пропускается. Улика короче трех значимых слов пропускается тоже: незакрепленный урок, собранный из обрывка, потом останавливал бы ночной прогон на ровном месте.
|
||||
|
||||
Съем идемпотентен. Повторное чтение того же транскрипта не удваивает записи: у каждого кандидата есть отпечаток, и повтор поднимает счетчик вместо новой строки.
|
||||
|
||||
## Хранение только дописывает
|
||||
|
||||
Журнал `~/.claude/koiz/lessons.jsonl` работает на дозапись. Состояние базы получается проигрыванием журнала с начала, поэтому у каждой записи остается история, и ничего не правится молча.
|
||||
|
||||
Запись несет: что сломалось, чем воспроизводится, почему так вышло, чем закрыто, проект, дату и интервал действия. Переставший действовать урок закрывается датой, а не стирается. Он не ложь, он просто больше не держит, и причина закрытия читается рядом с ним.
|
||||
|
||||
У базы есть бюджет, по умолчанию триста активных уроков. Потолок здесь и есть смысл: без него база растет вечно, и схлопывать никто не начинает.
|
||||
|
||||
## Схлопывание идет отдельным осознанным проходом
|
||||
|
||||
Слияние на записи стоит дорого и теряет данные, поэтому оно вынесено в свою команду. `collapse` ищет уроки одной формы, предлагает одно правило на них и показывает, какие записи свернет. `collapse --dry` показывает предложение и ничего не меняет.
|
||||
|
||||
## Закрепление отличает инструмент от дневника
|
||||
|
||||
У каждой записи есть поле закрепления с пятью законными значениями: `hook`, `deny`, прибор, тест или «ничем». Самодельные значения отвергаются. Закрепление без ссылки на файл или команду отвергается тоже: механизм, который нельзя открыть, механизмом не считается.
|
||||
|
||||
«Ничем» тоже законное и честное значение. Оно говорит, что механизма пока нет.
|
||||
|
||||
## Ворота превращают базу в давление
|
||||
|
||||
`node scripts/koiz.mjs gate` выходит ненулевым кодом, когда урок вернулся и до сих пор закреплен «ничем». Впишите ее в ночной скрипт или в хук перед пушем, и база начнет держать вас за ваши же выводы. Честных выхода два: закрыть повтор механизмом или признать правило нерабочим и закрыть его датой. Отсрочка требует даты и причины.
|
||||
|
||||
## Одна база на все проекты
|
||||
|
||||
Ключом служит класс ошибки, а не имя репозитория. Урок, снятый во время работы над мобильным приложением, находится из проекта юридической практики: сломалась работа с путями, а не приложение.
|
||||
|
||||
Поэтому журнал и живет вне дерева проектов. База, лежащая внутри одного репозитория, предупреждает только тех, кто уже стоит в этом репозитории, то есть ровно там, где урок нужен меньше всего.
|
||||
|
||||
## Почему селфтесту можно верить
|
||||
|
||||
`scripts/koiz-mutate.mjs` ломает девятнадцать правил прибора по одному и требует, чтобы селфтест упал каждый раз. Выжившая мутация означает, что проверка не проверяла. Первый прогон этих ворот нашел настоящий дефект: прибор выходил нулем по симлинк-пути вместо отказа.
|
||||
@@ -0,0 +1,49 @@
|
||||
# Koiz 是怎么工作的
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-how-it-works.png" alt="大理石桌上并排放着四样东西:一摞薄薄的大理石片、被金色别针穿透的摊开册页、一片更厚的石片,以及开着长方形通孔的石板" width="100%"></p>
|
||||
|
||||
三件事被有意分开:正是把它们混在一起,教训库才会烂掉。
|
||||
|
||||
## 采集便宜、确定,而且只由机器做
|
||||
|
||||
会话结束时,`SessionEnd` 钩子把本来就在你磁盘上的会话记录交给仪器。仪器从里面读磁盘能证明的东西:失败的命令、退出码、被拒的闸门、一个任务重试了几次。
|
||||
|
||||
有两类噪音进不了库。守卫正常工作不算失败,所以已经拦住的阻断会被跳过。短于三个实义词的证据也会被跳过:用碎片拼出来的、没有固定的教训,之后会无缘无故拦下夜里的活儿。
|
||||
|
||||
采集是幂等的。同一份记录读两遍不会写出两条:每个候选都带指纹,重复只会让计数加一,而不是多出一行。
|
||||
|
||||
## 存储只追加
|
||||
|
||||
`~/.claude/koiz/lessons.jsonl` 这份日志只做追加。库的状态是从头重放日志得到的结果,所以每条记录都留着自己的历史,也不会被悄悄改掉。
|
||||
|
||||
一条记录包含:什么坏了、怎么复现、为什么会这样、被什么关掉了、项目、日期和生效区间。不再适用的教训按日期关闭,而不是删除。它不是假话,只是不再成立了,关闭的原因就写在旁边。
|
||||
|
||||
库有预算,默认三百条生效教训。上限本身就是意义所在:没有上限,库会一直长下去,也就没人真的去归并。
|
||||
|
||||
## 归并是单独的、有意识的一趟
|
||||
|
||||
写入时顺手合并既贵又会丢数据,所以它被拆成了自己的命令。`collapse` 找出形状相同的教训,提出一条能覆盖它们的规则,并把要合并哪几条摊开给你看。`collapse --dry` 只给建议,什么都不改。
|
||||
|
||||
## 固定,是工具和日记的分界
|
||||
|
||||
每条记录都有固定这一栏,只有五个合法值:`hook`、`deny`、仪器、测试,或者「没有」。自造的值会被拒绝。没有指向具体文件或命令的固定也会被拒绝:打不开的机制不算机制。
|
||||
|
||||
「没有」是合法的,也是诚实的。它说明机制还不存在。
|
||||
|
||||
## 闸门把库变成压力
|
||||
|
||||
`node scripts/koiz.mjs gate` 在教训回来、而固定栏还写着「没有」时以非零码退出。把它写进夜间脚本或推送前的钩子,库就开始拿你自己的结论管着你。诚实的出路有两条:用机制关掉这次重复,或者承认这条规则不成立,按日期关掉它。要延期就得写上日期和理由。
|
||||
|
||||
## 一份库,所有项目
|
||||
|
||||
检索键是错误的类别,不是仓库的名字。你在做移动应用时采到的教训,从法律业务那个项目里也能找出来:坏掉的是路径处理,不是那个应用。
|
||||
|
||||
所以日志才放在所有项目目录之外。放在某一个仓库里的库,只会提醒已经站在那个仓库里的人,而那恰恰是最不需要这条教训的地方。
|
||||
|
||||
## 装了之后系统里多了什么
|
||||
|
||||
只有两样:`~/.claude/koiz` 这个目录,以及设置文件里一条 `SessionEnd` 记录。没有守护进程,没有开机启动项,没有后台任务,也没有任何网络连接。要卸载,把那条记录删掉就行,日志留着还是你的。
|
||||
|
||||
## 为什么自检值得信
|
||||
|
||||
`scripts/koiz-mutate.mjs` 每次打断仪器的一条规则,一共十九条,并要求自检每一次都失败。有变异活下来,就说明那个检查根本没在检查。这道闸门第一次跑,就抓到了一个真实缺陷:仪器在符号链接路径上是以 0 退出的,而不是拒绝。
|
||||
@@ -0,0 +1,142 @@
|
||||
# Getting Started In Chat
|
||||
|
||||
[Русский](ONBOARDING-CHAT.ru.md) · [中文](ONBOARDING-CHAT.zh.md)
|
||||
|
||||
This page is read by an agent, not by you. The agent runs the conversation from it: it says what
|
||||
it is about to do before doing it, and it stops wherever the choice is yours.
|
||||
|
||||
<!-- owner-greeting:start -->
|
||||
|
||||
> Hi. I am Fil.
|
||||
>
|
||||
> I built Koiz after the same mistake came back in three projects in a row. Every time I honestly
|
||||
> wrote the lesson into a log. Every time the next session did not read it — because prose is not
|
||||
> a gate, and a diary entry forbids nobody anything.
|
||||
>
|
||||
> Koiz stores a lesson only with the field that matters: what pins it. A hook, a deny rule, an
|
||||
> instrument, or a test. A lesson nothing can pin is a complaint, not a lesson, and the base says
|
||||
> so out loud.
|
||||
>
|
||||
> From here an agent talks to you. It installs nothing silently: before every step it says what
|
||||
> changes on disk and what you get. If a step is not for you, say "skip".
|
||||
>
|
||||
> — Filipp Zarubin
|
||||
|
||||
<!-- owner-greeting:end -->
|
||||
|
||||
## How To Use This
|
||||
|
||||
Open the project folder in Claude Code, Codex, or another agent and say: "run the onboarding".
|
||||
The agent walks the steps below, says each one before running it, and waits for your decision at
|
||||
every fork.
|
||||
|
||||
## Step 1: I look at what your machine already has
|
||||
|
||||
**What I do:** check the Node version and that git is present.
|
||||
|
||||
**Why:** Koiz is a set of instruments on Node with zero dependencies. Node 20 or newer is enough;
|
||||
nothing else will be installed, and that is worth confirming up front instead of midway.
|
||||
|
||||
**What changes on disk:** nothing. These two commands only read.
|
||||
|
||||
**What you get:** a plain "you can" or "update Node first", with no guessing.
|
||||
|
||||
```bash
|
||||
node --version
|
||||
git --version
|
||||
```
|
||||
|
||||
## Step 2: I bring the house down to your machine
|
||||
|
||||
**What I do:** clone the repository into the folder you choose.
|
||||
|
||||
**Why:** everything else happens inside it: the instruments, the acceptance gate, and the mutation
|
||||
gate all live there.
|
||||
|
||||
**What changes on disk:** one new folder appears. Nothing outside it is touched.
|
||||
|
||||
**What you get:** a complete local copy of the tool.
|
||||
|
||||
**Fork:** with git I use `git clone`, and updating later is one command. Without git I take the
|
||||
archive, but then updating means downloading again.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zarubinvibe/koiz.git && cd koiz
|
||||
```
|
||||
|
||||
## Step 3: I check that the instruments do not lie
|
||||
|
||||
**What I do:** run the selftest, then the mutation gate: it breaks nineteen rules on a copy and
|
||||
demands that each one fails the selftest.
|
||||
|
||||
**Why:** a selftest that stays green while a rule is broken checks nothing. Before you trust a
|
||||
tool with your lessons, it is worth seeing that it judges itself seriously.
|
||||
|
||||
**What changes on disk:** nothing outside a temporary folder that removes itself.
|
||||
|
||||
**What you get:** two green lines. A red one means do not install: the tool does not behave here
|
||||
the way it claims, and an issue is the right answer.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs --selftest
|
||||
node scripts/koiz-mutate.mjs
|
||||
```
|
||||
|
||||
## Step 4: I set up the lesson base
|
||||
|
||||
**What I do:** create the lesson journal and, if you already keep a handwritten self-learning log,
|
||||
migrate its entries with a check that not a single one was lost.
|
||||
|
||||
**Why:** the base lives OUTSIDE the repository, in `~/.claude/koiz/lessons.jsonl`. Lessons carry
|
||||
paths, names, and fragments of commands, and git is no place for that. The journal is append-only:
|
||||
nothing is overwritten and nothing is erased.
|
||||
|
||||
**What changes on disk:** one file appears in your home folder. Secrets do not reach it: the
|
||||
filter sits on write, not on read.
|
||||
|
||||
**What you get:** a base keyed by error class rather than repository name — a lesson from one
|
||||
project is found from another.
|
||||
|
||||
**Fork:** migrate an existing log (`--file <path>`) or start from an empty base. Migration spoils
|
||||
nothing: it only appends, and at the end it verifies every record by its source.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs migrate --file ~/.claude/self-learning/lessons.md
|
||||
```
|
||||
|
||||
## Step 5: I put capture on session close
|
||||
|
||||
**What I do:** wire the `SessionEnd` hook that reads the transcript on exit and takes the failed
|
||||
commands, the gate refusals, and the calls repeated three times.
|
||||
|
||||
**Why:** a lesson that has to be typed by hand does not get typed. The machine takes what is
|
||||
visible without you and leaves you the one thing it cannot know — why it happened.
|
||||
|
||||
**What changes on disk:** one line in your agent settings. The hook is quiet and cannot fail:
|
||||
it is unable to break the exit from a session.
|
||||
|
||||
**What you get:** a base that fills itself, and a list of raw material whose cause you still owe.
|
||||
|
||||
**Fork:** automatically through the hook, or by hand with `capture --transcript <file>` after a
|
||||
session. The first is more reliable, the second leaves your settings untouched.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs capture --transcript ~/.claude/projects/<project>/<session>.jsonl
|
||||
```
|
||||
|
||||
## Step 6: we ask the base and look at the debt
|
||||
|
||||
**What I do:** ask the base a question in your own words and show you the debt gate.
|
||||
|
||||
**Why:** the base proves itself by an answer, not by an install. The gate answers a different
|
||||
question: what has already repeated twice and is still pinned by nothing.
|
||||
|
||||
**What changes on disk:** nothing. Both commands only read.
|
||||
|
||||
**What you get:** results that carry the pin of every lesson, and an honest debt list. Exit code 1
|
||||
from the gate means this error class will come back until a mechanism closes it.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs ask "what the lesson was about"
|
||||
node scripts/koiz.mjs debt
|
||||
```
|
||||
@@ -0,0 +1,140 @@
|
||||
# Знакомство в чате
|
||||
|
||||
[English](ONBOARDING-CHAT.md) · [中文](ONBOARDING-CHAT.zh.md)
|
||||
|
||||
Эту страницу читает не человек, а агент. Он ведёт по ней разговор: говорит, что собирается
|
||||
сделать, прежде чем сделать, и останавливается там, где выбор ваш.
|
||||
|
||||
<!-- owner-greeting:start -->
|
||||
|
||||
> Привет. Я Фил.
|
||||
>
|
||||
> Койз я собрал после того, как одна и та же ошибка повторилась у меня в трёх проектах подряд.
|
||||
> Каждый раз я честно записывал урок в лог. Каждый раз следующая сессия его не читала — потому
|
||||
> что текст не ворота, а запись в дневнике никому ничего не запрещает.
|
||||
>
|
||||
> Койз хранит уроки так, чтобы у каждого было поле «чем закреплено»: хук, запрет, прибор или
|
||||
> тест. Урок, который нечем закрепить, — это жалоба, а не урок, и база говорит об этом прямо.
|
||||
>
|
||||
> Дальше с вами говорит агент. Он не поставит ничего молча: перед каждым шагом скажет, что
|
||||
> меняется на диске и что вы получите. Не нужен шаг — скажите «пропусти».
|
||||
>
|
||||
> — Филипп Зарубин
|
||||
|
||||
<!-- owner-greeting:end -->
|
||||
|
||||
## Как этим пользоваться
|
||||
|
||||
Откройте папку проекта в Claude Code, Codex или другом агенте и скажите: «проведи онбординг».
|
||||
Агент идёт по шагам ниже, произносит каждый до исполнения и ждёт вашего решения на развилках.
|
||||
|
||||
## Шаг 1: смотрю, что уже есть на машине
|
||||
|
||||
**Что я делаю:** проверяю версию Node и наличие git.
|
||||
|
||||
**Зачем:** Койз — это приборы на Node без единой зависимости. Нужен Node 20 или новее; больше
|
||||
ничего ставить не придётся, и это стоит подтвердить до начала, а не в середине.
|
||||
|
||||
**Что меняется на диске:** ничего. Две команды только читают.
|
||||
|
||||
**Что вы получите:** ответ «можно» или «сначала обновите Node», без догадок.
|
||||
|
||||
```bash
|
||||
node --version
|
||||
git --version
|
||||
```
|
||||
|
||||
## Шаг 2: забираю дом
|
||||
|
||||
**Что я делаю:** клонирую репозиторий в выбранную вами папку.
|
||||
|
||||
**Зачем:** дальше всё происходит внутри: приборы, ворота приёмки и мутационные ворота лежат там.
|
||||
|
||||
**Что меняется на диске:** появляется одна новая папка. За её пределами ничего не трогается.
|
||||
|
||||
**Что вы получите:** локальную копию инструмента целиком.
|
||||
|
||||
**Развилка:** есть git — беру `git clone`, обновление потом одной командой. Нет git — беру
|
||||
архивом, но тогда обновляться придётся повторным скачиванием.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/zarubinvibe/koiz.git && cd koiz
|
||||
```
|
||||
|
||||
## Шаг 3: проверяю, что приборы не врут
|
||||
|
||||
**Что я делаю:** гоню селфтест, а затем мутационные ворота: они ломают девятнадцать правил по
|
||||
копии и требуют, чтобы каждое роняло селфтест.
|
||||
|
||||
**Зачем:** селфтест, который остаётся зелёным при сломанном правиле, ничего не проверяет.
|
||||
Прежде чем доверить инструменту свои уроки, стоит увидеть, что он судит себя всерьёз.
|
||||
|
||||
**Что меняется на диске:** ничего за пределами временной папки, которая удаляется сама.
|
||||
|
||||
**Что вы получите:** две зелёные строки. Красная — не ставьте, откройте issue: значит инструмент
|
||||
у вас работает не так, как заявлено.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs --selftest
|
||||
node scripts/koiz-mutate.mjs
|
||||
```
|
||||
|
||||
## Шаг 4: завожу базу уроков
|
||||
|
||||
**Что я делаю:** создаю журнал уроков и, если у вас уже есть рукописный лог самообучения,
|
||||
переношу его записи с проверкой, что ни одна не потерялась.
|
||||
|
||||
**Зачем:** база лежит ВНЕ репозитория — в `~/.claude/koiz/lessons.jsonl`. Уроки несут пути,
|
||||
имена и куски команд, и в git такому не место. Журнал только дописывается: ничего не
|
||||
перезаписывается и не стирается.
|
||||
|
||||
**Что меняется на диске:** появляется один файл в вашей домашней папке. Секреты в него не
|
||||
попадают: фильтр стоит на записи, а не на выдаче.
|
||||
|
||||
**Что вы получите:** базу, которая ищется по классу ошибки, а не по имени репозитория, — урок из
|
||||
одного проекта находится из другого.
|
||||
|
||||
**Развилка:** перенести существующий лог (`--file <путь>`) или начать с чистой базы. Перенос
|
||||
ничего не портит: он только дописывает и в конце сверяет каждую запись по её источнику.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs migrate --file ~/.claude/self-learning/lessons.md
|
||||
```
|
||||
|
||||
## Шаг 5: ставлю съём на закрытие сессии
|
||||
|
||||
**Что я делаю:** вшиваю хук `SessionEnd`, который на выходе из сессии снимает с транскрипта
|
||||
упавшие команды, отказы ворот и трижды повторённые вызовы.
|
||||
|
||||
**Зачем:** урок, который надо записать руками, не записывается. Машина берёт с диска то, что
|
||||
видно без вас, и оставляет вам единственное, чего она не знает, — «почему так вышло».
|
||||
|
||||
**Что меняется на диске:** одна строка в настройках вашего агента. Хук тихий и не падающий:
|
||||
он не может сломать выход из сессии.
|
||||
|
||||
**Что вы получите:** базу, которая пополняется сама, и список сырья, у которого надо дознать
|
||||
причину.
|
||||
|
||||
**Развилка:** автоматически хуком или вручную командой `capture --transcript <файл>` после
|
||||
сессии. Первое надёжнее, второе не трогает ваши настройки.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs capture --transcript ~/.claude/projects/<проект>/<сессия>.jsonl
|
||||
```
|
||||
|
||||
## Шаг 6: спрашиваем базу и смотрим долги
|
||||
|
||||
**Что я делаю:** задаю базе вопрос вашими словами и показываю ворота долга.
|
||||
|
||||
**Зачем:** база доказывает себя не установкой, а ответом. Ворота отвечают на другой вопрос:
|
||||
что уже повторилось дважды и до сих пор ничем не закреплено.
|
||||
|
||||
**Что меняется на диске:** ничего. Обе команды только читают.
|
||||
|
||||
**Что вы получите:** выдачу с полем «чем закреплено» у каждого урока и честный список долгов.
|
||||
Код 1 у ворот означает: этот класс ошибки повторится снова, пока его не закроет механизм.
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs ask "о чём был урок"
|
||||
node scripts/koiz.mjs debt
|
||||
```
|
||||
@@ -0,0 +1,86 @@
|
||||
# 对话式上手:智能体和你一起安装 Koiz
|
||||
|
||||
这一页写给刚打开一个新克隆、需要向人解释自己的智能体。从上往下读,一步一步来,每一步都说清楚你在做什么、为什么这么做。
|
||||
|
||||
<!-- owner-greeting:start -->
|
||||
|
||||
> 你好。我是 Koiz,蜂群的审问者。
|
||||
>
|
||||
> 我为你所有的项目保存同一份教训库。教训进来的方式是拆解,不是复述:什么坏了,为什么会这样,重复被什么关掉了。最后一栏最重要,它写着「没有」,这条教训就还没做完。
|
||||
>
|
||||
> 我们现在把我装到你的机器上。我一次只问一个问题,每一步之前先说磁盘上会改变什么,没有你的「好」我什么都不做。
|
||||
|
||||
<!-- owner-greeting:end -->
|
||||
|
||||
## 第 1 步:先看清楚我们站在哪里
|
||||
|
||||
**我在做什么:** 检查 Node 版本,确认我们在 Koiz 的克隆目录里。
|
||||
|
||||
**为什么:** 在低于 20 的 Node 上安装,会在三步之后抛出一个看不懂的错误,那时候你面对的是一个装了一半的东西,比现在难处理得多。
|
||||
|
||||
**磁盘上会改变什么:** 什么都不变,这一步只读。
|
||||
|
||||
**你会得到:** 一个诚实的答案:下面这些到底能不能跑。
|
||||
|
||||
```bash
|
||||
node --version
|
||||
ls scripts/koiz.mjs
|
||||
```
|
||||
|
||||
## 第 2 步:决定教训库放在哪里
|
||||
|
||||
**我在做什么:** 问你是保持默认的 `~/.claude/koiz/lessons.jsonl`,还是换个地方。
|
||||
|
||||
**为什么:** 教训库放在仓库之外,因为教训里带着路径和别人项目的名字。如果你的工作文件在加密卷或共享磁盘上,现在选好比以后搬日志便宜得多。
|
||||
|
||||
**磁盘上会改变什么:** 暂时什么都不变,我只是记住你的回答。
|
||||
|
||||
**你会得到:** 一个固定的位置,以后总能在那里找到你的教训。
|
||||
|
||||
**岔路:** 用默认位置,或者给出你自己的目录并通过 `KOIZ_DB` 传进来。
|
||||
|
||||
## 第 3 步:把采集挂到会话结束上
|
||||
|
||||
**我在做什么:** 运行 `bash install.sh`,和你一起回答它的那一个问题。
|
||||
|
||||
**为什么:** 这是我在自己目录之外做的唯一改动,它让你不用再手打教训。手打这件事,人一般坚持两天。
|
||||
|
||||
**磁盘上会改变什么:** 出现教训库目录,`~/.claude/settings.json` 里多一条 `SessionEnd` 记录;原来的设置文件会在旁边留一份副本。
|
||||
|
||||
**你会得到:** 会话结束时自己写下来的教训。
|
||||
|
||||
**岔路:** 现在就装钩子,或者跳过它,用 `add` 命令手动记录。
|
||||
|
||||
```bash
|
||||
bash install.sh
|
||||
```
|
||||
|
||||
## 第 4 步:如果有旧教训,就搬过来
|
||||
|
||||
**我在做什么:** 问你手里是不是已经有一份写着结论的文件,然后整份迁移过来。
|
||||
|
||||
**为什么:** 旧教训进到空库里是历史。进到已经有内容的库里,它们会和新的混在一起,之后没有任何办法把它们分开。
|
||||
|
||||
**磁盘上会改变什么:** 日志里追加记录;已有的记录一条都不改。
|
||||
|
||||
**你会得到:** 迁移了多少条、丢了多少条,而后者必须是零。
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs migrate --file ~/.claude/self-learning/lessons.md
|
||||
```
|
||||
|
||||
## 第 5 步:写下第一条教训,并把闸门装上
|
||||
|
||||
**我在做什么:** 问你最近一周什么地方坏过,和你一起写下来,然后把欠账闸门演示一遍。
|
||||
|
||||
**为什么:** 玩具例子证明不了任何事。第一条教训必须是你自己的,否则这个库始终是别人的。
|
||||
|
||||
**磁盘上会改变什么:** 日志里多出你的那条记录。
|
||||
|
||||
**你会得到:** 一个活的库,以及一条在没固定的教训再次出现时会变红的命令。
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs add --what "什么坏了" --why "为什么会这样" --pin test --pin-ref scripts/koiz-mutate.mjs
|
||||
node scripts/koiz.mjs debt
|
||||
node scripts/koiz.mjs gate
|
||||
```
|
||||
@@ -0,0 +1,45 @@
|
||||
# Onboarding: the first run, step by step
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-onboarding.png" alt="Koios standing behind a marble table with the open ledger on his palm and blue paths arriving from the left edge of the frame" width="100%"></p>
|
||||
|
||||
This page is for somebody who has never installed a tool from GitHub. Every step says what to type and what appears on screen afterwards. If a step shows something else, stop there and open an issue: a walkthrough that lies is worse than no walkthrough.
|
||||
|
||||
You need Git, Node 20 or newer, and a terminal. No agent is required.
|
||||
|
||||
1. **Check Node.** Type `node --version`. You should see something like `v22.14.0`. If the version starts with `v18` or lower, install a newer Node from https://nodejs.org before going on.
|
||||
|
||||
2. **Pick a folder and clone the project.** Type `git clone https://github.com/zarubinvibe/koiz.git` and then `cd koiz`. Git prints a few lines about counting and unpacking objects, and you end up inside a folder that holds `scripts`, `docs` and `install.sh`.
|
||||
|
||||
3. **Run the install.** Type `bash install.sh`. It asks one question: whether to put lesson capture on session close. Answer `y`. It prints the path of the lesson base, the line `хук вписан` with the path of your settings file, and then runs the self-test.
|
||||
|
||||
4. **Read the self-test line.** The last block starts with `selftest ok` and lists what was checked. If it says anything else, the install did not finish and nothing else on this page will work.
|
||||
|
||||
5. **Ask the empty base a question.** Type `node scripts/koiz.mjs ask "what has broken before"`. On a fresh install the base is empty, so it answers that it found nothing. That is the correct answer, and it proves the instrument reads its journal.
|
||||
|
||||
6. **Write your first lesson by hand.** Type this on one line:
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs add --what "a script followed a symlink and overwrote the launcher" \
|
||||
--why "the path was taken on trust, without checking what it pointed at" \
|
||||
--pin тест --pin-ref scripts/koiz-mutate.mjs
|
||||
```
|
||||
|
||||
It prints the identifier of the new record. The `--pin` field is the point of the whole project: a lesson without a mechanism is a complaint.
|
||||
|
||||
7. **Find it from a different project.** Leave this folder, go to any other project of yours, and run the same `ask` command with a word from your lesson. The base is one for every project, so the answer comes back there too.
|
||||
|
||||
8. **Look at the debt.** Type `node scripts/koiz.mjs debt`. It lists lessons that came back and are still pinned to nothing. On a fresh base the list is empty, and that is what you want to see.
|
||||
|
||||
9. **Put the gate where it hurts.** Type `node scripts/koiz.mjs gate`. It exits with code 0 while there is no debt and with a non-zero code when a repeat is not pinned. Add that line to your nightly script or your pre-push hook, and the base starts holding you to your own conclusions.
|
||||
|
||||
10. **Close the session and let the machine work.** Exit your agent session normally. On close, the hook reads the transcript and writes the drafts by itself. Open `~/.claude/koiz/capture.log` to see what it took.
|
||||
|
||||
## Staying current
|
||||
|
||||
To pull the current version later, run `/koiz-update` in Claude Code. It shows what changed before touching anything, pulls fast-forward only, leaves your journal and your settings alone, and runs the self-test afterwards. Without an agent, `git pull --ff-only` in this folder does the same thing.
|
||||
|
||||
## If it helps
|
||||
|
||||
Give Koiz a star: https://github.com/zarubinvibe/koiz. It takes a second and it decides whether other people ever find the project.
|
||||
|
||||
Want to change something? The path is short: fork the repository, create a branch, commit your change, push the branch, then open a Pull Request. Do not push directly to `main`; the release gate rejects it.
|
||||
@@ -0,0 +1,45 @@
|
||||
# Онбординг: первый запуск по шагам
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-onboarding.png" alt="Койз стоит за мраморным столом, раскрытый свод лежит у него на ладони, голубые пути приходят от левого края кадра" width="100%"></p>
|
||||
|
||||
Эта страница написана для того, кто ни разу не ставил инструмент с GitHub. В каждом шаге сказано, что набрать и что появится на экране. Если шаг показал другое, остановитесь и заведите issue: проводник, который врет, хуже отсутствующего.
|
||||
|
||||
Нужен Git, Node 20 или новее и терминал. Агент не нужен.
|
||||
|
||||
1. **Проверьте Node.** Наберите `node --version`. Должно появиться что-то вроде `v22.14.0`. Если версия начинается на `v18` или ниже, поставьте свежий Node с https://nodejs.org и вернитесь сюда.
|
||||
|
||||
2. **Выберите папку и склонируйте проект.** Наберите `git clone https://github.com/zarubinvibe/koiz.git`, затем `cd koiz`. Git напечатает несколько строк про подсчет и распаковку объектов, и вы окажетесь в папке, где лежат `scripts`, `docs` и `install.sh`.
|
||||
|
||||
3. **Запустите установку.** Наберите `bash install.sh`. Он задаст один вопрос: ставить ли съем уроков на закрытие сессии. Ответьте `y`. Он напечатает путь к базе уроков, строку `хук вписан` с путем к вашему файлу настроек и прогонит селфтест.
|
||||
|
||||
4. **Прочитайте строку селфтеста.** Последний блок начинается словами `selftest ok` и перечисляет, что проверено. Если там что-то другое, установка не закончилась, и остальное на этой странице работать не будет.
|
||||
|
||||
5. **Спросите пустую базу.** Наберите `node scripts/koiz.mjs ask "что уже ломалось"`. На свежей установке база пуста, поэтому в ответ приходит «ничего не нашлось». Это правильный ответ: он доказывает, что прибор читает свой журнал.
|
||||
|
||||
6. **Запишите первый урок руками.** Наберите это одной командой:
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs add --what "скрипт пошел по симлинку и переписал лаунчер" \
|
||||
--why "путь взяли на веру, не посмотрев, куда он ведет" \
|
||||
--pin тест --pin-ref scripts/koiz-mutate.mjs
|
||||
```
|
||||
|
||||
Прибор напечатает идентификатор новой записи. Поле `--pin` и есть смысл проекта: урок без механизма остается жалобой.
|
||||
|
||||
7. **Найдите его из другого проекта.** Выйдите из этой папки, перейдите в любой свой другой проект и повторите ту же команду `ask` со словом из вашего урока. База одна на все проекты, поэтому ответ придет и там.
|
||||
|
||||
8. **Посмотрите долги.** Наберите `node scripts/koiz.mjs debt`. Прибор перечислит уроки, которые вернулись и до сих пор ничем не закреплены. На свежей базе список пуст, и это то, что вы хотите видеть.
|
||||
|
||||
9. **Поставьте ворота туда, где больно.** Наберите `node scripts/koiz.mjs gate`. Команда выходит кодом 0, пока долгов нет, и ненулевым кодом, когда повтор не закреплен. Впишите эту строку в ночной скрипт или в хук перед пушем, и база начнет держать вас за ваши же выводы.
|
||||
|
||||
10. **Закройте сессию и дайте машине поработать.** Выйдите из сессии агента обычным образом. На закрытии хук прочитает транскрипт и сам запишет черновики. Загляните в `~/.claude/koiz/capture.log`, чтобы увидеть, что он снял.
|
||||
|
||||
## Как обновляться
|
||||
|
||||
Чтобы позже забрать свежую версию, скажите `/koiz-update` в Claude Code. Скилл сначала покажет, что изменилось, потянет только fast-forward, не тронет ваш журнал и ваши настройки и прогонит селфтест после обновления. Без агента то же самое делает `git pull --ff-only` в этой папке.
|
||||
|
||||
## Если пригодилось
|
||||
|
||||
Поставьте Койзу звезду: https://github.com/zarubinvibe/koiz. Это секунда, а от нее зависит, найдут ли проект другие люди.
|
||||
|
||||
Хотите что-то поправить? Путь короткий: сделайте fork, заведите ветку, оформите commit, отправьте push и откройте Pull Request. Прямой push в `main` отклонит релизный gate.
|
||||
@@ -0,0 +1,45 @@
|
||||
# 上手引导:第一次运行,一步一步来
|
||||
|
||||
<p align="center"><img src="assets/pantheon/doc-onboarding.png" alt="科俄斯站在大理石桌后面,掌上摊着那本大理石册页,蓝色路径从画面左边一直连过来" width="100%"></p>
|
||||
|
||||
这一页写给从来没有从 GitHub 装过工具的人。每一步都写清楚要敲什么、敲完屏幕上会出现什么。如果某一步出来的是别的东西,就停在那里开一个 issue:会骗人的引导比没有引导更糟。
|
||||
|
||||
需要 Git、Node 20 或更新的版本,以及一个终端。不需要任何智能体。
|
||||
|
||||
1. **检查 Node。** 敲 `node --version`。应该看到类似 `v22.14.0` 的东西。如果版本是 `v18` 或更低,先去 https://nodejs.org 装一个新版再回来。
|
||||
|
||||
2. **选一个目录,把项目克隆下来。** 敲 `git clone https://github.com/zarubinvibe/koiz.git`,然后 `cd koiz`。Git 会打印几行关于清点和解包对象的信息,之后你就在一个包含 `scripts`、`docs` 和 `install.sh` 的目录里了。
|
||||
|
||||
3. **运行安装。** 敲 `bash install.sh`。它只问一个问题:要不要把教训采集挂到会话结束上。回答 `y`。它会打印教训库的路径、一行 `хук вписан` 加上你的设置文件路径,然后跑一遍自检。
|
||||
|
||||
4. **读那行自检结果。** 最后一段以 `selftest ok` 开头,并列出检查了哪些内容。如果不是这样,说明安装没有走完,这一页后面的东西都不会正常。
|
||||
|
||||
5. **向空的库提个问题。** 敲 `node scripts/koiz.mjs ask "什么地方坏过"`。刚装好时库是空的,所以它回答什么也没找到。这是正确答案:它证明仪器能读自己的日志。
|
||||
|
||||
6. **手写第一条教训。** 敲这一条命令:
|
||||
|
||||
```bash
|
||||
node scripts/koiz.mjs add --what "脚本顺着符号链接走,把启动器覆盖了" \
|
||||
--why "路径是凭信任拿来的,没有看它到底指向哪里" \
|
||||
--pin тест --pin-ref scripts/koiz-mutate.mjs
|
||||
```
|
||||
|
||||
仪器会打印新记录的标识。`--pin` 这一栏就是整个项目的意义所在:没有机制的教训只是抱怨。
|
||||
|
||||
7. **换一个项目再找它。** 离开这个目录,进入你另外任何一个项目,用你教训里的某个词再跑一次 `ask`。库是所有项目共用的,所以在那边也能得到答案。
|
||||
|
||||
8. **看看欠账。** 敲 `node scripts/koiz.mjs debt`。它会列出那些又回来了、却还没有任何机制拦着的教训。刚建好的库里这个列表是空的,这正是你想看到的。
|
||||
|
||||
9. **把闸门放到会疼的地方。** 敲 `node scripts/koiz.mjs gate`。没有欠账时它以 0 退出,有没固定的重复时以非零码退出。把这一行加进你的夜间脚本或推送前的钩子,库就开始拿你自己的结论管着你。
|
||||
|
||||
10. **结束会话,让机器干活。** 正常退出你的智能体会话。会话关闭时,钩子会读取记录并自己写好草稿。打开 `~/.claude/koiz/capture.log` 就能看到它采到了什么。
|
||||
|
||||
## 怎么更新
|
||||
|
||||
以后要拿最新版本,在 Claude Code 里说 `/koiz-update`。它会先把改了什么摊给你看,只做 fast-forward 拉取,不碰你的日志和设置,更新完再跑一遍自检。不用智能体的话,在这个目录里 `git pull --ff-only` 是一样的效果。
|
||||
|
||||
## 如果它有用
|
||||
|
||||
给 Koiz 点亮星标:https://github.com/zarubinvibe/koiz。这只要一秒,却决定别人能不能找到这个项目。
|
||||
|
||||
想改点什么?流程很短:先 fork 仓库,建一个分支,提交 commit,推送 push,然后开一个 Pull Request。请不要直接向 `main` 推送,发布闸门会拒绝。
|
||||
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.3 MiB |