@ngockhoale/ukit 1.6.8 → 2.0.2
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 +43 -0
- package/manifests/platform.full.yaml +47 -0
- package/package.json +2 -1
- package/scripts/skill/audit-skill.mjs +39 -0
- package/src/cli/commands/doctor.js +22 -2
- package/src/cli/commands/memory.js +76 -1
- package/src/core/memory/store.js +125 -1
- package/src/core/skillProfile.js +45 -0
- package/src/skill/auditSkill.js +99 -0
- package/templates/.claude/agents/code-reviewer.md +51 -7
- package/templates/.claude/agents/handoff-planner.md +18 -2
- package/templates/.claude/hooks/context-hardcap-gate.sh +102 -0
- package/templates/.claude/hooks/reset-compact-pressure.sh +25 -0
- package/templates/.claude/settings.json +15 -0
- package/templates/.claude/skills/canvas-design/SKILL.md +2 -20
- package/templates/.claude/skills/canvas-design/philosophy-examples.md +23 -0
- package/templates/.claude/skills/debugging-toolkit/SKILL.md +2 -30
- package/templates/.claude/skills/debugging-toolkit/reference-tables.md +33 -0
- package/templates/.claude/skills/docs-manager/SKILL.md +7 -249
- package/templates/.claude/skills/docs-manager/conventions-and-examples.md +221 -0
- package/templates/.claude/skills/docx/SKILL.md +3 -34
- package/templates/.claude/skills/docx/redlining-reference.md +34 -0
- package/templates/.claude/skills/duraone/SKILL.md +12 -16
- package/templates/.claude/skills/executing-plans/SKILL.md +31 -19
- package/templates/.claude/skills/file-organizer/SKILL.md +2 -170
- package/templates/.claude/skills/file-organizer/examples-and-practices.md +173 -0
- package/templates/.claude/skills/pdf/SKILL.md +1 -62
- package/templates/.claude/skills/pdf/reference.md +65 -0
- package/templates/.claude/skills/pdf-processing-pro/SKILL.md +2 -73
- package/templates/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +80 -0
- package/templates/.claude/skills/pptx/SKILL.md +14 -286
- package/templates/.claude/skills/pptx/design-references.md +81 -0
- package/templates/.claude/skills/pptx/template-replacement-reference.md +150 -0
- package/templates/.claude/skills/pptx/utilities.md +62 -0
- package/templates/.claude/skills/project-learning/SKILL.md +32 -0
- package/templates/.claude/skills/root-cause-tracing/SKILL.md +2 -35
- package/templates/.claude/skills/root-cause-tracing/diagrams.md +44 -0
- package/templates/.claude/skills/sharing-skills/SKILL.md +1 -41
- package/templates/.claude/skills/sharing-skills/complete-example.md +41 -0
- package/templates/.claude/skills/skill-quality/SKILL.md +37 -0
- package/templates/.claude/skills/skill-quality/pressure-scenario-template.md +20 -0
- package/templates/.claude/skills/skill-quality/rationalization-table-template.md +15 -0
- package/templates/.claude/skills/skill-quality/trigger-accuracy-template.md +32 -0
- package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +13 -440
- package/templates/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +128 -0
- package/templates/.claude/skills/sql-optimization-patterns/references/core-concepts.md +112 -0
- package/templates/.claude/skills/sql-optimization-patterns/references/query-patterns.md +204 -0
- package/templates/.claude/skills/subagent-driven-development/SKILL.md +4 -51
- package/templates/.claude/skills/subagent-driven-development/example-workflow.md +40 -0
- package/templates/.claude/skills/systematic-debugging/SKILL.md +2 -28
- package/templates/.claude/skills/systematic-debugging/reference-tables.md +33 -0
- package/templates/.claude/skills/test-driven-development/SKILL.md +2 -51
- package/templates/.claude/skills/test-driven-development/reference-tables.md +56 -0
- package/templates/.claude/skills/testing-anti-patterns/SKILL.md +1 -10
- package/templates/.claude/skills/testing-anti-patterns/reference-tables.md +14 -0
- package/templates/.claude/skills/verification-before-completion/SKILL.md +1 -31
- package/templates/.claude/skills/verification-before-completion/key-patterns.md +33 -0
- package/templates/.claude/ukit/runtime/compact-threshold.mjs +28 -0
- package/templates/.claude/ukit/runtime/reinject-context.mjs +14 -1
- package/templates/CLAUDE.md +4 -0
- package/templates/ukit/storage/config.json +4 -0
- package/src/core/memory/index.js +0 -2
- package/src/core/router/index.js +0 -2
- package/src/core/validation/index.js +0 -2
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
buildThresholdCompactPlan,
|
|
16
16
|
readCompactPressureState,
|
|
17
|
+
resetCompactPressureState,
|
|
18
|
+
writeCompactPressureState,
|
|
17
19
|
writeThresholdCompactPlan,
|
|
18
20
|
} from './compact-threshold.mjs';
|
|
19
21
|
|
|
@@ -62,6 +64,14 @@ async function main() {
|
|
|
62
64
|
const rawBodyLines = [...rawStaticLines, ...dynamicLines];
|
|
63
65
|
const bodyLines = [...staticLines, ...dynamicLines];
|
|
64
66
|
const pressureState = await readCompactPressureState(projectRoot, config);
|
|
67
|
+
|
|
68
|
+
// Reset the hard-cap tracker as early as possible: this hook fires on every real
|
|
69
|
+
// compaction, and it is the only signal that context actually shrank. It must happen
|
|
70
|
+
// before the promptCache early-return below, otherwise a cache hit would skip it and
|
|
71
|
+
// leave context-hardcap-gate.sh permanently tripped. Downstream writes
|
|
72
|
+
// (writeThresholdCompactPlan) re-read from disk, so they build on the zeroed state and
|
|
73
|
+
// keep their own stats increments intact.
|
|
74
|
+
await writeCompactPressureState(projectRoot, resetCompactPressureState(pressureState, config), config);
|
|
65
75
|
const anchorLines = dynamicLines.filter((line) => (
|
|
66
76
|
line.startsWith('- Recent routed lane:')
|
|
67
77
|
|| line.startsWith('- Current approach:')
|
|
@@ -93,7 +103,10 @@ async function main() {
|
|
|
93
103
|
activeSkills: Array.isArray(state?.activeSkills) ? state.activeSkills.map((item) => getActiveSkillPath(item)) : [],
|
|
94
104
|
bodyLines: thresholdPlan.active ? thresholdPlan.lines : bodyLines,
|
|
95
105
|
thresholdPhase: thresholdPlan.active ? thresholdPlan.phase : 'monitor',
|
|
96
|
-
|
|
106
|
+
// Only key on the token count when the threshold plan is active — that is the only case
|
|
107
|
+
// where it changes the rendered output. Keying on the live pressure value while inactive
|
|
108
|
+
// would miss the cache on every run, since the reset above zeroes it between runs.
|
|
109
|
+
estimatedTotalTokens: thresholdPlan.active ? thresholdPlan.estimatedTotalTokens : 0,
|
|
97
110
|
});
|
|
98
111
|
|
|
99
112
|
if (config.tokenPipeline?.promptCache) {
|
package/templates/CLAUDE.md
CHANGED
|
@@ -66,6 +66,10 @@ For clearly non-code specialist lanes (docs-only, status, task queue), skip the
|
|
|
66
66
|
- **Do not ask normal contributors to run internal helper commands**; run them yourself or tell them to rerun `ukit install`.
|
|
67
67
|
- Do not ask normal contributors to memorize `ukit doctor`, `ukit diff`, `ukit uninstall`, or `ukit index ...` unless they explicitly need maintainer/debug help.
|
|
68
68
|
|
|
69
|
+
## Skill Quality (maintainer-only)
|
|
70
|
+
|
|
71
|
+
- When editing a template skill/agent under `templates/.claude/`, read `.claude/skills/skill-quality/SKILL.md` before shipping the change.
|
|
72
|
+
|
|
69
73
|
## UKit v{{ukit.version}} Shared Runtime
|
|
70
74
|
|
|
71
75
|
- Shared runtime state lives in `.ukit/storage/`.
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"compact": {
|
|
10
10
|
"enabled": true,
|
|
11
11
|
"tokenThreshold": 50000,
|
|
12
|
+
"hardCapTokens": 220000,
|
|
13
|
+
"hardCapBlock": true,
|
|
12
14
|
"contextRotDetection": true,
|
|
13
15
|
"askBeforeDrop": true,
|
|
14
16
|
"codexContext": {
|
|
@@ -367,6 +369,8 @@
|
|
|
367
369
|
"compact": {
|
|
368
370
|
"enabled": "Bật/tắt toàn bộ helper compact của UKit.",
|
|
369
371
|
"tokenThreshold": "Ngưỡng token chung cho runtime compact dùng chung.",
|
|
372
|
+
"hardCapTokens": "Ngưỡng cứng tuyệt đối (mặc định 220000 token ước lượng). Chạm/vượt ngưỡng này thì context coi như quá dài — không phải gợi ý nữa, là bắt buộc.",
|
|
373
|
+
"hardCapBlock": "Nếu true, hook context-hardcap-gate chặn cứng Edit/Write/Bash (exit 2) khi vượt hardCapTokens, cho tới khi có compact thật (PreCompact) reset lại bộ đếm. Không có ngoại lệ.",
|
|
370
374
|
"contextRotDetection": "Phát hiện context quá dài/dễ mục để giữ lại state quan trọng trước khi AI nhớ sai.",
|
|
371
375
|
"askBeforeDrop": "Giữ thái độ thận trọng trước khi bỏ context quan trọng. Nếu rủi ro thì hand back cho main model.",
|
|
372
376
|
"agentContext": {
|
package/src/core/memory/index.js
DELETED
package/src/core/router/index.js
DELETED