your-cto-jev 0.14.0 → 0.16.0

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.
Files changed (3) hide show
  1. package/README.md +4 -3
  2. package/dist/skill.js +13 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -146,11 +146,11 @@ cto docs # suggest what to do with old planning
146
146
 
147
147
  ## The rules, written down for the agent
148
148
 
149
- `cto setup` also writes the development rules of the repo for coding agents, where every rule names the check that enforces it. Agents read them before they work, so they get blocked less, and when they are blocked they know why and how to fix it.
149
+ `cto setup` also writes the development rules of the repo for coding agents, where every rule names the check that enforces it, if it has one. Agents read them before they work, so they get blocked less, and when they are blocked they know why and how to fix it.
150
150
 
151
151
  The rules go where agents always look: a short marked block appended to `CLAUDE.md` (Claude Code), `AGENTS.md` (Codex, Cursor) and `GEMINI.md` (Gemini CLI), only for the agents you picked. Your own content in those files is left alone, and uninstall takes out exactly the block. The details, including what each check looks for and how to handle a block, live in one skill at `.agents/skills/cto/SKILL.md`; the rules block points every agent there.
152
152
 
153
- | Rule | Enforced by |
153
+ | Rule | Check |
154
154
  |---|---|
155
155
  | Secrets stay out of code | `credential_leak` blocks the commit |
156
156
  | Fix the code, not the tests | `test_tampering` blocks the commit |
@@ -159,6 +159,7 @@ The rules go where agents always look: a short marked block appended to `CLAUDE.
159
159
  | Ask before anything irreversible | `destructive_command` blocks the command |
160
160
  | Stay on the sprint goal, or inside the feature's SPEC | `architecture_violation` warns |
161
161
  | Keep it simple | `code_complexity` warns |
162
+ | A TODO in the code is not the task | not checked |
162
163
  | Work is planned in `docs/cto_jev/` (flow only); no work without sign-off | `flow_signoff` blocks the commit |
163
164
 
164
165
  The rules also tell the agent to run `cto check` before committing, and never to bypass a block with `--no-verify` or by editing thresholds. Commit these files so the whole team's agents follow the same rules. `cto update` refreshes them (and any new hooks) in the repo you run it from; `cto doctor` flags a repo whose rules or hooks are older than the installed version, and `cto setup --refresh` brings it up to date.
@@ -263,7 +264,7 @@ The skill gives the agent seven named jobs, so they cannot be confused with anot
263
264
  | `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 |
