cadet-agent 0.21.0 → 0.25.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 CHANGED
@@ -2,43 +2,50 @@
2
2
 
3
3
  Cadet-Agent is an **opinionated** cross-IDE agent framework for game-development workflows. It is built on foundational software engineering practices and real-world game-development experience, with the goal of **guiding you through the entire development process** — from requirements and technical design through TDD, implementation, and review.
4
4
 
5
- Cadet-Agent is **not a one-shot code generator**. It won't spit out a finished game from a single prompt. Instead, it walks you through each phase methodically: calibrating the learner model, scoping work into epics and stories, planning architecture, writing tests first, and iterating on feedback. The shared framework core integrates with GitHub Copilot, Cursor, Continue, and Claude Code.
5
+ Cadet-Agent is **not a one-shot code generator**. It won't spit out a finished game from a single prompt. Instead, it walks you through each phase methodically: calibrating the learner model, scoping work into epics and stories, planning architecture, writing tests first, and iterating on feedback. The shared framework core integrates with GitHub Copilot, Cursor, Continue, Claude Code, and Deep Code.
6
6
 
7
7
  ## Repository Layout
8
8
  - `.cadet/agent/core/` contains the shared Cadet-Agent framework documents.
9
9
  - `cadet-agent.md` is the thin global directive: identity, non-negotiable rules, workflow routing, hard-gate protocol, and skill dispatch.
10
- - `skills/` contains scoped workflow-phase skills (Requirements, Architecture, Spike, StoryBreakdown, TDD, Debugging, CodeReview).
10
+ - `Harness.md` is the canonical harness contract: budgets, evidence-backed gates, retries, context tiers, tool routing, privacy, and escalation.
11
+ - `harness.schema.json` and `state.schema.json` are the machine-readable schemas for harness records and session state.
12
+ - `skills/` contains scoped workflow-phase skills (Requirements, Architecture, Spike, StoryBreakdown, TDD, Debugging, CodeReview, Resume, MCPSetup, AgentReviewer).
11
13
  - `templates/` contains runtime templates for planning artifacts.
14
+ - `.cadet/harness.json` holds repository-local budget/policy overrides (preserved by sync).
15
+ - `.cadet/runs/` holds sanitized run ledgers (preserved by sync; no secrets or raw prompts by default).
16
+ - `src/harness/` contains the dependency-free harness implementation (policy, budget, state, verification, context, routing, redaction, ledger, archive, hook).
12
17
  - `.cadet/agent/docs/` contains setup guides for each supported IDE.
13
18
  - `.github/agents/` contains the Copilot custom agent definitions (Cadet Agent + Cadet Agent Reviewer).
14
19
  - `.github/prompts/` contains Copilot slash-command skill prompts (`/cadet-review`, `/cadet-tdd`, etc.).
15
20
  - `.cursor/` contains Cursor-specific authored files.
16
21
  - `.continue/` contains Continue-specific authored files.
17
22
  - `.claude/` contains Claude Code-specific authored files.
23
+ - `.agents/skills/` contains Deep Code (and cross-client) skill adapters.
18
24
  - These IDE folders hold thin integration shims; the core framework logic still lives in `.cadet/agent/core/`.
19
25
  - `package-agent.ps1` builds the distributable `cadet-agent.zip` package.
20
26
  - `publish-npm.ps1` publishes the CLI to npm using a token from `~/.npm_token`.
21
27
 
22
28
  ## Cross-IDE Support
23
29
 
