PromptKit

August 31, 2026 · View on GitHub

License: MIT CI DSH Plugin Node: >=22.6 Listed on dsh-plugin.org

English · 简体中文

Repository version: 0.2.1 (local release preparation; publishing has not been performed). Upgrade history and migration notes (Chinese) · Technical changelog

Turn a rough draft into a structured, executable prompt — in one click, inside DeepSeek Harness.

dsh plugin --profile web add dsh-promptkit

Write a draft, hit ✦ Enhance, and receive a structured prompt in the preview panel, then in the composer without sending it. PromptKit needs no separate API key: semantic enhancement reuses a model already configured in DSH. If the session has no model route, it reports that requirement. Local lightweight enhancement needs no model.

Why PromptKit

✦ One-click enhancement with diagnosis. Before rewriting, the plugin examines your draft on five dimensions (clarity · hidden premises · falsifiability · actionability · context fit) and shows the verdict. The rewrite is driven by the diagnosis — undefined terms get defined, assumptions get flagged, vague requirements become testable ones.

🎯 21 thinking methods, applied on signal match. A built-in library of complete Markdown methods (Socratic questioning, first principles, steel-man, minimal experiments…). Smart recommendation applies a method only when the draft hits clear task signals; otherwise the draft stays a light local cleanup rather than being forced into a template — or browse the full library in the Method Studio.

📚 A vault that closes the loop. Diagnosis findings (hidden premises, unfalsifiable requirements) can be saved as "to-verify" assumption cards. Verify them later; checked-in cards feed future enhancements as context. Your prompt quality compounds.

🔌 Zero telemetry, with a zero-token option. Local lightweight enhancement works offline. Semantic enhancement sends the draft and selected context to the host's configured model service. Optional project-memory searches make requests when that feature is used; @ file references come from the native DSH mention menu and are not reimplemented by the plugin.

Compatibility: verified by a real DSH 0.1.2-alpha.2 profile boot after installing the local bundle; CI runs the same alpha-channel smoke test. Running the DSH plugin requires Node >=22.6. The older 0.1.0-rc slot adapter is covered by simulated contract tests; this does not establish real-instance compatibility for every older release.

More capabilities (click to expand)
  • PromptStudio — the advanced workspace: browse 21 methods, fill in facts/constraints, compose and preview a structured prompt before sending.
  • PromptKit Vault — local library for drafts and finished prompts: search, favorites, project grouping, derivation with version diff, JSON backup/restore.
  • Streaming output — enhancement results stream segment-by-segment into a preview panel with phase hints (waiting → diagnosing → writing), a live elapsed-time badge, and a cancel button.
  • Strength levels — low (polish) / mid (standard) / high (expand ~3x) length budgets.
  • Auto-enhance before send — available when a custom host provides onSubmitDraft and composer.isInputTarget(). Intercepts only the composer's plain Enter; enhancement failure may send the original once, but send failure is never retried. Cancellation or a changed draft prevents sending. The standalone DSH plugin does not wire this send hook by default.
  • Skill-mention preservation — lost /tdd-style tokens are restored automatically. Dismissing the notice does not rewrite the draft again.
  • /pk quick insert — type /pk keywords for a compact vault candidate menu (arrow keys + Enter), never touching DSH-native commands.
  • Private methods — paste Obsidian-style Markdown prompt cards; stored locally only, exportable as JSON.
  • Template variables{{name}} placeholders in vault items prompt a fill-in panel before insertion.

The enhancement loop

write a rough draft


✦ Enhance ──► five-dimension diagnosis ──► model rewrite (streaming)
      │                                            │
      │                                            ▼
      │                            findings auto-staged in the Knowledge tab
      │                                            │
      │                              you decide: save as assumption card
      │                                            │
      └──────────────► verified cards feed future enhancements ◄┘

Installation

npm (recommended)

dsh plugin --profile web add dsh-promptkit

GitHub (pin a commit for reproducible installs)

dsh plugin --profile web add github:fsrmqi/dsh-promptkit#<commit-sha>

Build artifacts are committed to Git — GitHub installs work out of the box without building.

tarball (offline / audit)

npm pack && dsh plugin --profile web add ./dsh-promptkit-0.2.1.tgz

After installing, refresh the browser. You'll find ✦ Enhance beside the composer and Advanced Method Studio as a conversation tab. Node-side changes also require the host to reload the plugin or restart DSH; refreshing the page alone may keep cached server code. Registry installs select a published version; use a tarball to test this checkout. See the upgrade steps. In the standalone DSH plugin, "Studio →" from the enhancer prefills the draft into the studio and switches to that conversation tab automatically.

Interface

The plugin uses one stable, full configuration interface: mode selection, conversation/memory context, strength, method switching, and the optional five-dimension diagnosis are always available. A toolbar centralizes draft saving, vault access, studio hand-off, and method-collection progress. ⌘K opens the panel; common methods are reachable from the launcher's fan-out menu.

Using it as an npm library

The core depends on zero hosts. Four decoupled interfaces; hosts swap implementations via the contract:

InterfaceResponsibilityDefault
MethodProviderMethod source / composition / templates / historyStaticMethodProvider (21 built-ins + private methods)
ComposerRead/write a target input boxTextareaComposer
EnhancerSemantic model callOpenAIEnhancer (any OpenAI-compatible endpoint)
AssetProviderVault save / search / backupStaticAssetProvider
import { PromptStudio, QuickEnhancer, StaticMethodProvider, StaticAssetProvider, TextareaComposer } from 'dsh-promptkit/browser'

const methodProvider = new StaticMethodProvider()
const assetProvider = new StaticAssetProvider()
const composer = new TextareaComposer(document.querySelector('textarea'))

<QuickEnhancer methodProvider={methodProvider} assetProvider={assetProvider} composer={composer} messages={messages} />

Missing optional capabilities are hidden or degraded. Bundlers supporting the browser condition can also import the root package; its default Node entry additionally exports DSH registration. Runtime requirements are Node >=22.6 / React 17+; source development and tests use Node 24.15+. See the embed contract and verified upgrade combinations.

Embedding in other hosts (Embed Protocol v1)

Any React host can compose PromptKit's components via the standard artifact ui/embed.js: an IIFE that only exposes the PromptKit namespace, with the pk-* visual namespace isolated from host themes. Contract locked by tests. See docs/EMBED.md.

Privacy

AccessPurposeCan disable
localStorageVault, diagnosis inbox, favorites, history, preferences, onboarding progress (still recorded but no longer drives interface switching), optional detailed statisticsDetailed statistics default off; back up assets before clearing browser data
Target input boxButtons or shortcuts apply results; custom hosts can explicitly wire automatic sendingWithout a send hook, only the draft is changed; asynchronous writes check for newer edits
Local plugin requestsSemantic bridge, optional project-memory searchTriggered by the corresponding feature
Configured model endpointProcesses semantic drafts and selected contextUse lightweight mode to avoid model calls

Zero telemetry. Usage statistics are not uploaded. Semantic enhancement is not offline: the configured model service may be external, so review drafts and selected context for sensitive information. Project-memory and custom-adapter data handling depends on the host implementation.

Contributing

Issues and PRs welcome — see CONTRIBUTING.md. To add a thinking method, drop a Markdown file under methods/ (frontmatter + a ## Prompt block) and run npm run build.

License

MIT