diff --git a/.pi/agents/topic.md b/.pi/agents/topic.md index 0c3a9b6..82ace9b 100644 --- a/.pi/agents/topic.md +++ b/.pi/agents/topic.md @@ -49,9 +49,12 @@ Verify: ## 2. Load Context - Read {PROJECT_PATH}/icp.md - Read /workspace/content/images/images.json -- List posts: +- List candidate topic files (FILENAMES ONLY, do NOT read their contents): bash: ls /workspace/content/posts/*.md +HARD RULE: At this stage you must not `read` any file inside +`/workspace/content/posts/`. You only have the list of filenames. + --- ## 3. Filter Recent Topics @@ -65,24 +68,35 @@ Verify: --- -## 4. Score Candidates +## 4. Score Candidates (FILENAME ONLY) -Do not open all content markdown files. Decide on the filename. +HARD RULE: Do NOT open or `read` any candidate markdown file in this step. +The filename IS the headline — decide purely from the filename tokens. -Score each filename: -- +1 keyword match (from icp.md) -- +1 pain point match +For each candidate filename: +1. Strip the `.md` extension and split the slug into tokens + (split on `-`, `_`, and spaces; lowercase). +2. Score: + - +1 for each token that matches a keyword from `icp.md` + - +1 for each token that matches a pain point from `icp.md` +3. Pick the highest score. Tie-break alphabetically by filename. -Pick highest score (tie → alphabetical) and select this markdown file +Output of this step: exactly ONE selected filename. --- ## 5. Generate Output -- Read only the selected markdown file for content. Do not read all content files + +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. + +- Read the selected markdown file (and only that one). - Extract: - Story bullets - Pain points (max 3) -- Pick matching image from images.json +- Pick matching image from images.json (already loaded in step 2). Create: - Headline (Title Case filename)