24
- Cadet-Agent provides full workflow parity across four IDEs. The same 7 skills + resume + reviewer are available in each:
25
-
26
- | Feature | GitHub Copilot | Cursor | Continue | Claude Code |
27
- |---|---|---|---|---|
28
- | Auto-load rules | Agent definition | `alwaysApply` rule | Project rule | Project skill |
29
- | Skill dispatch | `/cadet-<skill>` prompts | Natural language | `/cadet-<skill>` commands | `/cadet-<skill>` skills |
30
- | Requirements | ✅ | ✅ | ✅ | ✅ |
31
- | Architecture | ✅ | ✅ | ✅ | ✅ |
32
- | Spike | ✅ | ✅ | ✅ | ✅ |
33
- | Story Breakdown | ✅ | ✅ | ✅ | ✅ |
34
- | TDD | ✅ | ✅ | ✅ | ✅ |
35
- | Debugging | ✅ | ✅ | ✅ | ✅ |
36
- | Code Review | ✅ | ✅ | ✅ | ✅ |
37
- | Resume | ✅ | ✅ | ✅ | ✅ |
38
- | Reviewer mode | Agent picker | Rule toggle | `/cadet-agent-reviewer` | `/cadet-agent-reviewer` |
39
- | Git guard | PreToolUse hook | Manual | Manual | Manual |
40
-
41
- All adapters delegate to the canonical files under `.cadet/agent/core/` — no duplicated rules or skills. See `ADAPTERS.md` for the full inventory.
30
+ Cadet-Agent provides full workflow parity across five IDEs. The same 9 skills + reviewer are available in each:
31
+
32
+ | Feature | GitHub Copilot | Cursor | Continue | Claude Code | Deep Code |
33
+ |---|---|---|---|---|---|
34
+ | Auto-load rules | Agent definition | `alwaysApply` rule | Project rule | Project skill | Project skill (`.agents/skills/`) |
35
+ | Skill dispatch | `/cadet-<skill>` prompts | Natural language | `/cadet-<skill>` commands | `/cadet-<skill>` skills | `/skills` menu (`/`) |
36
+ | Requirements | ✅ | ✅ | ✅ | ✅ | ✅ |
37
+ | Architecture | ✅ | ✅ | ✅ | ✅ | ✅ |
38
+ | Spike | ✅ | ✅ | ✅ | ✅ | ✅ |
39
+ | Story Breakdown | ✅ | ✅ | ✅ | ✅ | ✅ |
40
+ | TDD | ✅ | ✅ | ✅ | ✅ | ✅ |
41
+ | Debugging | ✅ | ✅ | ✅ | ✅ | ✅ |
42
+ | Code Review | ✅ | ✅ | ✅ | ✅ | ✅ |
43
+ | Resume | ✅ | ✅ | ✅ | ✅ | ✅ |
44
+ | MCP Setup | | | | | |
45
+ | Reviewer mode | Agent picker | Rule toggle | `/cadet-agent-reviewer` | `/cadet-agent-reviewer` | `cadet-agent-reviewer` skill |
46
+ | Git guard | PreToolUse hook | Manual | Manual | Manual | `permissions.ask` (`mutate-git-log`) |
47
+
48
+ All adapters delegate to the canonical files under `.cadet/agent/core/` — no duplicated rules or skills. See `ADAPTERS.md` for the full inventory and `docs/guidance/DeepCode.md` for Deep Code setup.
42
49
 
43
50
  ## Quick Install
44
51
 
@@ -58,7 +65,7 @@ npx cadet-agent@latest init --target ./my-unity-project
58
65
  npx cadet-agent@latest sync
59
66
  ```
60
67
 
61
- When a new release is available, `sync` downloads the updated framework and replaces managed files (`.cadet/agent/core/`, IDE integration shims, agent definitions). Your local policies (`.cadet/agent/policies/`) and project plans (`.cadet/agent/project-plans/`) are automatically preserved. After syncing, start a fresh chat for the changes to take effect.
68
+ When a new release is available, `sync` downloads the updated framework and replaces managed files (`.cadet/agent/core/`, IDE integration shims, agent definitions). Your local policies (`.cadet/agent/policies/`), project plans (`.cadet/agent/project-plans/`), harness overrides (`.cadet/harness.json`), and run ledgers (`.cadet/runs/`) are automatically preserved. After syncing, start a fresh chat for the changes to take effect.
62
69
 
63
70
  To sync a specific directory:
64
71
 
@@ -66,6 +73,20 @@ To sync a specific directory:
66
73
  npx cadet-agent@latest sync --target ./my-unity-project
67
74
  ```
68
75
 
76
+ #### AGENTS.md is create-only
77
+
78
+ Cadet ships a repository-root `AGENTS.md` (a thin pointer to `.cadet/agent/core/cadet-agent.md`). If your repo already has one, Cadet **never overwrites it**:
79
+
80
+ - In a terminal, `init`/`sync` ask whether to keep, overwrite, or merge (default: keep).
81
+ - Non-interactive installs (CI, `--yes`, piped output) always **keep** and print a tag-pinned link to Cadet's copy.
82
+ - Control it explicitly with `--agents-md keep|overwrite|merge`.
83
+ - `merge` inserts Cadet's text between `<!-- cadet-agent:begin -->` / `<!-- cadet-agent:end -->` markers and leaves the rest of your file untouched.
84
+
85
+ ```bash
86
+ npx cadet-agent@latest sync --agents-md keep # never touch an existing AGENTS.md
87
+ npx cadet-agent@latest sync --yes # non-interactive; keeps existing files
88
+ ```
89
+
69
90
  ## Manual Install (fallback)
70
91
 
