your-cto-jev 0.9.1 → 0.9.3
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 +7 -7
- package/dist/i18n.js +2 -2
- package/dist/setup.js +6 -4
- package/dist/skill.js +68 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,7 +130,7 @@ Other forms:
|
|
|
130
130
|
cto setup --agents claude,cursor --yes # non-interactive (scripts, CI); only adds, never removes
|
|
131
131
|
cto setup --refresh # re-write hooks and rules for the agents already set up
|
|
132
132
|
cto setup --uninstall # remove every cto hook, rules block and skill again
|
|
133
|
-
cto setup --flow # turn on the development flow (docs/cto_jev, cto-
|
|
133
|
+
cto setup --flow # turn on the development flow (docs/cto_jev, cto-jev skill, /cto-jev); --no-flow removes the skill and rule
|
|
134
134
|
cto doctor # is it actually working?
|
|
135
135
|
cto brief # what an agent should know before it starts here
|
|
136
136
|
cto check # preview the commit checks on your current changes
|
|
@@ -207,7 +207,7 @@ The lessons are collected without anyone writing them down. Every failed agent c
|
|
|
207
207
|
|
|
208
208
|
Everything above says no after the fact. The flow is the part before: your agent acts as the CTO of the repo (plans, breaks work down, dispatches, accepts), and `cto` keeps it honest. It is off by default; `cto setup --flow` (or the question at the end of interactive setup) turns it on, and repos that never enable it see no change.
|
|
209
209
|
|
|
210
|
-
The agent does not get a new tool. It gets
|
|
210
|
+
The agent does not get a new tool. It gets one skill, `cto-jev` (`.agents/skills/cto-jev/SKILL.md`; in Claude Code also the `/cto-jev` command), a fixed place for plans, and a few more checks:
|
|
211
211
|
|
|
212
212
|
```text
|
|
213
213
|
docs/cto_jev/
|
|
@@ -246,15 +246,15 @@ Blocked · 1
|
|
|
246
246
|
CUST-1.3 Shared types waiting on PERM-9 (missing), CUST-1.2
|
|
247
247
|
```
|
|
248
248
|
|
|
249
|
-
The skill gives the agent seven named jobs, so they cannot be confused with another skill's steps; say the name
|
|
249
|
+
The skill gives the agent seven named jobs, so they cannot be confused with another skill's steps. In Claude Code type `/cto-jev <job>` (for example `/cto-jev init`); bare `/cto-jev` runs `cto brief` and names the job to run next. In other agents say the name, for example "cto-jev init" (Codex also takes `$cto-jev`):
|
|
250
250
|
|
|
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
|
|
|
@@ -356,7 +356,7 @@ Nothing else is uploaded, and nothing is logged unless you set `CTO_DEBUG=1`. Th
|
|
|
356
356
|
Defaults: `credential_leak` 0.5, `destructive_command` 0.7, `infinite_loop` 0.6, `test_tampering` 0.8, `done_unverified` 0.6, `architecture_violation` 0.85, `architecture_undocumented` 0.85, `code_complexity` 2.
|
|
357
357
|
|
|
358
358
|
- **`sprint_goal`**: fill it in to enable the architecture check, for example `"Ship Stripe billing, no new services"`. Under the development flow a commit that falls inside a feature's code scope is judged against that feature's SPEC instead; the goal is the fallback.
|
|
359
|
-
- **`flow`**: `true` turns on the [development flow](#the-development-flow-optional). `cto setup --flow` / `--no-flow` set it; `cto setup --refresh` follows the saved value. `--no-flow` removes the cto-
|
|
359
|
+
- **`flow`**: `true` turns on the [development flow](#the-development-flow-optional). `cto setup --flow` / `--no-flow` set it; `cto setup --refresh` follows the saved value. `--no-flow` removes the cto-jev skill, `/cto-jev` and its rule but keeps `docs/cto_jev/`; while `docs/cto_jev/features/` exists, the sign-off, index and drift checks keep running. Delete or archive that folder to stop them.
|
|
360
360
|
- **`test_command`**: what `cto brief` tells the agent to verify with, for example `"pnpm test"`. Detected from the project when empty.
|
|
361
361
|
- **`protected_branches`**: for example `["main", "release"]`. Commits on them and pushes that delete or rewrite them are blocked locally, no key needed. Empty by default.
|
|
362
362
|
- **Thresholds**: Jev returns a probability from 0 to 1. `code_complexity` is the exception: it is a score from 0 (clean) to 4 (unmaintainable).
|
package/dist/i18n.js
CHANGED
|
@@ -131,7 +131,7 @@ const messages = {
|
|
|
131
131
|
ui_goal_q: () => 'Sprint goal(選填,填了才會檢查 commit 是否偏離目標)',
|
|
132
132
|
ui_goal_ph: () => '例如:完成 Stripe 金流,不新增服務',
|
|
133
133
|
ui_flow_q: () => '要用 cto 開發流程嗎?你的 agent 當 CTO:在 docs/cto_jev/ 規劃、派工、驗收;cto 檢查簽核和漂移。',
|
|
134
|
-
ui_flow_yes: () => '要,寫入 cto-
|
|
134
|
+
ui_flow_yes: () => '要,寫入 cto-jev skill(/cto-jev)和 docs/cto_jev/ 骨架',
|
|
135
135
|
ui_flow_no: () => '不用,只守關卡',
|
|
136
136
|
ui_on: () => '啟用',
|
|
137
137
|
ui_off: () => '未啟用',
|
|
@@ -319,7 +319,7 @@ const messages = {
|
|
|
319
319
|
ui_goal_q: () => 'Sprint goal (optional; enables the check for commits that drift from it)',
|
|
320
320
|
ui_goal_ph: () => 'e.g. Ship Stripe billing, no new services',
|
|
321
321
|
ui_flow_q: () => 'Use the cto development flow? Your agent acts as CTO: plans in docs/cto_jev/, dispatches, accepts; cto checks sign-off and drift.',
|
|
322
|
-
ui_flow_yes: () => 'Yes, write the cto-
|
|
322
|
+
ui_flow_yes: () => 'Yes, write the cto-jev skill (/cto-jev) and a docs/cto_jev/ skeleton',
|
|
323
323
|
ui_flow_no: () => 'No, gatekeeping only',
|
|
324
324
|
ui_on: () => 'on',
|
|
325
325
|
ui_off: () => 'off',
|
package/dist/setup.js
CHANGED
|
@@ -5,7 +5,7 @@ import { basename, dirname, join, relative } from 'node:path';
|
|
|
5
5
|
import { PHASES, agentNames, agents, hookCommand } from './agents.js';
|
|
6
6
|
import { t } from './i18n.js';
|
|
7
7
|
import { loadConfig } from './brain.js';
|
|
8
|
-
import { FLOW_SKILL_PATH, guidancePaths, syncFlowSkill, syncGuidance } from './skill.js';
|
|
8
|
+
import { FLOW_COMMAND_PATH, FLOW_SKILL_PATH, guidancePaths, syncFlowSkill, syncGuidance } from './skill.js';
|
|
9
9
|
import { findConflicts } from './conflicts.js';
|
|
10
10
|
import { FLOW_DIR } from './flow.js';
|
|
11
11
|
const START = '# >>> YOUR CTO JEV START >>>';
|
|
@@ -179,7 +179,7 @@ export function planSetup(root, chosenAgents, flow, goal) {
|
|
|
179
179
|
at(p, 'remove');
|
|
180
180
|
}
|
|
181
181
|
const g = syncGuidance(root, chosen, true, flow, true);
|
|
182
|
-
const f = syncFlowSkill(root, flow, true);
|
|
182
|
+
const f = syncFlowSkill(root, flow, true, chosen.has('claude'));
|
|
183
183
|
for (const p of [...g.written, ...f.written])
|
|
184
184
|
at(p, 'write');
|
|
185
185
|
for (const p of [...g.removed, ...f.removed])
|
|
@@ -299,10 +299,12 @@ export function setup(cwd, lang, opts = {}) {
|
|
|
299
299
|
const savedFlow = loadConfig(root).flow;
|
|
300
300
|
const flow = opts.flow ?? savedFlow;
|
|
301
301
|
const skills = syncGuidance(root, chosen, !!opts.exact, flow);
|
|
302
|
-
|
|
302
|
+
// Not exact: an agent left unpicked keeps its cto wiring, so Claude Code keeps /cto-jev too.
|
|
303
|
+
const claude = chosen.has('claude') || (!opts.exact && wiredAgents(root).includes('claude'));
|
|
304
|
+
const flowSkill = syncFlowSkill(root, flow, false, claude);
|
|
303
305
|
for (const p of [...skills.written, ...flowSkill.written])
|
|
304
306
|
lines.push(t(lang, 'setup_skill', { path: p }));
|
|
305
|
-
const hidden = ignoredByGit(root, [...guidancePaths(chosen), ...(flow ? [FLOW_SKILL_PATH] : [])]);
|
|
307
|
+
const hidden = ignoredByGit(root, [...guidancePaths(chosen), ...(flow ? [FLOW_SKILL_PATH] : []), ...(flow && claude ? [FLOW_COMMAND_PATH] : [])]);
|
|
306
308
|
// Advise git add -f: a .gitignore negation cannot re-include a file whose parent folder is excluded (git rule).
|
|
307
309
|
if (hidden.length)
|
|
308
310
|
lines.push(t(lang, 'setup_ignored', { list: hidden.join(', '), cmd: `git add -f ${hidden.join(' ')}` }));
|
package/dist/skill.js
CHANGED
|
@@ -17,7 +17,21 @@ export const MEMORY_FILES = [
|
|
|
17
17
|
{ path: 'AGENTS.md', agents: ['codex', 'cursor'] },
|
|
18
18
|
{ path: 'GEMINI.md', agents: ['gemini'] },
|
|
19
19
|
];
|
|
20
|
-
export const FLOW_SKILL_PATH = '.agents/skills/cto-
|
|
20
|
+
export const FLOW_SKILL_PATH = '.agents/skills/cto-jev/SKILL.md';
|
|
21
|
+
const LEGACY_FLOW_SKILL = '.agents/skills/cto-flow/SKILL.md'; // 0.9.x name, removed on sync
|
|
22
|
+
// Claude Code reads neither .agents/skills nor (safely) .claude/skills, since Cursor scans .claude/skills too and would
|
|
23
|
+
// list the skill twice. A slash command is Claude-only and only points at the one skill file, so `/cto-jev init` works.
|
|
24
|
+
export const FLOW_COMMAND_PATH = '.claude/commands/cto-jev.md';
|
|
25
|
+
export const FLOW_COMMAND_TEXT = `---
|
|
26
|
+
description: The cto development flow - init, feature, tasks, work, release, docs, decision
|
|
27
|
+
argument-hint: "[init | feature <request> | tasks | work | release | docs | decision]"
|
|
28
|
+
---
|
|
29
|
+
${SKILL_MARK}
|
|
30
|
+
|
|
31
|
+
Read \`${FLOW_SKILL_PATH}\` in full, then do the job named here: $ARGUMENTS
|
|
32
|
+
|
|
33
|
+
No job named: run \`cto brief\`, say in two lines where this repo stands in the flow, and name the one job to run next.
|
|
34
|
+
`;
|
|
21
35
|
/** The one extra rule when `cto setup` chose the development flow: the plan lives in docs/cto_jev/. */
|
|
22
36
|
export const FLOW_RULE = `- **Work is planned in \`docs/cto_jev/\`.** Before planning, breaking down, dispatching or accepting work, read \`${FLOW_SKILL_PATH}\`; \`cto brief\` lists what is ready.`;
|
|
23
37
|
export const rulesBlock = (flow) => `${MD_START}
|
|
@@ -90,16 +104,16 @@ turns it into a calibration case; you do not run that yourself.
|
|
|
90
104
|
// The flow skill: how the host agent plans, dispatches and accepts work under docs/cto_jev/. Written only when
|
|
91
105
|
// `cto setup` chose the flow; the body mirrors docs/cto_jev/features/cto-flow/SPEC.md.
|
|
92
106
|
export const FLOW_SKILL_TEXT = `---
|
|
93
|
-
name: cto-
|
|
94
|
-
description: The development flow of this repo, kept in docs/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.
|
|
107
|
+
name: cto-jev
|
|
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.
|
|
95
109
|
---
|
|
96
110
|
${SKILL_MARK}
|
|
97
111
|
|
|
98
|
-
# cto-
|
|
112
|
+
# cto-jev
|
|
99
113
|
|
|
100
114
|
You are the CTO of this repo. You plan, break down, dispatch, accept and review; sub-agents write the code. The plan lives in \`docs/cto_jev/\`; the only state is the checkboxes in TASKS.md. cto checks what you claim: a tick without a passing check is sent back, a commit on a feature without sign-off is blocked.
|
|
101
115
|
|
|
102
|
-
Seven jobs, each named \`cto-jev <job>\`. When the user says the name, do that job and nothing else. Each says when it applies, the steps, and where you stop.
|
|
116
|
+
Seven jobs, each named \`cto-jev <job>\`. When the user says the name (or types \`/cto-jev <job>\`), do that job and nothing else. Each says when it applies, the steps, and where you stop. Invoked with no job: run \`cto brief\`, say in two lines where the repo stands, and name the one job to run next.
|
|
103
117
|
|
|
104
118
|
## cto-jev init
|
|
105
119
|
|
|
@@ -126,15 +140,16 @@ Short bullets or a table per heading. \`## 不做的事\` and \`## 不變的原
|
|
|
126
140
|
1. Run \`cto-jev docs\` first when it has not run this session; bring its suggestions to the user before opening a feature.
|
|
127
141
|
2. Read \`docs/cto_jev/INDEX.md\` and classify:
|
|
128
142
|
- Inside an existing feature, within its Constraints: add tasks to its TASKS.md (\`cto-jev tasks\`). No new docs.
|
|
129
|
-
- 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.
|
|
130
144
|
- A new module: \`features/<slug>/\` with the four files below.
|
|
131
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.
|
|
132
146
|
- Infrastructure (CI, build, deploy, dependency upgrades): a task under \`features/platform/\`.
|
|
133
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.
|
|
134
|
-
- 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.
|
|
135
|
-
- 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.
|
|
136
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.
|
|
137
|
-
5.
|
|
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.
|
|
138
153
|
|
|
139
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.
|
|
140
155
|
|
|
@@ -176,16 +191,28 @@ Two more tags, on any task:
|
|
|
176
191
|
|
|
177
192
|
**When:** the user says "cto-jev work" or "continue", or \`cto brief\` shows Ready tasks.
|
|
178
193
|
|
|
179
|
-
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.
|
|
180
195
|
|
|
181
196
|
1. \`cto brief\`. Dispatch only Ready tasks; the "run together" set is safe to run at once. P1 tasks go first.
|
|
182
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.
|
|
183
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.
|
|
184
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.
|
|
185
|
-
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).
|
|
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.
|
|
186
201
|
6. \`cto check\`, then commit the wave to the review branch.
|
|
187
202
|
|
|
188
|
-
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
|
|
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.
|
|
189
216
|
|
|
190
217
|
## cto-jev release
|
|
191
218
|
|
|
@@ -200,12 +227,12 @@ First decide what "release" means in this repo. Look at \`git branch -a\` and th
|
|
|
200
227
|
| \`main\` + an integration branch (\`review\`, \`develop\`, \`staging\`) | the integration branch | merging it into \`main\` (what deploys to production) | \`git diff main...<integration>\` |
|
|
201
228
|
| \`staging\` and \`live\` (or \`production\`) deploy branches | \`staging\` | promoting \`staging\` to \`live\` | \`git diff live...staging\`; a second, lighter release review |
|
|
202
229
|
|
|
203
|
-
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.
|
|
204
231
|
|
|
205
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.
|
|
206
|
-
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
|
|
207
|
-
3. P1 findings are fixed (through \`cto-jev work
|
|
208
|
-
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.
|
|
209
236
|
|
|
210
237
|
**Stop:** before the merge, with the P1/P2/P3 lists in front of the user.
|
|
211
238
|
|
|
@@ -244,7 +271,7 @@ docs/cto_jev/
|
|
|
244
271
|
CONCEPT.md why: 目的, 動機, 商業規則, 不做的事
|
|
245
272
|
SPEC.md how: Interface, Constraints, Internals
|
|
246
273
|
TASKS.md the only state; review findings carry (P1)/(P2)
|
|
247
|
-
REVIEW.md one entry per wave review and
|
|
274
|
+
REVIEW.md one entry per docs review, wave review and release
|
|
248
275
|
archive/<YYYYMM>-<name>/ cto-jev docs moves old documents here; nobody reads them
|
|
249
276
|
\`\`\`
|
|
250
277
|
|
|
@@ -324,25 +351,35 @@ export function syncGuidance(root, chosen, removeOthers, flow = false, dry = fal
|
|
|
324
351
|
}
|
|
325
352
|
return { written, removed };
|
|
326
353
|
}
|
|
327
|
-
/**
|
|
328
|
-
|
|
354
|
+
/**
|
|
355
|
+
* Write or refresh the cto-jev skill when the flow is enabled, plus the `/cto-jev` command when Claude Code is one of the
|
|
356
|
+
* agents; remove each (only if cto-marked) when not. The 0.9.x `cto-flow` skill is always removed.
|
|
357
|
+
*/
|
|
358
|
+
export function syncFlowSkill(root, enabled, dry = false, claude = false) {
|
|
329
359
|
const written = [];
|
|
330
360
|
const removed = [];
|
|
331
|
-
const
|
|
332
|
-
|
|
333
|
-
|
|
361
|
+
const sync = (rel, text, want) => {
|
|
362
|
+
const path = join(root, rel);
|
|
363
|
+
const current = existsSync(path) ? readFileSync(path, 'utf8') : undefined;
|
|
364
|
+
if (want) {
|
|
365
|
+
// A file of the same name without the marker is the user's own (e.g. their own /cto-jev command): never overwrite it.
|
|
366
|
+
if (current === text || (current !== undefined && !current.includes(SKILL_MARK)))
|
|
367
|
+
return;
|
|
334
368
|
if (!dry) {
|
|
335
|
-
mkdirSync(dirname(
|
|
336
|
-
writeFileSync(
|
|
369
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
370
|
+
writeFileSync(path, text);
|
|
337
371
|
}
|
|
338
|
-
written.push(
|
|
372
|
+
written.push(rel);
|
|
339
373
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
374
|
+
else if (current?.includes(SKILL_MARK)) {
|
|
375
|
+
if (!dry)
|
|
376
|
+
removeFileAndEmptyDirs(root, path);
|
|
377
|
+
removed.push(rel);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
sync(FLOW_SKILL_PATH, FLOW_SKILL_TEXT, enabled);
|
|
381
|
+
sync(FLOW_COMMAND_PATH, FLOW_COMMAND_TEXT, enabled && claude);
|
|
382
|
+
sync(LEGACY_FLOW_SKILL, '', false);
|
|
346
383
|
return { written, removed };
|
|
347
384
|
}
|
|
348
385
|
/** The guidance files the given agents use (what should be committed for them). */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "your-cto-jev",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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",
|