@ngockhoale/ukit 2.7.13 → 2.8.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/manifests/documentation.yaml +11 -0
  3. package/manifests/platform.full.yaml +182 -0
  4. package/manifests/platform.user.yaml +53 -0
  5. package/package.json +3 -1
  6. package/src/cli/commands/diff.js +4 -2
  7. package/src/cli/commands/doctor.js +22 -1
  8. package/src/cli/commands/install.js +10 -0
  9. package/src/cli/commands/memory.js +142 -3
  10. package/src/cli/commands/playbook.js +53 -0
  11. package/src/cli/index.js +7 -0
  12. package/src/core/memory/recordStore.js +81 -0
  13. package/src/core/memory/storeV2.js +16 -52
  14. package/src/core/memory/userMemory.js +111 -0
  15. package/src/core/paths.js +1 -0
  16. package/src/core/runInstallPipeline.js +96 -3
  17. package/src/core/runtimeConfig.js +170 -5
  18. package/src/core/userPaths.js +21 -0
  19. package/src/core/userPlaybooks.js +185 -0
  20. package/src/index/taskRouting.js +422 -21
  21. package/src/index/verificationPlan.js +17 -0
  22. package/src/manifest/validateManifest.js +19 -0
  23. package/templates/.claude/config/providers.md +1 -3
  24. package/templates/.claude/skills/principle-attack-the-premise/SKILL.md +16 -0
  25. package/templates/.claude/skills/principle-boundary-discipline/SKILL.md +16 -0
  26. package/templates/.claude/skills/principle-encode-lessons-in-structure/SKILL.md +16 -0
  27. package/templates/.claude/skills/principle-fix-root-causes/SKILL.md +18 -0
  28. package/templates/.claude/skills/principle-foundational-thinking/SKILL.md +17 -0
  29. package/templates/.claude/skills/principle-guard-the-context-window/SKILL.md +16 -0
  30. package/templates/.claude/skills/principle-laziness-protocol/SKILL.md +17 -0
  31. package/templates/.claude/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +16 -0
  32. package/templates/.claude/skills/principle-minimize-reader-load/SKILL.md +17 -0
  33. package/templates/.claude/skills/principle-model-the-domain/SKILL.md +16 -0
  34. package/templates/.claude/skills/principle-never-block-on-the-human/SKILL.md +16 -0
  35. package/templates/.claude/skills/principle-prove-it-works/SKILL.md +18 -0
  36. package/templates/.claude/skills/principle-sequence-verifiable-units/SKILL.md +16 -0
  37. package/templates/.claude/skills/principle-subtract-before-you-add/SKILL.md +16 -0
  38. package/templates/.claude/skills/principle-test-behavior-not-implementation/SKILL.md +18 -0
  39. package/templates/.claude/ukit/index/route-task.mjs +652 -28
  40. package/templates/.claude/ukit/runtime/execution-ledger.mjs +238 -9
  41. package/templates/ukit/README.md +31 -0
  42. package/templates/ukit/storage/config.json +10 -0
  43. package/templates/user/README.md +21 -0
  44. package/templates/user/playbooks/bug-fix.md +18 -0
  45. package/templates/user/playbooks/issue-implementation.md +14 -0
  46. package/templates/user/storage/config.json +16 -0
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: principle-fix-root-causes
3
+ description: Reproduce first; fix the mechanism, not the symptom. No nil-guards that silence crashes. Apply to every bug fix.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Fix Root Causes
8
+
9
+ **Why:** A guard that silences a crash hides the bug and moves the failure somewhere harder to find. Fixing the mechanism kills the whole class; fixing the symptom rents it.
10
+
11
+ - Reproduce the failure before touching code — no repro, no fix.
12
+ - Trace back to the original trigger, not the nearest crash site.
13
+ - Never add a nil-check, try/catch, or default that masks the mechanism.
14
+ - The smallest fix that kills the mechanism ships; belt-and-suspenders does not.
15
+
16
+ **Canonical workflow:** `root-cause-tracing` / `systematic-debugging` — this leaf is the trigger; those skills are the procedure.
17
+
18
+ **Test:** Removing the fix makes the original reproduction fail again — the fix addresses the cause, not a coincidence.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: principle-foundational-thinking
3
+ description: Pick core types and data structures before writing logic. Apply at the start of any non-trivial implementation or refactor.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Foundational Thinking
8
+
9
+ **Why:** Logic written before the data shape is chosen gets rewritten when the shape arrives. The structure is the program; the code is just its traversal.
10
+
11
+ - Name the data shape and its organizing structure before writing any logic.
12
+ - Choose types that make invalid states unrepresentable where the host language allows.
13
+ - Derive functions from the shape — if a function fights the structure, the structure is wrong.
14
+ - State the done condition as a checkable predicate before implementing.
15
+ - Reuse the established analog's shape unless you can name why it does not fit.
16
+
17
+ **Test:** Before the first function is written, you can say in one sentence what the core data looks like.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-guard-the-context-window
3
+ description: Push bulk work to subagents; keep summaries in the main thread. Apply when facing large reads, noisy logs, or multi-file exploration.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Guard the Context Window
8
+
9
+ **Why:** The main thread's context is the budget every decision draws from. Bulk reads and noisy output spent there are unavailable for reasoning — delegate the bulk, keep the summary.
10
+
11
+ - Send bulk exploration, wide searches, and noisy logs to subagents; receive only conclusions.
12
+ - Read sections, not whole files; search before opening.
13
+ - Keep the main thread for decisions, not data hauling.
14
+ - A subagent's job is to return compressed context, not a transcript.
15
+
16
+ **Test:** The main thread holds conclusions and file:line references, not raw dumps.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: principle-laziness-protocol
3
+ description: Bias toward deletion and the smallest change that solves the problem. Apply when refactoring, evaluating diff size, or tempted to add abstractions.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Laziness Protocol
8
+
9
+ **Why:** Every line added is a line that must be read, tested, and maintained forever. The cheapest correct change is the one that adds the least code — and the best change often removes code instead.
10
+
11
+ - Solve the stated problem with the smallest diff that satisfies it.
12
+ - Prefer deleting dead weight over adding a parallel structure.
13
+ - Refuse abstractions with one caller, options nobody asked for, and "might need it" hooks.
14
+ - When two fixes are possible, pick the one that shrinks the codebase.
15
+ - Scope creep is still creep when you wrote it yourself — do the task, not the adjacent task.
16
+
17
+ **Test:** If the diff is larger than the problem statement justifies, cut until it isn't.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-migrate-callers-then-delete-legacy-apis
3
+ description: Migrate every caller, then delete the old API in the same wave. Apply when renaming, replacing, or removing any shared interface.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Migrate Callers, Then Delete
8
+
9
+ **Why:** A new API beside the old one is two conventions, and the codebase keeps both forever. Clean cutover is the only cutover that finishes.
10
+
11
+ - Migrate every caller to the new interface before the change is considered done.
12
+ - Delete the old API, its shims, aliases, and re-exports in the same wave — not "later."
13
+ - No compatibility layers unless the user explicitly asked for a deprecation window.
14
+ - Search for callers by symbol and by string; dynamic references hide from both.
15
+
16
+ **Test:** After the change, the old name returns zero hits in a repo-wide search.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: principle-minimize-reader-load
3
+ description: Collapse one-caller wrappers and shrink mutable scope. Apply when structuring functions, naming, or scoping state.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Minimize Reader Load
8
+
9
+ **Why:** The reader's working memory is the scarcest resource in the codebase. Every indirection, wrapper, and wide mutable scope spends it on plumbing instead of meaning.
10
+
11
+ - Collapse wrappers that have exactly one caller and add no contract.
12
+ - Shrink mutable scope: const by default, narrowest lifetime, fewest places a value can change.
13
+ - Name things after what they are for, not how they are built.
14
+ - Keep related decisions adjacent; a reader should not jump three files to see one choice.
15
+ - Prefer boring, linear flow over clever control flow.
16
+
17
+ **Test:** A reader can explain what the code does after one pass, without opening callees.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-model-the-domain
3
+ description: Encode domain rules in structure rather than scattered conditionals. Apply when the same business rule appears in more than one place.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Model the Domain
8
+
9
+ **Why:** A rule expressed as scattered if-checks drifts: each copy is updated on a different schedule and they diverge silently. Structure cannot diverge — it is checked once, everywhere.
10
+
11
+ - Encode domain invariants in types, enums, and data structures, not in repeated conditionals.
12
+ - When the same predicate appears twice, the domain is asking for a named concept — create it.
13
+ - Push rules to the edges: validate once at the boundary, then trust the structure inside.
14
+ - Name domain concepts with domain vocabulary, not implementation vocabulary.
15
+
16
+ **Test:** Changing a domain rule touches one definition, not a grep across the codebase.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-never-block-on-the-human
3
+ description: Proceed, report, course-correct after. Apply whenever tempted to stop and ask instead of acting.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Never Block on the Human
8
+
9
+ **Why:** A stopped agent produces nothing; a proceeding agent produces something correctable. Most questions answer themselves with tools, repo context, or a cheap experiment.
10
+
11
+ - Ask only for: irreversible writes, a genuine preference call no experiment settles, or a real dead end.
12
+ - Everything else: do it, report it, course-correct on feedback.
13
+ - "I wasn't sure" is not a blocker — pick the informed default and state the assumption.
14
+ - A question you can answer with a tool call is a tool call, not a question.
15
+
16
+ **Test:** The turn ends with work done and assumptions stated, not with an unanswered question that tools could have resolved.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: principle-prove-it-works
3
+ description: Verify the real artifact, not a proxy, self-report, or "it compiles". Apply before claiming any work is done.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Prove It Works
8
+
9
+ **Why:** "It compiles" proves the syntax parses; self-report proves nothing. Only the real artifact exercised on the real surface demonstrates the change works.
10
+
11
+ - Run the actual thing: the command, the page, the endpoint — not a stand-in.
12
+ - For a bug fix, the original reproduction must now pass on the same surface.
13
+ - "Inconclusive" and wrong-surface verification are not passes.
14
+ - Evidence is observed output, not reasoning about output.
15
+
16
+ **Canonical workflow:** `verification-before-completion` — this leaf is the trigger; that skill is the procedure. Read it before claiming completion.
17
+
18
+ **Test:** The final report pastes the command and its real output, not a summary of what should have happened.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-sequence-verifiable-units
3
+ description: Break work into small units, each ending in a verifiable state. Apply when planning multi-step changes.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Sequence Verifiable Units
8
+
9
+ **Why:** A large unverified change fails as a whole and localizes nothing. Small units that each end green isolate failure to the last step and keep the work resumable.
10
+
11
+ - Order work so every unit ends in a state you can check.
12
+ - Verify each unit before starting the next — errors compound silently otherwise.
13
+ - Keep each unit independently revertable.
14
+ - The unit boundary is where evidence is collected, not where the todo item happens to end.
15
+
16
+ **Test:** At any point in the sequence, the last completed unit has concrete evidence it works.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: principle-subtract-before-you-add
3
+ description: Remove dead weight before building on top of it. Apply before adding features, files, or abstractions to an existing area.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Subtract Before You Add
8
+
9
+ **Why:** New code built on top of dead code inherits its confusion and doubles the surface the next reader must map. Removal first makes the addition smaller and the review easier.
10
+
11
+ - Before adding, list what in the touched area is already dead, duplicated, or bypassed.
12
+ - Delete obsolete code, comments, aliases, and re-exports in the same wave as the change that obsoletes them.
13
+ - Never keep a deprecated path "just in case" — version control is the backup.
14
+ - If the addition replaces something, the something leaves in this diff, not a later one.
15
+
16
+ **Test:** The diff's deletion count is non-trivial whenever the change replaces an existing path.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: principle-test-behavior-not-implementation
3
+ description: Assert what consumers observe, not how the code is wired. Apply when writing or changing any test.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Test Behavior, Not Implementation
8
+
9
+ **Why:** Tests that assert internals break on every refactor and pass on every real bug. A test earns its place only if a plausible bug would fail it.
10
+
11
+ - Assert observable contract: output, state, errors — never wiring, field copies, or mock echoes.
12
+ - A test that passes when every imported function returns undefined is testing nothing.
13
+ - Never add test-only methods to production code to make a test easier.
14
+ - Delete tests that pin wording, defaults, or implementation details — do not re-pin them.
15
+
16
+ **Canonical workflow:** `testing-anti-patterns` — this leaf is the trigger; that skill is the procedure.
17
+
18
+ **Test:** If the test would still pass when every imported function returns `undefined`, rewrite the assertion or delete the test.