your-cto-jev 0.14.0 → 0.15.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.
- package/README.md +3 -2
- package/dist/skill.js +8 -6
- 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 |
|
|
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.
|
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()} -->`;
|
|
@@ -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
|
|
84
|
+
## Rules guarded by cto
|
|
85
85
|
|
|
86
|
-
This repo is guarded by cto:
|
|
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
|
|
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
|
|
111
|
+
Each rule below names the check behind it, if any. Following the rules is faster than being blocked.
|
|
111
112
|
|
|
112
|
-
| Rule |
|
|
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
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "your-cto-jev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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",
|