chore(prompts): drop unused target_platform supplement

The target-platform supplement only fed legacy prompt builders that read
the now-removed wizard_state platforms field. Drop the YAML entry,
loader struct field, and runtime helper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-01 11:02:33 +08:00
parent 490c6c759d
commit dca36ed1f6
5 changed files with 32 additions and 43 deletions
-1
View File
@@ -210,7 +210,6 @@ runtime:
prompt_rule_scene_supplement_format: "适用场景:%s"
prompt_rule_tone_supplement_format: "默认语气:%s"
prompt_rule_word_count_supplement_format: "建议字数:%d 字左右"
prompt_rule_target_platform_supplement_format: "目标发布平台:%s"
prompt_rule_supplement_heading: "补充要求:"
prompt_rule_output_requirements_section: |
输出要求:
+32 -33
View File
@@ -21,39 +21,38 @@ type promptsConfig struct {
}
type runtimePromptsConfig struct {
DefaultGenerationBasePromptTemplate string `yaml:"default_generation_base_prompt_template"`
PromptContextHeading string `yaml:"prompt_context_heading"`
GenerationWritingRequirementsSection string `yaml:"generation_writing_requirements_section"`
GenerationTemplateSpecificRulesHeading string `yaml:"generation_template_specific_rules_heading"`
GenerationLengthGuidanceHeading string `yaml:"generation_length_guidance_heading"`
TopXBrandPriorityRulesTemplate string `yaml:"top_x_brand_priority_rules_template"`
EnglishLengthGuidanceTemplate string `yaml:"english_length_guidance_template"`
ChineseLengthGuidanceTemplate string `yaml:"chinese_length_guidance_template"`
ContextLabels map[string]string `yaml:"context_labels"`
TemplateContextWithJSONExampleTemplate string `yaml:"template_context_with_json_example_template"`
JSONOutputExampleHeading string `yaml:"json_output_example_heading"`
AnalyzeOutputExample string `yaml:"analyze_output_example"`
AnalyzeFallbackPromptTemplate string `yaml:"analyze_fallback_prompt_template"`
TitleCustomOutputRequirementsSection string `yaml:"title_custom_output_requirements_section"`
TitleOutputExample string `yaml:"title_output_example"`
TitleFallbackPromptTemplate string `yaml:"title_fallback_prompt_template"`
OutlineOutputExample string `yaml:"outline_output_example"`
OutlineCustomOutputRequirementsSection string `yaml:"outline_custom_output_requirements_section"`
OutlineFallbackPromptTemplate string `yaml:"outline_fallback_prompt_template"`
OutlineResponseFormatDescription string `yaml:"outline_response_format_description"`
PromptRuleTaskNameSupplementFormat string `yaml:"prompt_rule_task_name_supplement_format"`
PromptRuleSceneSupplementFormat string `yaml:"prompt_rule_scene_supplement_format"`
PromptRuleToneSupplementFormat string `yaml:"prompt_rule_tone_supplement_format"`
PromptRuleWordCountSupplementFormat string `yaml:"prompt_rule_word_count_supplement_format"`
PromptRuleTargetPlatformSupplementFormat string `yaml:"prompt_rule_target_platform_supplement_format"`
PromptRuleSupplementHeading string `yaml:"prompt_rule_supplement_heading"`
PromptRuleOutputRequirementsSection string `yaml:"prompt_rule_output_requirements_section"`
ArticleImitationPromptTemplate string `yaml:"article_imitation_prompt_template"`
ArticleImitationLocaleInstructions map[string]string `yaml:"article_imitation_locale_instructions"`
ArticleImitationSettingLabels map[string]string `yaml:"article_imitation_setting_labels"`
KnowledgePromptIntroLines []string `yaml:"knowledge_prompt_intro_lines"`
KnowledgeSnippetLabelFormat string `yaml:"knowledge_snippet_label_format"`
KnowledgeWebsiteMarkdown knowledgeWebsiteMarkdownConfig `yaml:"knowledge_website_markdown"`
DefaultGenerationBasePromptTemplate string `yaml:"default_generation_base_prompt_template"`
PromptContextHeading string `yaml:"prompt_context_heading"`
GenerationWritingRequirementsSection string `yaml:"generation_writing_requirements_section"`
GenerationTemplateSpecificRulesHeading string `yaml:"generation_template_specific_rules_heading"`
GenerationLengthGuidanceHeading string `yaml:"generation_length_guidance_heading"`
TopXBrandPriorityRulesTemplate string `yaml:"top_x_brand_priority_rules_template"`
EnglishLengthGuidanceTemplate string `yaml:"english_length_guidance_template"`
ChineseLengthGuidanceTemplate string `yaml:"chinese_length_guidance_template"`
ContextLabels map[string]string `yaml:"context_labels"`
TemplateContextWithJSONExampleTemplate string `yaml:"template_context_with_json_example_template"`
JSONOutputExampleHeading string `yaml:"json_output_example_heading"`
AnalyzeOutputExample string `yaml:"analyze_output_example"`
AnalyzeFallbackPromptTemplate string `yaml:"analyze_fallback_prompt_template"`
TitleCustomOutputRequirementsSection string `yaml:"title_custom_output_requirements_section"`
TitleOutputExample string `yaml:"title_output_example"`
TitleFallbackPromptTemplate string `yaml:"title_fallback_prompt_template"`
OutlineOutputExample string `yaml:"outline_output_example"`
OutlineCustomOutputRequirementsSection string `yaml:"outline_custom_output_requirements_section"`
OutlineFallbackPromptTemplate string `yaml:"outline_fallback_prompt_template"`
OutlineResponseFormatDescription string `yaml:"outline_response_format_description"`
PromptRuleTaskNameSupplementFormat string `yaml:"prompt_rule_task_name_supplement_format"`
PromptRuleSceneSupplementFormat string `yaml:"prompt_rule_scene_supplement_format"`
PromptRuleToneSupplementFormat string `yaml:"prompt_rule_tone_supplement_format"`
PromptRuleWordCountSupplementFormat string `yaml:"prompt_rule_word_count_supplement_format"`
PromptRuleSupplementHeading string `yaml:"prompt_rule_supplement_heading"`
PromptRuleOutputRequirementsSection string `yaml:"prompt_rule_output_requirements_section"`
ArticleImitationPromptTemplate string `yaml:"article_imitation_prompt_template"`
ArticleImitationLocaleInstructions map[string]string `yaml:"article_imitation_locale_instructions"`
ArticleImitationSettingLabels map[string]string `yaml:"article_imitation_setting_labels"`
KnowledgePromptIntroLines []string `yaml:"knowledge_prompt_intro_lines"`
KnowledgeSnippetLabelFormat string `yaml:"knowledge_snippet_label_format"`
KnowledgeWebsiteMarkdown knowledgeWebsiteMarkdownConfig `yaml:"knowledge_website_markdown"`
}
type knowledgeWebsiteMarkdownConfig struct {
@@ -121,13 +121,6 @@ func PromptRuleWordCountSupplement(wordCount int) string {
return fmt.Sprintf(trimPrompt(loadRuntimePrompts().PromptRuleWordCountSupplementFormat), wordCount)
}
func PromptRuleTargetPlatformSupplement(target string) string {
return fmt.Sprintf(
trimPrompt(loadRuntimePrompts().PromptRuleTargetPlatformSupplementFormat),
strings.ReplaceAll(target, ",", "、"),
)
}
func PromptRuleSupplementSection(items []string) string {
return trimPrompt(loadRuntimePrompts().PromptRuleSupplementHeading) + "\n- " + strings.Join(items, "\n- ")
}