your-cto-jev 0.9.2 → 0.9.4

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.
package/README.md CHANGED
@@ -251,10 +251,10 @@ The skill gives the agent seven named jobs, so they cannot be confused with anot
251
251
  | Say | The agent |
252
252
  |---|---|
253
253
  | `cto-jev init` | scans the repo, fills PRODUCT.md and ARCHITECTURE.md, asks you the rest a few questions at a time, walks you through the result until you say it is complete |
254
- | `cto-jev feature` | talks the request through first (who it is for, business rules, what is out of scope, what other features may call, how it will be verified), writes CONCEPT and SPEC, walks you through them, stops for your `Status: approved` |
254
+ | `cto-jev feature` | talks the request through first (who it is for, business rules, what is out of scope, the simpler option it rejected, data migration and rollback, what other features may call, how a production failure gets noticed, how it will be verified), writes CONCEPT and SPEC, has a zero-context reviewer check that a newcomer could build from them without making design decisions and that nothing unneeded or already in the code gets built, walks you through them, stops for your `Status: approved` |
255
255
  | `cto-jev tasks` | breaks an approved SPEC into parent/child tasks with files, dependencies and an acceptance command each |
256
- | `cto-jev work` | dispatches Ready tasks to sub-agents with the narrowest brief, runs each acceptance command itself before ticking, has a zero-context reviewer read the diff **before every commit**: P1 findings are fixed first, P2 findings become tasks, then it commits to the review branch |
257
- | `cto-jev release` | reviews the whole unreleased diff against the SPECs, files P1/P2/P3 tasks, requires every P1 ticked and `cto check --base <release branch>` green, then prepares the merge, PR or tag for you to perform |
256
+ | `cto-jev work` | dispatches Ready tasks to sub-agents with the narrowest brief, runs each acceptance command itself before ticking, has a zero-context reviewer read the diff **before every commit**: P1 findings are fixed first (and the fixes reviewed once more), P2 findings become tasks, a finding is contested only with evidence the reviewer could read, then it commits to the review branch |
257
+ | `cto-jev release` | reviews the whole unreleased diff against the SPECs (looking hardest at waves marked `self-review`), files P1/P2/P3 tasks under the same findings rules, requires every P1 ticked and `cto check --base <release branch>` green, then prepares the merge, PR or tag for you to perform |
258
258
  | `cto-jev docs` | runs `cto docs` and brings you the list; acts only on what you decide |
259
259
  | `cto-jev decision` | writes an append-only decision record under `decisions/` |
260
260
 
@@ -411,8 +411,6 @@ node scripts/harvest-commands.mjs --rows 300 # real agent commands from a public
411
411
 
412
412
  `calibrate` uses exactly the questions and state builders that ship, prints every case's score, and reports how many cases the current threshold catches and wrongly blocks. Harvested candidates in `calibration/candidates/` (from nebius/SWE-rebench-openhands-trajectories, CC-BY-4.0) join the measurement once someone sets their `expect` label.
413
413
 
414
- The full design, including the measured results behind the defaults, is in [`your-cto-jev-spec.html`](./your-cto-jev-spec.html) (written in 繁體中文).
415
-
416
414
  ## License
417
415
 
418
416
  [MIT](./LICENSE)
package/dist/brief.js CHANGED
@@ -73,7 +73,7 @@ const unknownCount = (path) => {
73
73
  return 0;
74
74
  }
75
75
  };
