✨ feat(vscode): 七份提示词统一走 Handlebars,头脑风暴三档合一
- 模板引擎换成 Handlebars(noEscape,提示词是纯文本不能被转义),单花括号写法彻底退场
- brainstorm-continue / brainstorm-continue-prototype 两份并进 brainstorm.md,
用 {{#if issueNumber}} 分新建 / 续聊,续聊里用 {{#if prototypeFile}} 嵌原型段落,
设置面板对应的两个 textarea 一并删掉
- 模板上下文 = 工单 state JSON 全量字段 + issueNumber / userRequest / nonce /
planFile / prNumber / prRef,以后模板想用新字段不用改扩展代码
- 各会话入口共用一条 state 读取路径,读失败只记 warn 按空状态继续,不拦开会话
- 升级后首次启动把存量自定义提示词迁到双花括号并合并成一份,改写前把
settings.json 备份成 settings.json.bak-<时间戳>,迁移动作全写日志
- 装 handlebars 时给 vsce 传递依赖的老 semver 加 trustPolicyExclude 豁免,
否则 no-downgrade 策略卡住整个装包
Claude-Session: https://claude.ai/code/session_01Kgmb1LvrPmFX3NoUDB4zZC
This commit is contained in:
1 parent
efeac8c978
commit
7bac5c8b03
28 files changed
+853
-424
No files matched your search
@@ -21,8 +21,6 @@ interface SubmitValues {
|
||||
webhookPort: number
|
||||
webhookSecret: string
|
||||
brainstormPrompt: string
|
||||
brainstormContinuePrompt: string
|
||||
prototypeRefPrompt: string
|
||||
implementPlanPrompt: string
|
||||
autoReview: boolean
|
||||
reviewPrompt: string
|
||||
@@ -78,8 +76,6 @@ export interface SettingsModalProps {
|
||||
initialWebhookPort: number
|
||||
initialWebhookSecret: string
|
||||
initialBrainstormPrompt: string
|
||||
initialBrainstormContinuePrompt: string
|
||||
initialPrototypeRefPrompt: string
|
||||
initialImplementPlanPrompt: string
|
||||
initialAutoReview: boolean
|
||||
initialReviewPrompt: string
|
||||
@@ -171,8 +167,6 @@ export function SettingsModal({
|
||||
initialWebhookPort,
|
||||
initialWebhookSecret,
|
||||
initialBrainstormPrompt,
|
||||
initialBrainstormContinuePrompt,
|
||||
initialPrototypeRefPrompt,
|
||||
initialImplementPlanPrompt,
|
||||
initialAutoReview,
|
||||
initialReviewPrompt,
|
||||
@@ -216,8 +210,6 @@ export function SettingsModal({
|
||||
const [webhookPort, setWebhookPort] = useState<string>(String(initialWebhookPort))
|
||||
const [webhookSecret, setWebhookSecret] = useState(initialWebhookSecret)
|
||||
const [brainstormPrompt, setBrainstormPrompt] = useState(initialBrainstormPrompt)
|
||||
const [brainstormContinuePrompt, setBrainstormContinuePrompt] = useState(initialBrainstormContinuePrompt)
|
||||
const [prototypeRefPrompt, setPrototypeRefPrompt] = useState(initialPrototypeRefPrompt)
|
||||
const [implementPlanPrompt, setImplementPlanPrompt] = useState(initialImplementPlanPrompt)
|
||||
const [autoReview, setAutoReview] = useState(initialAutoReview)
|
||||
const [reviewPrompt, setReviewPrompt] = useState(initialReviewPrompt)
|
||||
@@ -263,8 +255,6 @@ export function SettingsModal({
|
||||
setWebhookPort(String(initialWebhookPort))
|
||||
setWebhookSecret(initialWebhookSecret)
|
||||
setBrainstormPrompt(initialBrainstormPrompt)
|
||||
setBrainstormContinuePrompt(initialBrainstormContinuePrompt)
|
||||
setPrototypeRefPrompt(initialPrototypeRefPrompt)
|
||||
setImplementPlanPrompt(initialImplementPlanPrompt)
|
||||
setAutoReview(initialAutoReview)
|
||||
setReviewPrompt(initialReviewPrompt)
|
||||
@@ -358,8 +348,6 @@ export function SettingsModal({
|
||||
webhookPort: portNum,
|
||||
webhookSecret: webhookSecret.trim(),
|
||||
brainstormPrompt,
|
||||
brainstormContinuePrompt,
|
||||
prototypeRefPrompt,
|
||||
implementPlanPrompt,
|
||||
autoReview,
|
||||
reviewPrompt,
|
||||
@@ -979,64 +967,34 @@ export function SettingsModal({
|
||||
label="头脑风暴提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{userRequest}'}</code>
|
||||
Handlebars 模板。
|
||||
<code>{'{{#if issueNumber}}'}</code>
|
||||
分支 = 对已有工单续聊(
|
||||
<code>{'{{issueNumber}}'}</code>
|
||||
,里面再用
|
||||
<code>{'{{#if prototypeFile}}'}</code>
|
||||
嵌原型段落、
|
||||
<code>{'{{#if prototypeSessionId}}'}</code>
|
||||
控制原型会话 id 那行);
|
||||
<code>{'{{else}}'}</code>
|
||||
分支 = 新建工单(
|
||||
<code>{'{{userRequest}}'}</code>
|
||||
、
|
||||
<code>{'{nonce}'}</code>
|
||||
。同时承担:建工单初始指令 + 会话内 spec/plan 路径写回 issue body 的持续约定。
|
||||
<code>{'{{nonce}}'}</code>
|
||||
)。工单 state JSON 的字段(
|
||||
<code>{'{{planFile}}'}</code>
|
||||
、
|
||||
<code>{'{{branch}}'}</code>
|
||||
等)都能直接用。
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<textarea
|
||||
rows={12}
|
||||
rows={16}
|
||||
value={brainstormPrompt}
|
||||
onChange={e => setBrainstormPrompt(e.target.value)}
|
||||
className={`${inputClass} resize-y font-mono`}
|
||||
placeholder="头脑风暴 + 建工单 + 持续约定提示词"
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="头脑风暴续聊提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{issueNumber}'}</code>
|
||||
、
|
||||
<code>{'{prototypeRef}'}</code>
|
||||
(工单挂了原型插件才填,没挂时该段整段删掉);用于对已有工单继续讨论 / 写 spec/plan 的会话初始指令。
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<textarea
|
||||
rows={8}
|
||||
value={brainstormContinuePrompt}
|
||||
onChange={e => setBrainstormContinuePrompt(e.target.value)}
|
||||
className={`${inputClass} resize-y font-mono`}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
<Field
|
||||
label="续聊·原型段落"
|
||||
hint={(
|
||||
<>
|
||||
工单挂了原型插件时,这段会填进续聊提示词的
|
||||
<code>{'{prototypeRef}'}</code>
|
||||
处。可用占位符:
|
||||
<code>{'{prototypeFile}'}</code>
|
||||
、
|
||||
<code>{'{issueNumber}'}</code>
|
||||
、
|
||||
<code>{'{prototypeSessionId}'}</code>
|
||||
(取值为空时,含该占位符的整行会被删掉)
|
||||
</>
|
||||
)}
|
||||
>
|
||||
<textarea
|
||||
rows={8}
|
||||
value={prototypeRefPrompt}
|
||||
onChange={e => setPrototypeRefPrompt(e.target.value)}
|
||||
className={`${inputClass} resize-y font-mono`}
|
||||
placeholder="新建工单 + 续聊 + 原型段落,一份模板按条件分叉"
|
||||
/>
|
||||
</Field>
|
||||
|
||||
@@ -1044,10 +1002,10 @@ export function SettingsModal({
|
||||
label="实施提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{planFile}'}</code>
|
||||
可用变量(Handlebars):
|
||||
<code>{'{{planFile}}'}</code>
|
||||
、
|
||||
<code>{'{issueNumber}'}</code>
|
||||
<code>{'{{issueNumber}}'}</code>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
@@ -1063,8 +1021,8 @@ export function SettingsModal({
|
||||
label="审查提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{prNumber}'}</code>
|
||||
可用变量(Handlebars):
|
||||
<code>{'{{prNumber}}'}</code>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
@@ -1080,10 +1038,10 @@ export function SettingsModal({
|
||||
label="测试提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{issueNumber}'}</code>
|
||||
可用变量(Handlebars):
|
||||
<code>{'{{issueNumber}}'}</code>
|
||||
、
|
||||
<code>{'{prRef}'}</code>
|
||||
<code>{'{{prRef}}'}</code>
|
||||
(worktree 里是分支,主仓库里是已合并的 PR)
|
||||
</>
|
||||
)}
|
||||
@@ -1100,8 +1058,8 @@ export function SettingsModal({
|
||||
label="原型提示词"
|
||||
hint={(
|
||||
<>
|
||||
可用占位符:
|
||||
<code>{'{issueNumber}'}</code>
|
||||
可用变量(Handlebars):
|
||||
<code>{'{{issueNumber}}'}</code>
|
||||
</>
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user