@futurelastic/colab-handbook 1.13.0-rc.6 → 1.13.0-rc.61

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.
Files changed (54) hide show
  1. package/README.md +52 -22
  2. package/README.vi.md +55 -25
  3. package/audit/audit.mjs +200 -25
  4. package/package.json +2 -1
  5. package/templates/README.md +19 -4
  6. package/templates/ci-laravel.yml +431 -44
  7. package/templates/ci-node.yml +564 -40
  8. package/templates/ci-python.yml +374 -37
  9. package/templates/deploy-container-run.mjs +17 -3
  10. package/templates/deploy-xserver.yml +12 -0
  11. package/templates/instruction-files.yml +11 -0
  12. package/templates/pre-commit-instruction-files +55 -0
  13. package/templates/release-auto.yml +68 -4
  14. package/tools/colab +1402 -133
  15. package/tools/lib/batch-history.js +104 -0
  16. package/tools/lib/batch-stats.js +300 -0
  17. package/tools/lib/ci-profile.js +195 -0
  18. package/tools/lib/ci-verdict.js +13 -5
  19. package/tools/lib/ci-wait.js +6 -1
  20. package/tools/lib/claim-comments.js +3 -2
  21. package/tools/lib/codec/claim.js +6 -3
  22. package/tools/lib/codec/decision.d.ts +7 -0
  23. package/tools/lib/codec/decision.js +54 -0
  24. package/tools/lib/codec/hold.d.ts +8 -1
  25. package/tools/lib/codec/hold.js +42 -8
  26. package/tools/lib/codec/labels.js +7 -0
  27. package/tools/lib/codec/release.js +6 -3
  28. package/tools/lib/codec/samples.json +61 -0
  29. package/tools/lib/config-set.js +320 -0
  30. package/tools/lib/decision-record.js +42 -0
  31. package/tools/lib/disposition.js +9 -6
  32. package/tools/lib/docs-only.js +48 -1
  33. package/tools/lib/engines.js +52 -0
  34. package/tools/lib/git.js +127 -23
  35. package/tools/lib/install-check.js +77 -5
  36. package/tools/lib/instruction-file.js +49 -0
  37. package/tools/lib/instruction-gate.js +150 -0
  38. package/tools/lib/journal.js +3 -0
  39. package/tools/lib/landed-prs.js +58 -0
  40. package/tools/lib/migration-grant.js +19 -2
  41. package/tools/lib/notify-endpoint.js +114 -59
  42. package/tools/lib/notify.js +68 -22
  43. package/tools/lib/release-cut.js +39 -3
  44. package/tools/lib/release-finalize.js +173 -17
  45. package/tools/lib/release-policy.js +11 -3
  46. package/tools/lib/ship-batch.js +293 -12
  47. package/tools/lib/ship-handoff.js +174 -0
  48. package/tools/lib/ship-human-door.js +76 -0
  49. package/tools/lib/shipguard.js +12 -1
  50. package/tools/lib/stamp.js +6 -2
  51. package/tools/lib/template-trunk.js +80 -0
  52. package/tools/lib/thresholds.js +110 -0
  53. package/tools/lib/tree-green.js +21 -4
  54. package/tools/lib/verify-runs.js +117 -4
package/README.md CHANGED
@@ -6,22 +6,23 @@ A small set of conventions and tools for running many repos — many coding
6
6
  sessions in parallel, humans and AI agents alike — without stepping on each
7
7
  other.
8
8
 
9
- **If you are an AI agent, stop here and read [`CLAUDE.md`](CLAUDE.md).**
9
+ **If you are an AI agent, stop here and read [`AGENTS.md`](AGENTS.md).**
10
10
  This file is for humans.
11
11
 
12
12
  ## Quick start
13
13
 
14
14
  ```sh
15
15
  git clone https://github.com/futurelastic/colab-handbook.git ~/code/colab-handbook
16
- cd ~/code/colab-handbook && ./install.sh --all # skills + colab CLI + hooks, from the newest release; --dry shows it first
16
+ cd ~/code/colab-handbook && ./install.sh --all # asks which coding agent gets the skills; + colab CLI + hooks, from the newest release; --dry shows it first
17
17
  cd /path/to/your-repo
18
18
  colab adopt # asks only what it cannot detect, writes .github/project.yml
19
19
  colab labels --ensure # creates the convention labels
20
20
  colab register # adds the repo to this machine's fleet list
21
21
  ```
