@dzhechkov/skills-feature-adr 1.3.40 → 1.3.41

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 +46 -0
  2. package/bin/cli.js +0 -0
  3. package/package.json +6 -5
package/README.md CHANGED
@@ -175,6 +175,52 @@ Workflow({ scriptPath: '.claude/workflows/feature-adr.js',
175
175
  models: { code: 'opus', qe: 'codex:gpt-5.6:high', architecture: 'opus', router: 'fable' } } })
176
176
  ```
177
177
 
178
+ ### Usage-adaptive routing — pre-emptive Codex switch at ≥ 70% Claude usage
179
+
180
+ The `codex-fallback` knobs above are **reactive** — they catch a stage *after* it dies on a limit. At
181
+ true exhaustion even the fallback dispatch can die, so the pipeline also switches **pre-emptively**:
182
+ when model routing is opted into, it probes Claude **SESSION** (active 5h-block) and **WEEKLY** (rolling
183
+ 7d) usage at each phase boundary via `dz usage --json` (from `@dzhechkov/harness-cli`), and moves the
184
+ remaining stages to Codex **before** hitting the wall.
185
+
186
+ | Knob (`args.*`) | Default | Effect |
187
+ |---|---|---|
188
+ | `usageAdaptive` | `true` when routing is requested; `false` otherwise | `true` forces it on by itself; `false` disables all probes (byte-identical to no-routing runs) |
189
+ | `usageThreshold` | `70` | the `>=` percent (SESSION **or** WEEKLY) that triggers the switch |
190
+ | `usageReasoning` | built-in map | per-stage reasoning under the override (design/code/plan → `xhigh`; router/qe/fleet → `high`) |
191
+
192
+ **Two-way, hysteretic, fail-safe:**
193
+
194
+ - `>= usageThreshold` on **either** metric ⇒ ALL remaining stages switch to `codex:<top>`.
195
+ - Both metrics back below (positive numbers, not nulls) ⇒ the normal model mix is **restored**.
196
+ - A probe whose agent **dies** (often *means* the limit was hit) fail-safe-switches to Codex; a
197
+ value-null (limits not configured) flips nothing — no flapping, no false switches.
198
+ - A reactive belt remains: a stage agent returning null while not overridden also flips the switch for
199
+ the *remaining* stages.
200
+
201
+ **Observability:** switched stages carry ` (usage-switched)` in `modelsUsed`; results include
202
+ `usageEvents` (`[{phase, sessionPct, weeklyPct, action}]`, action ∈
203
+ `switch|restore|keep|fail-safe-switch|reactive-switch|none`) and `usageThreshold`.
204
+
205
+ **Config (optional):** percentages are local-transcript **estimates** (no official usage API); they stay
206
+ `null` — and never trigger a switch — until you set your plan's limits in `.dz/config.json`:
207
+
208
+ ```json
209
+ { "memory": { "usage": { "sessionTokenLimit": 200000000, "weeklyTokenLimit": 1000000000 } } }
210
+ ```
211
+
212
+ ```js
213
+ // Claude codes until usage crosses 70%, then every remaining stage runs on Codex until it drops back:
214
+ Workflow({ scriptPath: '.claude/workflows/feature-adr.js',
215
+ args: { slug: 'add-oauth', description: '…', tier: 'L',
216
+ models: { code: 'opus' }, usageAdaptive: true, usageThreshold: 70 } })
217
+ ```
218
+
219
+ > Note: under the override, coder **and** QE both run on Codex — the cross-model self-QE guard is
220
+ > consciously suspended (a Claude QE reviewer is exactly the agent that dies under limit pressure). The
221
+ > ` (usage-switched)` suffix + `usageEvents` keep it auditable; re-run an independent QE after limits
222
+ > reset if the switch fired during Step 8.
223
+
178
224
  ---
179
225
 
180
226
  ## Spec-Driven Development (SDD)
package/bin/cli.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dzhechkov/skills-feature-adr",
3
- "version": "1.3.40",
3
+ "version": "1.3.41",
4
4
  "description": "Adaptive Feature Development skill pack for Claude Code — 11-step pipeline with Complexity Router (S/M/L/XL), ADR-driven architecture, 15 agentic-qe skills, multi-agent fleet QE. Supports --full-qe, --full-qe-extended, --with-learning, and --knowledge-extractor modes.",
5
5
  "bin": {
6
6
  "skills-feature-adr": "./bin/cli.js"
@@ -13,6 +13,10 @@
13
13
  "CHANGELOG.md",
14
14
  "docs/"
15
15
  ],
16
+ "scripts": {
17
+ "test": "node --test \"test/**/*.test.js\"",
18
+ "prepack": "node -e \"const fs=require('fs');const bad=['.claude','.skills-feature-adr.json'].filter(p=>fs.existsSync(p));if(bad.length){console.error('prepack guard: stray init artifacts in package dir: '+bad.join(', ')+' — remove before packing');process.exit(1)}\""
19
+ },
16
20
  "keywords": [
17
21
  "claude",
18
22
  "claude-code",
@@ -57,8 +61,5 @@
57
61
  },
58
62
  "publishConfig": {
59
63
  "access": "public"
60
- },
61
- "scripts": {
62
- "test": "node --test \"test/**/*.test.js\""
63
64
  }
64
- }
65
+ }