71
92
  If you prefer to install from a packaged release artifact, download `cadet-agent.zip` from [GitHub Releases](https://github.com/naishtech/cadet-agent/releases) and extract it into your Unity project root:
@@ -128,7 +149,7 @@ flowchart TD
128
149
 
129
150
  ### Resuming a Session
130
151
 
131
- Use the `/cadet-resume` slash command to pick up where you left off. It reads `.cadet/state.json` and reports the current phase, epic/story progress, and outstanding gates — then dispatches the right skill for the next step. If no state file exists, it initializes a fresh session from `context-resolution`.
152
+ Use the `/cadet-resume` slash command to pick up where you left off. It reads `.cadet/state.json` and reports the current phase, epic/story progress, and outstanding gates — then dispatches the right skill for the next step. It also checks the current branch and working tree, so leftover changes from a previous task are resolved (commit, stash, push, or move to a new branch) before a new task begins. If no state file exists, it initializes a fresh session from `context-resolution`.
132
153
 
133
154
  ### Phase Gating
134
155
 
@@ -140,6 +161,36 @@ Hard gates are enforced at every phase transition. The agent reads `.cadet/state
140
161
  | review → validation | `codeReviewCompleted`, `securityReviewPassed`, `acceptanceCriteriaValidated` |
141
162
  | validation → closed | `designArtifactSyncConfirmed` |
142
163
 
164
+ ### Harness
165
+
166
+ Gates are backed by **evidence**, not assertion. Each claimed gate must have a fresh, non-superseded evidence record bound to the current work item, input tree hash, and acceptance criteria. The harness also bounds context, tokens, tool calls, retries, wall-clock time, cost, and archive sizes — and those bounds are enforced, not advisory.
167
+
168
+ - Rules: `.cadet/agent/core/Harness.md`. Data contract: `docs/core/HarnessContract.md`.
169
+ - Overrides: `.cadet/harness.json` (preserved by sync; conservative defaults in `src/harness/policy.mjs`).
170
+ - Ledgers: `.cadet/runs/<runId>.json` (sanitized; artifacts are redacted before they are written; no secrets or raw prompts by default).
171
+ - Transitions recompute the input tree hash from the evidence's relevant files, so editing a relevant file invalidates the evidence.
172
+ - `harness verify` binds evidence to `--files` (or the working tree's changed files), and a `testsPassed` green result requires a prior red record.
173
+ - When Git is unavailable and no `--files` are given, verification blocks (`freshness-unavailable`) rather than recording unscoped evidence.
174
+ - `state validate` rejects a `true` gate whose evidence is missing, stale, expired, superseded, or bound to another work item; evidence records are schema-validated in full (`command`, `result`, `criteriaHash`, and a freshness bound).
175
+ - Evidence must include a UUID, work item, phase, gate, status, command/result, input-tree hash, criteria hash, relevant files, timestamp, and either `expiresAt` or `freshnessPolicy`.
176
+ - Command output counts against the output budget; a configured cost budget cannot be satisfied by unmeasurable cost (the run is blocked, `budget-blocked`).
177
+ - State and run ledgers are written atomically, so an interrupted write cannot truncate a record; persisted artifacts are redacted before hashing or writing.
178
+ - Empty freshness coverage is an explicit policy decision: set `allowEmptyFreshness: true` in `.cadet/harness.json` only when unscoped evidence is acceptable.
179
+
180
+ ```bash
181
+ cadet-agent state validate # validate state against the schema
182
+ cadet-agent state migrate # atomically upgrade v1 → v2
183
+ cadet-agent state transition --to review # enforce the matrix + evidence
184
+ cadet-agent harness verify --gate testsPassed --files src/a.cs # bounded, classified loop
185
+ cadet-agent harness report # budget consumption and failures (no secrets)
186
+ cadet-agent harness cleanup # apply the retention policy
187
+ cadet-agent harness capabilities # available CLI/Unity/MCP/hook/token/cost telemetry
188
+ ```
189
+
190
+ Every command supports `--format human|json` and exits nonzero for invalid state, failed verification, budget exhaustion, stale evidence, or safety rejection.
191
+
192
+ See `docs/guidance/HarnessTroubleshooting.md` for stale evidence, budget exhaustion, unavailable Unity CLI, and live MCP connection failures.
193
+
143
194
  ## Examples
144
195
 
145
196
  ### GitHub Copilot
@@ -191,6 +242,26 @@ Create a requirements outline for a single-player time-trial mode with ghost rep
191
242
 
192
243
  The Continue rule in `.continue/rules/cadet-agent.md` should steer the response back through the shared Cadet framework.
193
244
 
245
+ ### Deep Code request
246
+ With [Deep Code](https://deepcode.vegamo.cn/) installed (`npm install -g @vegamo/deepcode-cli`), run `deepcode` in the repository and use `/skills` to confirm the `cadet-*` skills are discovered from `.agents/skills/`. Then pick a phase skill from the `/` menu (there is no `/cadet-<skill>` command — select it by name, or ask for the phase in plain language):
247
+
248
+ ```text
249
+ Run the TDD skill for the ghost-replay story.
250
+ ```
251
+
252
+ Because Deep Code has no PreToolUse hook, enforce the commit/push approval gate in `.deepcode/settings.json`:
253
+
254
+ ```json
255
+ {
256
+ "permissions": {
257
+ "ask": ["mutate-git-log", "network"],
258
+ "defaultMode": "askAll"
259
+ }
260
+ }
261
+ ```
262
+
263
+ See `docs/guidance/DeepCode.md` for the full setup, MCP wiring, and configuration reference.
264
+
194
265
  ### Repository policy example
195
266
  If a specific game repository needs local conventions, add a policy file under `.cadet/agent/policies` using `.cadet/agent/core/Templates/PolicyTemplate.md`. For example, a repository policy could define:
196
267
  - where project plans should live
@@ -199,7 +270,7 @@ If a specific game repository needs local conventions, add a policy file under `
199
270
 
200
271
  ## Package Output
201
272
  Running `./package-agent.ps1` produces `cadet-agent.zip` with this layout:
202
- - `.cadet/agent/core/`
273
+ - `.cadet/agent/core/` (including `Harness.md`, `harness.schema.json`, and `state.schema.json`)
203
274
  - `.cadet/agent/core/skills/`
204
275
  - `.cadet/agent/core/templates/`
205
276
  - `.github/agents/cadet.agent.md`
@@ -207,8 +278,12 @@ Running `./package-agent.ps1` produces `cadet-agent.zip` with this layout:
207
278
  - `.github/prompts/cadet-*.prompt.md`
208
279
  - `.github/hooks/`
209
280
  - `.cursor/rules/cadet-agent.md`
281
+ - `.cursor/rules/cadet-agent-reviewer.md`
210
282
  - `.continue/rules/cadet-agent.md`
211
- - `.claude/skills/cadet-agent.md`
283
+ - `.continue/rules/cadet-agent-reviewer.md`
284
+ - `.continue/config.yaml`
285
+ - `.claude/skills/cadet-agent/SKILL.md`
286
+ - `.claude/skills/cadet-*/SKILL.md`
212
287
 
213
288
  ## Notes
214
289
  - `.cadet/agent/core/FrameworkManifest.json` defines the managed and preserved paths for packaged installs.
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "cadet-agent",
3
- "version": "0.21.0",
4
- "description": "Cross-IDE agent framework for Unity/C# game-development — one-command install",
5
- "type": "module",
6
- "bin": {
7
- "cadet-agent": "bin/cli.mjs"
8
- },
9
- "scripts": {
10
- "test": "node --test test/*.test.mjs"
11
- },
12
- "files": [
13
- "bin/",
14
- "src/"
15
- ],
16
- "keywords": [
17
- "cadet",
18
- "cadet-agent",
19
- "unity",
20
- "game-development",
21
- "ai-agent",
22
- "copilot",
23
- "cursor",
24
- "claude-code"
25
- ],
26
- "license": "CC-BY-4.0",
27
- "repository": {
28
- "type": "git",
29
- "url": "git+https://github.com/naishtech/cadet-agent.git"
30
- },
31
- "homepage": "https://github.com/naishtech/cadet-agent#readme",
32
- "engines": {
33
- "node": ">=18.0.0"
34
- }
35
- }
1
+ {
2
+ "name": "cadet-agent",
3
+ "version": "0.25.0",
4
+ "description": "Cross-IDE agent framework for Unity/C# game-development — one-command install",
5
+ "type": "module",
6
+ "bin": {
7
+ "cadet-agent": "bin/cli.mjs"
8
+ },
9
+ "scripts": {
10
+ "test": "node --test test/*.test.mjs"
11
+ },
12
+ "files": [
13
+ "bin/",
14
+ "src/"
15
+ ],
16
+ "keywords": [
17
+ "cadet",
18
+ "cadet-agent",
19
+ "unity",
20
+ "game-development",
21
+ "ai-agent",
22
+ "copilot",
23
+ "cursor",
24
+ "claude-code"
25
+ ],
26
+ "license": "CC-BY-4.0",
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/naishtech/cadet-agent.git"
30
+ },
31
+ "homepage": "https://github.com/naishtech/cadet-agent#readme",
32
+ "engines": {
33
+ "node": ">=18.0.0"
34
+ }
35
+ }