22
22
 
23
- Then, in an agent session in that repo, run `/code-start <issue-number>`. With an
24
- agent at hand, `/handbook-sync` replaces the last three commands and also does
23
+ Then, in an agent session in that repo, run the `code-start` skill with an issue
24
+ number — each engine has its own way to invoke a skill, see [*Choose your engine*](#choose-your-engine).
25
+ With an agent at hand, the `handbook-sync` skill replaces the last three commands and also does
25
26
  the rest of adoption (see [*Adopting it into a repo*](#adopting-it-into-a-repo)).
26
27
  You need `git`, `node` ≥ 18 and `gh` ≥ 2.94 logged in (`gh auth login`); distro
27
28
  packages often ship an older `gh`, so install it from [cli.github.com](https://cli.github.com).
@@ -94,19 +95,19 @@ with no agent and no other tool.
94
95
 
95
96
  ## Your first session
96
97
 
97
- A unit of work goes round one loop. Each step is a skill, invoked in an agent
98
- session as a slash command (`/code-start 42`), or followed by hand from
99
- [`skills/`](skills/).
98
+ A unit of work goes round one loop. Each step is a skill, invoked by name in an
99
+ agent session (the syntax is the engine's — [*Choose your engine*](#choose-your-engine)),
100
+ or followed by hand from [`skills/`](skills/).
100
101
 
101
102
  | Step | Skill | Who runs it | What it leaves behind |
102
103
  |---|---|---|---|
103
- | 1. Pick | `/code-triage` | coordinator | the ready work in order, `group:` labels on issues that must share a branch, `needs-plan` on hard ones, the start commands |
104
- | 2. Open | `/code-start <N>` | implementer | the issue claimed, a branch cut from trunk and pushed, a worktree, a short plan file |
104
+ | 1. Pick | `code-triage` | coordinator | the ready work in order, `group:` labels on issues that must share a branch, `needs-plan` on hard ones, the start commands |
105
+ | 2. Open | `code-start <N>` | implementer | the issue claimed, a branch cut from trunk and pushed, a worktree, a short plan file |
105
106
  | 3. Work | — | implementer | commits on the branch |
106
- | 4. Hand off | `/code-wrap` | implementer | what was learned written onto the Issue, the repo's gate run, the branch pushed — then it **stops** |
107
- | 5. Merge | `/code-ship` | coordinator, after a human go | one squash commit on trunk with `Closes #N`, evidence on each issue, claims released, the worktree removed |
108
- | 6. Clean up | `/code-sweep` | coordinator | finished work shipped, stale claims and worktrees cleared |
109
- | 7. Release | release workflow, or `/release-rung` | automatic, or a human where a tag deploys | a candidate tag, then the final after a test period — only where the repo's `exposure` has releases |
107
+ | 4. Hand off | `code-wrap` | implementer | what was learned written onto the Issue, the repo's gate run, the branch pushed — then it **stops** |
108
+ | 5. Merge | `code-ship` | coordinator, after a human go | one squash commit on trunk with `Closes #N`, evidence on each issue, claims released, the worktree removed |
109
+ | 6. Clean up | `code-sweep` | coordinator | finished work shipped, stale claims and worktrees cleared |
110
+ | 7. Release | release workflow, or `release-rung` | automatic, or a human where a tag deploys | a candidate tag, then the final after a test period — only where the repo's `exposure` has releases |
110
111
 
111
112
  Also in [`skills/`](skills/): `code-plan` (a full plan for a hard issue, run by
112
113
  `code-start` when flagged), `handbook-sync` (bring one repo up to the current
@@ -165,7 +166,7 @@ and why: [`CONVENTIONS.md` §2](CONVENTIONS.md#2-tiers) and
165
166
 
166
167
  ## Adopting it into a repo
167
168
 
168
- **The default route: run `/handbook-sync` in an agent session inside the repo.**
169
+ **The default route: run the `handbook-sync` skill in an agent session inside the repo.**
169
170
  It sees that nothing is adopted yet and drives adoption to the end — the
170
171
  descriptor (through `colab adopt`), the labels, the `CLAUDE.md` block, CI from
171
172
  the templates, and registration on this machine. Run later, the same skill
@@ -239,12 +240,13 @@ migration hold with or without it.
239
240
  | Path | What it is |
240
241
  |---|---|
241
242
  | [`CONVENTIONS.md`](CONVENTIONS.md) | The rules. Normative, the single source of truth (EN). |
242
- | [`CLAUDE.md`](CLAUDE.md) | The entry point for AI agents — the operational distillation (EN). |
243
+ | [`AGENTS.md`](AGENTS.md) | The entry point for AI agents — the operational distillation (EN). |
243
244
  | [`project.schema.md`](project.schema.md) | Field reference for `.github/project.yml`. |
244
245
  | [`templates/`](templates/) | **Copy-and-own** starting points: CI, release, git hooks (a secret scan and an identity scan), and the `CLAUDE.md` block for adopting repos. Nothing is called remotely — copy it, edit it, own it. |
245
246
  | [`tools/`](tools/) | `colab` — a small CLI (optional): adopt a repo, claim issues, allocate ports, manage worktrees, and merge a finished branch to trunk when the repo grants it. JSON state, zero dependencies. Command reference: [`tools/README.md`](tools/README.md). |
246
- | [`audit/`](audit/) | An external conformance checker. Reads all your repos — every owner, including local-only ones — and reports drift in a single run. Advisory only. `--identity` also scans public repository descriptions and topics, which no git hook can see. What each check means: [`audit/README.md`](audit/README.md). |
247
- | [`skills/`](skills/) | The session flow — see [*Your first session*](#your-first-session). Installed as Claude Code skills by `install.sh`. |
247
+ | [`audit/`](audit/) | An external conformance checker. Reads all your repos — every owner, including local-only ones — and reports drift in a single run. Advisory only. `--identity` also scans public repository descriptions and topics, which no git hook can see. `--batch-history` shows each repo's measured batch landing picture, flagged only against thresholds the repo declares. What each check means: [`audit/README.md`](audit/README.md). |
248
+ | [`skills/`](skills/) | The session flow — see [*Your first session*](#your-first-session). Plain `SKILL.md` folders; `install.sh` links them into each coding agent you choose. |
249
+ | [`engines/`](engines/) | One small data file per coding agent: where its user-level skills go, how a skill is invoked, what it supports. Adding an engine is adding a file — [`engines/README.md`](engines/README.md). |
248
250
  | [`install.sh`](install.sh) | Sets up **your machine**: skills, the `colab` CLI, the pre-commit hook, the fleet list. Idempotent; `--dry` shows everything first. |
249
251
 
250
252
  ## Setting up a machine
@@ -268,14 +270,41 @@ Later moves are explicit:
268
270
  A clone with uncommitted changes is never moved, and a re-run without either
269
271
  flag keeps whatever is checked out.
270
272
 
273
+ ### Choose your engine
274
+
275
+ The skills are plain `SKILL.md` folders that call `git`, `gh` and `colab`; any
276
+ coding agent that reads skills can run them. What differs is **where each
277
+ agent looks for them**, so the install asks. At a terminal, `./install.sh`
278
+ lists the engines it knows and lets you pick one or more, with *other: give a
279
+ path* last. Unattended, say it with a flag:
280
+
281
+ ```sh
282
+ ./install.sh --engine claude # Claude Code → ~/.claude/skills
283
+ ./install.sh --engine claude,codex # both
284
+ ./install.sh --skills-dir ~/my-agent/skills # any other agent: you give its folder
285
+ ```
286
+
287
+ | Engine | Skills folder | Invoke | Before the skills work there |
288
+ |---|---|---|---|
289
+ | Claude Code (`claude`) | `~/.claude/skills` | `/code-start` | Nothing. This user-level install **wins** over a repo's own `.claude/skills/<name>` of the same name (precedence is enterprise > personal > project), so rename a repo variant you want used. |
290
+ | OpenAI Codex (`codex`) | `~/.agents/skills` | `$code-start` | Its default sandbox has no network, so `gh` fails: set `[sandbox_workspace_write] network_access = true` in `~/.codex/config.toml`. Values from Codex's docs; not yet verified by a clean-machine run. |
291
+ | anything else | `--skills-dir <path>` | the agent's own way | The agent's shell needs network access for `gh`. The folder is remembered in `~/.colab/skills-dirs`. |
292
+
293
+ A re-run with no flag and no terminal keeps every engine it finds already
294
+ linked, so an existing machine changes nothing. Finding none, it installs for
295
+ Claude Code and says so. The per-engine facts live in [`engines/`](engines/),
296
+ one file each — that folder is the source for the table above.
297
+
271
298
  | Flag | What it does |
272
299
  |---|---|
273
- | *(none)* | Symlink `skills/` into `~/.claude/skills/`, so they are available in every repo you open. |
300
+ | *(none)* | Symlink `skills/` into each chosen engine's user-level folder, so they are available in every repo you open. Asks at a terminal; otherwise keeps what is linked (see [*Choose your engine*](#choose-your-engine)). |
301
+ | `--engine <id>[,<id>]` | Install for these engines (`claude`, `codex` — the files in `engines/`), no question asked. |
302
+ | `--skills-dir <path>` | Also install into this folder, for an agent `engines/` does not know. |
274
303
  | `--tools` | The `colab` CLI twice: a **symlink** at `~/.local/bin/colab` for your sessions (it prints the `PATH` line if needed), and a stamped **frozen copy** at `~/.colab/bin/colab` for always-on services. Also creates an empty `~/.colab/state.json` if there is none. |
275
304
  | `--hooks` | Point this clone's git at `.githooks/`: a gitleaks secret scan and an identity scan whose vocabulary you keep outside every repo (see [`templates/README.md`](templates/README.md)). |
276
305
  | `--fleet` | Seed `~/.colab/repos.txt` with format notes only, if absent. It stays machine-local because it names your private repos; `colab register` fills it. |
277
306
  | `--all` | `--tools --hooks --fleet`. |
278
- | `--notify-url <url>` | Seed `notifyUrl` in `~/.colab/config.json`, only if the key is absent. See [`tools/README.md`](tools/README.md#notifyurl--optional-event-push-off-by-default). |
307
+ | `--notify-url <url>` | Add `<url>` to `notifyUrl` in `~/.colab/config.json` if the key lacks it; an existing entry is never removed or rewritten. See [`tools/README.md`](tools/README.md#notifyurl--optional-event-push-off-by-default). |
279
308
  | `--release` | Check this clone out at the newest final release tag, then install. The default for a first install from a fresh clone. |
280
309
  | `--trunk` | Check out `main` and install it, unreleased work included — the clone's `@next`. |
281
310
  | `--dry` | Print what would happen, change nothing. Combines with the flags above. |
@@ -294,7 +323,7 @@ yet, so the default `latest` tag holds only a placeholder; install from
294
323
  **`@next`**, the release candidates: `npx @futurelastic/colab-handbook@next
295
324
  <command>`, or `npm i -g @futurelastic/colab-handbook@next`. The command is
296
325
  still `colab`. The skills are not in the package; they install from a
297
- clone, because they must symlink into `~/.claude/skills/`.
326
+ clone, because they are symlinks into its working tree.
298
327
 
299
328
  ### Checking an install
300
329
 
@@ -305,10 +334,11 @@ node audit/audit.mjs # a conformance report across every registered repo
305
334
  colab update # stamped copies that fell behind, the frozen CLI included
306
335
  ```
307
336
 
308
- `--check` reports whether the frozen copy is behind the latest release and
337
+ `--check` reports, per engine, how many skills are linked, missing or broken,
338
+ plus that engine's own caveats (Codex's sandbox network, for instance). It also reports whether the frozen copy is behind the latest release and
309
339
  which commands it does not dispatch, whether the state file exists, whether
310
340
  anything is registered, whether both pre-commit hooklets can run, and whether
311
- `notifyUrl` is unset while a local observer declared an endpoint. ✗ means
341
+ `notifyUrl` is unset, or lacks a URL, while a local observer declared one. ✗ means
312
342
  something installed is stale or unusable; ⚠ means something was never set up,
313
343
  which may be deliberate or just not done yet — so a correct fresh install, with
314
344
  no repo registered and no identity vocabulary, reports ⚠ rows and exits 0. It
package/README.vi.md CHANGED
@@ -5,22 +5,23 @@
5
5
  Bộ quy ước và công cụ nhỏ để vận hành nhiều repo — nhiều phiên code song song,
6
6
  người thật lẫn AI agent — mà không giẫm chân nhau.
7
7
 
8
- **Nếu bạn là AI agent, dừng ở đây và đọc [`CLAUDE.md`](CLAUDE.md).**
8
+ **Nếu bạn là AI agent, dừng ở đây và đọc [`AGENTS.md`](AGENTS.md).**
9
9
  File này dành cho con người.
10
10
 
11
11
  ## Bắt đầu nhanh
12
12
 
13
13
  ```sh
14
14
  git clone https://github.com/futurelastic/colab-handbook.git ~/code/colab-handbook
15
- cd ~/code/colab-handbook && ./install.sh --all # skills + CLI colab + hook, từ bản phát hành mới nhất; --dry để xem trước
15
+ cd ~/code/colab-handbook && ./install.sh --all # hỏi agent nào nhận skill; + CLI colab + hook, từ bản phát hành mới nhất; --dry để xem trước
16
16
  cd /duong-dan/toi/repo-cua-ban
17
17
  colab adopt # chỉ hỏi những gì không tự dò ra được, rồi ghi .github/project.yml
18
18
  colab labels --ensure # tạo các label quy ước
19
19
  colab register # đưa repo vào danh sách fleet của máy này
20
20
  ```
21
21
 
22
- Sau đó, trong một phiên agent ở repo đó, chạy `/code-start <số-issue>`. Có agent
23
- trong tay thì `/handbook-sync` thay được ba lệnh cuối và làm nốt phần adopt còn
22
+ Sau đó, trong một phiên agent ở repo đó, chạy skill `code-start` kèm số issue —
23
+ mỗi engine có cách gọi skill riêng, xem [*Chọn engine*](#chọn-engine). Có agent
24
+ trong tay thì skill `handbook-sync` thay được ba lệnh cuối và làm nốt phần adopt còn
24
25
  lại (xem [*Adopt vào một repo*](#adopt-vào-một-repo)). Cần có `git`, `node` ≥ 18
25
26
  và `gh` ≥ 2.94 đã đăng nhập (`gh auth login`); gói `gh` của các distro thường cũ
26
27
  hơn, nên hãy cài từ [cli.github.com](https://cli.github.com).
@@ -93,19 +94,19 @@ khác.
93
94
 
94
95
  ## Phiên làm việc đầu tiên
95
96
 
96
- Mỗi đầu việc đi qua một vòng. Mỗi bước là một skill, gọi trong phiên agent bằng
97
- slash command (`/code-start 42`), hoặc tự làm theo bằng tay từ
98
- [`skills/`](skills/).
97
+ Mỗi đầu việc đi qua một vòng. Mỗi bước là một skill, gọi theo tên trong phiên
98
+ agent (cú pháp gọi là của engine — [*Chọn engine*](#chọn-engine)), hoặc tự làm
99
+ theo bằng tay từ [`skills/`](skills/).
99
100
 
100
101
  | Bước | Skill | Ai chạy | Để lại gì |
101
102
  |---|---|---|---|
102
- | 1. Chọn | `/code-triage` | điều phối | việc sẵn sàng theo thứ tự, label `group:` trên các issue phải chung một nhánh, `needs-plan` trên việc khó, lệnh để bắt đầu |
103
- | 2. Mở | `/code-start <N>` | thợ | issue đã claim, nhánh cắt từ trunk và đã push, một worktree, một file plan ngắn |
103
+ | 1. Chọn | `code-triage` | điều phối | việc sẵn sàng theo thứ tự, label `group:` trên các issue phải chung một nhánh, `needs-plan` trên việc khó, lệnh để bắt đầu |
104
+ | 2. Mở | `code-start <N>` | thợ | issue đã claim, nhánh cắt từ trunk và đã push, một worktree, một file plan ngắn |
104
105
  | 3. Làm | — | thợ | commit trên nhánh |
105
- | 4. Bàn giao | `/code-wrap` | thợ | điều học được ghi lên Issue, gate của repo đã chạy, nhánh đã push — rồi **dừng** |
106
- | 5. Merge | `/code-ship` | điều phối, sau khi người đồng ý | một squash commit trên trunk kèm `Closes #N`, bằng chứng trên từng issue, claim đã nhả, worktree đã gỡ |
107
- | 6. Dọn | `/code-sweep` | điều phối | việc đã xong được ship, claim và worktree cũ được dọn |
108
- | 7. Release | release workflow, hoặc `/release-rung` | tự động, hoặc người khi tag là thứ deploy | một tag ứng viên, rồi bản final sau thời gian thử — chỉ khi `exposure` của repo có release |
106
+ | 4. Bàn giao | `code-wrap` | thợ | điều học được ghi lên Issue, gate của repo đã chạy, nhánh đã push — rồi **dừng** |
107
+ | 5. Merge | `code-ship` | điều phối, sau khi người đồng ý | một squash commit trên trunk kèm `Closes #N`, bằng chứng trên từng issue, claim đã nhả, worktree đã gỡ |
108
+ | 6. Dọn | `code-sweep` | điều phối | việc đã xong được ship, claim và worktree cũ được dọn |
109
+ | 7. Release | release workflow, hoặc `release-rung` | tự động, hoặc người khi tag là thứ deploy | một tag ứng viên, rồi bản final sau thời gian thử — chỉ khi `exposure` của repo có release |
109
110
 
110
111
  Cũng trong [`skills/`](skills/): `code-plan` (plan đầy đủ cho issue khó, do
111
112
  `code-start` gọi khi có cờ), `handbook-sync` (kéo một repo lên bản handbook mới
@@ -165,8 +166,8 @@ sao: [`CONVENTIONS.md` §2](CONVENTIONS.md#2-tiers) và
165
166
 
166
167
  ## Adopt vào một repo
167
168
 
168
- **Đường mặc định: chạy `/handbook-sync` trong một phiên agent ngay trong repo
169
- đó.** Nó nhận ra repo chưa adopt gì và đi hết đường adopt — descriptor (qua
169
+ **Đường mặc định: chạy skill `handbook-sync` trong một phiên agent ngay trong
170
+ repo đó.** Nó nhận ra repo chưa adopt gì và đi hết đường adopt — descriptor (qua
170
171
  `colab adopt`), label, block `CLAUDE.md`, CI từ template, và đăng ký trên máy
171
172
  này. Chạy lại về sau, chính skill đó kéo một repo đã adopt lên bản handbook mới
172
173
  nhất mà không làm mất phần bạn đã sửa.
@@ -238,12 +239,13 @@ quyền cấp trước khi chạy migration vẫn đứng vững dù có nó hay
238
239
  | Đường dẫn | Là gì |
239
240
  |---|---|
240
241
  | [`CONVENTIONS.md`](CONVENTIONS.md) | Luật. Chuẩn tắc, nguồn sự thật duy nhất (EN). |
241
- | [`CLAUDE.md`](CLAUDE.md) | Cửa vào cho AI agent — bản chưng cất vận hành (EN). |
242
+ | [`AGENTS.md`](AGENTS.md) | Cửa vào cho AI agent — bản chưng cất vận hành (EN). |
242
243
  | [`project.schema.md`](project.schema.md) | Tham chiếu field của `.github/project.yml`. |
243
244
  | [`templates/`](templates/) | Điểm khởi đầu **copy-về-là-của-bạn**: CI, release, git hook (một bản quét secret và một bản quét danh tính), và block `CLAUDE.md` cho repo adopt. Không có gì được gọi từ xa — copy, sửa, sở hữu. |
244
245
  | [`tools/`](tools/) | `colab` — một CLI nhỏ (tùy chọn): adopt một repo, claim issue, cấp port, quản lý worktree, và merge nhánh đã xong vào trunk khi repo cho phép. State JSON, không dependency. Tham chiếu các lệnh: [`tools/README.md`](tools/README.md). |
245
- | [`audit/`](audit/) | Trình kiểm tra conformance từ bên ngoài. Đọc mọi repo của bạn — mọi owner, kể cả repo local-only — và báo drift trong một lần chạy. Chỉ cảnh báo. Thêm `--identity` thì quét cả description và topic của repo public — thứ mà không git hook nào nhìn thấy được. Ý nghĩa từng check: [`audit/README.md`](audit/README.md). |
246
- | [`skills/`](skills/) | Luồng phiên làm việc — xem [*Phiên làm việc đầu tiên*](#phiên-làm-việc-đầu-tiên). `install.sh` cài chúng thành skill Claude Code. |
246
+ | [`audit/`](audit/) | Trình kiểm tra conformance từ bên ngoài. Đọc mọi repo của bạn — mọi owner, kể cả repo local-only — và báo drift trong một lần chạy. Chỉ cảnh báo. Thêm `--identity` thì quét cả description và topic của repo public — thứ mà không git hook nào nhìn thấy được. Thêm `--batch-history` thì hiện số liệu batch landing đo được của từng repo, chỉ cảnh báo theo ngưỡng repo tự khai báo. Ý nghĩa từng check: [`audit/README.md`](audit/README.md). |
247
+ | [`skills/`](skills/) | Luồng phiên làm việc — xem [*Phiên làm việc đầu tiên*](#phiên-làm-việc-đầu-tiên). Là các thư mục `SKILL.md` thuần; `install.sh` link chúng vào từng coding agent bạn chọn. |
248
+ | [`engines/`](engines/) | Mỗi coding agent một file dữ liệu nhỏ: skill cấp user đặt ở đâu, gọi skill thế nào, agent hỗ trợ gì. Thêm engine là thêm một file — [`engines/README.md`](engines/README.md). |
247
249
  | [`install.sh`](install.sh) | Cài đặt cho **máy của bạn**: skills, CLI `colab`, hook pre-commit, danh sách fleet. Idempotent; `--dry` cho xem trước mọi thứ. |
248
250
 
249
251
  ## Cài đặt máy
@@ -267,14 +269,41 @@ sau đều phải chủ động:
267
269
  Clone đang có thay đổi chưa commit thì không bao giờ bị chuyển, và chạy lại
268
270
  không kèm flag nào thì giữ nguyên thứ đang checkout.
269
271
 
272
+ ### Chọn engine
273
+
274
+ Các skill là thư mục `SKILL.md` thuần, chỉ gọi `git`, `gh` và `colab`; coding
275
+ agent nào đọc được skill thì chạy được chúng. Khác nhau là **mỗi agent tìm
276
+ skill ở đâu**, nên bản cài sẽ hỏi. Ở terminal, `./install.sh` liệt kê các
277
+ engine nó biết và cho bạn chọn một hoặc nhiều, lựa chọn cuối là *other: give a
278
+ path*. Chạy không người trông thì nói bằng flag:
279
+
280
+ ```sh
281
+ ./install.sh --engine claude # Claude Code → ~/.claude/skills
282
+ ./install.sh --engine claude,codex # cả hai
283
+ ./install.sh --skills-dir ~/my-agent/skills # agent khác: bạn đưa thư mục của nó
284
+ ```
285
+
286
+ | Engine | Thư mục skill | Gọi | Cần làm gì để skill chạy được |
287
+ |---|---|---|---|
288
+ | Claude Code (`claude`) | `~/.claude/skills` | `/code-start` | Không cần gì. Bản cài cấp user này **thắng** `.claude/skills/<name>` cùng tên của repo (thứ tự ưu tiên là enterprise > personal > project), nên muốn dùng bản của repo thì đổi tên nó. |
289
+ | OpenAI Codex (`codex`) | `~/.agents/skills` | `$code-start` | Sandbox mặc định không có mạng nên `gh` lỗi: đặt `[sandbox_workspace_write] network_access = true` trong `~/.codex/config.toml`. Số liệu lấy từ tài liệu của Codex; chưa được xác minh bằng một lần chạy trên máy sạch. |
290
+ | agent khác | `--skills-dir <path>` | theo cách của agent | Shell của agent cần có mạng cho `gh`. Thư mục được ghi nhớ trong `~/.colab/skills-dirs`. |
291
+
292
+ Chạy lại không flag và không có terminal thì giữ mọi engine đã thấy được link
293
+ sẵn, nên máy đã cài không thay đổi gì. Không thấy engine nào thì cài cho Claude
294
+ Code và nói rõ điều đó. Thông tin từng engine nằm trong [`engines/`](engines/),
295
+ mỗi engine một file — thư mục đó là nguồn của bảng trên.
296
+
270
297
  | Flag | Làm gì |
271
298
  |---|---|
272
- | *(không có)* | Symlink `skills/` vào `~/.claude/skills/`, để mở repo nào cũng có. |
299
+ | *(không có)* | Symlink `skills/` vào thư mục cấp user của từng engine đã chọn, để mở repo nào cũng có. Ở terminal thì hỏi; không thì giữ những gì đã link (xem [*Chọn engine*](#chọn-engine)). |
300
+ | `--engine <id>[,<id>]` | Cài cho các engine này (`claude`, `codex` — các file trong `engines/`), không hỏi. |
301
+ | `--skills-dir <path>` | Cài thêm vào thư mục này, cho agent mà `engines/` chưa biết. |
273
302
  | `--tools` | CLI `colab` cài hai lần: một **symlink** ở `~/.local/bin/colab` cho các phiên làm việc của bạn (in sẵn dòng `PATH` nếu cần), và một **bản đóng băng** có đóng dấu ở `~/.colab/bin/colab` cho các service luôn-bật. Đồng thời tạo `~/.colab/state.json` rỗng nếu chưa có. |
274
303
  | `--hooks` | Trỏ git của clone này vào `.githooks/`: quét secret bằng gitleaks, và quét danh tính với danh sách từ khoá do bạn giữ NGOÀI mọi repo (xem [`templates/README.md`](templates/README.md)). |
275
304
  | `--fleet` | Tạo `~/.colab/repos.txt` chỉ chứa ghi chú định dạng, nếu chưa có. Nó cố tình nằm trên máy vì nó ghi tên các repo private của bạn; `colab register` mới là thứ điền vào. |
276
305
  | `--all` | `--tools --hooks --fleet`. |
277
- | `--notify-url <url>` | Ghi `notifyUrl` vào `~/.colab/config.json`, chỉ khi khoá đó chưa có. Xem [`tools/README.md`](tools/README.md#notifyurl--optional-event-push-off-by-default). |
306
+ | `--notify-url <url>` | Thêm `<url>` vào `notifyUrl` trong `~/.colab/config.json` nếu khoá đó chưa có URL này; không bao giờ xoá hay ghi đè mục đã có. Xem [`tools/README.md`](tools/README.md#notifyurl--optional-event-push-off-by-default). |
278
307
  | `--release` | Checkout clone này về tag phát hành chính thức mới nhất, rồi cài. Là mặc định cho lần cài đầu từ một bản clone mới. |
279
308
  | `--trunk` | Checkout `main` rồi cài, kể cả phần chưa phát hành — `@next` của bản clone. |
280
309
  | `--dry` | In ra sẽ làm gì, không thay đổi gì. Ghép được với các flag trên. |
@@ -291,8 +320,8 @@ báo khi nó tụt sau một thay đổi CLI đã phát hành, và chạy lại
291
320
  Chưa có bản phát hành chính thức nào lên npm, nên tag mặc định `latest` chỉ là
292
321
  bản giữ chỗ; hãy cài từ **`@next`**, các bản ứng viên: `npx
293
322
  @futurelastic/colab-handbook@next <lệnh>`, hoặc `npm i -g
294
- @futurelastic/colab-handbook@next`. Lệnh gõ vẫn là `colab`. Skill không nằm trong package; chúng cài từ một bản clone, vì phải
295
- symlink vào `~/.claude/skills/`.
323
+ @futurelastic/colab-handbook@next`. Lệnh gõ vẫn là `colab`. Skill không nằm trong package; chúng cài từ một bản clone, vì chúng là
324
+ symlink trỏ vào working tree của bản clone đó.
296
325
 
297
326
  ### Kiểm tra bản cài
298
327
 
@@ -303,10 +332,11 @@ node audit/audit.mjs # báo cáo conformance cho mọi repo đã đăng ký
303
332
  colab update # các bản copy có đóng dấu đã tụt lại, kể cả CLI đóng băng
304
333
  ```
305
334
 
306
- `--check` báo bản đóng băng có tụt sau bản phát hành mới nhất không và lệnh nào
335
+ `--check` báo theo từng engine: bao nhiêu skill đã link, thiếu hay hỏng, kèm
336
+ các lưu ý riêng của engine đó (ví dụ mạng trong sandbox của Codex). Nó cũng báo bản đóng băng có tụt sau bản phát hành mới nhất không và lệnh nào
307
337
  nó không chạy được, file state có tồn tại không, đã đăng ký repo nào chưa, cả
308
- hai hooklet pre-commit có chạy được không, và `notifyUrl` có đang trống trong
309
- khi một observer trên máy đã khai endpoint không. ✗ nghĩa là thứ đã cài đang cũ
338
+ hai hooklet pre-commit có chạy được không, và `notifyUrl` có đang trống (hoặc
339
+ thiếu một URL) trong khi một observer trên máy đã khai endpoint không. ✗ nghĩa là thứ đã cài đang cũ
310
340
  hoặc không dùng được; ⚠ nghĩa là có thứ chưa từng được cài, có thể là cố ý hoặc
311
341
  chỉ là chưa làm tới — nên một bản cài mới đúng, chưa đăng ký repo nào và chưa có
312
342
  danh sách từ khoá danh tính, sẽ ra các dòng ⚠ và exit 0. Nó không bao giờ tự làm