Skip to content
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ node_modules/
# Environment
.env
.env.*

# Agent session workspace (ZCode)
.zcode/
2 changes: 1 addition & 1 deletion ADOPT.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Before starting, read in the BoCode repository: `AGENTS.md`, `book/guidelines/wo

Copy from the BoCode repository into the project:

- `book/guidelines/` — all of it (README, workflow, writing-style, git-workflow, review-checklist, architecture, coding-style)
- `book/guidelines/` — all of it (README, workflow, task-tiers, writing-style, git-workflow, review-checklist, architecture, coding-style)
- `book/docs/README.md`, `book/docs/architecture/README.md`, `book/docs/api/README.md`, `book/docs/decisions/README.md`
- `book/notes/README.md`, `book/plans/README.md`, `book/changelogs/README.md`

Expand Down
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This project runs on the **BoCode workflow**: `code/` holds the source, `book/`

## Workflow

Feature development strictly follows the six-phase gate workflow — see `book/guidelines/workflow.md`.
Feature development is graded first: every task is tiered S/M/L per `book/guidelines/task-tiers.md` (the tier lands in the first commit's motive); M/L tasks then strictly follow the six-phase gate workflow — see `book/guidelines/workflow.md`.

Git commits and branching strictly follow `book/guidelines/git-workflow.md`: every non-merge commit uses the Clean Commit format; independent big features branch from `dev`; small verified fixes may commit to `dev` directly; PRs serve multi-contributor work and the `dev → main` release, which only ever merges. Never commit or push directly to `main`.

Expand Down Expand Up @@ -67,8 +67,9 @@ Local commands are disposable and have no production access — npm scripts, tes

## Hard constraints

- Step 0 (the structured requirements brief) is required before any code
- No skipping between phases
- The task tier (S/M/L, `book/guidelines/task-tiers.md`) is decided before any code and recorded in the first commit's motive; S runs the light channel, M/L owe the full pipeline
- Step 0 (the structured requirements brief) is required before any M/L code
- No skipping between phases (M/L)
- Phase 2 stops for the user only on real gaps — scope conflict, undetermined data shape, unclear external dependency — never just for confirmation
- Problems found in Phase 5 / Phase 6 are **recorded, never fixed**
- Feature work touches no code outside its scope: no opportunistic refactors, no new abstractions
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,43 @@

Releases of the BoCode template itself. Adopting projects upgrade by handing [UPGRADE.md](UPGRADE.md) to an agent; each entry lists what changed and what an adopting project must do. History before 2026-11-05 lives in git log and [book/docs/decisions/](book/docs/decisions/) (ADR-001..ADR-004).

When adding an entry, also refresh the collapsed What's-new block near the top of the three READMEs (`README.md`, `README.zh-CN.md`, `README.ja.md`): newest title in the summary line, latest three titles as bullets.

## 2026-11-06 — phase-2 stop rule aligned, L-tier ADR trigger decidable

The task-tiers replay (ADR-008) caught two leftovers: boscope still required Phase-2 approval while workflow.md, AGENTS.md, and the newer skill variants stop only on real gaps; and the L row's "an ADR when impact warrants" carried no criterion.

- Changed: `skills/boscope/SKILL.md` (Phase 2 stops only on a real gap — scope conflict, undetermined data shape, unclear external dependency — and goes straight to Phase 3 otherwise; the plan step no longer hangs on approval; Phase 3 builds "per the design"; the constraints bullet splits the two rules it used to merge); `book/guidelines/task-tiers.md` (the L row's ADR gate defers to the triggers in `book/docs/decisions/README.md`: expensive to reverse · a reasonable person could have made differently · an architecture boundary rule)

**Adopter action:** copy the two changed files; in translated boscope variants, replace the "stop and wait for approval" block with the real-gaps rule and drop it from any companion README's flow; regenerate the index.

## 2026-11-06 — tasks and issues archive by status (ADR-010)

Handled and unhandled entries were indistinguishable from the outside; the tempting fix — a folder files move into — breaks the book's relative links. Archiving is now a status flip.

- Added: `book/docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md`
- Changed: `code/tools/gen-book-index.mjs` (parses a frontmatter `status` in `notes/task/` and `notes/issue/`, validates `open|done` / `open|resolved`, lists open entries first; missing or unknown status warns and exits 1); `book/notes/README.md` (status convention, wrap-up step flips statuses, `status: open` in the task and issue templates)

**Adopter action:** copy the two changed files; add a `status` line (`open`, `done`, or `resolved`) to every existing task and issue entry — the index build fails without it; rerun `cd code && npm run book:index`.

## 2026-11-06 — bowrite's voice rules on every write (ADR-009)

The skill could de-water a text but rarely made it human: voice rules were scoped to from-scratch drafts while most project writing is revision, and thinning could silently cut conditions(仅当/除非/不适用于)— facts survived, their boundaries didn't.

- Added: `book/docs/decisions/ADR-009-bowrite-voice-on-every-write.md`
- Changed: `skills/bowrite/SKILL.md` (voice rules universal; conditions join the fidelity contract; read-back gains a regular voice pass; the skill thinned by its own rules — the 把书读薄 story once, the duplicated rule merged into the ledger); `book/guidelines/writing-style.md` (same conditions clause, keeping the fallback in sync); `skills/book-writeback/SKILL.md` (names bowrite, writing-style.md as fallback); `book/notes/README.md` and `book/docs/decisions/README.md` (style stated at the templates)

**Adopter action:** copy the five changed files; if you localized bowrite, port the same four changes (voice scope, conditions clause, voice read-back pass, self-thinning); regenerate the index.

## 2026-11-05 — task tiers before the gates (ADR-008)

Small tasks were paying the full six-gate tax — agents packaged ten-minute fixes as "feature development". Grading is now explicit and comes first, before Step 0. Distilled from adopter feedback (Lighthouse3.0, verified in their repo).

- Added: `book/guidelines/task-tiers.md` (S/M/L criteria — "any one means at least this tier"; the four hard rules; the always-L mount point), `book/docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md`
- Changed: `book/guidelines/workflow.md` (tier-first paragraph; no-skipping scoped to M/L), `AGENTS.md` (hard constraints scoped to M/L; tier recorded in the first commit's motive), `skills/boscope/SKILL.md` (tier-first gate before Step 0, description, constraints), `book/guidelines/review-checklist.md` (eleventh check: task tier too low → issue, never backfill), `book/guidelines/README.md` (routing rows), `UPGRADE.md` and `ADOPT.md` (task-tiers in the template-owned lists)

**Adopter action:** copy the changed files (Lighthouse3.0 already runs a local task-tiers.md — diff and merge, then declare your always-L list in it); sync translated variants of boscope (e.g. structured-feature-implementation) with the tier-first insertion; run `cd code && npm run book:index`.

## 2026-11-05 — template updates reach adopters (ADR-007)

The upgrade mechanism itself, plus a link-integrity fix.
Expand Down
11 changes: 11 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@

BoCode はリポジトリを二つに分けます——ソースを置く `code/` と、ドキュメントの流れとナレッジベースを置く `book/` です。両者は双方向に接続されます。今のソフトウェアが実際に書かれている方法、つまり人間と AI コーディングエージェントの共同開発を前提に設計されています。エージェントは速く、メモリもありますが、その記憶はエージェントだけのもの:人間には読めず、管理もできません。プロジェクトの知識がどこに置かれ、誰が読めるかが、速さが制御とともにあるか、制御のない速さになるかを決めます。

<details>
<summary><b>最新情報</b> · 2026-11-06 — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に</summary>

- **2026-11-06** — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に
- **2026-11-06** — タスクと issue を status でアーカイブ(ADR-010)
- **2026-11-06** — bowrite の voice ルールをすべての執筆に適用(ADR-009)

履歴全文と移行手順は [CHANGELOG.md](CHANGELOG.md)

</details>

## 一行で導入

すでにプロジェクトがある? この一行を AI エージェントに貼り付けてください:
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@

BoCode gives a repository two halves — `code/` for the source, `book/` for the documentation stream and knowledge base — wired together in both directions. It is built for the way software is written now: a human and AI coding agents together. Agents are fast and have memory now — but that memory serves the agent alone: unreadable to humans, unmanageable. Where a project's knowledge lives, and who can read it, decides whether speed comes with control or without it.

<details>
<summary><b>What's new</b> · 2026-11-06 — phase-2 stop rule aligned, L-tier ADR trigger decidable</summary>

- **2026-11-06** — phase-2 stop rule aligned, L-tier ADR trigger decidable
- **2026-11-06** — tasks and issues archive by status (ADR-010)
- **2026-11-06** — bowrite's voice rules on every write (ADR-009)

Full history and adopter actions: [CHANGELOG.md](CHANGELOG.md)

</details>

## Adopt it in one line

Already have a project? Paste this to your AI agent:
Expand Down
11 changes: 11 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@

BoCode 把仓库分成两半:`code/` 放源代码,`book/` 放文档和知识库,两边互相驱动。它是为现在最常见的开发方式设计的:人和 AI agent 一起写代码。agent 快,也有记忆,可记忆只归它自己:人读不懂、管不了。项目知识放在哪里、给谁读,决定了开发是又快又稳,还是快得让人心里没底。

<details>
<summary><b>最近更新</b> · 2026-11-06 — Phase-2 停止规则对齐,L 级 ADR 触发判据化</summary>

- **2026-11-06** — Phase-2 停止规则对齐,L 级 ADR 触发判据化
- **2026-11-06** — task/issue 按 status 归档(ADR-010)
- **2026-11-06** — bowrite 的 voice 规则覆盖每一次书写(ADR-009)

完整历史与采用方操作见 [CHANGELOG.md](CHANGELOG.md)

</details>

## 一句话接入

已经有项目了?把这句发给你的 AI agent:
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The one table that decides everything. Template-owned files get refreshed; proje

| Template-owned (refresh) | Project-owned (never touch) |
|--------------------------|------------------------------|
| `book/guidelines/{README,workflow,writing-style,git-workflow,review-checklist}.md` | `AGENTS.md`, root `README.md` |
| `book/guidelines/{README,workflow,task-tiers,writing-style,git-workflow,review-checklist}.md` | `AGENTS.md`, root `README.md` |
| the `README.md` of every `book/` directory (`docs/`, `docs/decisions/`, `docs/architecture/`, `docs/api/`, `notes/`, `plans/`, `changelogs/`) | `book/guidelines/architecture.md` and `coding-style.md` (project drafts since adoption) |
| `skills/` — all four skills plus `skills/README.md` | everything under `book/docs/decisions/`, `book/docs/architecture/`, `book/docs/api/` (the project's own records) |
| `code/tools/*.mjs`; the `scripts` block of `code/package.json` (keep the project's `name`) | everything under `book/notes/`, `book/plans/`, `book/changelogs/` |
Expand Down
13 changes: 9 additions & 4 deletions book/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ description: Master index of the book — the map of every document. Regenerate
# book — bocode master index

> Generated by a script — do not edit by hand. After any book change run: `cd code && npm run book:index`.
> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); the build warns and exits 1 otherwise.
> Every new file must carry a frontmatter `description` (one plain-language line about the content, not the genre); entries under `notes/task/` and `notes/issue/` also need a `status` (`open|done` / `open|resolved`); the build warns and exits 1 otherwise.

## How to use this book

- **AI agents**: read this file first for the full map, then follow links to what you need. Before writing any book document, read `guidelines/writing-style.md`.
- **Humans**: browse by the directory table below. Rules live in `guidelines/`, blueprints in `plans/`, experience in `notes/learn/`, architecture in `docs/architecture/`, decisions in `docs/decisions/`.
- **By time**: `changelogs/` and `notes/{summary,learn,issue}/` archive under `YYYY-MM/`; the month is a physical grouping only — do not nest deeper by feature.
- **By status**: entries in `notes/task/` and `notes/issue/` carry a frontmatter `status`; this index lists open entries first — flipping the field and rerunning is the archive step.
- **By feature**: search this index for a feature name, keyword, or frontmatter summary; `notes/learn/` entries are also searchable by their `tags`.
- **Obsidian**: open `book/` directly as a vault. Links are plain relative Markdown; if you move files, rerun the index.

Expand Down Expand Up @@ -55,15 +56,19 @@ description: Master index of the book — the map of every document. Regenerate
- [ADR-005-distill-first-principles-into-design-phases.md](docs/decisions/ADR-005-distill-first-principles-into-design-phases.md) — Musk's first-principles engineering method is woven into the design phases — requirements face a physics test, estimates derive bottom-up, deletion precedes optimization
- [ADR-006-distill-experience-first-design-into-phases.md](docs/decisions/ADR-006-distill-experience-first-design-into-phases.md) — Jobs's experience-first craft is woven in beside ADR-005 — the request is a proxy for an experience, design is how it works, focus is saying no, and gates are the polish point
- [ADR-007-template-updates-reach-adopters.md](docs/decisions/ADR-007-template-updates-reach-adopters.md) — Template updates reach adopters through a root CHANGELOG, an agent-facing UPGRADE playbook, and a .bocode-version stamp — release-gated by CI; semver rejected, the commit SHA is the baseline
- [ADR-008-grade-tasks-into-tiers-before-the-workflow.md](docs/decisions/ADR-008-grade-tasks-into-tiers-before-the-workflow.md) — Tasks are graded S/M/L before any work — S runs a light channel whose only gate is a one-sentence motive, M/L run Step 0 and all six phases; the tier is decided before Step 0 and recorded in the first commit's motive
- [ADR-009-bowrite-voice-on-every-write.md](docs/decisions/ADR-009-bowrite-voice-on-every-write.md) — bowrite's voice rules now run on every write, not just from-scratch drafts; conditions and exceptions join the fidelity contract's never-move list; the writeback path names bowrite explicitly
- [ADR-010-archive-by-status-flip-not-by-moving-files.md](docs/decisions/ADR-010-archive-by-status-flip-not-by-moving-files.md) — task and issue entries archive by flipping a frontmatter status and regenerating the index — files never move, the index regroups with open entries first
- [README.md](docs/decisions/README.md) — How to write an ADR here — sections, naming, numbering, and when a decision needs a record

### guidelines/

- [README.md](guidelines/README.md) — Index of the five guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading
- [README.md](guidelines/README.md) — Index of the guidelines and the input pointer table — which guideline to read for which kind of task, with no blanket pre-reading
- [architecture.md](guidelines/architecture.md) — Template for your project's long-term architecture rules — boundary invariants, module map, tech baseline, with a worked example of boundary-style rules
- [coding-style.md](guidelines/coding-style.md) — Template for your project's coding baseline — the language-specific rules any contributor or agent must follow
- [git-workflow.md](guidelines/git-workflow.md) — Clean Commit message format and Clean Flow branch, PR, and merge rules for solo and team development
- [review-checklist.md](guidelines/review-checklist.md) — The ten code-review checks every change must pass — findings are recorded, never fixed in passing
- [review-checklist.md](guidelines/review-checklist.md) — The eleven code-review checks every M/L change must pass — findings are recorded, never fixed in passing
- [task-tiers.md](guidelines/task-tiers.md) — S/M/L task grading — criteria per tier, which channel a change runs, the four hard rules, and the always-L list each adopting project declares
- [workflow.md](guidelines/workflow.md) — Six-phase gate workflow with the eight code↔book interaction rules and the document routing table
- [writing-style.md](guidelines/writing-style.md) — Plain-language writing standard for every book document — fidelity contract first, then minimal style rules, intensity levels, and a read-back check

Expand All @@ -75,4 +80,4 @@ description: Master index of the book — the map of every document. Regenerate

- [README.md](plans/README.md) — Plans directory usage — implementation plans land here after Phase 2 approval, with naming and the plan template

<!-- 21 documents -->
<!-- 25 documents -->
Loading
Loading