diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a4405..4d1211e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ Releases of the BoCode template itself. Adopting projects upgrade by handing [UP 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-07 — trilingual readmes aligned with the current gates + +The readme bodies predated two shipped changes: they said every feature runs the six gates (task tiers landed with ADR-008 — S runs a light channel), and they said Phase 2 waits for user approval (the stop rule has fired only on real gaps since the phase-2 alignment). The zh-CN and ja bodies also missed the what-you-gain sentence under the adoption line. + +- Changed: `README.md`, `README.zh-CN.md`, `README.ja.md` (tier-first sentence before the phase table; Phase-2 gate and design-intent paragraph state the real-gaps rule with its three examples; Phase-3 gate reads per design, not approved; zh/ja gain the what-you-gain paragraph; What's-new refreshed) + +**Adopter action:** none — the readmes are the template's own front page; your project's readme stays yours. + +## 2026-11-06 — selected ub-mode practices (ADR-011) + +Selected practices from Robert C. Martin's [ub-mode](https://github.com/unclebob/ub-mode/blob/master/SKILL.md) supplement the existing phases where useful: valid state modeling, pure business calculations, behavior-focused tests, evidence-based defect repairs, shared domain terms, and complexity review. Automation samples remain an optional boscope reference, outside the general workflow and review checklist. Project rules and user requirements take precedence over this supplementary guidance. No phases, approval gates, required review items, mandatory tools, or fixed thresholds are added. Context-management, action logs, metrics-tool dependencies, and worktree cleanup are excluded; existing validation and data-ownership rules remain. + +- Added: `book/docs/decisions/ADR-011-distill-selected-ub-mode-practices.md` — the selection, adaptations, and scope boundaries; `skills/boscope/references/automation-tools.md` — the optional method and sample-storage guidance +- Changed: `skills/boscope/SKILL.md` (defect evidence and premise checks in Phase 1, state modeling, terminology and an optional reading pointer in Phase 2, calculation boundaries in Phase 3, behavior tests and repair verification in Phase 4); `skills/README.md` (entry points and reference installation); `book/guidelines/workflow.md` (matching principles); `book/guidelines/README.md` (check count and terminology pointer); `book/guidelines/writing-style.md` (use the existing domain glossary); `book/guidelines/architecture.md` (optional inline glossary guidance); `book/guidelines/coding-style.md` (optional complexity-check configuration) + +**Adopter action:** sync the entire `skills/boscope/` directory, `skills/README.md`, and `book/guidelines/{workflow,README,writing-style}.md` per UPGRADE.md, preserving project edits; sync any translated boscope variants and their reference pointers. Do not copy only `SKILL.md` and leave its reference behind. `architecture.md` and `coding-style.md` are project-owned after adoption: do not overwrite them. When useful, offer the glossary and optional complexity-check guidance for manual incorporation into those documents. No new sample directory or mandatory glossary file is required; retained samples follow existing test/fixture conventions. + ## 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. diff --git a/README.ja.md b/README.ja.md index f2aa128..4af5a67 100644 --- a/README.ja.md +++ b/README.ja.md @@ -17,11 +17,11 @@ BoCode はリポジトリを二つに分けます——ソースを置く `code/` と、ドキュメントの流れとナレッジベースを置く `book/` です。両者は双方向に接続されます。今のソフトウェアが実際に書かれている方法、つまり人間と AI コーディングエージェントの共同開発を前提に設計されています。エージェントは速く、メモリもありますが、その記憶はエージェントだけのもの:人間には読めず、管理もできません。プロジェクトの知識がどこに置かれ、誰が読めるかが、速さが制御とともにあるか、制御のない速さになるかを決めます。
-最新情報 · 2026-11-06 — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に +最新情報 · 2026-11-07 — 三言語の README を現行ゲートに合わせて更新 +- **2026-11-07** — 三言語の README を現行ゲートに合わせて更新 +- **2026-11-06** — ub-mode の精選プラクティスを追加(ADR-011) - **2026-11-06** — フェーズ 2 停止ルールを統一、L の ADR トリガーを判定可能に -- **2026-11-06** — タスクと issue を status でアーカイブ(ADR-010) -- **2026-11-06** — bowrite の voice ルールをすべての執筆に適用(ADR-009) 履歴全文と移行手順は [CHANGELOG.md](CHANGELOG.md) @@ -37,6 +37,8 @@ https://github.com/Focus695/BoCode を読み(まず ADOPT.md から)、そ ゼロから始める? [クイックスタート](#クイックスタート)へ直接どうぞ。 +クローンして、スクリプトを一つ実行し、四つのスキルをインストールするだけで、プロジェクトは得ます:ゲート付きの開発ワークフロー、自己インデックス化するナレッジベース、すべての機能を蓄積された経験に変える書き戻しの規律、そして履歴を読みやすく保つ git ポリシー。 + --- ## なぜ BoCode が必要か @@ -110,21 +112,21 @@ BoCode のルールは四つのスキルが分担し、それぞれ独立して ### boscope(薄界)——ブレーキではなくゲート -すべての機能は六段階のワークフローを硬いゲート付きで通ります(ルール本体は `book/guidelines/workflow.md`): +タスクはまず S/M/L に格付けされます(`book/guidelines/task-tiers.md`)——S は軽い経路を通り、M/L の機能だけが六段階の硬いゲート付きワークフローを通ります(ルール本体は `book/guidelines/workflow.md`): | フェーズ | 産出 | ゲート | |-------|--------|------| | Step 0 — 要件ブリーフ | 背景、スコープ、除外項目、要件 | 全スロット記入 | | 1 — 分析 | 影響マップ + リスク一覧 | コードは一行も変更しない | -| 2 — 設計 | データフロー、ファイル、インターフェース | **ユーザーの承認が必要** | -| 3 — 実装 | コード | 承認されたスコープの外には手を出さない | +| 2 — 設計 | データフロー、ファイル、インターフェース | **本当のギャップがあるときのみ停止** | +| 3 — 実装 | コード | 設計どおりに、スコープの外には手を出さない | | 4 — テスト | テスト(先に書く) | 全グリーン、アサーションを弱めない | | 5 — レビュー | 発見事項リスト | 記録のみ、その場で直さない | | 6 — クローズアップ | summary、learn、issue、changelog、インデックス | 記録のみ、その場で直さない | 除外リストは Step 0 の急所です:空の「影響しない」リストこそ、Phase 3 でのスコープ外変更の最大の原因になります。 -設計意図:エージェントは実装を分単位に圧縮するので、ボトルネックは意思決定とスコープに移ります。ゲートはまさにそこを守ります——Step 0 が要求に書かれていないことを埋め、Phase 2 で人が方向を承認し、Phase 5〜6 が観察と修正の分離を強制します。**レビューで見つかった問題は記録された issue になり、直すのは別の仕事です。** 記録のみにすることで、レビューの結論が信頼に足ります。 +設計意図:エージェントは実装を分単位に圧縮するので、ボトルネックは意思決定とスコープに移ります。ゲートはまさにそこを守ります——Step 0 が要求に書かれていないことを埋め、Phase 2 は本当のギャップ——スコープの衝突、データ形式の未確定、外部依存の不明——があるときだけ人を呼び、Phase 5〜6 が観察と修正の分離を強制します。**レビューで見つかった問題は記録された issue になり、直すのは別の仕事です。** 記録のみにすることで、レビューの結論が信頼に足ります。 ### 読者のために書く diff --git a/README.md b/README.md index 1f4756d..68a7248 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,11 @@ 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.
-What's new · 2026-11-06 — phase-2 stop rule aligned, L-tier ADR trigger decidable +What's new · 2026-11-07 — trilingual readmes aligned with the current gates +- **2026-11-07** — trilingual readmes aligned with the current gates +- **2026-11-06** — selected ub-mode practices (ADR-011) - **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) @@ -112,21 +112,21 @@ The sections below state the rules; the skills are their enforcement layer. ### boscope(薄界)— gates, not brakes -Every feature runs a six-phase workflow with hard gates (the rules live in `book/guidelines/workflow.md`): +Tasks are graded S/M/L first (`book/guidelines/task-tiers.md`); S runs a light channel, and every M/L feature runs the six-phase workflow with hard gates (the rules live in `book/guidelines/workflow.md`): | Phase | Output | Gate | |-------|--------|------| | Step 0 — requirements brief | background, scope, exclusions, requirement | Every slot filled | | 1 — Analysis | impact map + risk list | No code changed | -| 2 — Design | data flow, files, interfaces | **User approval required** | -| 3 — Implementation | the code | Nothing outside the approved scope | +| 2 — Design | data flow, files, interfaces | **Stop only on real gaps** | +| 3 — Implementation | the code | Strictly per design, nothing outside scope | | 4 — Testing | tests, written first | All green, no weakened assertions | | 5 — Review | findings list | Recorded, never fixed | | 6 — Wrap-up | summary, learn, issues, changelog, index | Recorded, never fixed | The exclusions list is Step 0's crux: an empty "does not affect" list is the number-one cause of out-of-scope changes in Phase 3. -The design intent: agents compress implementation to minutes, which moves the bottleneck to decisions and scope. The gates hold exactly there — Step 0 fills in what the request didn't say, Phase 2 is where a person approves direction, and Phases 5–6 enforce the separation of observing and fixing. **A problem found at review becomes a recorded issue; fixing it is separate work.** That is what keeps the review honest. +The design intent: agents compress implementation to minutes, which moves the bottleneck to decisions and scope. The gates hold exactly there — Step 0 fills in what the request didn't say, Phase 2 calls the user in only on a real gap (scope conflict, undetermined data shape, unclear external dependency), and Phases 5–6 enforce the separation of observing and fixing. **A problem found at review becomes a recorded issue; fixing it is separate work.** That is what keeps the review honest. ### Write for the reader diff --git a/README.zh-CN.md b/README.zh-CN.md index 2348bd1..809ef87 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -17,11 +17,11 @@ BoCode 把仓库分成两半:`code/` 放源代码,`book/` 放文档和知识库,两边互相驱动。它是为现在最常见的开发方式设计的:人和 AI agent 一起写代码。agent 快,也有记忆,可记忆只归它自己:人读不懂、管不了。项目知识放在哪里、给谁读,决定了开发是又快又稳,还是快得让人心里没底。
-最近更新 · 2026-11-06 — Phase-2 停止规则对齐,L 级 ADR 触发判据化 +最近更新 · 2026-11-07 — 三语 README 与现行关卡对齐 +- **2026-11-07** — 三语 README 与现行关卡对齐 +- **2026-11-06** — 精选 ub-mode 实践(ADR-011) - **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) @@ -37,6 +37,8 @@ BoCode 把仓库分成两半:`code/` 放源代码,`book/` 放文档和知识 新开项目?直接跳到[快速开始](#快速开始)。 +Clone 下来、跑一个脚本、装上四个 skill,项目就有了:带硬关卡的开发流程、自动建索引的知识库、把每个功能沉淀成经验的回写纪律,和保持历史可读的 git 规则。 + --- ## 为什么需要 BoCode @@ -110,21 +112,21 @@ BoCode 的规矩由四个 skill 分头执行、各自独立调用: ### 薄界(boscope):是关卡,不是刹车 -每个功能走六阶段,每阶段是硬关卡(规范本体:`book/guidelines/workflow.md`): +任务先分级 S/M/L(`book/guidelines/task-tiers.md`)——S 走轻通道,M/L 功能才走六阶段硬关卡(规范本体:`book/guidelines/workflow.md`): | 阶段 | 产出 | 关卡 | |------|------|------| | Step 0 需求 Brief | 背景、作用域、排除项、需求 | 每个槽位填实 | | 1 需求分析 | 影响图 + 风险清单 | 不改任何代码 | -| 2 设计 | 数据流、文件清单、接口 | **用户确认后才推进** | -| 3 实现 | 代码 | 严格按批准的作用域 | +| 2 设计 | 数据流、文件清单、接口 | **仅在真实缺口时停下问人** | +| 3 实现 | 代码 | 严格按设计,不出作用域 | | 4 测试 | 先写测试 | 全绿,不削弱断言 | | 5 Review | 问题清单 | 只记录,不修复 | | 6 收尾 | summary、learn、issue、changelog、索引 | 只记录,不修复 | 排除清单是 Step 0 的命门:空着的"不影响"清单,就是 Phase 3 越界改动的头号来源。 -设计意图:agent 把实现压到分钟级,瓶颈就挪到了决策和作用域上,关卡恰好守在那里——Step 0 补上需求没说的话,Phase 2 由人拍板方向,Phase 5/6 把"看"和"改"分开。**Review 时发现的问题进清单,修复是另一件事。** 只记录、不修复,review 的结论才可信。 +设计意图:agent 把实现压到分钟级,瓶颈就挪到了决策和作用域上,关卡恰好守在那里——Step 0 补上需求没说的话,Phase 2 只在真实缺口——作用域冲突、数据形态未定、外部依赖不清——时停下问人,Phase 5/6 把"看"和"改"分开。**Review 时发现的问题进清单,修复是另一件事。** 只记录、不修复,review 的结论才可信。 ### 为读者而写 diff --git a/book/README.md b/book/README.md index d2d7427..e7182d2 100644 --- a/book/README.md +++ b/book/README.md @@ -59,6 +59,7 @@ description: Master index of the book — the map of every document. Regenerate - [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 +- [ADR-011-distill-selected-ub-mode-practices.md](docs/decisions/ADR-011-distill-selected-ub-mode-practices.md) — Selected ub-mode practices supplement project rules for modeling, calculations, testing, defects, terminology, and optional automation - [README.md](docs/decisions/README.md) — How to write an ADR here — sections, naming, numbering, and when a decision needs a record ### guidelines/ @@ -80,4 +81,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 - + diff --git a/book/docs/decisions/ADR-011-distill-selected-ub-mode-practices.md b/book/docs/decisions/ADR-011-distill-selected-ub-mode-practices.md new file mode 100644 index 0000000..17586bd --- /dev/null +++ b/book/docs/decisions/ADR-011-distill-selected-ub-mode-practices.md @@ -0,0 +1,36 @@ +--- +description: Selected ub-mode practices supplement project rules for modeling, calculations, testing, defects, terminology, and optional automation +--- + +# ADR-011: Distill selected ub-mode practices + +## Status + +Accepted — 2026-11-06. Ships with the template. + +## Context + +Robert C. Martin's [ub-mode](https://github.com/unclebob/ub-mode) provides engineering instructions for agents. Its [skill](https://github.com/unclebob/ub-mode/blob/master/SKILL.md) informs the modeling, calculation, testing, defect, terminology, and automation guidance selected here. We adapt those practices to BoCode's scope and document rules. + +BoCode already covers small changes, first-principles design, test-first iteration, regression, data ownership, and knowledge writeback. Importing the whole skill would repeat those rules and introduce conflicting process requirements. Short instructions can make modeling, calculation boundaries, test assertions, and defect investigation more concrete. Easily confused business concepts need shared definitions. Worked samples can help develop automation tools, but this specific task should not add checks to ordinary feature work. + +## Decision + +The ub-mode-derived practices below are supplementary and apply only where useful within the current task. The user's requirements and the project's workflow, task tiers, architecture, and coding conventions take precedence; skip or adapt any conflicting practice. These practices add no phase, approval gate, or required review item. Keep automation guidance in an optional reference, with one task-specific reading pointer in boscope. Keep the current phases, skills, and eleven-item review checklist. + +- **Defects:** Phase 1 establishes the cause from reproduction or checkable failure evidence. Where reproduction is unavailable, separate facts from hypotheses and specify verification. If two fixes sharing a premise fail the same verification, state and recheck that premise before another attempt. Phase 4 checks the original failure and regression; hiding an error alone is insufficient. +- **Modeling and calculations:** where practical, Phase 2 represents valid state combinations in types or data structures, and Phase 3 keeps business calculations as pure functions with explicit inputs and outputs, separate from external reads and writes. Existing scope rules still prohibit unrelated abstractions or refactors. +- **Tests:** Phase 4 checks observable results and required side effects through the caller's interface, without tying tests to private call sequences. +- **Complexity:** use the existing complexity review to consider complex conditions, deep nesting, and repeated branches when relevant. Reuse configured lint/static-analysis checks where available; adopting projects choose thresholds and warning or blocking policy. Scores identify candidates for review, not automatic refactoring. No measurement suite is required. +- **Automation tools (optional):** `skills/boscope/references/automation-tools.md` describes worked samples for batch or repetitive tasks. Use a sample when processing rules, expected results, or batch effects need confirmation; existing tools and established rules may already provide enough evidence. The agent can produce it from the requirements, clarifying unresolved business rules. It need not be a test or file. Retained regression cases follow the owning tests' conventions. Ordinary tasks do not load this reference or evaluate an automation checklist item. +- **Domain terms:** when concepts need clarification or terms are used inconsistently, maintain concise meanings, code names, and distinctions in the existing architecture document. Use existing definitions across docs, interfaces, and code; split the glossary only when it grows. This does not authorize unrelated renames. + +Context-management and action-log requirements are excluded by user choice. Boundary-only validation is not introduced; existing input, authorization, and business checks remain necessary. Existing data-ownership rules stay as they are. Companion metrics tools, fixed thresholds, worktree cleanup, and upstream commit/push instructions remain outside this change. Phase 5/6 still record findings without fixing them. + +## Consequences + +- Defect repairs have evidence to review; terminology has a shared definition when needed; tool-development tasks can consult the sample method without burdening the general workflow. +- No new skill, sample directory, mandatory glossary file, or tool dependency is introduced. Complexity review adds no mandatory Python runtime, custom analyzer, or fixed score threshold. New tooling remains within the designed scope. +- The glossary guidance lives in the skill as well as the architecture template: adopters own their architecture documents, so upgrades offer this addition for manual incorporation rather than overwriting project content. +- The existing eleven-item review checklist is unchanged. The skills README and root changelog explain that boscope's reference is copied with its entry point, and list the optional architecture-template addition. This template's own records remain ADRs, per [ADR-004](ADR-004-template-free-of-instance-records.md). +- Verification exposed an existing portability issue: on a Windows CRLF checkout, the index generator misreads descriptions and emits backslash paths. Rebuild with the unchanged generator on an LF copy under Linux; fixing the generator is separate work. diff --git a/book/guidelines/README.md b/book/guidelines/README.md index e44e87d..1755156 100644 --- a/book/guidelines/README.md +++ b/book/guidelines/README.md @@ -22,7 +22,7 @@ The project's development rules. Every contributor — including AI agents — f |--------|-----------| | Phases, gates, book sync | `workflow.md` | | Grading a task, which channel it runs | `task-tiers.md` | -| Module boundaries, data ownership, tech swaps | `architecture.md` | +| Module boundaries, data ownership, tech swaps, domain terms | `architecture.md` | | The current shape of modules and data flow | `../docs/architecture/` snapshots | | Interface contracts | `../docs/api/` | | Writing any book document | `writing-style.md` | diff --git a/book/guidelines/architecture.md b/book/guidelines/architecture.md index b698faa..3ed312f 100644 --- a/book/guidelines/architecture.md +++ b/book/guidelines/architecture.md @@ -12,6 +12,7 @@ description: Template for your project's long-term architecture rules — bounda 2. **Module map** — the top-level modules/processes, their responsibilities, and who talks to whom. One sentence per module is enough; details live in snapshots. 3. **Technology baseline** — languages, frameworks, storage, and the rule for swapping any of them (usually: via an adapter, never via a rewrite). 4. **Data ownership** — for each store or dataset, the single module allowed to write it. +5. **Domain terms (when needed)** — when concepts need clarification or terms are used inconsistently, keep a short glossary here: each term's meaning, code name, and distinction from similar concepts. Reuse existing definitions across docs, interfaces, and code; split the glossary into a linked document only when it grows. Terminology work stays within the task's scope. ## Worked example: boundary invariants diff --git a/book/guidelines/coding-style.md b/book/guidelines/coding-style.md index 2e05a15..e13dae1 100644 --- a/book/guidelines/coding-style.md +++ b/book/guidelines/coding-style.md @@ -11,6 +11,7 @@ description: Template for your project's coding baseline — the language-specif - **Language & toolchain** — versions, runtime, package manager; what counts as "the standard way to run this project" - **Naming** — files, types, functions, variables, constants; the project's one convention per kind - **Formatting & lint** — the tool, the command, and that CI fails when it's dirty +- **Complexity checks (optional)** — reuse existing lint/static analysis; define the command, scope, project-specific thresholds, and whether findings warn or block. Scores guide review; do not split code mechanically to lower them - **Error handling** — how errors are raised, wrapped, and surfaced; what never gets swallowed - **Testing conventions** — where tests live, how they're named, what must be covered before a change counts as done - **Dependencies** — the policy for adding one (and the default answer: don't, unless it removes more code than it adds) diff --git a/book/guidelines/workflow.md b/book/guidelines/workflow.md index 3c66a6c..30a5353 100644 --- a/book/guidelines/workflow.md +++ b/book/guidelines/workflow.md @@ -8,6 +8,8 @@ description: Six-phase gate workflow with the eight code↔book interaction rule Grade the task first — S, M, or L per `task-tiers.md`; the tier is decided before any work and lands in the first commit's motive. S runs the light channel and never enters this table. Every M/L feature moves through these phases in order. **No skipping.** +The ub-mode-derived practices below are supplementary and apply only where useful within the current task. The user's requirements and the project's workflow, task tiers, architecture, and coding conventions take precedence; skip or adapt any conflicting practice. These practices add no phase, approval gate, or required review item. + | Phase | Name | Output | Gate | |------|------|--------|------| | Step 0 | Structured requirements brief | Requirements brief | Every slot filled | @@ -20,10 +22,18 @@ Grade the task first — S, M, or L per `task-tiers.md`; the tier is decided bef Step 0 comes before any code (M and L). Fill the brief: background, scope (what it affects, what it explicitly does **not** affect, and the boundaries), and the requirement itself. An empty "does not affect" list is the number-one cause of out-of-scope changes in Phase 3 — the exclusions slot is required. Requirements arrive as suggestions; physics is the only law — correctness, data integrity, and the user's explicit hard constraints don't negotiate, while convention, past practice, and "how it's done" do. Question the inherited HOW; the user's WHAT holds (reasoning and sources in ADR-005, in the BoCode repository's `book/docs/decisions/`). The stated request is a proxy — the experience behind it is the requirement: capture what the user will see, do, and get. Focus is saying no; the exclusions slot gives the feature its shape (ADR-006). +For defect work, Phase 1 reproduces the failure or gathers checkable failure evidence and locates the cause before code changes. If reproduction is unavailable, distinguish facts from hypotheses and state how the fix will be verified. Suppressing an error alone does not establish a repair. If two fixes sharing a premise fail the same verification, state and recheck that premise before trying another fix (ADR-011). + Phase 2 produces the full design — data flow, file list, interfaces — and proceeds; it stops for the user only when a real gap appears (scope conflict, undetermined data shape, unclear external dependency), never just for confirmation. Designs and estimates derive bottom-up from primitives — what the data and code actually are — never by analogy to last time; delete what no requirement calls for before optimizing anything that remains. Design is how it works — the surfaces the user touches (defaults, empty states, error messages) are designed with the data flow, never decorated after it (ADR-006). +When domain concepts need clarification or terms are used inconsistently, maintain a short glossary in the existing architecture document, with meanings, code names, and distinctions; split it only when it grows. Use those terms consistently across docs, interfaces, and code (ADR-011). + +Where practical, Phase 2 uses types or data structures to exclude invalid state combinations. Phase 3 keeps business calculations as pure functions with explicit inputs and outputs, separate from database, file, and network operations (ADR-011). + Phase 4's hard part is the gate, not the sequence: all relevant tests green, no assertion weakened to get there, coverage of the normal path, boundary inputs (ranges, empty, extremes), error paths, and a regression check that existing behavior didn't break. Test-first (write a failing test → minimum implementation → refactor staying green) is the default loop — sequence the work however keeps the gate honest. Iterate fast inside the phase; polish at the gate — what crosses a gate is finished: defaults chosen, errors worded, edges handled (ADR-006). +Phase 4 tests observable results and required side effects through the caller's interface, avoiding dependence on private call sequences. For defects, it verifies that the original failure is resolved and existing behavior holds; unverified outcomes remain explicit (ADR-011). + Phases 5 and 6 share one discipline: **record, never fix.** A problem found during review or wrap-up goes into `notes/issue/` — fixing it is a separate, later task. Fixing in passing feels efficient and destroys the gate: the review no longer reviews what was built. ## code ↔ book — the two halves diff --git a/book/guidelines/writing-style.md b/book/guidelines/writing-style.md index 4de2983..718eba9 100644 --- a/book/guidelines/writing-style.md +++ b/book/guidelines/writing-style.md @@ -31,6 +31,7 @@ Work by pattern, not word-for-word substitution. Rotating synonyms to dodge repe - Un-nominalize: "performed an optimization" → what changed, how much faster. "perform / implement / complete + gerund" is the tell - Shorten translationese: fewer long attributive chains, fewer passive piles, less "through X, by way of Y, to achieve Z" - Don't call the same thing by three different names in adjacent sentences +- Use the project's domain glossary, when present, as the source for business terms; preserve the distinctions between similar concepts - Filler intensifiers ("important", "key", "critical", "core"): trim only when density is clearly too high, or replace with concrete information ## Intensity levels diff --git a/skills/README.md b/skills/README.md index 0d7c0b3..dd8f452 100644 --- a/skills/README.md +++ b/skills/README.md @@ -1,6 +1,6 @@ # Skills -Four self-contained skills implement the BoCode workflow for AI agents. Each is a single `SKILL.md` in the standard format (frontmatter with `name` and `description`, then the body) — no code, no dependencies. +Four skills implement the BoCode workflow for AI agents. Each has a `SKILL.md` entry point in the standard format (frontmatter with `name` and `description`, then the body) — no code, no dependencies. A skill can include optional references: boscope's [automation tools guide](boscope/references/automation-tools.md) is read only when relevant, not as a separate skill. | Skill | Does | Triggers | |-------|------|----------| @@ -13,7 +13,7 @@ Division of labor: **skills say when and how** (executable behavior for the agen ## Installation -Copy the four skill directories into your agent's skills folder: +Copy the four skill directories, including any `references/` subdirectories, into your agent's skills folder: - **ZCode**: `~/.zcode/skills/` (user-wide) or `/.zcode/skills/` (per project) - **Claude Code**: `~/.claude/skills/` or `/.claude/skills/` diff --git a/skills/boscope/SKILL.md b/skills/boscope/SKILL.md index 45c91bd..f67760d 100644 --- a/skills/boscope/SKILL.md +++ b/skills/boscope/SKILL.md @@ -15,6 +15,8 @@ Grade the task first (tier first, below). An M/L feature then splits into **brie **Core principle:** a request that says *what* but not *why / scope / boundaries* is not ready for code. Fill the gaps first; then surface the axes the user didn't know were missing. +The ub-mode-derived practices below are supplementary and apply only where useful within the current task. The user's requirements and the project's workflow, task tiers, architecture, and coding conventions take precedence; skip or adapt any conflicting practice. These practices add no phase, approval gate, or required review item. + ## Tier first — grade before anything (REQUIRED — before Step 0) Grade the task against the tier table in `book/guidelines/task-tiers.md` (the criteria live there, not here — this project's copy, with its always-L list). The tier is a fact about the change, not a preference; it lands in the first commit's motive. @@ -63,16 +65,24 @@ Render the brief below and fill every slot. For empty slots you have two duties: Understand the requirement → find the relevant code → trace the call chain → map the impact → flag risks. **No code changes.** +**For defects, establish the cause.** Reproduce the failure or collect checkable failure evidence, then locate its cause before editing. If reproduction is unavailable, separate confirmed evidence from hypotheses and state how the fix will be verified. A guard that merely hides the failure is not a fix. If two fixes sharing a premise fail the same verification, state that premise and recheck it against evidence before trying another fix. + **Output:** impact map + risk list. ### Phase 2: Design **Output:** data flow, sequence diagram (optional), file change list, new interfaces, permission design, notification design, experience surfaces (defaults, empty states, error messages), test points. +Where practical, represent valid state combinations in types or data structures so invalid combinations cannot be constructed. + **Derive, don't analogize.** Design and estimate bottom-up: decompose to primitives — what the data actually is, what the code actually does, measured costs — and reason up from there. An analogy ("the last similar feature took three days") is a data point, not an estimate. A gap between the bottom-up answer and the received number marks the real problem. **Delete before you optimize.** Question every part against its requirement: delete what nothing calls for, simplify what remains, and only then optimize or speed up. If nothing ever gets added back, you're deleting too little; optimizing a part that shouldn't exist is waste, faster. +When developing batch or repetitive-task tools, consult the optional [automation tools guide](references/automation-tools.md) as needed. + +**Use the domain's terms.** Reuse existing definitions across the design, interfaces, and code. When concepts need clarification or terms are used inconsistently, add or update a short glossary with each term's meaning, code name, and distinction from similar concepts. Keep it in the existing architecture document; split it only when it grows. Do not rename unrelated code to enforce terminology. + **Design is how it works.** The surfaces the user touches — defaults, empty states, error messages — are the design itself, not decoration on the data flow. A design that needs explaining before it works gets simplified, not documented. **Real gaps stop this phase; nothing else does.** With the outputs above complete, go straight to Phase 3 and deliver the design with the implementation — stop for the user only on a real gap (scope conflict, undetermined data shape, unclear external dependency), never just for confirmation. @@ -85,12 +95,18 @@ Understand the requirement → find the relevant code → trace the call chain Strictly per the design. **No changes outside scope, no refactors, no new abstractions.** Match the existing code's style. +Where practical, keep business calculations as pure functions with explicit inputs and outputs, separate from database, file, and network operations. + ### Phase 4: Testing (test-first) Write a failing test → write the minimal implementation that passes → refactor with tests green. This loop is the iteration engine — run it fast and let it fail: a red test is data, not a setback. Iterate freely inside the phase, never past the gate. What crosses the gate crosses it polished — defaults chosen, errors worded, edges handled. **Coverage (all required):** normal path · permission checks · boundaries (input ranges / empty / extremes) · error paths · regression (existing behavior intact). +Test through the caller's interface and assert observable results and required side effects; avoid coupling tests to private call sequences. + +For defects, verify the original failure is resolved and existing behavior holds; distinguish verified results from remaining uncertainty. + **Gate:** all relevant tests pass, and no assertion was weakened to make them pass. ### Phase 5: Code review diff --git a/skills/boscope/references/automation-tools.md b/skills/boscope/references/automation-tools.md new file mode 100644 index 0000000..7012ec1 --- /dev/null +++ b/skills/boscope/references/automation-tools.md @@ -0,0 +1,23 @@ +--- +description: Optional guidance for developing batch or repetitive-task tools — use a worked sample when processing rules or batch effects need confirmation +--- + +# Automation tools — optional guidance + +Use this reference when developing tools for batch or repetitive tasks, such as data conversion, report generation, or file processing. It adds no gate to ordinary feature development or the general review checklist. The user's requirements and existing project workflow and conventions take precedence over this reference. + +## When a sample helps + +Complete one small unit directly when processing rules, expected results, or batch effects need confirmation. Reuse suitable existing tools and established rules; do not manufacture a new sample when they already provide sufficient evidence. Include any new tooling in the task's design scope. + +The agent can produce the sample from known requirements. Clarify unresolved business rules rather than inventing them. A sample is a worked result, not necessarily an automated test or a separate file. + +For example, before generating sales reports, calculate one store's total from a few transactions and confirm how refunds affect it. That result gives the report generator something checkable to match. + +## Implement and verify + +Compare the tool's output with the checked result. Where batch effects matter, verify a small batch before wider execution. Follow the project's existing authorization and safety rules for execution. + +## Keep only useful samples + +Keep samples needed for regression with the owning tool's or module's tests: small cases inline, larger inputs and expected outputs as fixtures under existing conventions. Temporary working examples need not become maintained files. Do not create a project-wide sample directory for this method or retain a second implementation of the tool.