From 0668794a4d4b81cf9fe48204355aaea0ceee37ca Mon Sep 17 00:00:00 2001 From: Daniel Smolsky Date: Tue, 13 Jan 2026 02:52:54 -0500 Subject: [PATCH] refactor: flatten prompts directory structure Remove unnecessary user/ nesting from prompts directory. Files now live directly under system/ and nudge/ subdirectories. --- lib/hooks.ts | 6 +++--- lib/messages/inject.ts | 6 +++--- lib/prompts/{user => }/nudge/nudge-both.txt | 0 lib/prompts/{user => }/nudge/nudge-discard.txt | 0 lib/prompts/{user => }/nudge/nudge-extract.txt | 0 lib/prompts/{user => }/system/system-prompt-both.txt | 0 lib/prompts/{user => }/system/system-prompt-discard.txt | 0 lib/prompts/{user => }/system/system-prompt-extract.txt | 0 package.json | 2 +- 9 files changed, 7 insertions(+), 7 deletions(-) rename lib/prompts/{user => }/nudge/nudge-both.txt (100%) rename lib/prompts/{user => }/nudge/nudge-discard.txt (100%) rename lib/prompts/{user => }/nudge/nudge-extract.txt (100%) rename lib/prompts/{user => }/system/system-prompt-both.txt (100%) rename lib/prompts/{user => }/system/system-prompt-discard.txt (100%) rename lib/prompts/{user => }/system/system-prompt-extract.txt (100%) diff --git a/lib/hooks.ts b/lib/hooks.ts index e1583a5..fc5e479 100644 --- a/lib/hooks.ts +++ b/lib/hooks.ts @@ -34,11 +34,11 @@ export function createSystemPromptHandler( let promptName: string if (discardEnabled && extractEnabled) { - promptName = "user/system/system-prompt-both" + promptName = "system/system-prompt-both" } else if (discardEnabled) { - promptName = "user/system/system-prompt-discard" + promptName = "system/system-prompt-discard" } else if (extractEnabled) { - promptName = "user/system/system-prompt-extract" + promptName = "system/system-prompt-extract" } else { return } diff --git a/lib/messages/inject.ts b/lib/messages/inject.ts index 132e784..5048e18 100644 --- a/lib/messages/inject.ts +++ b/lib/messages/inject.ts @@ -17,11 +17,11 @@ const getNudgeString = (config: PluginConfig): string => { const extractEnabled = config.tools.extract.enabled if (discardEnabled && extractEnabled) { - return loadPrompt(`user/nudge/nudge-both`) + return loadPrompt(`nudge/nudge-both`) } else if (discardEnabled) { - return loadPrompt(`user/nudge/nudge-discard`) + return loadPrompt(`nudge/nudge-discard`) } else if (extractEnabled) { - return loadPrompt(`user/nudge/nudge-extract`) + return loadPrompt(`nudge/nudge-extract`) } return "" } diff --git a/lib/prompts/user/nudge/nudge-both.txt b/lib/prompts/nudge/nudge-both.txt similarity index 100% rename from lib/prompts/user/nudge/nudge-both.txt rename to lib/prompts/nudge/nudge-both.txt diff --git a/lib/prompts/user/nudge/nudge-discard.txt b/lib/prompts/nudge/nudge-discard.txt similarity index 100% rename from lib/prompts/user/nudge/nudge-discard.txt rename to lib/prompts/nudge/nudge-discard.txt diff --git a/lib/prompts/user/nudge/nudge-extract.txt b/lib/prompts/nudge/nudge-extract.txt similarity index 100% rename from lib/prompts/user/nudge/nudge-extract.txt rename to lib/prompts/nudge/nudge-extract.txt diff --git a/lib/prompts/user/system/system-prompt-both.txt b/lib/prompts/system/system-prompt-both.txt similarity index 100% rename from lib/prompts/user/system/system-prompt-both.txt rename to lib/prompts/system/system-prompt-both.txt diff --git a/lib/prompts/user/system/system-prompt-discard.txt b/lib/prompts/system/system-prompt-discard.txt similarity index 100% rename from lib/prompts/user/system/system-prompt-discard.txt rename to lib/prompts/system/system-prompt-discard.txt diff --git a/lib/prompts/user/system/system-prompt-extract.txt b/lib/prompts/system/system-prompt-extract.txt similarity index 100% rename from lib/prompts/user/system/system-prompt-extract.txt rename to lib/prompts/system/system-prompt-extract.txt diff --git a/package.json b/package.json index 2c9e86a..b047434 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "types": "./dist/index.d.ts", "scripts": { "clean": "rm -rf dist", - "build": "npm run clean && tsc && cp -r lib/prompts/*.txt lib/prompts/user dist/lib/prompts/", + "build": "npm run clean && tsc && cp -r lib/prompts/*.txt lib/prompts/system lib/prompts/nudge dist/lib/prompts/", "postbuild": "rm -rf dist/logs", "prepublishOnly": "npm run build", "dev": "opencode plugin dev",