@korallis/k-pi 0.1.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/CHANGELOG.md +5619 -0
- package/LICENSE +21 -0
- package/NOTICE +66 -0
- package/README.md +723 -0
- package/dist/bundle/chunks/anthropic-messages-IBCPCIJO.js +45 -0
- package/dist/bundle/chunks/anthropic.js +75 -0
- package/dist/bundle/chunks/azure-openai-responses-GUUG57CZ.js +2 -0
- package/dist/bundle/chunks/bedrock-converse-stream.js +74 -0
- package/dist/bundle/chunks/chunk-4L3WN2XY.js +2 -0
- package/dist/bundle/chunks/chunk-6CYCI3EJ.js +12 -0
- package/dist/bundle/chunks/chunk-6R7UI4IY.js +2 -0
- package/dist/bundle/chunks/chunk-AXIIZGTV.js +2 -0
- package/dist/bundle/chunks/chunk-CO7LIZG5.js +2 -0
- package/dist/bundle/chunks/chunk-DRQDKNXA.js +2 -0
- package/dist/bundle/chunks/chunk-GMWCTUPB.js +2 -0
- package/dist/bundle/chunks/chunk-HOFU6X66.js +50 -0
- package/dist/bundle/chunks/chunk-JUUC5AZY.js +2 -0
- package/dist/bundle/chunks/chunk-L2ZPNLYD.js +2 -0
- package/dist/bundle/chunks/chunk-MNAIPA3J.js +2 -0
- package/dist/bundle/chunks/chunk-NBBFIJUL.js +11 -0
- package/dist/bundle/chunks/chunk-NUHFSC37.js +25 -0
- package/dist/bundle/chunks/chunk-PGXDEOVV.js +2 -0
- package/dist/bundle/chunks/chunk-PJACZCIR.js +2 -0
- package/dist/bundle/chunks/chunk-PRRNXB7S.js +2 -0
- package/dist/bundle/chunks/chunk-TEPMHNKQ.js +2 -0
- package/dist/bundle/chunks/chunk-TRDNDS6A.js +4 -0
- package/dist/bundle/chunks/chunk-UAQELI3K.js +2 -0
- package/dist/bundle/chunks/chunk-X5QHCKY4.js +1653 -0
- package/dist/bundle/chunks/chunk-XDUWOHPL.js +6 -0
- package/dist/bundle/chunks/github-copilot.js +2 -0
- package/dist/bundle/chunks/google-generative-ai-YRXF7C4I.js +2 -0
- package/dist/bundle/chunks/google-vertex-BVZ6VBRQ.js +2 -0
- package/dist/bundle/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/dist/bundle/chunks/image-resize-worker.js +2 -0
- package/dist/bundle/chunks/kimi-coding.js +2 -0
- package/dist/bundle/chunks/lib-HGQMNYVT.js +9 -0
- package/dist/bundle/chunks/mistral-conversations-Q3AWZJAZ.js +5 -0
- package/dist/bundle/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/dist/bundle/chunks/openai-codex-responses-GJVBJXLB.js +8 -0
- package/dist/bundle/chunks/openai-codex.js +75 -0
- package/dist/bundle/chunks/openai-completions-OICQQ5JB.js +7 -0
- package/dist/bundle/chunks/openai-responses-P5LIZTXX.js +2 -0
- package/dist/bundle/chunks/openrouter-images-XTKS2AS3.js +2 -0
- package/dist/bundle/chunks/openrouter.js +75 -0
- package/dist/bundle/chunks/pi-messages-TPFH44NP.js +8 -0
- package/dist/bundle/chunks/radius.js +75 -0
- package/dist/bundle/chunks/src-UK77SYZE.js +4 -0
- package/dist/bundle/chunks/xai.js +2 -0
- package/dist/bundle/cli.js +3 -0
- package/dist/bundle/client.js +2 -0
- package/dist/bundle/index.js +2 -0
- package/dist/bundle/rpc-entry.js +3 -0
- package/dist/core/export-html/template.css +1066 -0
- package/dist/core/export-html/template.html +55 -0
- package/dist/core/export-html/template.js +1864 -0
- package/dist/core/export-html/vendor/highlight.min.js +1213 -0
- package/dist/core/export-html/vendor/marked.min.js +78 -0
- package/dist/kpi/graphs/coding-loop.auto.json +377 -0
- package/dist/kpi/graphs/coding-loop.gated.json +417 -0
- package/dist/kpi/graphs/spec-first.json +40 -0
- package/dist/kpi/kstack/NOTICE +5 -0
- package/dist/kpi/kstack/UPSTREAM.md +23 -0
- package/dist/kpi/kstack/generated/LICENSE +21 -0
- package/dist/kpi/kstack/generated/skills/architect/SKILL.md +83 -0
- package/dist/kpi/kstack/generated/skills/architect/references/design-red-flags.md +33 -0
- package/dist/kpi/kstack/generated/skills/architect/references/rationale-template.md +35 -0
- package/dist/kpi/kstack/generated/skills/architect/references/runner-prompt.md +20 -0
- package/dist/kpi/kstack/generated/skills/arena/SKILL.md +29 -0
- package/dist/kpi/kstack/generated/skills/blast-radius/SKILL.md +50 -0
- package/dist/kpi/kstack/generated/skills/bro/SKILL.md +7 -0
- package/dist/kpi/kstack/generated/skills/create-verification-skill/SKILL.md +44 -0
- package/dist/kpi/kstack/generated/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/dist/kpi/kstack/generated/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/dist/kpi/kstack/generated/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/dist/kpi/kstack/generated/skills/figure-it-out/SKILL.md +55 -0
- package/dist/kpi/kstack/generated/skills/how/SKILL.md +135 -0
- package/dist/kpi/kstack/generated/skills/how/references/critic-prompt.md +59 -0
- package/dist/kpi/kstack/generated/skills/how/references/critique-rubric.md +58 -0
- package/dist/kpi/kstack/generated/skills/how/references/explainer-prompt.md +55 -0
- package/dist/kpi/kstack/generated/skills/how/references/explorer-prompt.md +52 -0
- package/dist/kpi/kstack/generated/skills/interrogate/SKILL.md +113 -0
- package/dist/kpi/kstack/generated/skills/interrogate/references/code-quality-review.md +47 -0
- package/dist/kpi/kstack/generated/skills/interrogate/references/lead-judgment.md +58 -0
- package/dist/kpi/kstack/generated/skills/interrogate/references/reviewer-prompt.md +72 -0
- package/dist/kpi/kstack/generated/skills/interrogate/references/rubric.md +77 -0
- package/dist/kpi/kstack/generated/skills/k-agent/SKILL.md +17 -0
- package/dist/kpi/kstack/generated/skills/k-mode/SKILL.md +64 -0
- package/dist/kpi/kstack/generated/skills/k-stack-principles/SKILL.md +24 -0
- package/dist/kpi/kstack/generated/skills/maintain-verification-skill/SKILL.md +39 -0
- package/dist/kpi/kstack/generated/skills/no-comments/SKILL.md +24 -0
- package/dist/kpi/kstack/generated/skills/playbook-arena/SKILL.md +20 -0
- package/dist/kpi/kstack/generated/skills/playbook-autonomous-run/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/playbook-autopilot-full/SKILL.md +20 -0
- package/dist/kpi/kstack/generated/skills/playbook-autopilot-stack/SKILL.md +20 -0
- package/dist/kpi/kstack/generated/skills/playbook-bug-fix/SKILL.md +21 -0
- package/dist/kpi/kstack/generated/skills/playbook-feature/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/playbook-investigation/SKILL.md +21 -0
- package/dist/kpi/kstack/generated/skills/playbook-shipping/SKILL.md +18 -0
- package/dist/kpi/kstack/generated/skills/playbook-swarm/SKILL.md +20 -0
- package/dist/kpi/kstack/generated/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/dist/kpi/kstack/generated/skills/principle-build-the-lever/SKILL.md +23 -0
- package/dist/kpi/kstack/generated/skills/principle-encode-lessons-in-structure/SKILL.md +31 -0
- package/dist/kpi/kstack/generated/skills/principle-exhaust-the-design-space/SKILL.md +21 -0
- package/dist/kpi/kstack/generated/skills/principle-experience-first/SKILL.md +19 -0
- package/dist/kpi/kstack/generated/skills/principle-fix-root-causes/SKILL.md +23 -0
- package/dist/kpi/kstack/generated/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/dist/kpi/kstack/generated/skills/principle-guard-the-context-window/SKILL.md +17 -0
- package/dist/kpi/kstack/generated/skills/principle-laziness-protocol/SKILL.md +18 -0
- package/dist/kpi/kstack/generated/skills/principle-make-operations-idempotent/SKILL.md +24 -0
- package/dist/kpi/kstack/generated/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/principle-minimize-reader-load/SKILL.md +23 -0
- package/dist/kpi/kstack/generated/skills/principle-model-the-domain/SKILL.md +26 -0
- package/dist/kpi/kstack/generated/skills/principle-never-block-on-the-human/SKILL.md +23 -0
- package/dist/kpi/kstack/generated/skills/principle-outcome-oriented-execution/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/principle-prove-it-works/SKILL.md +33 -0
- package/dist/kpi/kstack/generated/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/dist/kpi/kstack/generated/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/dist/kpi/kstack/generated/skills/principle-sequence-verifiable-units/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/principle-subtract-before-you-add/SKILL.md +22 -0
- package/dist/kpi/kstack/generated/skills/principle-type-system-discipline/SKILL.md +31 -0
- package/dist/kpi/kstack/generated/skills/recall/SKILL.md +35 -0
- package/dist/kpi/kstack/generated/skills/reflect/SKILL.md +77 -0
- package/dist/kpi/kstack/generated/skills/reflect/references/divergent-reviewer.md +43 -0
- package/dist/kpi/kstack/generated/skills/reflect/references/judgment-reviewer.md +42 -0
- package/dist/kpi/kstack/generated/skills/reflect/references/synthesizer.md +56 -0
- package/dist/kpi/kstack/generated/skills/reflect/references/tooling-reviewer.md +57 -0
- package/dist/kpi/kstack/generated/skills/setup-kstack/SKILL.md +48 -0
- package/dist/kpi/kstack/generated/skills/show-me-your-work/SKILL.md +82 -0
- package/dist/kpi/kstack/generated/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/dist/kpi/kstack/generated/skills/show-me-your-work/scripts/log.sh +40 -0
- package/dist/kpi/kstack/generated/skills/swarm/SKILL.md +27 -0
- package/dist/kpi/kstack/generated/skills/tdd/SKILL.md +44 -0
- package/dist/kpi/kstack/generated/skills/teach/SKILL.md +21 -0
- package/dist/kpi/kstack/generated/skills/technical-writing/SKILL.md +130 -0
- package/dist/kpi/kstack/generated/skills/typescript-best-practices/SKILL.md +30 -0
- package/dist/kpi/kstack/generated/skills/typescript-best-practices/references/patterns.md +313 -0
- package/dist/kpi/kstack/generated/skills/unslop/SKILL.md +81 -0
- package/dist/kpi/kstack/generated/skills/why/SKILL.md +230 -0
- package/dist/kpi/kstack/generated/skills/why/references/epistemics.md +144 -0
- package/dist/kpi/kstack/generated/skills/why/references/investigator-prompt.md +103 -0
- package/dist/kpi/kstack/generated/skills/why/references/source-playbook.md +17 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/code-archaeology.md +88 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/databricks.md +70 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/datadog.md +99 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/incident-postmortem.md +15 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/linear.md +48 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/notion.md +55 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/sentry.md +100 -0
- package/dist/kpi/kstack/generated/skills/why/references/sources/slack.md +54 -0
- package/dist/kpi/kstack/generated/skills/why/references/synthesizer-prompt.md +135 -0
- package/dist/kpi/kstack/model-ladder.md +50 -0
- package/dist/kpi/kstack/provenance.json +17 -0
- package/dist/kpi/prompts/implement.md +6 -0
- package/dist/kpi/prompts/plan.md +6 -0
- package/dist/kpi/prompts/review.md +6 -0
- package/dist/kpi/prompts/ship.md +6 -0
- package/dist/kpi/prompts/specify.md +6 -0
- package/dist/kpi/prompts/verify.md +6 -0
- package/dist/kpi/schemas/event.schema.json +1314 -0
- package/dist/kpi/schemas/evidence.schema.json +43 -0
- package/dist/kpi/schemas/stack.schema.json +102 -0
- package/dist/kpi/schemas/task.schema.json +165 -0
- package/dist/kpi/schemas/verdict.schema.json +44 -0
- package/dist/kpi/skills/concise-output/SKILL.md +10 -0
- package/dist/kpi/skills/context-pack/SKILL.md +10 -0
- package/dist/kpi/skills/conventional-commit/SKILL.md +12 -0
- package/dist/kpi/skills/isolated-review/SKILL.md +10 -0
- package/dist/kpi/skills/kg-claim/SKILL.md +26 -0
- package/dist/kpi/skills/minimalist/SKILL.md +24 -0
- package/dist/kpi/skills/quality-gates/SKILL.md +10 -0
- package/dist/kpi/skills/spec-first/SKILL.md +10 -0
- package/dist/kpi/skills/tdd-cycle/SKILL.md +10 -0
- package/dist/kpi/templates/AGENTS.md +31 -0
- package/dist/kpi/templates/APPEND_SYSTEM.md +13 -0
- package/dist/kpi/templates/context-pack/product.md +7 -0
- package/dist/kpi/templates/context-pack/structure.md +7 -0
- package/dist/kpi/templates/context-pack/tech.md +9 -0
- package/dist/kpi/templates/policy.json +17 -0
- package/dist/kpi/themes/loop-amber.json +82 -0
- package/dist/kpi/themes/protocol-blue.json +82 -0
- package/dist/modes/interactive/assets/clankolas.png +0 -0
- package/dist/modes/interactive/theme/dark.json +90 -0
- package/dist/modes/interactive/theme/light.json +89 -0
- package/dist/modes/interactive/theme/theme-schema.json +352 -0
- package/docs/compaction.md +418 -0
- package/docs/containerization.md +111 -0
- package/docs/custom-provider.md +777 -0
- package/docs/development.md +71 -0
- package/docs/docs.json +156 -0
- package/docs/environment-variables.md +97 -0
- package/docs/extensions.md +3020 -0
- package/docs/images/doom-extension.png +0 -0
- package/docs/images/exy.png +0 -0
- package/docs/images/interactive-mode.png +0 -0
- package/docs/images/tree-view.png +0 -0
- package/docs/index.md +84 -0
- package/docs/json.md +98 -0
- package/docs/keybindings.md +236 -0
- package/docs/llama-cpp.md +101 -0
- package/docs/models.md +571 -0
- package/docs/packages.md +228 -0
- package/docs/prompt-templates.md +96 -0
- package/docs/providers.md +317 -0
- package/docs/quickstart.md +167 -0
- package/docs/rpc.md +1618 -0
- package/docs/sdk.md +1219 -0
- package/docs/security.md +59 -0
- package/docs/session-format.md +438 -0
- package/docs/sessions.md +145 -0
- package/docs/settings.md +369 -0
- package/docs/shell-aliases.md +13 -0
- package/docs/skills.md +232 -0
- package/docs/terminal-setup.md +177 -0
- package/docs/termux.md +127 -0
- package/docs/themes.md +320 -0
- package/docs/tmux.md +63 -0
- package/docs/tui.md +942 -0
- package/docs/usage.md +311 -0
- package/docs/windows.md +39 -0
- package/examples/README.md +25 -0
- package/examples/extensions/README.md +213 -0
- package/examples/extensions/auto-commit-on-exit.ts +49 -0
- package/examples/extensions/bash-spawn-hook.ts +30 -0
- package/examples/extensions/bookmark.ts +50 -0
- package/examples/extensions/border-status-editor.ts +150 -0
- package/examples/extensions/built-in-tool-renderer.ts +249 -0
- package/examples/extensions/claude-rules.ts +86 -0
- package/examples/extensions/commands.ts +72 -0
- package/examples/extensions/confirm-destructive.ts +59 -0
- package/examples/extensions/custom-compaction.ts +117 -0
- package/examples/extensions/custom-footer.ts +64 -0
- package/examples/extensions/custom-header.ts +73 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +611 -0
- package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
- package/examples/extensions/custom-provider-anthropic/package.json +19 -0
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +405 -0
- package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +82 -0
- package/examples/extensions/dirty-repo-guard.ts +56 -0
- package/examples/extensions/doom-overlay/README.md +46 -0
- package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +152 -0
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +132 -0
- package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
- package/examples/extensions/doom-overlay/doom-keys.ts +104 -0
- package/examples/extensions/doom-overlay/index.ts +74 -0
- package/examples/extensions/doom-overlay/wad-finder.ts +55 -0
- package/examples/extensions/dynamic-resources/SKILL.md +8 -0
- package/examples/extensions/dynamic-resources/dynamic.json +79 -0
- package/examples/extensions/dynamic-resources/dynamic.md +5 -0
- package/examples/extensions/dynamic-resources/index.ts +15 -0
- package/examples/extensions/dynamic-tools.ts +74 -0
- package/examples/extensions/entry-renderer.ts +41 -0
- package/examples/extensions/event-bus.ts +43 -0
- package/examples/extensions/file-trigger.ts +41 -0
- package/examples/extensions/git-checkpoint.ts +53 -0
- package/examples/extensions/git-merge-and-resolve.ts +115 -0
- package/examples/extensions/github-issue-autocomplete.ts +185 -0
- package/examples/extensions/gondolin/index.ts +531 -0
- package/examples/extensions/gondolin/package-lock.json +185 -0
- package/examples/extensions/gondolin/package.json +19 -0
- package/examples/extensions/handoff.ts +190 -0
- package/examples/extensions/hello.ts +26 -0
- package/examples/extensions/hidden-thinking-label.ts +53 -0
- package/examples/extensions/inline-bash.ts +94 -0
- package/examples/extensions/input-transform-streaming.ts +39 -0
- package/examples/extensions/input-transform.ts +43 -0
- package/examples/extensions/interactive-shell.ts +196 -0
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/mac-system-theme.ts +47 -0
- package/examples/extensions/message-renderer.ts +59 -0
- package/examples/extensions/minimal-mode.ts +426 -0
- package/examples/extensions/modal-editor.ts +85 -0
- package/examples/extensions/model-status.ts +31 -0
- package/examples/extensions/notify.ts +57 -0
- package/examples/extensions/overlay-qa-tests.ts +1450 -0
- package/examples/extensions/overlay-test.ts +153 -0
- package/examples/extensions/permission-gate.ts +34 -0
- package/examples/extensions/pirate.ts +47 -0
- package/examples/extensions/plan-mode/README.md +66 -0
- package/examples/extensions/plan-mode/index.ts +390 -0
- package/examples/extensions/plan-mode/utils.ts +168 -0
- package/examples/extensions/preset.ts +436 -0
- package/examples/extensions/project-trust.ts +64 -0
- package/examples/extensions/prompt-customizer.ts +97 -0
- package/examples/extensions/protected-paths.ts +30 -0
- package/examples/extensions/provider-payload.ts +18 -0
- package/examples/extensions/qna.ts +118 -0
- package/examples/extensions/question.ts +286 -0
- package/examples/extensions/questionnaire.ts +448 -0
- package/examples/extensions/rainbow-editor.ts +88 -0
- package/examples/extensions/reload-runtime.ts +37 -0
- package/examples/extensions/rpc-demo.ts +118 -0
- package/examples/extensions/sandbox/index.ts +321 -0
- package/examples/extensions/sandbox/package-lock.json +92 -0
- package/examples/extensions/sandbox/package.json +19 -0
- package/examples/extensions/send-user-message.ts +97 -0
- package/examples/extensions/session-name.ts +27 -0
- package/examples/extensions/shutdown-command.ts +63 -0
- package/examples/extensions/snake.ts +343 -0
- package/examples/extensions/space-invaders.ts +560 -0
- package/examples/extensions/ssh.ts +220 -0
- package/examples/extensions/status-line.ts +32 -0
- package/examples/extensions/structured-output.ts +65 -0
- package/examples/extensions/subagent/README.md +177 -0
- package/examples/extensions/subagent/agents/planner.md +37 -0
- package/examples/extensions/subagent/agents/reviewer.md +35 -0
- package/examples/extensions/subagent/agents/scout.md +50 -0
- package/examples/extensions/subagent/agents/worker.md +24 -0
- package/examples/extensions/subagent/agents.ts +157 -0
- package/examples/extensions/subagent/index.ts +1038 -0
- package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/examples/extensions/subagent/prompts/implement.md +10 -0
- package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/examples/extensions/summarize.ts +199 -0
- package/examples/extensions/system-prompt-header.ts +17 -0
- package/examples/extensions/tic-tac-toe.ts +1008 -0
- package/examples/extensions/timed-confirm.ts +70 -0
- package/examples/extensions/titlebar-spinner.ts +58 -0
- package/examples/extensions/todo.ts +297 -0
- package/examples/extensions/tool-override.ts +144 -0
- package/examples/extensions/tools.ts +146 -0
- package/examples/extensions/trigger-compact.ts +50 -0
- package/examples/extensions/truncated-tool.ts +195 -0
- package/examples/extensions/widget-placement.ts +9 -0
- package/examples/extensions/with-deps/index.ts +32 -0
- package/examples/extensions/with-deps/package-lock.json +31 -0
- package/examples/extensions/with-deps/package.json +22 -0
- package/examples/extensions/working-indicator.ts +123 -0
- package/examples/extensions/working-message-test.ts +25 -0
- package/examples/rpc-extension-ui.ts +641 -0
- package/examples/sdk/01-minimal.ts +26 -0
- package/examples/sdk/02-custom-model.ts +49 -0
- package/examples/sdk/03-custom-prompt.ts +75 -0
- package/examples/sdk/04-skills.ts +55 -0
- package/examples/sdk/05-tools.ts +48 -0
- package/examples/sdk/06-extensions.ts +99 -0
- package/examples/sdk/07-context-files.ts +47 -0
- package/examples/sdk/08-prompt-templates.ts +51 -0
- package/examples/sdk/09-api-keys-and-oauth.ts +34 -0
- package/examples/sdk/10-settings.ts +53 -0
- package/examples/sdk/11-sessions.ts +52 -0
- package/examples/sdk/12-full-control.ts +74 -0
- package/examples/sdk/13-session-runtime.ts +67 -0
- package/examples/sdk/README.md +140 -0
- package/package.json +55 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: no-comments
|
|
3
|
+
description: "Spawn Comment Sicko, fix accepted findings, and offer encodings for claimed constraints."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# No comments
|
|
8
|
+
|
|
9
|
+
Spawn Comment Sicko. Act on accepted findings.
|
|
10
|
+
|
|
11
|
+
Authoring agents defend comments. Defer to Comment Sicko's fresh perspective.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
Use the caller's files or diff. Otherwise use the current diff against the base branch, default `main`, including the working tree.
|
|
16
|
+
|
|
17
|
+
## Steps
|
|
18
|
+
|
|
19
|
+
1. Spawn `spawn_background` with `role: "Comment Sicko"`. Pass the scope. Do not restate its rules.
|
|
20
|
+
2. Inspect its report and diff. Reject application-code edits, scope escapes, exception-protected deletions, misstated `MUST KILL` reasons, and flags that treat kept intentional code as guilty. Reshape flags on our-code surprises stay actionable. Do not restore those comments. A keep survives only with proof it is about something we cannot change. Audit missed scoped lint and TypeScript suppressions. Correctness or safety suppressions stay actionable `MUST KILL`s. Restore deletions only with exact exceptions and scoped proof. Before accepting thin `IMPORTANT` or `do not remove` kills or keeps, run `/how` or `/why` on their symbol. If a kill is ambiguous, do not restore. If a keep is refuted or still ambiguous, delete it. Revert and rerun one rejected report with the failure named. Reject a second, report it open, and fail `/no-comments`.
|
|
21
|
+
3. Fix trivial accepted flags directly by deleting a dead path, dropping a parameter, or using the real API. If any fix needs a shape, run `/architect` once for the accepted set and surrounding code. Stop at the sketch. Architect shapes. Step 4 implements.
|
|
22
|
+
4. Implement the smallest root-cause fix in scope. Remove every named workaround. If the root cause is out of scope, land the smallest in-scope fix and report the rest open. The **principle-fix-root-causes** and **principle-redesign-from-first-principles** skills guide intent only: fix real causes, redesign as if requirements always existed, never bolt on symptom guards. Neither authorizes widening the fence nor fixing instances outside it.
|
|
23
|
+
5. Constraint comments say `do not remove`, `do not change wording`, or `talk to X before changing`. Leave keeps about things we cannot change. Offer the cheapest in-scope type, runtime, test, or CI lint. Wait for interactive approval. Unattended and eval require caller pre-approval. If approved, encode then delete. Otherwise delete, report the constraint open, and sketch out-of-scope work.
|
|
24
|
+
6. Report the deletion count, restored comments, reruns, architect sketch, fixes, encoding offers, encodings, unenforced constraints, and other open work.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-arena
|
|
3
|
+
description: Compare two local K-π candidates for the same brief and graft the stronger one. Use for a bake-off, an arena run, or comparing two approaches.
|
|
4
|
+
playbook: arena
|
|
5
|
+
match: arena, bake-off, bakeoff, compare approaches, two attempts
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# arena playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **plan** Freeze one brief both workers receive unchanged.
|
|
17
|
+
- **implement** Call `spawn_background` for at most two arena workers on live configured K-π pools, and steer them with `communicate`.
|
|
18
|
+
- **test** Compare their `candidate.json` files against the frozen acceptance criteria.
|
|
19
|
+
- **review** Select or graft the smallest proven result.
|
|
20
|
+
- **ship** Hand the grafted result to the shipping gate. Never merge an origin branch.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-autonomous-run
|
|
3
|
+
description: Run executable acceptance criteria through local K-π autopilot. Use for autonomous, autopilot, or unattended runs.
|
|
4
|
+
playbook: autonomous-run
|
|
5
|
+
match: autonomous, autopilot, unattended, overnight
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# autonomous-run playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **specify** Refuse to start unless every required acceptance criterion is machine-executable.
|
|
17
|
+
- **plan** Plan one vertical slice and freeze the plan.
|
|
18
|
+
- **plan-check** Scaffold the slice before behaviour.
|
|
19
|
+
- **implement** Implement inside the declared write bounds and dependency bounds.
|
|
20
|
+
- **test** Run the gates. A failing gate ends the round; it does not lower the bar.
|
|
21
|
+
- **review** Obtain a fresh isolated verdict.
|
|
22
|
+
- **ship** Create one local commit and mark DONE. Never push or deploy.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-autopilot-full
|
|
3
|
+
description: Coordinate local K-π owners without remote merge authority. Use for a full autopilot coordination run across slices.
|
|
4
|
+
playbook: autopilot-full
|
|
5
|
+
match: autopilot-full, coordinate owners, full autopilot
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# autopilot-full playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **plan** Order the slices and name one owner per slice.
|
|
17
|
+
- **implement** Use at most two background K-π sessions and one writer. The parent reads contract files, not transcripts.
|
|
18
|
+
- **test** Run the gates for each slice before starting the next.
|
|
19
|
+
- **review** Obtain a verdict per slice.
|
|
20
|
+
- **ship** Finish with DONE and an optional local commit after release approval. Never push, deploy, or merge origin.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-autopilot-stack
|
|
3
|
+
description: Run linear local K-π slices without remote merge authority. Use for a stacked or sequential autopilot run.
|
|
4
|
+
playbook: autopilot-stack
|
|
5
|
+
match: autopilot-stack, stacked slices, linear slices
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# autopilot-stack playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **plan** Order the vertical slices in graph order.
|
|
17
|
+
- **implement** Run one slice at a time with at most two background sessions and one writer; hand off through contract files.
|
|
18
|
+
- **test** Run the gates for the current slice.
|
|
19
|
+
- **review** Obtain a verdict for the current slice.
|
|
20
|
+
- **ship** Finish with DONE and linear local commits only after release approval. Never push, deploy, or merge origin.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-bug-fix
|
|
3
|
+
description: Reproduce and repair one defect through the K-π gates. Use for a bug, a regression, broken behaviour, or a failing test.
|
|
4
|
+
playbook: bug-fix
|
|
5
|
+
match: bug, fix, broken, regression, defect, crash, fails
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# bug-fix playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **specify** Reproduce the reported defect and write the reproduction down as the acceptance criterion.
|
|
17
|
+
- **plan** Locate the root cause and state the regression contract the fix must hold.
|
|
18
|
+
- **implement** Implement the narrowest source fix. Never suppress the symptom.
|
|
19
|
+
- **test** Confirm the reproduction no longer triggers and the gates stay green.
|
|
20
|
+
- **review** Obtain a fresh isolated verdict.
|
|
21
|
+
- **ship** Create exactly one local Conventional Commit carrying the job marker.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-feature
|
|
3
|
+
description: Deliver one vertical feature slice through the K-π gates. Use for a new capability, a feature request, or adding behaviour to a module.
|
|
4
|
+
playbook: feature
|
|
5
|
+
match: feature, add, implement, build, support, introduce
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# feature playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **specify** Specify executable acceptance criteria and freeze them.
|
|
17
|
+
- **plan** Research the repository and current external practice, then plan one vertical Dune module.
|
|
18
|
+
- **plan-check** Scaffold the module folder, its public interface, and its test twin before behaviour.
|
|
19
|
+
- **implement** Implement the smallest change that satisfies the frozen criteria.
|
|
20
|
+
- **test** Run the declared quality gates and record their output as evidence.
|
|
21
|
+
- **review** Obtain a fresh isolated verdict against the frozen criteria.
|
|
22
|
+
- **ship** Create exactly one local Conventional Commit carrying the job marker.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-investigation
|
|
3
|
+
description: Produce evidence about a system without changing product code. Use to investigate, research, diagnose, or explain why something behaves as it does.
|
|
4
|
+
playbook: investigation
|
|
5
|
+
match: investigate, research, diagnose, why, explain, understand, audit
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# investigation playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **specify** State the question and the falsifiable hypotheses.
|
|
17
|
+
- **plan** Inspect repository sources and current authoritative references.
|
|
18
|
+
- **implement** Run one focused experiment. Write it under a scratch path, never into product code. `skip: an investigation changes no product code`
|
|
19
|
+
- **test** Record the experiment's output as evidence.
|
|
20
|
+
- **review** Write the conclusion and the evidence it rests on.
|
|
21
|
+
- **ship** Stop without shipping. `skip: an investigation produces evidence, not a commit`
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-shipping
|
|
3
|
+
description: Ship an already approved K-π candidate as one local commit. Use to ship, release, or land work whose verdict is already approved.
|
|
4
|
+
playbook: shipping
|
|
5
|
+
match: ship, release, land, cut a release
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# shipping playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **test** Verify the recorded evidence is fresh for the current HEAD.
|
|
17
|
+
- **review** Verify bounds held and that `verdict.approved` is true.
|
|
18
|
+
- **ship** Create exactly one Conventional Commit with the job marker, then mark DONE. Never push or deploy.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: playbook-swarm
|
|
3
|
+
description: Fan out at most two disjoint local K-π workers for coverage. Use for a swarm, a fan-out, or splitting independent slices.
|
|
4
|
+
playbook: swarm
|
|
5
|
+
match: swarm, fan out, fan-out, parallelize, split the work
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# swarm playbook
|
|
9
|
+
|
|
10
|
+
Every step below is a K-π graph node. The graph decides which node runs next; a
|
|
11
|
+
step never jumps ahead of its gate. A step carrying `skip:` is kept in the todo
|
|
12
|
+
list with its reason rather than deleted, so the record shows what was not done.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
- **plan** Split the request into at most two non-overlapping slices with no shared files.
|
|
17
|
+
- **implement** Call `spawn_background` for each local worker and steer with `communicate`, one writer at a time.
|
|
18
|
+
- **test** Read each worker's contract file. Never copy a worker transcript.
|
|
19
|
+
- **review** Aggregate the evidence and stop the workers.
|
|
20
|
+
- **ship** Hand the aggregate to the shipping gate.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-boundary-discipline
|
|
3
|
+
description: "Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Boundary Discipline
|
|
8
|
+
|
|
9
|
+
Place validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions; the shell is thin and mechanical.
|
|
10
|
+
|
|
11
|
+
**Why:** Scattered validation is noisy, redundant, and gives a false sense of safety. Validate data once at the boundary. Keep logic out of framework wiring so it can be tested without the framework.
|
|
12
|
+
|
|
13
|
+
**The pattern:**
|
|
14
|
+
- **At boundaries** (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.
|
|
15
|
+
- **Inside the system:** typed data, error propagation, no re-validation. Trust the types.
|
|
16
|
+
- **Across the boundary.** Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.
|
|
17
|
+
|
|
18
|
+
**Applications:**
|
|
19
|
+
|
|
20
|
+
Validation and error handling:
|
|
21
|
+
- Validate config at parse time (the boundary), not inside business logic
|
|
22
|
+
- Parse raw data into domain types at the boundary
|
|
23
|
+
- Do not re-export transport, storage, framework, or wire types through the public surface
|
|
24
|
+
- No redundant nil checks deep in call chains if the boundary already validated
|
|
25
|
+
|
|
26
|
+
Code organization:
|
|
27
|
+
- Business logic in pure functions with no framework dependencies
|
|
28
|
+
- Parse functions: pure transforms from raw bytes to typed state
|
|
29
|
+
- Prompt construction: structured state in, string out
|
|
30
|
+
- Scoring and assessment: pure transforms from state to results
|
|
31
|
+
|
|
32
|
+
**The tests:**
|
|
33
|
+
- "Is this data crossing a system boundary right now?" If not, validation is redundant.
|
|
34
|
+
- "Can this be a pure function that the shell just calls?" If yes, extract it.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-build-the-lever
|
|
3
|
+
description: "Apply to any non-trivial work, not just bulk work: edits, migrations, analyses, checks. Build the tool that does it or proves it (codemod, script, generator, or a skill your background K-π workers follow) instead of working by hand. The tool is the artifact a reviewer can rerun."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
# Build the Lever
|
|
7
|
+
|
|
8
|
+
When the work isn't trivial, build the tool that does it instead of doing it by hand.
|
|
9
|
+
|
|
10
|
+
**Why:** Two payoffs. Throughput: a codemod, generator, or script does the work the same way every time and reruns for free. Confidence: the tool is one artifact a reviewer can read and rerun to check the work. Hand-done changes can only be re-verified by redoing them. A deterministic script turns "trust me" into "run this".
|
|
11
|
+
|
|
12
|
+
**Pattern:** Default to building the lever. Skip it only when the task is genuinely trivial, a couple of obvious edits you can see at a glance.
|
|
13
|
+
|
|
14
|
+
- Do the first unit by hand to learn the recipe, then build the tool. Prove it by rerunning it on that unit and diffing against your hand-done version. Make the lever safe to rerun. A reviewer will.
|
|
15
|
+
- Codemod or script for edits, generator for repetitive files, a dump-to-sqlite query for analysis, a rerunnable check for verification.
|
|
16
|
+
- A deterministic lever beats fan-out. If the tool can process every unit in one pass, run it yourself; don't fan out delegates to hand-apply what a script can do.
|
|
17
|
+
- When you fan work out to background K-π workers, write the lever as a skill they all read: the recipe, the verification contract, and the do-not-touch fences in one artifact, so every delegate inherits the same hardened version instead of re-explaining it per prompt and watching each one drift. Keep it outside the delegates' write scope so they can't quietly edit the contract.
|
|
18
|
+
- Applying this principle produces a file. If you cited it and there is no codemod, script, generator, or delegate skill in the diff, you didn't apply it.
|
|
19
|
+
- Commit the lever when the work outlives the session, so the next run reruns it instead of redoing it.
|
|
20
|
+
|
|
21
|
+
**Balance:** The bar is triviality, not repetition. A one-off still earns a lever when the lever is what makes the work checkable. Per the [Laziness Protocol](../principle-laziness-protocol/SKILL.md), build the smallest script that does or proves the job, never a framework.
|
|
22
|
+
|
|
23
|
+
Distinct from [Encode Lessons in Structure](../principle-encode-lessons-in-structure/SKILL.md), which makes a recurring instruction a durable guardrail. This is throughput and reviewability on the work in front of you. For scripting the verification itself, see [Prove It Works](../principle-prove-it-works/SKILL.md).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-encode-lessons-in-structure
|
|
3
|
+
description: "Apply when you catch yourself writing the same instruction a second time, or notice a recurring correction. Encode the rule as a lint, metadata flag, runtime check, or script instead of more text."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Encode Lessons in Structure
|
|
8
|
+
|
|
9
|
+
Encode recurring fixes in mechanisms (tools, code, metadata, automation) instead of textual instructions. Every error, human correction, and unexpected outcome is a learning signal. Capture it, route it, and close the loop.
|
|
10
|
+
|
|
11
|
+
**Why:** Textual instructions are easy to miss. They require the reader to notice, remember, and comply. Structural mechanisms (lint rules, metadata flags, runtime checks, automation scripts) enforce the rule without cooperation.
|
|
12
|
+
|
|
13
|
+
**Pattern:**
|
|
14
|
+
When you catch yourself writing the same instruction a second time:
|
|
15
|
+
1. Ask: can this be a lint rule, a metadata flag, a runtime check, or a script?
|
|
16
|
+
2. If yes, encode it. Delete the instruction
|
|
17
|
+
3. If no (genuinely requires judgment), make the instruction more prominent and add an example of the failure mode
|
|
18
|
+
|
|
19
|
+
**Pick the strongest rung.** When more than one mechanism would work, choose the strongest the situation allows (an unrepresentable state that cannot compile, then a lint or banned API that fails CI, then a canonical helper, then a runtime check), because agents copy whatever the surrounding code already does and a weaker guard becomes the next template.
|
|
20
|
+
|
|
21
|
+
**Corollary:** Don't paper over symptoms. If the fix is structural, ONLY use the structural fix. The instruction IS the symptom.
|
|
22
|
+
|
|
23
|
+
**Feedback loop:**
|
|
24
|
+
- **Capture every correction.** When the human intervenes or tests fail, decide if it's a one-off or a pattern.
|
|
25
|
+
- **Route to the right layer.** One-off -> brain note. Recurring fix -> skill or lint rule. Systemic issue -> principle.
|
|
26
|
+
- **Close the loop.** Don't just record. Apply now or create a concrete todo.
|
|
27
|
+
|
|
28
|
+
**Anti-patterns:**
|
|
29
|
+
- Acknowledging without recording ("I'll keep that in mind" does not persist)
|
|
30
|
+
- Recording without routing (a brain note about a lint rule that should exist is wasted unless the lint rule gets implemented)
|
|
31
|
+
- Fixing without generalizing (fixing one instance while leaving the recurring pattern intact)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-exhaust-the-design-space
|
|
3
|
+
description: "Apply when facing a novel UI interaction or architectural decision with no precedent in the codebase. Build 2-3 competing prototypes and compare side by side before committing."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Exhaust the Design Space
|
|
8
|
+
|
|
9
|
+
When a novel interaction or architectural decision has no established precedent, explore several concrete alternatives before implementation. Building the wrong thing costs more than exploring three options.
|
|
10
|
+
|
|
11
|
+
**The rule.** When the right answer is not obvious, build 2-3 competing prototypes or sketches. Compare them side by side. Only then commit. Design it twice is this rule by another name. A second flavor of the first shape does not count.
|
|
12
|
+
|
|
13
|
+
**When it applies:**
|
|
14
|
+
- Novel UI interactions (no prior art in the codebase)
|
|
15
|
+
- Architectural choices with multiple viable approaches
|
|
16
|
+
- Product design decisions where user experience depends on feel, not logic
|
|
17
|
+
|
|
18
|
+
**When it doesn't:**
|
|
19
|
+
- Mechanical implementation where the pattern is established
|
|
20
|
+
- Bug fixes or refactors with a clear target state
|
|
21
|
+
- Changes where constraints dictate a single viable approach
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-experience-first
|
|
3
|
+
description: "Apply when product, UX, or feature-scope tradeoffs come up. Choose user delight over implementation convenience; ship fewer polished features over more rough ones."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Experience First
|
|
8
|
+
|
|
9
|
+
The product is the experience. Every technical decision either helps or hurts it. When implementation convenience conflicts with user delight, choose delight.
|
|
10
|
+
|
|
11
|
+
- Say no to 1,000 things (every feature, control, and option must earn its place)
|
|
12
|
+
- Ship less, ship better (polished experience with three features beats rough one with ten)
|
|
13
|
+
- Prototype before committing (design decisions are cheaper in throwaway HTML than production code)
|
|
14
|
+
- Sweat the details (transitions, alignment, spacing, feedback, error states)
|
|
15
|
+
- Tighten the core loop (every feature should serve the central workflow or get out of the way)
|
|
16
|
+
|
|
17
|
+
The user is whoever consumes the work. For a UI that is the end user. For a library or an internal API it is the colleague who imports it. The engineer who maintains the code next is a user too. Weigh their experience the same way, and explain impact from their seat.
|
|
18
|
+
|
|
19
|
+
Foundations should serve the experience, not the other way around. Foundational thinking governs the *sequence* of work; this principle governs the *target*.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-fix-root-causes
|
|
3
|
+
description: "Apply when debugging. Trace each symptom to its root cause and fix it there; reproduce first, ask why until you reach it, resist nil-check guards that silence crashes."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Fix Root Causes
|
|
8
|
+
|
|
9
|
+
When debugging, do not paper over symptoms. Trace every problem to its root cause and fix it there.
|
|
10
|
+
|
|
11
|
+
**Why:** Symptom fixes accumulate. Each workaround makes the system harder to reason about, and the real bug remains. Root-cause fixes are slower upfront but reduce total debugging time.
|
|
12
|
+
|
|
13
|
+
**Pattern:**
|
|
14
|
+
- Reproduce first (if you can't reproduce it, you can't verify your fix)
|
|
15
|
+
- Ask "why" until you hit the root cause
|
|
16
|
+
- Resist the urge to add guards (adding a nil check to silence a crash is a symptom fix)
|
|
17
|
+
- If a workaround needs a paragraph-long comment to justify it, the code is wrong (fix the code, not the comment)
|
|
18
|
+
- Check for the pattern, not just the instance (grep for the same pattern, fix all instances)
|
|
19
|
+
- When stuck, instrument. Don't guess (add logging, read the actual error)
|
|
20
|
+
|
|
21
|
+
**Restart bugs: suspect state before code**
|
|
22
|
+
|
|
23
|
+
Code doesn't change between runs. State does. When something "fails after restart," suspect stale persistent state first: config files, caches, lock files, serialized state. If clearing a state file restores behavior, prioritize state validation as the fix.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-foundational-thinking
|
|
3
|
+
description: "Apply before writing logic: choosing core types and data structures, sequencing scaffold-vs-feature work, asking what concurrent actors share. Get the data structures right so downstream code becomes obvious."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Foundational Thinking
|
|
8
|
+
|
|
9
|
+
**Structural decisions** protect option value. **Code-level decisions** protect simplicity. Over-engineering is often a premature decision that closes doors. The right foundational data structure keeps doors open.
|
|
10
|
+
|
|
11
|
+
**Data structures first.** Get the data shape right before writing logic. The right shape makes downstream code obvious. Define core types early, trace every access pattern, and choose structures that match the dominant paths. A data-structure change late is a rewrite. Early, it is often a one-line diff.
|
|
12
|
+
|
|
13
|
+
At code level, DRY the structure, not every line. Types and data models should converge. Three similar statements still beat a premature abstraction. Prefer explicit over clever. Test behavior and edge cases, not line counts.
|
|
14
|
+
|
|
15
|
+
**Concurrency corollary.** Before sharing state between actors, ask "what happens if another actor modifies this concurrently?" If not "nothing", isolate.
|
|
16
|
+
|
|
17
|
+
**Scaffold first.** If something helps every later phase, do it first. Ask "does every subsequent phase benefit from this existing?" CI, linting, test infrastructure, and shared types are scaffold. Sequence for option value: setup before features, tests before fixes. Keep commits small and single-purpose.
|
|
18
|
+
|
|
19
|
+
Each increment should land a coherent abstraction or deepen one that exists. Do not spread a new capability across callers as special-case coordination.
|
|
20
|
+
|
|
21
|
+
Subtraction comes before scaffolding: remove dead weight first, then lay foundations.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-guard-the-context-window
|
|
3
|
+
description: "Apply when context is filling up: large outputs, long files, repeated reads, fan-out planning. Route bulk to background K-π workers; keep summaries in the main thread, not raw payloads."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Guard the Context Window
|
|
8
|
+
|
|
9
|
+
The context window is finite and non-renewable within a session. Every token that enters should earn its place.
|
|
10
|
+
|
|
11
|
+
**Why:** Context overflow degrades reasoning quality, creates compression artifacts, and halts progress. Unlike compute or time, context spent inside a session cannot be reclaimed.
|
|
12
|
+
|
|
13
|
+
**Pattern:**
|
|
14
|
+
- **Isolate large payloads.** Route verbose outputs, screenshots, and large documents to background K-π workers. The main context gets summaries, not raw data.
|
|
15
|
+
- **Don't read what you won't use.** Read selectively based on relevance. If a file isn't needed for the current task, skip it.
|
|
16
|
+
- **Keep frequently used content inline.** Templates and references used on every invocation belong in the skill file, not in separate files that cost a read each time.
|
|
17
|
+
- **Size phases and cap scope.** Limit files per phase, set turn budgets, account for mechanism costs.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-laziness-protocol
|
|
3
|
+
description: "Apply when refactoring, evaluating diff size, or tempted to add abstractions, layers, or signal threading. Bias toward deletion and the smallest change that solves the problem."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Laziness Protocol
|
|
8
|
+
|
|
9
|
+
Writing code is cheap for you, which makes over-engineering easy. Counter it by borrowing a human maintainer's fatigue. Aim for the most result with the least code and complexity.
|
|
10
|
+
|
|
11
|
+
- **Prefer deletion.** When asked to refactor or improve, look for removals before additions.
|
|
12
|
+
- **Maintain a flat call hierarchy.** Avoid deep call chains. A rich interface that hides substantial work is not a deep call chain. If answering a question requires tracing through more than 3 files or layers, flatten it.
|
|
13
|
+
- **Consolidate decisions.** Do not repeat the same choice in several places. Put it behind one source of truth and pass the result as a simple flag.
|
|
14
|
+
- **Minimize the diff.** Make the smallest change that solves the problem. Fewer lines beat "elegant" boilerplate.
|
|
15
|
+
- **Question the threading.** If a task asks you to pass a new signal through types, schemas, pipelines, or similar layers, stop and look for a more direct path.
|
|
16
|
+
- **Sweat the small leaks.** Remove tiny pass-throughs, representation leaks, and duplicated choices before they spread. Small leaks compound into permanent coordination costs.
|
|
17
|
+
|
|
18
|
+
**Prime directive:** If a human developer would find the code exhausting to maintain, it is a bad solution. Be lazy. Stay simple.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-make-operations-idempotent
|
|
3
|
+
description: "Apply when designing commands, lifecycle steps, or processing loops that run amid crashes, restarts, and retries. Converge to the same end state regardless of partial prior runs."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Make Operations Idempotent
|
|
8
|
+
|
|
9
|
+
Design operations so they converge to the correct state regardless of how many times they run or where they start from. Every state-mutating operation should answer: "What happens if this runs twice? What happens if the previous run crashed halfway?"
|
|
10
|
+
|
|
11
|
+
**Why:** Commands, lifecycle operations, and processing loops run where crashes, restarts, and retries are normal. If partial state changes the next run's outcome, every restart becomes a debugging session.
|
|
12
|
+
|
|
13
|
+
**The pattern:**
|
|
14
|
+
- Convergent startup: scan for existing state, clean stale artifacts, adopt live sessions
|
|
15
|
+
- Content-based cleanup: compare by content equivalence, not creation order
|
|
16
|
+
- Self-healing locks: use PID-based stale lock detection
|
|
17
|
+
- Idempotent scheduling: failed work respawns cleanly, fresh input regenerated after each cycle
|
|
18
|
+
|
|
19
|
+
**The test:**
|
|
20
|
+
1. What happens if this runs twice in a row?
|
|
21
|
+
2. What happens if the previous run crashed at every possible point?
|
|
22
|
+
3. Does re-execution converge to the same end state?
|
|
23
|
+
|
|
24
|
+
If any answer is "it depends on what state was left behind," the operation needs a reconciliation step.
|
package/dist/kpi/kstack/generated/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-migrate-callers-then-delete-legacy-apis
|
|
3
|
+
description: "Apply when introducing a new internal API while old callers still exist. Migrate callers and delete the old API in the same wave instead of preserving compatibility layers."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Migrate Callers Then Delete Legacy APIs
|
|
8
|
+
|
|
9
|
+
When we decide a new API is the right design, migrate callers and remove the old API in the same refactor wave instead of preserving compatibility layers.
|
|
10
|
+
|
|
11
|
+
**Rule:**
|
|
12
|
+
- Do not keep legacy API paths alive only because internal callers still exist
|
|
13
|
+
- Inventory callers, migrate them, and delete the old API immediately
|
|
14
|
+
- Treat temporary adapters as exceptional and time-boxed, not default architecture
|
|
15
|
+
- Update tests to assert the new contract, and delete tests that only protect pre-refactor implementation details
|
|
16
|
+
|
|
17
|
+
**When this applies:**
|
|
18
|
+
- No external users depend on backward compatibility
|
|
19
|
+
- The project can absorb coordinated breaking changes
|
|
20
|
+
- The new API is part of a simplification or refactor initiative
|
|
21
|
+
|
|
22
|
+
Keeping both old and new APIs creates dual-path complexity, slows cleanup, and makes the codebase feel append-only.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-minimize-reader-load
|
|
3
|
+
description: "Apply when reviewing or shaping code that's hard to trace. Count layers between question and answer, and hidden state in the reader's head; collapse one-caller wrappers and shrink mutable scope."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Minimize Reader Load
|
|
8
|
+
|
|
9
|
+
Maintainability is the work a reader must do to understand code. Track two axes:
|
|
10
|
+
1. **Layers to trace.** How many indirections sit between the question and the answer.
|
|
11
|
+
2. **State to hold.** How much hidden or mutable context the reader must keep in their head.
|
|
12
|
+
|
|
13
|
+
**Why:** Code is read far more than it is written. LOC, cyclomatic complexity, and "clean architecture" are proxies. Reader load is the thing that matters. The two axes are independent. A flat file with 50 globals can be as hard to reason about as a 6-layer adapter stack. Guard both. This is the human analog of [Guard the Context Window](../principle-guard-the-context-window/SKILL.md): working memory is finite for readers too.
|
|
14
|
+
|
|
15
|
+
**The pattern:**
|
|
16
|
+
- **Collapse layers** that do not earn their keep: wrappers with one caller, adapters with no second implementation, indirection introduced for a future that never came. Inline them.
|
|
17
|
+
- **Make adjacent layers change the abstraction.** A layer that repeats the same methods and arguments adds reader load without compression. Collapse pass-through layers.
|
|
18
|
+
- **Demand interface compression.** A broad interface that hides little complexity makes readers learn both the surface and the implementation. Prefer boundaries that hide meaningful decisions.
|
|
19
|
+
- **Shrink state scope:** prefer pure functions (returns over mutations), locals over fields, fields over module state, and module state over globals. Derive instead of sync.
|
|
20
|
+
- **Name the invariant at the boundary,** not in every consumer, so the reader learns it once.
|
|
21
|
+
- Before adding a layer or a piece of state, ask: does this reduce reader load somewhere else by at least as much?
|
|
22
|
+
|
|
23
|
+
**The test:** Can a new reader answer "where does X come from?" and "what can change X?" in under 30 seconds? If not, cut layers or cut state.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-model-the-domain
|
|
3
|
+
description: "Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files. Encode the domain in a structure instead of scattered conditionals."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Model the Domain
|
|
8
|
+
|
|
9
|
+
Encode the real domain in a data structure instead of scattering it across conditionals.
|
|
10
|
+
|
|
11
|
+
**Why:** Scattered booleans, repeated shape assumptions, and branching spread across files are accidental complexity. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap; recovering it later reads as a refactor and gets deferred.
|
|
12
|
+
|
|
13
|
+
**Reach for structures like these:**
|
|
14
|
+
|
|
15
|
+
- A state machine instead of scattered booleans, phases, or lifecycle checks.
|
|
16
|
+
- A typed object/model instead of loose parameters or repeated shape assumptions.
|
|
17
|
+
- A map, registry, lookup table, or discriminated union instead of branching spread across files.
|
|
18
|
+
- A reducer or command/event model instead of ad hoc state mutations.
|
|
19
|
+
- A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.
|
|
20
|
+
- A small module boundary that gathers repeated behavior, ownership, or invariants.
|
|
21
|
+
- A queue, cache, index, graph/tree, or normalized collection where the data access pattern calls for it.
|
|
22
|
+
- Any other structure that fits. The list above covers the common cases only. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.
|
|
23
|
+
|
|
24
|
+
Do not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.
|
|
25
|
+
|
|
26
|
+
The tell that you skipped this is a new feature that grows an existing if/else chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another tell. Phase-named modules repeat the same domain rules across steps.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-never-block-on-the-human
|
|
3
|
+
description: "Apply when tempted to ask 'should I do X?' on reversible work. Proceed, present the result, let the human course-correct after the fact; reserve confirmation for irreversible actions."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Never Block on the Human
|
|
8
|
+
|
|
9
|
+
The human supervises asynchronously. Agents must stay unblocked: make reasonable decisions, proceed, and let the human course-correct after the fact. Code is cheap. Waiting is expensive.
|
|
10
|
+
|
|
11
|
+
**Why:** Every permission pause stalls the pipeline and makes the human the bottleneck. Since code changes are reversible and reviewable, a wrong decision usually costs less than blocking.
|
|
12
|
+
|
|
13
|
+
**Pattern:**
|
|
14
|
+
- **Proceed, then present.** Do the work, show the result. Don't ask "should I do X?" Do X, explain why.
|
|
15
|
+
- **Reserve questions for genuine ambiguity.** Ask only when you truly cannot infer intent from context.
|
|
16
|
+
- **Make the system self-healing.** When you notice a problem, log it and fix it in the next round.
|
|
17
|
+
- **Supervision is async.** The human reviews plans, diffs, and changes on their own schedule. Design workflows for review-after-the-fact.
|
|
18
|
+
- **Code is cheap, attention is scarce.** A wrong implementation costs minutes to fix. A blocked agent costs the human's attention to unblock.
|
|
19
|
+
|
|
20
|
+
**Boundaries:**
|
|
21
|
+
- **Irreversible actions** (force-push, delete production data, send external messages) still require confirmation.
|
|
22
|
+
- **Reversible actions** (write code, edit notes, split tasks) should proceed without blocking.
|
|
23
|
+
- **Product direction** comes from the human; *execution* should not block.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-outcome-oriented-execution
|
|
3
|
+
description: "Apply during planned rewrites and migrations with explicit phase boundaries. Converge on the target architecture; don't preserve smooth intermediate states with throwaway compatibility code."
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Outcome-Oriented Execution
|
|
8
|
+
|
|
9
|
+
Optimize for the intended, verifiable end state rather than preserving smooth intermediate states.
|
|
10
|
+
|
|
11
|
+
**Why:** Keeping every intermediate step fully stable often creates temporary compatibility code that becomes long-lived debt. Converge on the target architecture and prove correctness at explicit verification boundaries.
|
|
12
|
+
|
|
13
|
+
**Core rule:**
|
|
14
|
+
- Prioritize end-state integrity over transitional stability
|
|
15
|
+
- Intermediate breakage is acceptable when it is planned, scoped, and reversible
|
|
16
|
+
- Always run final verification before declaring done
|
|
17
|
+
|
|
18
|
+
**Guardrails:**
|
|
19
|
+
- Use this for planned rewrites and migrations with explicit phase boundaries
|
|
20
|
+
- Declare where temporary breakage is acceptable
|
|
21
|
+
- Keep high-signal checks for actively touched areas while migrating
|
|
22
|
+
- Require full static and runtime verification at plan completion
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: principle-prove-it-works
|
|
3
|
+
description: "Apply after completing a task, before declaring done. Verify against the real artifact (run the feature, read the actual value, inspect the diff), not a proxy, self-report, or 'it compiles.'"
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Prove It Works
|
|
8
|
+
|
|
9
|
+
Verify every task output by checking the real thing directly. Do not infer from proxies, self-reports, or "it compiles."
|
|
10
|
+
|
|
11
|
+
**Why:** Unverified work has unknown correctness. Indirect verification (file mtimes, output freshness, agent self-reports, cached screenshots) feels cheaper than direct observation. Acting on a wrong inference costs far more than checking the source.
|
|
12
|
+
|
|
13
|
+
**Pattern:** After completing any task, ask: "how do I prove this actually works?"
|
|
14
|
+
|
|
15
|
+
Check the real thing, not a proxy:
|
|
16
|
+
- Check process liveness directly, not indirectly through derived state
|
|
17
|
+
- Read the actual value, not a cached or derived representation
|
|
18
|
+
- When verification fails, suspect the observation method before suspecting the system
|
|
19
|
+
|
|
20
|
+
Code and features:
|
|
21
|
+
1. Build it (necessary but not sufficient)
|
|
22
|
+
2. Run it and exercise the actual feature path
|
|
23
|
+
3. Check the full chain: does data flow from input to output?
|
|
24
|
+
4. For integrations, test the full communication path end-to-end
|
|
25
|
+
|
|
26
|
+
Delegation: trust artifacts, not self-reports.
|
|
27
|
+
When verifying delegated work, inspect the actual output artifact (git diff, file contents, runtime behavior), not the delegate's summary. Agents report what they intended, not always what happened.
|
|
28
|
+
|
|
29
|
+
## Script the check when you can
|
|
30
|
+
|
|
31
|
+
The strongest proof is a deterministic script that re-runs the same comparison, not a one-time eyeball. Write the script, run it, and keep its output as an artifact a reviewer can re-run instead of trusting your word. A script comparing the old and new compiled output catches what a glance misses.
|
|
32
|
+
|
|
33
|
+
Keep the artifact visible for the human. Commit it only for large or complex work where the trail has to be auditable later, like a big port or migration (the **show-me-your-work** skill). Most work just needs it visible, not committed.
|