@ngockhoale/ukit 1.6.1 → 1.6.3

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to UKit are documented here.
4
4
 
5
+ ## 1.6.2 - 2026-07-26
6
+
7
+ ### Added
8
+
9
+ - `ukit update` — new command that upgrades the globally installed UKit CLI to the latest published version (equivalent to `npm install -g @ngockhoale/ukit`).
10
+
11
+ ### Changed
12
+
13
+ - Downgraded `find-cause` and `map-impact` orchestration contracts from `modelTier: smart` (opus) to `modelTier: code` (sonnet); `review-release` stays on `smart`. Reduces unnecessary Opus usage for routine debugging/impact-mapping work.
14
+
15
+ ### Fixed
16
+
17
+ - Auto-compact context-pressure state is now surfaced to the model as a warning (`[ukit-skill-router] Context pressure: soft/hard ...`) once token usage crosses the soft/hard threshold, instead of being silently tracked and only reinjected after Claude Code's native compaction already began. Users previously had to compact manually because nothing ever prompted proactive `/compact` suggestions.
18
+
5
19
  ## 1.5.24 - 2026-06-10
6
20
 
7
21
  ### Fixed
package/README.md CHANGED
@@ -162,6 +162,7 @@ These commands are still available, but they are **advanced workflows**, not def
162
162
  - `ukit uninstall` — remove UKit-managed assets
163
163
  - `ukit status` — inspect shared UKit runtime state
164
164
  - `ukit memory ...` — inspect/export/forget shared memory items
165
+ - `ukit update` — upgrade the global UKit CLI to the latest published version (same as `npm install -g @ngockhoale/ukit`)
165
166
  - `ukit index ...` — run repo indexing/query/triage tools directly
166
167
  - `ukit build index` — alias for `ukit index build`
167
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ukit",
3
- "version": "1.6.1",
3
+ "version": "1.6.3",
4
4
  "description": "Install/update an index-first AI workspace for Claude Code, Antigravity, OpenAI Codex, and OpenCode.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,27 @@
1
+ import { updateUkit, UKIT_PACKAGE_NAME } from '../../core/update.js';
2
+
3
+ const KNOWN_UPDATE_FLAGS = new Set(['--help', '-h']);
4
+
5
+ export async function runUpdate({ packageVersion, argv = [] }) {
6
+ if (argv.includes('--help') || argv.includes('-h')) {
7
+ console.log('Usage: ukit update');
8
+ console.log('');
9
+ console.log('Upgrade the globally installed UKit CLI to the latest published version.');
10
+ console.log(`Equivalent to: npm install -g ${UKIT_PACKAGE_NAME}`);
11
+ return;
12
+ }
13
+
14
+ const unknownFlags = argv.filter((a) => a.startsWith('-') && !KNOWN_UPDATE_FLAGS.has(a));
15
+ if (unknownFlags.length > 0) {
16
+ throw new Error(
17
+ `Unknown option(s): ${unknownFlags.join(', ')}. Run \`ukit update --help\` for usage.`,
18
+ );
19
+ }
20
+
21
+ console.log(`[UKit] Current version: ${packageVersion}`);
22
+ console.log(`[UKit] Running: npm install -g ${UKIT_PACKAGE_NAME}`);
23
+
24
+ updateUkit();
25
+
26
+ console.log('[UKit] Update complete. Run `ukit --version` to confirm the new version.');
27
+ }
package/src/cli/index.js CHANGED
@@ -5,6 +5,7 @@ import { runUninstall } from './commands/uninstall.js';
5
5
  import { runIndexTools } from './commands/indexTools.js';
6
6
  import { runStatus } from './commands/status.js';
7
7
  import { runMemory } from './commands/memory.js';
8
+ import { runUpdate } from './commands/update.js';
8
9
 
9
10
  const GLOBAL_FLAGS = new Set(['--help', '-h', '--version', '-v']);
10
11
 
@@ -58,6 +59,11 @@ export async function runCli({ argv, packageRoot, projectRoot, packageVersion })
58
59
  return;
59
60
  }
60
61
 