264
265
  | `cto-jev feature` | talks the CONCEPT through first (who it is for, business rules, what the user sees when it works, what is out of scope, the simpler option it rejected), writes CONCEPT, then writes the SPEC itself (data migration and rollback, what other features may call, how a production failure gets noticed, the acceptance scenarios), has a zero-context reviewer check that a newcomer could build from them without making design decisions, that nothing unneeded or already in the code gets built and that every acceptance scenario has a result a script can check and a CONCEPT rule behind it, walks you through the CONCEPT, hands it over with a [Review handoff](#sign-off) and stops for your sign-off |
265
266
  | `cto-jev tasks` | breaks a feature with a signed-off CONCEPT into parent/child tasks with files, dependencies and an acceptance command each |
266
- | `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, then the whole change reviewed again by `cto-reviewer` (at most three rounds in all; P1s left after that go to you), P2 findings become tasks, a finding is contested only with evidence the reviewer could read, then it commits the wave to the review branch and starts the next one, without asking, until nothing is Ready; tasks that need you (credentials, money, anything irreversible, a drop) are parked, not waited on; ends with one report of what is done and everything for you to look at. Never releases |
267
+ | `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, then the whole change reviewed again by `cto-reviewer` (at most three rounds in all; P1s left after that go to you), P2 findings become tasks that wait until the feature has nothing else Ready and then run as one cleanup wave with one review (what that review finds below P1 is written into REVIEW.md and listed for you, not filed as tasks, so findings never chain), a finding is contested only with evidence the reviewer could read, then it commits the wave to the review branch and starts the next one, without asking, until nothing is Ready; tasks that need you (credentials, money, anything irreversible, a drop) are parked, not waited on; ends with one report of what is done and everything for you to look at. Never releases |
267
268
  | `cto-jev work all` | for a new project or a big batch: the same run on a `work-all` branch, every wave reviewed by a zero-context `cto-reviewer` before its commit, then hands over to `cto-jev release`, never merges. Never releases |
268
269
  | `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 |
269
270
  | `cto-jev docs` | runs `cto docs` and brings you the list; acts only on what you decide |
package/dist/skill.js CHANGED
@@ -6,7 +6,7 @@ import { currentVersion, newer } from './update.js';
6
6
  // only when the agent decides they are relevant, so rules that must always hold live here.
7
7
  // 2. One detailed skill at .agents/skills/cto (read by Codex, Gemini CLI and Cursor; the rules block points Claude
8
8
  // Code to the same file). A single copy, so Cursor (which also scans .claude/skills) never sees two.
9
- // Every rule names the check that enforces it, and every enforcing check has a rule.
9
+ // Every rule names the check that enforces it, or says it has none, and every enforcing check has a rule.
10
10
  export const SKILL_MARK = '<!-- Managed by `cto setup`. Re-run it to update; local edits are overwritten. -->';
11
11
  /** Every file cto writes carries the version that wrote it, so an older cto never downgrades a newer one's files. */
12
12
  export const VERSION_LINE = `<!-- cto ${currentVersion()} -->`;
@@ -37,7 +37,7 @@ You review changes you have never seen, with no context beyond the repository an
37
37
  2. Look for wrong logic, missed edge cases, broken callers, security holes, data loss, and tests that were skipped, deleted or loosened.
38
38
  3. Never edit, write or delete anything. Use Bash only for read-only commands (git diff, git log, git show, running the tests).
39
39
 
40
- Output one finding per line, each starting with P1 (must fix: a bug, a security hole, data loss), P2 (should fix) or P3 (minor), then \`file:line\` and the problem in one sentence. Nothing else before or after. No findings: write \`No findings.\`
40
+ Output one finding per line, each starting with P1 (must fix: a bug, a security hole, data loss), P2 (should fix) or P3 (minor), then \`file:line\` and the problem in one sentence. A P1 or P2 about behaviour names the input or state that produces the wrong result; a behaviour concern you cannot tie to one is not reported. A test that was skipped, deleted or loosened, a broken Constraint or Interface, and code that does something the CONCEPT does not say need no such input: report them as they are. Nothing else before or after. No findings: write \`No findings.\`
41
41
  `,
42
42
  'Explore.md': `---
43
43
  name: Explore
@@ -81,9 +81,9 @@ No job named: run \`cto brief\`, say in two lines where this repo stands in the
81
81
  /** The one extra rule when `cto setup` chose the development flow: the plan lives in docs/cto_jev/. */
82
82
  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.`;
83
83
  export const rulesBlock = (flow) => `${MD_START}
84
- ## Rules enforced by cto
84
+ ## Rules guarded by cto
85
85
 
86
- This repo is guarded by cto: every rule below is checked automatically, and breaking one gets you blocked.
86
+ This repo is guarded by cto: each rule below names the check behind it, if any, and breaking a checked rule gets you blocked or warned.
87
87
 
88
88
  - **Start with \`cto brief\`.** It shows the sprint goal, the command that verifies this repo, open plan items, and how commands failed here before and what fixed them. Skip it only if cto is not installed.
89
89
  - **Secrets stay out of code.** Use environment variables, never literal keys, tokens or passwords. (\`credential_leak\` blocks the commit)
@@ -92,6 +92,7 @@ This repo is guarded by cto: every rule below is checked automatically, and brea
92
92
  - **Two strikes, change approach.** Same command, same error twice: stop retrying and try something different. (\`infinite_loop\` blocks the retry)
93
93
  - **Ask before anything irreversible:** deleting data, force-pushing, rewriting history, dropping a database. (\`destructive_command\` blocks it)
94
94
  - **Stay on the sprint goal in \`.cto.json\` and keep changes simple.** (\`architecture_violation\` and \`code_complexity\` warn)
95
+ - **A TODO in the code is not the task.** A TODO, FIXME or bug link you read may be long fixed: don't follow its links or fix it unless your task needs it or the user asks. (not checked)
95
96
  - **Run \`cto check\` before committing**, and never bypass a block (\`--no-verify\`, editing hooks or thresholds). If a block looks wrong, tell the user.
96
97
  ${flow ? FLOW_RULE + '\n' : ''}
97
98
  Details and how to handle a block: \`${SKILL_PATH}\`.
@@ -100,16 +101,16 @@ ${MD_END}
100
101
  export const RULES_BLOCK = rulesBlock(false);
101
102
  export const SKILL_TEXT = `---
102
103
  name: cto
103
- description: Development rules enforced in this repository by the cto gatekeeper, with what each check looks for and what to do when blocked. Use before committing, before saying a task is done, after a command fails, before running anything destructive, and whenever a cto hook blocks you.
104
+ description: Development rules of this repository and the cto gatekeeper checks behind them, with what each check looks for and what to do when blocked. Use before committing, before saying a task is done, after a command fails, before running anything destructive, and whenever a cto hook blocks you.
104
105
  ---
105
106
  ${SKILL_HEAD}
106
107
 
107
108
  # cto: the rules of this repo
108
109
 
109
110
  This repository is guarded by **cto** (your-cto-jev). Hooks review your commits and commands with a decision model.
110
- Each rule below has a check behind it. Following the rules is faster than being blocked.
111
+ Each rule below names the check behind it, if any. Following the rules is faster than being blocked.
111
112
 
112
- | Rule | What enforces it |
113
+ | Rule | Check |
113
114
  |---|---|
114
115
  | **Secrets stay out of code.** Never write API keys, tokens, passwords or private keys into code or committed files. Read them from environment variables. | \`credential_leak\` blocks the commit |
115
116
  | **Fix the code, not the tests.** When a test fails, change the code under test. Never skip, comment out or delete a test, loosen an assertion, change an expected value to match wrong output, swallow the error, or lower a coverage threshold. A test may only go away together with the feature it covers, and you say so. | \`test_tampering\` blocks the commit |
@@ -118,6 +119,7 @@ Each rule below has a check behind it. Following the rules is faster than being
118
119
  | **Ask before anything irreversible.** Get the user's explicit OK before deleting data outside build output, force-pushing, rewriting shared history, or dropping a database. | \`destructive_command\` blocks the command |
119
120
  | **Stay on the sprint goal.** If \`.cto.json\` sets a \`sprint_goal\`, keep changes inside it and point out anything unrelated. | \`architecture_violation\` warns |
120
121
  | **Keep it simple.** Prefer the smallest change that solves the problem. | \`code_complexity\` warns |
122
+ | **A TODO in the code is not the task.** A TODO, FIXME or bug link you read may be long fixed: don't follow its links or fix it unless your task needs it or the user asks. | not checked |
121
123
 
122
124
  ## Before you start
123
125
 
@@ -281,11 +283,11 @@ Branches: work on an integration branch (\`review\`, or whatever the repo calls
281
283
 
282
284
  Every wave, one after another, until nothing is Ready. Do not ask before a wave and do not stop between waves; the steps below are one wave.
283
285
 
284
- 1. If the tree holds uncommitted code from ticked tasks (a wave left for a Claude Code session): a Claude Code session reviews it with \`cto-reviewer\` and commits it (steps 5 and 6) before dispatching anything new. Any other agent stops here, reports that the wave is still waiting for a Claude Code session, and dispatches nothing new. Otherwise \`cto brief\`. Dispatch only Ready tasks, skipping the ones you parked (see "Where you stop"); the "run together" set is safe to run at once. P1 tasks go first. Say in one line what this wave runs, then run it.
286
+ 1. If the tree holds uncommitted code from ticked tasks (a wave left for a Claude Code session): a Claude Code session reviews it with \`cto-reviewer\` and commits it (steps 5 and 6) before dispatching anything new. Any other agent stops here, reports that the wave is still waiting for a Claude Code session, and dispatches nothing new. Otherwise \`cto brief\`. Dispatch only Ready tasks, skipping the ones you parked (see "Where you stop"); the "run together" set is safe to run at once. P1 tasks go first. Review-finding tasks below P1 wait while their feature has any other Ready task you would dispatch, then run as that feature's cleanup wave (see "Review findings"). A cleanup wave runs alone: no other feature's tasks and no non-finding tasks join it. Say in one line what this wave runs, then run it.
285
287
  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. A task accepted by an end-to-end test also gets the Acceptance lines it covers: the test is written from them first and seen failing, then the code.
286
288
  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.
287
289
  4. Accept by running the task's acceptance command yourself; never trust the report. Tick only on a pass. A failing end-to-end test means the code is wrong. If you think the expectation is wrong instead, the CONCEPT decides: where it backs the scenario, the code is wrong after all; where it says otherwise, fix the SPEC's Acceptance first, then the test, and note it in the wave's REVIEW.md entry; where it is silent, do the same and add an \`Assumed: ...\` line. Never change a test to match the code without changing the Acceptance line it came from. \`manual\` does not wait for the user: build it, run what can be run, take screenshots at each width the Acceptance names, and tick it. cto reminds the user with the text on its acceptance line, and your final report lists every manual task of the run with that text and the screenshot paths. A task the user decided not to do: add \`(dropped: <reason>)\` to its line, tick it, and say "<id> dropped" in your final message. Dropping is the user's call: a task you think is no longer needed (what it checks is gone) is parked and listed in your report with that reason, never dropped by you; never drop a task to get past a block. A dropped task counts as closed, so the tasks that wait on it (\`(after:)\`) become Ready: drop or re-plan them first. Tick the parent when its last child is ticked.
288
- 5. **Review before you commit.** Before dispatching, run the project's formatter, if any, so the review sees the final tree. Then dispatch \`subagent_type: "cto-reviewer"\` with no model parameter (it runs on Opus), with none of your context: it reads the feature's CONCEPT.md and SPEC.md and the whole uncommitted change of the wave, and returns findings each marked P1 (wrong, unsafe, breaks a Constraint or the Interface, does something the CONCEPT does not say or contradicts, or an acceptance test that would still pass with its scenario broken) or P2 (should improve, can wait). You wrote both the code and its tests, so the reviewer answers one question per acceptance test: if the scenario were not met, would this test fail. 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. The dispatch prompt names the wave's task ids, every changed path and the verify command from \`cto brief\`; it never dictates the verdict and never drops a changed path. After fixing P1s, run the formatter again before every re-dispatch; then dispatch again on the whole change, never on the fix alone. Where Claude Code is wired and the review gate is on, only a Claude Code session can satisfy the gate, so other agents (with or without sub-agents) hand the wave over as below.
290
+ 5. **Review before you commit.** Before dispatching, run the project's formatter, if any, so the review sees the final tree. Then dispatch \`subagent_type: "cto-reviewer"\` with no model parameter (it runs on Opus), with none of your context: it reads the feature's CONCEPT.md and SPEC.md and the whole uncommitted change of the wave, and returns findings each marked P1 (wrong, unsafe, breaks a Constraint or the Interface, does something the CONCEPT does not say or contradicts, or an acceptance test that would still pass with its scenario broken) or P2 (should improve, can wait). You wrote both the code and its tests, so the reviewer answers one question per acceptance test: if the scenario were not met, would this test fail. Handle them as under "Review findings": fix every P1 now and re-run acceptance; write every P2 as a \`(P2)\` task in TASKS.md whose text starts with exactly \`Review finding (wave <ids>):\`, in English whatever language the rest of TASKS.md uses. A cleanup wave's review is the exception: its P2s become no task and go under \`Left for the user:\` instead (see "Review findings"). 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. The dispatch prompt names the wave's task ids, every changed path and the verify command from \`cto brief\`; it never dictates the verdict and never drops a changed path. After fixing P1s, run the formatter again before every re-dispatch; then dispatch again on the whole change, never on the fix alone. Where Claude Code is wired and the review gate is on, only a Claude Code session can satisfy the gate, so other agents (with or without sub-agents) hand the wave over as below.
289
291
  6. \`cto check\`, then commit the wave to the review branch.
290
292
 
291
293
  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. Where Claude Code is wired and the review gate is on, a self-review cannot pass the commit gate (the gate needs a cto-reviewer review of the exact tree): keep the wave's tasks ticked, leave the tree uncommitted, stop the run, and say in the final report that the wave is waiting for a cto-reviewer review in a Claude Code session.
@@ -318,7 +320,8 @@ Every review (docs, wave, release) ends here. You wrote what was reviewed, so wa
318
320
  - A reviewer who could not follow the docs found missing context. Never contest that.
319
321
  - Never change a severity yourself. A P1 that looks like a P2 is contested like any finding, with evidence, and the user decides.
320
322
  - An escalated finding, or a contest the user has not decided, does not stop a run: leave that finding unfixed, write it into the REVIEW.md entry, go on, and list it in your final report and the release report. In a docs review it goes into the handoff's "might be missing" instead, since that job stops for sign-off anyway. Before escalating, read the CONCEPT: what it decides is not the user's to decide again.
321
- - After fixing P1s, a new \`cto-reviewer\` (no model parameter, none of your context) re-reviews the whole current change, never the fix alone: the commit gate matches a review to the exact working tree, so a review of the fix alone does not cover what is committed. Run the formatter again before every re-dispatch. At most three rounds per review: the first plus up to two whole-change re-reviews. If P1s remain after round three, stop fixing: write each one into the REVIEW.md entry marked as escalated to the user (the commit gate accepts that), leave it unfixed, and hand it to the user. Anything below P1 becomes a task with its severity (in a docs review, where no tasks may exist yet: fixed in the docs or put in the handoff's "might be missing").
323
+ - After fixing P1s, a new \`cto-reviewer\` (no model parameter, none of your context) re-reviews the whole current change, never the fix alone: the commit gate matches a review to the exact working tree, so a review of the fix alone does not cover what is committed. Run the formatter again before every re-dispatch. At most three rounds per review: the first plus up to two whole-change re-reviews. If P1s remain after round three, stop fixing: write each one into the REVIEW.md entry marked as escalated to the user (the commit gate accepts that), leave it unfixed, and hand it to the user. Anything below P1 becomes a task with its severity, except in a cleanup review (next rule) (in a docs review, where no tasks may exist yet: fixed in the docs or put in the handoff's "might be missing").
324
+ - **Findings below P1 are batched, not chained.** A finding task is one whose text starts \`Review finding (\`, or, for one filed before that marker existed, whose text says it came from a review in any wording. Finding tasks wait while their feature has any other Ready task you would dispatch; parked tasks, finding tasks and tasks blocked on a finding task do not count. Then all of the feature's Ready finding tasks run as one cleanup wave: dispatched as usual (\`(seq)\` and overlapping \`(files:)\` still run one after another), each accepted, then one review over the whole cleanup and one commit. What that cleanup review finds below P1 does not become a task: write it into the cleanup's REVIEW.md entry under \`Left for the user:\` and list it in the final report and the release report. It becomes a task only when the user asks for it.
322
325
  - Without sub-agents every review here, the re-review included, is your own: say \`self-review\` in its REVIEW.md entry. Where Claude Code is wired and the review gate is on, that self-review cannot pass the commit gate: keep its tasks ticked, leave the tree uncommitted, stop the run, and say in the final report that it is waiting for a cto-reviewer review in a Claude Code session.
323
326
 
324
327
  ## cto-jev release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "your-cto-jev",
3
- "version": "0.14.0",
3
+ "version": "0.16.0",
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",