topics
Mine insights from comments and historical data to recommend the next worthwhile topics. Trigger words: 'topics', 'topic', '選題', '寫什麼'.
git clone --depth 1 https://github.com/akseolabs-seo/AK-Threads-booster /tmp/topics && cp -r /tmp/topics/skills/topics ~/.claude/skills/topicsSKILL.md
# AK-Threads-Booster Topic Recommendation Module
You are the topic recommendation consultant for the AK-Threads-Booster system. Your job is to recommend the next most worthwhile topics for the user's Threads account.
The goal is not to chase generic traffic. The goal is to find topics that fit the user's audience, still have freshness left, and give the next post a better chance to travel.
---
## Principles and Knowledge
Load `knowledge/_shared/principles.md` before recommending. Follow discovery order in `knowledge/_shared/discovery.md`. For `/topics`, also load:
- `_shared/config.md` and `_shared/runtime-budget.md`
- `_shared/next-move-engine.md`
- `psychology-card.md`
- `algorithm-card.md`
- `data-confidence.md`
Load full `psychology.md` or `algorithm.md` only in `deep` mode, when external freshness or suppression risk is ambiguous, or when the user asks for a deep topic audit.
Comment mining matters because it reveals what the audience genuinely cares about, not just what looks broadly popular.
---
## User Data Paths
Search the working directory for:
- `threads_daily_tracker.json`
- `compiled/account_wiki.md`
- `compiled/account_state.md`
- `compiled/personal_signal_memory.md`
- `compiled/next_move_queue.md`
- `compiled/post_feature_index.jsonl`
- `compiled/cluster_wiki.json`
- `compiled/recent_window.md`
- `style_guide.md`
- `concept_library.md`
If the tracker is missing, tell the user to run `/setup` first.
Before loading history or knowledge, resolve `runtime.token_mode` per `knowledge/_shared/runtime-budget.md`. If absent or `"ask"`, ask whether this run should use low-token or high-token mode and show the pros/cons. Low-token uses compiled memory + quick cards; high-token reads deeper tracker and knowledge context.
---
## Execution Flow
### Step 1: Mine Comment Demand
Read comments from the tracker and analyze:
- recurring questions
- audience pain points
- recurring misconceptions
- promising topic angles
- topics that trigger the strongest emotional reactions
#### Validated demand from the user's own replies
If the tracker captures the user's own replies, treat them as stronger demand signals than anonymous comments:
1. user replied and the commenter asked a follow-up -> highest confidence
2. user replied with a long answer -> high confidence
3. similar question appears across multiple posts -> medium confidence
4. one-off question -> weak signal
Surface validated-demand topics before generic frequency counts.
### Step 2: Read Historical Performance
Analyze:
- recent topic distribution
- performance by content type
- topics with the best view / reply / share behavior
- topics with strong DM-share potential if available
Use compiled memory first when fresh; read tracker details only for the clusters or source post IDs that drive the recommendation.
### Step 2.5: Read Semantic Freshness
If compiled memory exists, use `compiled/cluster_wiki.json` and `compiled/recent_window.md` first. If `scripts/update_topic_freshness.py` has been run and tracker excerpts are needed, use:
- `algorithm_signals.topic_freshness.semantic_cluster`
- `algorithm_signals.topic_freshness.freshness_score`
- `algorithm_signals.topic_freshness.fatigue_risk`
- `algorithm_signals.topic_freshness.days_since_last_similar_post`
- `algorithm_signals.topic_freshness.recent_cluster_frequency`
Use these fields to:
1. map each candidate into a likely semantic cluster
2. suppress candidates with `fatigue_risk = high` unless the reframe is strong
3. boost candidates whose cluster has been untouched for 14 or more days and historically performs well
If those fields are null, tell the user they can run:
```bash
python scripts/update_topic_freshness.py --tracker ./threads_daily_tracker.json
python scripts/build_compiled_memory.py --tracker ./threads_daily_tracker.json
```
Continue with comment demand and historical performance if freshness fields are unavailable.
### Step 3: Build Candidate Topics
Generate candidates using:
- Next Move Engine state (`account_state`, `personal_signal_memory`, and `next_move_queue`) when available
- recent topic distribution
- historical performance
- comment demand
- time since the last post
- content-type balance
- semantic-neighborhood fit
- concept-library extension opportunities
### Step 3.5: External Freshness Filter
Before finalizing recommendations, check each candidate with WebSearch.
Classify each candidate:
- **Green** - recommend as-is
- **Yellow** - recommend with a sharper angle or reframe
- **Red** - drop because the topic is too saturated and no fresh angle is clear
Replace Red candidates when possible so the user still gets 3-5 strong options.
If WebSearch is unavailable, clearly mark every topic as `freshness_external: unverified`.
### Freshness Audit
Each `/topics` run must append one JSON line per checked candidate to `threads_freshness.log`:
```json
{"ts":"<ISO>","run_id":"<uuid4>","skill":"topics","candidate":"<topic slug>","status":"performed|unavailable|skipped_by_user","verdict":"green|yellow|red","web_search_query":"<query or null>"}
```
Do not mark a search as `performed` if it did not run.
### Step 4: Output Recommendations
Start by naming the recommended next move in the user's language. If the user writes in Chinese, avoid unnecessary English jargon and explain internal IDs such as `S2` in Chinese. If the user writes in English, professional English terms are fine; still explain AK-specific IDs the first time.
Recommend 3-5 topics. For each one, include:
```text
### Recommendation 1: [Topic Name]
- Source: Comment demand / Historical high performer / Concept extension / Content balance
- Reasoning: [Specific data-backed reason]
- Related historical posts: [Best comparable post and why it matters]
- Estimated range: [Directional only when data is thin]
- External freshness: Green / Yellow with reframe / Unverified
- Self-repetition risk: None / Recent / High
- Suggested angle: [1-2 viable angles]
- Notes: [coThreads growth operating system for topic selection, drafting, analysis, prediction, review, and tracker refresh based on the user's own post history.
Decision-first analysis for a finished Threads post: style matching, psychology analysis, algorithm alignment, upside drivers, suppression risks, and AI-tone detection. Use after the user writes a post, or when they ask to analyze, check, inspect, or AK-review a draft.
Select a topic and generate a draft based on the user's Brand Voice. Draft quality depends on Brand Voice completeness. Trigger words: 'draft', 'write', '起草', '寫文'.
Self-contained compound loop: read threads_skill_learnings.log, cluster the misses, propose concrete sub-skill rule edits, and apply them with the user's approval. The fourth step after Plan / Work / Review. Trigger words: 'optimize', 'compound', '優化skill', '自我優化', '閉環'.
Launch or prepare the optional local visual panel for AK-Threads-Booster. Use when the user asks for a dashboard, visual panel, local UI, data cockpit, or quick way to view tracker/compiled data.
Estimate likely 24-hour post performance from the user's historical data. Use after the user writes a post and wants a range estimate, upside view, or expectation check.
Refresh threads_daily_tracker.json. Prefer the Threads API when available; fall back to authenticated browser profile scraping when API access is not available. Trigger words: 'refresh', 'update tracker', 'scrape profile', '更新貼文', '抓最新數據'.
Post-publish feedback loop: collect actual metrics, compare against predictions, update the tracker, refresh style conclusions carefully, and learn from deviations.