62
+ if (command === 'update') {
63
+ await runUpdate({ packageVersion, argv: commandArgv });
64
+ return;
65
+ }
66
+
61
67
  if (command === 'build' && (commandArgv[0] ?? '').toLowerCase() === 'index') {
62
68
  await runIndexTools({ projectRoot, argv: ['build', ...commandArgv.slice(1)] });
63
69
  return;
@@ -85,6 +91,7 @@ export async function runCli({ argv, packageRoot, projectRoot, packageVersion })
85
91
  console.log(' index Codebase index tools (build/query/triage)');
86
92
  console.log(' status Show UKit runtime status');
87
93
  console.log(' memory Inspect shared UKit memory');
94
+ console.log(' update Upgrade the global UKit CLI to the latest version');
88
95
  console.log(' version Show UKit version');
89
96
  console.log('');
90
97
  console.log('Options (install / diff):');
@@ -0,0 +1,19 @@
1
+ import { spawnSync as defaultSpawnSync } from 'node:child_process';
2
+
3
+ export const UKIT_PACKAGE_NAME = '@ngockhoale/ukit';
4
+
5
+ export function updateUkit({ spawnSync = defaultSpawnSync } = {}) {
6
+ const result = spawnSync('npm', ['install', '-g', UKIT_PACKAGE_NAME], {
7
+ stdio: 'inherit',
8
+ });
9
+
10
+ if (result.error) {
11
+ throw new Error(`Failed to run npm install -g ${UKIT_PACKAGE_NAME}: ${result.error.message}`);
12
+ }
13
+
14
+ if (result.status !== 0) {
15
+ throw new Error(`npm install -g ${UKIT_PACKAGE_NAME} exited with code ${result.status}`);
16
+ }
17
+
18
+ return result;
19
+ }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: bug-debugger
3
3
  description: "Debugging specialist for reproducible errors, failing tests, and unexpected behavior. Use proactively when investigation will involve noisy logs, stack traces, or a self-contained reproduce-trace-fix-verify loop. Do not use for trivial obvious fixes or broad architecture ideation."
4
- model: inherit
4
+ model: sonnet # unic-code
5
5
  color: red
6
6
  tools: ["Read", "Grep", "Glob", "Bash", "Edit", "TodoWrite"]
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: code-reviewer
3
3
  description: "Independent reviewer for handoff Phase 3. Use after executor reports STATUS: DONE on a handoff task. MUST run with a model different from the executor (configured in .ukit/storage/config.json → handoff.reviewer.model, default unic-smart). Produces a verdict: APPROVED | APPROVED-WITH-MINOR | CHANGES-REQUESTED | CRITICAL."
4
- model: inherit
4
+ model: opus # unic-smart
5
5
  color: yellow
6
6
  tools: ["Read", "Grep", "Glob", "Bash"]
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: feature-implementer
3
3
  description: "Implementation specialist for clear, self-contained coding tasks. Use proactively when the approach is clear and the work can be completed in a bounded pass with a concise summary. Do not use for trivial one-file tweaks or tightly coupled exploratory work."
4
- model: inherit
4
+ model: sonnet # unic-code
5
5
  color: green
6
6
  tools: ["Read", "Edit", "Write", "Grep", "Glob", "Bash", "TodoWrite"]
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: handoff-planner
3
3
  description: "Handoff planning specialist for Phase 1+2. Use when creating a new handoff cycle: writes PLAN.md with full test plan, splits into TASK-xxx.md files with TDD-embedded test cases, and updates INDEX.md. Always use the strongest available model (Opus/unic-smart)."
4
- model: inherit
4
+ model: opus # unic-smart
5
5
  color: purple
6
6
  tools: ["Read", "Edit", "Write", "Glob", "Bash", "TodoWrite"]
7
7
  ---
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: ukit-small-task-maintainer
3
3
  description: "Internal UKit maintenance subagent for low-risk, reversible UKit decisions. Use proactively when UKit needs to decide or perform safe cleanup such as pruning docs/TASKS.md, classifying queued work, choosing whether compact/summarization is appropriate, summarizing local docs/status, or maintaining small UKit runtime queues. Do not use for product implementation, security, release/publish, data-loss, architecture, or risky/shared code changes."
4
- model: unic-lite
4
+ model: haiku # unic-lite
5
5
  color: cyan
6
6
  tools: ["Read", "Grep", "Glob", "Edit", "Write"]
7
7
  ---
@@ -2601,7 +2601,7 @@ const { pathToFileURL } = require('url');
2601
2601
  NODE
2602
2602
 
2603
2603
  if [ -f "$THRESHOLD_SCRIPT" ]; then
2604
- printf '%s' "$INPUT" | CLAUDE_PROJECT_DIR="$PROJECT_ROOT" node "$THRESHOLD_SCRIPT" prompt >/dev/null 2>&1 || true
2604
+ printf '%s' "$INPUT" | CLAUDE_PROJECT_DIR="$PROJECT_ROOT" node "$THRESHOLD_SCRIPT" prompt 2>/dev/null || true
2605
2605
  fi
2606
2606
 
2607
2607
  exit 0
@@ -1,5 +1,6 @@
1
1
  {
2
- "fastMode": true,
2
+ "model": "sonnet",
3
+ "fastMode": false,
3
4
  "fastModePerSessionOptIn": false,
4
5
  "alwaysThinkingEnabled": true,
5
6
  "effortLevel": "high",
@@ -1685,7 +1685,7 @@ function buildExecutionContract(executionMode = null) {
1685
1685
  completionEvidence: ['write-evidence'],
1686
1686
  },
1687
1687
  'find-cause': {
1688
- modelTier: 'smart',
1688
+ modelTier: 'code',
1689
1689
  maxReadPassesBeforeReassess: 3,
1690
1690
  verificationPolicy: 'root-cause-then-targeted',
1691
1691
  completionRule: 'never-claim-fixed-without-write-and-verification',
@@ -1703,7 +1703,7 @@ function buildExecutionContract(executionMode = null) {
1703
1703
  mirrorConsistencyRequired: true,
1704
1704
  },
1705
1705
  'map-impact': {
1706
- modelTier: 'smart',
1706
+ modelTier: 'code',
1707
1707
  maxReadPasses: 3,
1708
1708
  maxContextPulls: 3,
1709
1709
  verificationPolicy: 'impact-first-then-targeted-then-widen-on-risk',
@@ -1019,12 +1019,18 @@ async function runCli() {
1019
1019
  return;
1020
1020
  }
1021
1021
 
1022
- await updateCompactPressureFromPrompt(projectRoot, {
1022
+ const nextState = await updateCompactPressureFromPrompt(projectRoot, {
1023
1023
  promptText,
1024
1024
  routingContext: routeState?.routingContext ?? {},
1025
1025
  previousContext: routeState?.previousContext ?? null,
1026
1026
  routeSummary: routeState?.routeSummary ?? null,
1027
1027
  }, config);
1028
+
1029
+ if (nextState.phase === 'soft' || nextState.phase === 'hard') {
1030
+ process.stdout.write(
1031
+ `[ukit-skill-router] Context pressure: ${nextState.phase} (est ${nextState.estimatedTotalTokens} / soft ${nextState.softThreshold} / hard ${nextState.hardThreshold}). Suggest running /compact soon, or I will self-summarize before continuing.\n`,
1032
+ );
1033
+ }
1028
1034
  }
1029
1035
  }
1030
1036
 
@@ -145,16 +145,16 @@ UKit routes tasks to one of three model tiers based on task complexity:
145
145
  | Tier | Generic alias | Claude model | Typical tasks |
146
146
  |------|--------------|--------------|---------------|
147
147
  | lite | `unic-lite` | claude-haiku | Reads, git queries, bash summaries, small doc edits |
148
- | code | `unic-code` | claude-sonnet | Normal coding, local fixes, shared edits, builds |
149
- | smart | `unic-smart` | claude-opus | Deep reasoning, root-cause analysis, release review |
148
+ | code | `unic-code` | claude-sonnet | Normal coding, local fixes, shared edits, builds, debugging, impact mapping |
149
+ | smart | `unic-smart` | claude-opus | Release review/audit, and escalated deep reasoning after repeated failure |
150
150
 
151
151
  ### Contract-to-tier mapping
152
152
 
153
153
  | Contract | Tier |
154
154
  |----------|------|
155
155
  | `tiny-fix` | lite |
156
- | `local-fix`, `local-build`, `shared-edit` | code |
157
- | `find-cause`, `map-impact`, `review-release` | smart |
156
+ | `local-fix`, `local-build`, `shared-edit`, `find-cause`, `map-impact` | code |
157
+ | `review-release` | smart |
158
158
 
159
159
  ### Escalation rule
160
160