✨ feat(vscode): 测试提示词改成可配置模板并带上工单号
启动测试会话原先硬编码发 `/pr-acceptance-testing`,不带目标,验收技能只能
反问要测哪个。现在做成 prompts/test.md 模板 + 设置里的「测试提示词」,占位符
{issueNumber} 和 {prRef}(worktree 里是分支,主仓库里是已合并的 PR)。
Claude-Session: https://claude.ai/code/session_01Kgmb1LvrPmFX3NoUDB4zZC
This commit is contained in:
1 parent
e05a5234db
commit
f946e5cfee
11 files changed
+77
-4
No files matched your search
@@ -30,9 +30,11 @@ const FALLBACK_BRAINSTORM_CONTINUE_PROMPT = `/ecc:grilling 讨论下 {issueNumbe
|
||||
|
||||
const FALLBACK_IMPLEMENT_PLAN_PROMPT = `/ecc:tdd @{planFile} 按计划实施,编码派子代理,发起 PR 时在 body 中包含 "Closes #{issueNumber}"。严禁合并 PR。`
|
||||
|
||||
const FALLBACK_TEST_PROMPT = `/pr-acceptance-testing 验收 {issueNumber} 号工单({prRef})。验收目标以工单正文为准,不要再问验收哪个。`
|
||||
|
||||
const FALLBACK_REVIEW_PROMPT = `用 tea 拿到 #{prNumber} PR,diff 交给 ecc:code-reviewer 子代理审查。审查意见用 spx pr review-comment 发评论,body 第一行写 <!-- spx:review=1 -->。`
|
||||
|
||||
type PromptName = 'brainstorm' | 'brainstorm-continue' | 'implement-plan' | 'review'
|
||||
type PromptName = 'brainstorm' | 'brainstorm-continue' | 'implement-plan' | 'review' | 'test'
|
||||
|
||||
/**
|
||||
* Read a default prompt template from `${extensionPath}/prompts/${name}.md`.
|
||||
@@ -54,6 +56,7 @@ export function readDefaultPrompt(extensionPath: string, name: PromptName): stri
|
||||
case 'brainstorm-continue': return FALLBACK_BRAINSTORM_CONTINUE_PROMPT
|
||||
case 'implement-plan': return FALLBACK_IMPLEMENT_PLAN_PROMPT
|
||||
case 'review': return FALLBACK_REVIEW_PROMPT
|
||||
case 'test': return FALLBACK_TEST_PROMPT
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,6 +90,8 @@ export interface Settings {
|
||||
autoReview: boolean
|
||||
/** Prompt template for the auto-review flow. `{prNumber}` placeholder. */
|
||||
reviewPrompt: string
|
||||
/** 测试会话首个提示词模板;占位符 {issueNumber} / {prRef}。 */
|
||||
testPrompt: string
|
||||
/** Day-to-day development branch (e.g. `main`). Jenkins doesn't watch it. */
|
||||
devBranch: string
|
||||
/**
|
||||
@@ -266,6 +271,7 @@ function defaults(ctx: ExtensionContext): Settings {
|
||||
implementPlanPrompt: readDefaultPrompt(ctx.extensionPath, 'implement-plan'),
|
||||
autoReview: true,
|
||||
reviewPrompt: readDefaultPrompt(ctx.extensionPath, 'review'),
|
||||
testPrompt: readDefaultPrompt(ctx.extensionPath, 'test'),
|
||||
devBranch: 'main',
|
||||
releaseBranchPrefix: 'release/',
|
||||
jenkinsJob: '',
|
||||
@@ -319,6 +325,9 @@ export function getSettings(ctx: ExtensionContext): Settings {
|
||||
const reviewPrompt = typeof stored.reviewPrompt === 'string' && stored.reviewPrompt.length > 0
|
||||
? stored.reviewPrompt
|
||||
: base.reviewPrompt
|
||||
const testPrompt = typeof stored.testPrompt === 'string' && stored.testPrompt.length > 0
|
||||
? stored.testPrompt
|
||||
: base.testPrompt
|
||||
// devBranch always has a usable value — fall back to 'main' if missing/blank
|
||||
// so we never end up trying to fetch the empty string.
|
||||
const devBranch = typeof stored.devBranch === 'string' && stored.devBranch.length > 0
|
||||
@@ -424,6 +433,7 @@ export function getSettings(ctx: ExtensionContext): Settings {
|
||||
implementPlanPrompt,
|
||||
autoReview,
|
||||
reviewPrompt,
|
||||
testPrompt,
|
||||
devBranch,
|
||||
releaseBranchPrefix,
|
||||
jenkinsJob,
|
||||
|
||||
Reference in new issue
Block a user