76
- // Fixed headings, as the SPEC's 欄位 tables name them (docs/cto_jev/features/cto-flow/SPEC.md).
76
+ // Fixed headings, as the flow skill (FLOW_SKILL_TEXT in skill.ts) names them.
77
77
  const HEADINGS = [
78
78
  ['PRODUCT.md', ['一句話', '使用者角色', '怎麼賺錢', '方案與限制', '不做的事', '設計約束']],
79
79
  ['ARCHITECTURE.md', ['技術棧', '目錄地圖', '外部服務與資料', '驗證指令', '不變的原則']],
package/dist/flow.js CHANGED
@@ -2,7 +2,7 @@ import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { BOX } from './turn.js';
4
4
  // docs/cto_jev/features/<slug>/TASKS.md: the one place the development flow keeps state. Everything else (INDEX,
5
- // ready list, feature dependencies, code ownership) is computed from it. Spec: docs/cto_jev/features/cto-flow/SPEC.md.
5
+ // ready list, feature dependencies, code ownership) is computed from it. Format: FLOW_SKILL_TEXT in skill.ts.
6
6
  export const FLOW_DIR = 'docs/cto_jev';
7
7
  export const FEATURE_FILES = ['CONCEPT.md', 'SPEC.md', 'TASKS.md', 'REVIEW.md'];
8
8
  const ID = /^([A-Z][A-Z0-9]*-\d+(?:\.\d+)*)\b\s*/;
package/dist/setup.js CHANGED
@@ -122,7 +122,7 @@ function uninstallHooks(settings) {
122
122
  return touched;
123
123
  }
124
124
  // docs/cto_jev/ skeleton, created only for files that do not exist. Headings are the fixed field names the flow checks
125
- // read (docs/cto_jev/features/cto-flow/SPEC.md); `unknown` is what the agent's first run fills in.
125
+ // read (FLOW_SKILL_TEXT in skill.ts); `unknown` is what the agent's first run fills in.
126
126
  const fields = (names) => names.map((n) => `## ${n}\n\nunknown\n`).join('\n');
127
127
  export const FLOW_SKELETON = {
128
128
  'docs/cto_jev/PRODUCT.md': `# PRODUCT\n\nStatus: draft\n\n${fields(['一句話', '使用者角色', '怎麼賺錢', '方案與限制', '不做的事', '設計約束'])}`,
@@ -142,7 +142,7 @@ export function planSetup(root, chosenAgents, flow, goal) {
142
142
  const out = [];
143
143
  const at = (p, change, abs = join(root, p)) => out.push({ path: p, change: change === 'remove' ? 'remove' : existsSync(abs) ? 'update' : 'new' });
144
144
  const chosen = new Set(chosenAgents);
145
- // git reports the hooks dir with long names; a Windows temp root may be 8.3 (ERICHS~1). Compare real paths.
145
+ // git reports the hooks dir with long names; a Windows temp root may be 8.3 (C:\Users\JOHNDO~1). Compare real paths.
146
146
  const real = (p) => { try {
147
147
  return realpathSync.native(p);
148
148
  }
package/dist/skill.js CHANGED
@@ -102,7 +102,7 @@ turns it into a calibration case; you do not run that yourself.
102
102
  - \`cto docs\`: list stale planning markdown outside \`docs/cto_jev/\` with a suggestion per file; changes nothing.
103
103
  `;
104
104
  // The flow skill: how the host agent plans, dispatches and accepts work under docs/cto_jev/. Written only when
105
- // `cto setup` chose the flow; the body mirrors docs/cto_jev/features/cto-flow/SPEC.md.
105
+ // `cto setup` chose the flow.
106
106
  export const FLOW_SKILL_TEXT = `---
107
107
  name: cto-jev
108
108
  description: The development flow of this repo, kept in docs/cto_jev/. Invoked by saying the job's name (in Claude Code: /cto-jev <job>; in Codex: $cto-jev). Its jobs are named so they cannot be confused with another skill's steps - "cto-jev init" (first-time setup, also "set up PRODUCT.md and ARCHITECTURE.md"), "cto-jev feature" (a request bigger than one edit), "cto-jev tasks" (break an approved spec down), "cto-jev work" (dispatch, accept, review, commit), "cto-jev release" (review everything unreleased, then merge to main), "cto-jev docs" (clean up old documents), "cto-jev decision" (record an architecture decision). Load it when the user names one of them, and whenever you are about to plan, dispatch, tick a task or commit.
@@ -140,15 +140,16 @@ Short bullets or a table per heading. \`## 不做的事\` and \`## 不變的原
140
140
  1. Run \`cto-jev docs\` first when it has not run this session; bring its suggestions to the user before opening a feature.
141
141
  2. Read \`docs/cto_jev/INDEX.md\` and classify:
142
142
  - Inside an existing feature, within its Constraints: add tasks to its TASKS.md (\`cto-jev tasks\`). No new docs.
143
- - Changes a feature's \`## Constraints\` or \`## Interface\`: edit its SPEC.md, set \`Status: draft\`, stop for sign-off.
143
+ - Changes a feature's \`## Constraints\` or \`## Interface\`: edit its SPEC.md, set \`Status: draft\`, run the docs review (step 5), stop for sign-off.
144
144
  - A new module: \`features/<slug>/\` with the four files below.
145
145
  - An existing module with no feature folder yet: create its folder describing what exists today (short CONCEPT, SPEC with the three sections), \`Status: draft\`, before any task on it.
146
146
  - Infrastructure (CI, build, deploy, dependency upgrades): a task under \`features/platform/\`.
147
147
  3. Talk before you write. Restate the request in two sentences and ask until every question below has an answer or an explicit "not relevant". At most five questions per message, each with your best guess; an installed interview skill may run the rounds, the questions below are what must be answered. Do not write CONCEPT.md until the first group is settled, nor SPEC.md until the second.
148
- - For CONCEPT: who uses this and what changes for them; which business rules apply, including what happens on failure, limits, roles and paid tiers; what is explicitly out of scope; which existing features it touches.
149
- - For SPEC: which data and tables change; what other features may call (the Interface) and what stays private; the error cases and what the user sees; the hard rules the code must never break (the Constraints); how each part will be verified.
148
+ - For CONCEPT: who uses this and what changes for them; which business rules apply, including what happens on failure, limits, roles and paid tiers; what is explicitly out of scope; which existing features it touches; which simpler option was considered and why it was rejected (goes under \`## 動機\`).
149
+ - For SPEC: which data and tables change, and whether existing data must migrate and how it rolls back; what other features may call (the Interface) and what stays private; the error cases and what the user sees; how a failure in production gets noticed (migration, rollback and that go under \`## Internals\`); the hard rules the code must never break (the Constraints); how each part will be verified.
150
150
  4. Write CONCEPT.md, then SPEC.md. Constraints are testable rules ("a refund always writes an audit row"), not aspirations. Interface is only what other features may call.
151
- 5. Walk the user through both files section by section and ask what is wrong or missing. Edit, walk through again, until they have nothing to add.
151
+ 5. **Review the docs before the user does.** Dispatch a reviewer with none of your context, which may read and search the code. It reads CONCEPT.md and SPEC.md and answers two questions: could an engineer new to this repo build it from these two files without making a design decision; and does it build something not needed now, or something the code already has. Findings are P1 or P2; handle them as under "Review findings" below, fixing both P1 and P2 in the docs now (the docs are cheap to change). Append one REVIEW.md entry: date, "docs", counts, what was contested or escalated.
152
+ 6. Walk the user through both files section by section, including what the review changed, and ask what is wrong or missing. Edit, walk through again, until they have nothing to add.
152
153
 
153
154
  **Stop:** when the user says the docs are complete; they set \`Status: approved\`. Never write TASKS.md before the SPEC is approved; cto blocks the commit anyway.
154
155
 
@@ -190,16 +191,28 @@ Two more tags, on any task:
190
191
 
191
192
  **When:** the user says "cto-jev work" or "continue", or \`cto brief\` shows Ready tasks.
192
193
 
193
- Branches: work on an integration branch (\`review\`, or whatever the repo calls it; see the table under \`cto-jev release\`). The release branch only receives \`cto-jev release\`. Never commit to it directly; ask the user to add it to \`protected_branches\` in \`.cto.json\` if it is not there.
194
+ Branches: work on an integration branch (\`review\`, or whatever the repo calls it; see the table under \`cto-jev release\`). The release branch only receives \`cto-jev release\`. Never commit to it directly; ask the user to add it to \`protected_branches\` in \`.cto.json\` if it is not there. The one exception is a repo with only \`main\` and one developer (the first row of that table): there you commit each reviewed wave to \`main\`, and \`main\` stays out of \`protected_branches\`, or every commit would be blocked.
194
195
 
195
196
  1. \`cto brief\`. Dispatch only Ready tasks; the "run together" set is safe to run at once. P1 tasks go first.
196
197
  2. One sub-agent per task. Give it only: the task line, the feature's SPEC.md, the \`## Interface\` of each feature it depends on, the list of files it may touch, and "do not edit anything else, write nothing outside this repo (no notes, no lesson logs), no git commands; report what you changed and what you found ambiguous". Each sub-agent writes its own new test file; nobody appends to a shared one.
197
198
  3. When they return: \`git status\`; revert anything outside the union of their \`(files:)\`. Integrate the shared files yourself. Fix any existing test their change broke. A sub-agent's "the SPEC does not say" goes into the SPEC now, not into the code's comments.
198
199
  4. Accept by running the task's acceptance command yourself; never trust the report. Tick only on a pass. \`manual\` waits for the user to confirm in the conversation; say "accepted manually" when you tick it. Tick the parent when its last child is ticked.
199
- 5. **Review before you commit.** Dispatch a reviewer with none of your context: it reads the feature's CONCEPT.md and SPEC.md and the uncommitted diff, and returns findings each marked P1 (wrong, unsafe, breaks a Constraint or the Interface) or P2 (should improve, can wait). Fix every P1 now and re-run acceptance. Write every P2 as a \`(P2)\` task in TASKS.md. Append one entry to REVIEW.md: date, scope (the task ids of the wave), how many P1/P2, which task ids they became.
200
+ 5. **Review before you commit.** Dispatch a reviewer with none of your context: it reads the feature's CONCEPT.md and SPEC.md and the uncommitted diff, and returns findings each marked P1 (wrong, unsafe, breaks a Constraint or the Interface) or P2 (should improve, can wait). Handle them as under "Review findings": fix every P1 now and re-run acceptance; write every P2 as a \`(P2)\` task in TASKS.md. Append one entry to REVIEW.md: date, scope (the task ids of the wave), how many P1/P2, which task ids they became, what was contested or escalated.
200
201
  6. \`cto check\`, then commit the wave to the review branch.
201
202
 
202
- Without sub-agents: do the Ready tasks yourself in brief's order, one at a time, accepting each before the next; review your own diff with fresh eyes against the SPEC before each commit.
203
+ Without sub-agents: do the Ready tasks yourself in brief's order, one at a time, accepting each before the next; review your own diff against the SPEC before each commit. That is not a review by a fresh reader: write \`self-review\` in its REVIEW.md entry, so the release review looks harder at those waves.
204
+
205
+ ## Review findings
206
+
207
+ Every review (docs, wave, release) ends here. You wrote what was reviewed, so wanting to disagree is not evidence.
208
+
209
+ - **Contest** a finding only by citing something the reviewer could read: a file and symbol, or a decision written in the docs. "It was intentional" is not evidence.
210
+ - **Escalate** to the user when the evidence is outside anything the reviewer could read (a verbal decision, a team convention). Do not dismiss it yourself; if the user confirms, write the fact into the docs.
211
+ - A reviewer who could not follow the docs found missing context. Never contest that.
212
+ - Never change a severity yourself. A P1 that looks like a P2 is contested like any finding, with evidence, and the user decides.
213
+ - An escalated finding, or a contest the user has not decided, stops the job there: do not commit, tick or ask for sign-off over it.
214
+ - After fixing P1s, one more reviewer with none of your context reads only the fixes, once. A P1 it finds is fixed now without a further review; anything else becomes a task with its severity (in a docs review, where no tasks may exist yet: fixed in the docs or raised in the walk-through). Do not loop.
215
+ - Without sub-agents every review here, the re-review included, is your own: say \`self-review\` in its REVIEW.md entry.
203
216
 
204
217
  ## cto-jev release
205
218
 
@@ -214,12 +227,12 @@ First decide what "release" means in this repo. Look at \`git branch -a\` and th
214
227
  | \`main\` + an integration branch (\`review\`, \`develop\`, \`staging\`) | the integration branch | merging it into \`main\` (what deploys to production) | \`git diff main...<integration>\` |
215
228
  | \`staging\` and \`live\` (or \`production\`) deploy branches | \`staging\` | promoting \`staging\` to \`live\` | \`git diff live...staging\`; a second, lighter release review |
216
229
 
217
- Whatever the row, one rule holds: the branch that reaches users receives nothing without a release review, and \`protected_branches\` in \`.cto.json\` names it.
230
+ Whatever the row, one rule holds: the branch that reaches users receives nothing without a release review, and \`protected_branches\` in \`.cto.json\` names it. In the \`main\`-only row the wave review before each commit is that review, and \`main\` is not protected.
218
231
 
219
232
  1. Everything to be released is on the work branch and every P1 task is ticked. If not, stop and list what is open.
220
- 2. Dispatch a reviewer with none of your context over the whole unreleased diff (the review scope above) plus the SPECs of every feature it touches. Findings get P1, P2 or P3 like a wave review, written into TASKS.md.
221
- 3. P1 findings are fixed (through \`cto-jev work\`) before anything else; P2 and P3 stay as tasks for after the release. Tell the user both lists and let them decide which P2 should move up.
222
- 4. \`cto check --base <release branch>\` must pass. Then prepare the merge, PR or tag; the user performs it. Append one REVIEW.md entry per feature released: date, "release", counts, task ids.
233
+ 2. Dispatch a reviewer with none of your context over the whole unreleased diff (the review scope above) plus the SPECs of every feature it touches; point it at the waves marked \`self-review\` in REVIEW.md. Findings get P1, P2 or P3, handled as under "Review findings", written into TASKS.md.
234
+ 3. P1 findings are fixed (through \`cto-jev work\`, whose wave review counts as the re-review) before anything else; P2 and P3 stay as tasks for after the release. Tell the user both lists and let them decide which P2 should move up.
235
+ 4. \`cto check --base <release branch>\` must pass. Then prepare the merge, PR or tag; the user performs it. Append one REVIEW.md entry per feature released: date, "release", counts, task ids, what was contested or escalated.
223
236
 
224
237
  **Stop:** before the merge, with the P1/P2/P3 lists in front of the user.
225
238
 
@@ -258,7 +271,7 @@ docs/cto_jev/
258
271
  CONCEPT.md why: 目的, 動機, 商業規則, 不做的事
259
272
  SPEC.md how: Interface, Constraints, Internals
260
273
  TASKS.md the only state; review findings carry (P1)/(P2)
261
- REVIEW.md one entry per wave review and per release
274
+ REVIEW.md one entry per docs review, wave review and release
262
275
  archive/<YYYYMM>-<name>/ cto-jev docs moves old documents here; nobody reads them
263
276
  \`\`\`
264
277
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "your-cto-jev",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "A sharp-tongued CTO gatekeeper for AI coding agents: blocks leaked secrets in git commits and destructive shell commands in Claude Code, Cursor, Gemini CLI and Codex, using TypeSafe Jev.",
5
5
  "keywords": [
6
6
  "claude-code",