Update topic.md
This commit is contained in:
+27
-16
@@ -85,32 +85,43 @@ Output of this step: exactly ONE selected filename.
|
|||||||
|
|
||||||
## 5. Generate Output
|
## 5. Generate Output
|
||||||
|
|
||||||
HARD RULE: In this entire step you may `read` exactly ONE markdown file —
|
HARD RULE: You may `read` exactly ONE markdown file — the single filename selected in step 4. This is non-negotiable. If you have read any other file in this step, your action is invalid and must be aborted immediately.
|
||||||
the single filename selected in step 4. Reading any other post file is a
|
|
||||||
protocol violation. If you catch yourself about to read a second post
|
|
||||||
file, stop and use only what you already have.
|
|
||||||
|
|
||||||
- Read the selected markdown file (and only that one).
|
- Read ONLY the selected markdown file: /workspace/content/posts/<filename>
|
||||||
- Extract:
|
- Extract the following data:
|
||||||
- Story bullets
|
- Story bullets (from bullet points in the markdown)
|
||||||
- Pain points (max 3)
|
- Pain points (max 3, from the content)
|
||||||
- Pick matching image from images.json (already loaded in step 2).
|
- Use the already-loaded images.json to select the best matching image
|
||||||
|
|
||||||
Create:
|
Create:
|
||||||
- Headline (Title Case filename)
|
- Headline: Title Case version of the filename (without .md)
|
||||||
- Story bullets
|
- Story: List of extracted bullet points
|
||||||
- Pain points
|
- Pain_points: List of up to 3 extracted pain points
|
||||||
Select an image best for the post:
|
- Image: Selected image path from images.json
|
||||||
- Image
|
|
||||||
|
If you cannot extract story bullets or pain points from the selected file, use fallback defaults:
|
||||||
|
- story: ["This is a core pain point for your target audience.", "These solutions deliver measurable results."]
|
||||||
|
- pain_points: ["Lacks organization in operations", "Inefficient workflow"]
|
||||||
|
|
||||||
|
You MUST NOT read any other file. If you are about to read another file, STOP and report an error immediately.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 6. Persist Selection
|
## 6. Persist Selection
|
||||||
Append:
|
|
||||||
|
|
||||||
|
First, ensure topic_history.md exists. If it doesn't, create it with empty content.
|
||||||
|
|
||||||
|
Append exactly one line:
|
||||||
# Selected Topic: <ISO timestamp> – <filename>
|
# Selected Topic: <ISO timestamp> – <filename>
|
||||||
|
|
||||||
Then keep only last 15 entries
|
Then, keep only the last 15 entries (no more, no less). Use this precise sequence:
|
||||||
|
1. Read the current topic_history.md content
|
||||||
|
2. Split by lines
|
||||||
|
3. Filter out empty lines
|
||||||
|
4. Keep only the most recent 15 entries
|
||||||
|
5. Overwrite topic_history.md with these 15 entries
|
||||||
|
|
||||||
|
If any error occurs during this process (file read/write failure, permissions issue, etc.), completely abort the operation and report the exact error. Failure to record the selection breaks the entire workflow.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user