your-cto-jev 0.9.1 → 0.9.2

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
@@ -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-flow skill); --no-flow removes the skill and rule
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 a skill (`.agents/skills/cto-flow/SKILL.md`), a fixed place for plans, and a few more checks:
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,7 +246,7 @@ 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 and it does that job:
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
  |---|---|
@@ -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-flow skill 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.
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-flow skill 和 docs/cto_jev/ 骨架',
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-flow skill and a docs/cto_jev/ skeleton',
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
- const flowSkill = syncFlowSkill(root, flow);
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-flow/SKILL.md';
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-flow
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-flow
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
 
@@ -324,25 +338,35 @@ export function syncGuidance(root, chosen, removeOthers, flow = false, dry = fal
324
338
  }
325
339
  return { written, removed };
326
340
  }
327
- /** Write or refresh the cto-flow skill when the flow is enabled; remove it (only if cto-marked) when not. */
328
- export function syncFlowSkill(root, enabled, dry = false) {
341
+ /**
342
+ * Write or refresh the cto-jev skill when the flow is enabled, plus the `/cto-jev` command when Claude Code is one of the
343
+ * agents; remove each (only if cto-marked) when not. The 0.9.x `cto-flow` skill is always removed.
344
+ */
345
+ export function syncFlowSkill(root, enabled, dry = false, claude = false) {
329
346
  const written = [];
330
347
  const removed = [];
331
- const skill = join(root, FLOW_SKILL_PATH);
332
- if (enabled) {
333
- if (!existsSync(skill) || readFileSync(skill, 'utf8') !== FLOW_SKILL_TEXT) {
348
+ const sync = (rel, text, want) => {
349
+ const path = join(root, rel);
350
+ const current = existsSync(path) ? readFileSync(path, 'utf8') : undefined;
351
+ if (want) {
352
+ // A file of the same name without the marker is the user's own (e.g. their own /cto-jev command): never overwrite it.
353
+ if (current === text || (current !== undefined && !current.includes(SKILL_MARK)))
354
+ return;
334
355
  if (!dry) {
335
- mkdirSync(dirname(skill), { recursive: true });
336
- writeFileSync(skill, FLOW_SKILL_TEXT);
356
+ mkdirSync(dirname(path), { recursive: true });
357
+ writeFileSync(path, text);
337
358
  }
338
- written.push(FLOW_SKILL_PATH);
359
+ written.push(rel);
339
360
  }
340
- }
341
- else if (existsSync(skill) && readFileSync(skill, 'utf8').includes(SKILL_MARK)) {
342
- if (!dry)
343
- removeFileAndEmptyDirs(root, skill);
344
- removed.push(FLOW_SKILL_PATH);
345
- }
361
+ else if (current?.includes(SKILL_MARK)) {
362
+ if (!dry)
363
+ removeFileAndEmptyDirs(root, path);
364
+ removed.push(rel);
365
+ }
366
+ };
367
+ sync(FLOW_SKILL_PATH, FLOW_SKILL_TEXT, enabled);
368
+ sync(FLOW_COMMAND_PATH, FLOW_COMMAND_TEXT, enabled && claude);
369
+ sync(LEGACY_FLOW_SKILL, '', false);
346
370
  return { written, removed };
347
371
  }
348
372
  /** 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.1",
3
+ "version": "0.9.2",
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",