diff --git a/.pi/agents/topic.md b/.pi/agents/topic.md index 965321d..bd0ad67 100644 --- a/.pi/agents/topic.md +++ b/.pi/agents/topic.md @@ -85,32 +85,43 @@ Output of this step: exactly ONE selected filename. ## 5. Generate Output -HARD RULE: In this entire step you may `read` exactly ONE markdown file — -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. +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. -- Read the selected markdown file (and only that one). -- Extract: - - Story bullets - - Pain points (max 3) -- Pick matching image from images.json (already loaded in step 2). +- Read ONLY the selected markdown file: /workspace/content/posts/ +- Extract the following data: + - Story bullets (from bullet points in the markdown) + - Pain points (max 3, from the content) +- Use the already-loaded images.json to select the best matching image Create: -- Headline (Title Case filename) -- Story bullets -- Pain points -Select an image best for the post: -- Image +- Headline: Title Case version of the filename (without .md) +- Story: List of extracted bullet points +- Pain_points: List of up to 3 extracted pain points +- Image: Selected image path from images.json + +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 -Append: +First, ensure topic_history.md exists. If it doesn't, create it with empty content. + +Append exactly one line: # Selected Topic: -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. --- @@ -133,4 +144,4 @@ Return ONLY this JSON: "image": "" } -🔥 CRITICAL: Do NOT output any text, comment, markdown, or explanation — only the JSON block. Even a single extra character will break downstream pipelines. +🔥 CRITICAL: Do NOT output any text, comment, markdown, or explanation — only the JSON block. Even a single extra character will break downstream pipelines. \ No newline at end of file