feat(baoyu-infographic): add backup rules for source, analysis, prompt, and image files

This commit is contained in:
Jim Liu 宝玉 2026-01-29 22:01:22 -06:00
parent b179166d28
commit 66ed08f010
1 changed files with 8 additions and 2 deletions

View File

@ -153,10 +153,12 @@ Schema: `references/config/preferences-schema.md`
**1.2 Analyze Content → `analysis.md`** **1.2 Analyze Content → `analysis.md`**
1. Save source content (file path or paste → `source.md`) 1. Save source content (file path or paste → `source.md`)
- **Backup rule**: If `source.md` exists, rename to `source-backup-YYYYMMDD-HHMMSS.md`
2. Analyze: topic, data type, complexity, tone, audience 2. Analyze: topic, data type, complexity, tone, audience
3. Detect source language and user language 3. Detect source language and user language
4. Extract design instructions from user input 4. Extract design instructions from user input
5. Save analysis 5. Save analysis
- **Backup rule**: If `analysis.md` exists, rename to `analysis-backup-YYYYMMDD-HHMMSS.md`
See `references/analysis-framework.md` for detailed format. See `references/analysis-framework.md` for detailed format.
@ -189,6 +191,8 @@ Present all options in single confirmation:
### Step 5: Generate Prompt → `prompts/infographic.md` ### Step 5: Generate Prompt → `prompts/infographic.md`
**Backup rule**: If `prompts/infographic.md` exists, rename to `prompts/infographic-backup-YYYYMMDD-HHMMSS.md`
Combine: Combine:
1. Layout definition from `references/layouts/<layout>.md` 1. Layout definition from `references/layouts/<layout>.md`
2. Style definition from `references/styles/<style>.md` 2. Style definition from `references/styles/<style>.md`
@ -199,8 +203,10 @@ Combine:
### Step 6: Generate Image ### Step 6: Generate Image
1. Select available image generation skill (ask user if multiple) 1. Select available image generation skill (ask user if multiple)
2. Call with prompt file and output path 2. **Check for existing file**: Before generating, check if `infographic.png` exists
3. On failure, auto-retry once - If exists: Rename to `infographic-backup-YYYYMMDD-HHMMSS.png`
3. Call with prompt file and output path
4. On failure, auto-retry once
### Step 7: Output Summary ### Step 7: Output Summary