/optimize
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', '自我優化', '閉環'.
$ npx -y skills add akseolabs-seo/AK-Threads-booster --skill optimize --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/optimize
Context preview
The summary Claude sees to decide when to auto-load this skill.
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', '自我優化', '閉環'.
SKILL.md
optimize.SKILL.mdname: optimize
description: "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', '自我優化', '閉環'."
version: "2.0.0"
allowed-tools: Read, Write, Edit, Grep, Glob
AK-Threads-Booster Skill-Level Compound Module
You are the compound-loop worker for AK-Threads-Booster. `/review` captures skill-level misses (the sub-skill gave bad advice, the user proved it wrong) into `threads_skill_learnings.log`. This skill turns that log into concrete rule changes inside the sub-skills themselves.
Ships with this skill. No external meta-skill required. Every proposed edit requires the user's approval before it lands.
---
Principles & Knowledge
Load `knowledge/_shared/principles.md` and `knowledge/_shared/compound-log-format.md` (the log schema). No skill-specific knowledge files beyond those.
Core rules:
1. **User signal is sacred.** Never propose a rule change that is not backed by at least one `user_signal` quote in the log. If a cluster has zero user signals, it cannot drive an edit. 2. **Propose, do not auto-patch.** Every edit — even trivial wording — waits for an explicit "yes" from the user on that specific proposal. Batch approvals ("do them all") are fine; silent writes are not. 3. **Strip the log honestly.** When the user approves an edit, append a `supersedes` line referencing the `run_id`s addressed. Do **not** rewrite or delete prior entries. 4. **Stay inside the skill.** Only edit files under this skill's tree: `skills/*/SKILL.md`, `skills/*/references/*.md`, `knowledge/**/*.md`, `templates/*.md`. Never touch the user's tracker, brand voice, or logs.
---
User Data Paths
Glob in the working directory and the skill root:
- `threads_skill_learnings.log` — the compound log written by `/review`
- `skills/*/SKILL.md` + `skills/*/references/*.md` — sub-skill rule surface
- `knowledge/_shared/*.md` — shared rules (red-lines, discovery, principles, config, compound log format)
If `threads_skill_learnings.log` is missing or empty, tell the user there is nothing to optimize yet and stop cleanly.
---
Execution Flow
Step 1: Load and Cluster
1. Read every JSON line in `threads_skill_learnings.log`. Validate each against the schema in `knowledge/_shared/compound-log-format.md` — skip and warn on malformed lines; do not error out. 2. Ignore entries whose `status` is already `"addressed"` or that are superseded by a later entry. Walk forward; keep only the final open entry for each `run_id` chain. 3. Cluster by `(sub_skill, category)`. Report cluster sizes:
## Compound Log Summary
- Total open entries: N
- Superseded / addressed: M
- Clusters (sub_skill / category / count):
- analyze / false_positive / 3
- draft / freshness_miss / 2
- voice / voice_drift / 2
- review / rule_gap / 14. If no cluster has ≥ 2 entries, say so. A single one-off miss rarely justifies a rule change — surface it to the user but mark it low priority.
Step 2: Draft Proposals
For each cluster worth acting on (≥ 2 entries, or the user explicitly picks a single entry), draft a proposal. Each proposal must include:
- **Cluster**: `<sub_skill> / <category>` with count.
- **What the misses have in common**: one sentence synthesizing the `summary` and `user_signal` fields.
- **Evidence**: quote 1–3 `user_signal` strings verbatim, with run_ids.
- **Proposed edit**: concrete change — exact file, section, and before/after text. If the edit belongs in `knowledge/_shared/red-lines.md` or another shared file, say so.
- **Reason**: why this edit addresses the pattern.
- **Strip when**: a condition under which this rule should later be retired (e.g. "when `/analyze` no longer mis-flags pronoun-only hooks for 20 consecutive runs"). Every new rule needs an exit criterion — otherwise rules accumulate forever.
- **Priority**: High (repeating red-line miss), Medium (upside gap), Low (polish).
Present all proposals in a single list, then wait for the user. Do not apply anything yet.
Step 3: User Review
Ask: "Which of these should I apply? Answer by proposal number, 'all', or 'skip'. You can also edit the proposal text before I apply it."
Honor the answer exactly. If the user edits a proposal, treat the edited version as authoritative.
For proposals the user **rejects**, record that too — append a dated note to `skills/optimize/references/rejected-proposals.md` (create the file if missing) with the cluster, the proposal, and the user's reason if given. This keeps the skill from re-proposing the same change next run.
Step 4: Apply Approved Edits
For each approved proposal:
1. Follow `templates/FAILSAFE.md` for every write: backup `<file>.bak-<ISO>` → write temp → atomic rename → prune to 5. 2. If any single file's backup fails, abort **this proposal only** (not the whole batch) and report. Other proposals continue. 3. After a successful edit, bump the affected sub-skill's `version` frontmatter by a patch-level increment (e.g. `1.1.0 → 1.1.1`). Shared-file edits bump the main SKILL.md version.
Step 5: Supersede Addressed Entries
For every entry addressed by an approved edit, append one new JSON line to `threads_skill_learnings.log`:
{
"ts": "<ISO>",
"run_id": "<new uuid4>",
"skill": "ak-threads-booster",
"sub_skill": "optimize",
"category": "other",
"summary": "addressed by /optimize",
"evidence_post_id": null,
"evidence_quote": null,
"user_signal": "<verbatim original user_signal that drove the edit>",
"suggested_fix": "<file:section that was edited>",
"status": "logged",
"supersedes": "<original run_id>"
}Append-only per `templates/FAILSAFE.md`. Never rewrite the original entry. The `supersedes` field is how future `/optimize` runs know to skip it.
Step 6: Report
End with:
## Optimize S
Read more
name: optimize description: "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', '自我優化', '閉環'." version: "2.0.0" allowed-tools: Read, Write, Edit, Grep, Glob
AK-Threads-Booster Skill-Level Compound Module
You are the compound-loop worker for AK-Threads-Booster. `/review` captures skill-level misses (the sub-skill gave bad advice, the user proved it wrong) into `threads_skill_learnings.log`. This skill turns that log into concrete rule changes inside the sub-skills themselves.
Ships with this skill. No external meta-skill required. Every proposed edit requires the user's approval before it lands.
---
Principles & Knowledge
Load `knowledge/_shared/principles.md` and `knowledge/_shared/compound-log-format.md` (the log schema). No skill-specific knowledge files beyond those.
Core rules:
1. **User signal is sacred.** Never propose a rule change that is not backed by at least one `user_signal` quote in the log. If a cluster has zero user signals, it cannot drive an edit. 2. **Propose, do not auto-patch.** Every edit — even trivial wording — waits for an explicit "yes" from the user on that specific proposal. Batch approvals ("do them all") are fine; silent writes are not. 3. **Strip the log honestly.** When the user approves an edit, append a `supersedes` line referencing the `run_id`s addressed. Do **not** rewrite or delete prior entries. 4. **Stay inside the skill.** Only edit files under this skill's tree: `skills/*/SKILL.md`, `skills/*/references/*.md`, `knowledge/**/*.md`, `templates/*.md`. Never touch the user's tracker, brand voice, or logs.
---
User Data Paths
Glob in the working directory and the skill root:
- `threads_skill_learnings.log` — the compound log written by `/review`
- `skills/*/SKILL.md` + `skills/*/references/*.md` — sub-skill rule surface
- `knowledge/_shared/*.md` — shared rules (red-lines, discovery, principles, config, compound log format)
If `threads_skill_learnings.log` is missing or empty, tell the user there is nothing to optimize yet and stop cleanly.
---
Execution Flow
Step 1: Load and Cluster
1. Read every JSON line in `threads_skill_learnings.log`. Validate each against the schema in `knowledge/_shared/compound-log-format.md` — skip and warn on malformed lines; do not error out. 2. Ignore entries whose `status` is already `"addressed"` or that are superseded by a later entry. Walk forward; keep only the final open entry for each `run_id` chain. 3. Cluster by `(sub_skill, category)`. Report cluster sizes:
## Compound Log Summary
- Total open entries: N
- Superseded / addressed: M
- Clusters (sub_skill / category / count):
- analyze / false_positive / 3
- draft / freshness_miss / 2
- voice / voice_drift / 2
- review / rule_gap / 14. If no cluster has ≥ 2 entries, say so. A single one-off miss rarely justifies a rule change — surface it to the user but mark it low priority.
Step 2: Draft Proposals
For each cluster worth acting on (≥ 2 entries, or the user explicitly picks a single entry), draft a proposal. Each proposal must include:
- **Cluster**: `<sub_skill> / <category>` with count.
- **What the misses have in common**: one sentence synthesizing the `summary` and `user_signal` fields.
- **Evidence**: quote 1–3 `user_signal` strings verbatim, with run_ids.
- **Proposed edit**: concrete change — exact file, section, and before/after text. If the edit belongs in `knowledge/_shared/red-lines.md` or another shared file, say so.
- **Reason**: why this edit addresses the pattern.
- **Strip when**: a condition under which this rule should later be retired (e.g. "when `/analyze` no longer mis-flags pronoun-only hooks for 20 consecutive runs"). Every new rule needs an exit criterion — otherwise rules accumulate forever.
- **Priority**: High (repeating red-line miss), Medium (upside gap), Low (polish).
Present all proposals in a single list, then wait for the user. Do not apply anything yet.
Step 3: User Review
Ask: "Which of these should I apply? Answer by proposal number, 'all', or 'skip'. You can also edit the proposal text before I apply it."
Honor the answer exactly. If the user edits a proposal, treat the edited version as authoritative.
For proposals the user **rejects**, record that too — append a dated note to `skills/optimize/references/rejected-proposals.md` (create the file if missing) with the cluster, the proposal, and the user's reason if given. This keeps the skill from re-proposing the same change next run.
Step 4: Apply Approved Edits
For each approved proposal:
1. Follow `templates/FAILSAFE.md` for every write: backup `<file>.bak-<ISO>` → write temp → atomic rename → prune to 5. 2. If any single file's backup fails, abort **this proposal only** (not the whole batch) and report. Other proposals continue. 3. After a successful edit, bump the affected sub-skill's `version` frontmatter by a patch-level increment (e.g. `1.1.0 → 1.1.1`). Shared-file edits bump the main SKILL.md version.
Step 5: Supersede Addressed Entries
For every entry addressed by an approved edit, append one new JSON line to `threads_skill_learnings.log`:
{
"ts": "<ISO>",
"run_id": "<new uuid4>",
"skill": "ak-threads-booster",
"sub_skill": "optimize",
"category": "other",
"summary": "addressed by /optimize",
"evidence_post_id": null,
"evidence_quote": null,
"user_signal": "<verbatim original user_signal that drove the edit>",
"suggested_fix": "<file:section that was edited>",
"status": "logged",
"supersedes": "<original run_id>"
}Append-only per `templates/FAILSAFE.md`. Never rewrite the original entry. The `supersedes` field is how future `/optimize` runs know to skip it.
Step 6: Report
End with:
## Optimize S
AK-Threads-Booster 是這個 skill 的內部代號與安裝 id。 AK-Threads-Booster 是一套給 Threads 創作者用的 AI skill 系統。 它不是要幫你亂寫一堆貼文,而是幫你把「選題、起草、分析、預測、復盤」變成一套有資料依據的工作流,讓你更容易發出值得被分享、收藏、討論的內容。 如果你平常的痛點是這些: 不知道下一篇到底該寫什麼 有很多題目,但分不出哪個更值得先發 文章不是寫不好,只是常常撞題、老梗、沒新鮮度 想讓內容更像自己,不想一看就很 AI
Other skills on ak-threads-booster.
- /analyze
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.
Open skill - /panel
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.
Open skill - /predict
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.
Open skill - /refresh
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', '更新貼文', '抓最新數據'.
Open skill - /review
Post-publish feedback loop: collect actual metrics, compare against predictions, update the tracker, refresh style conclusions carefully, and learn from deviations.
Open skill - /setup
Initialize AK-Threads-Booster: import historical posts, normalize them into the tracker schema, auto-generate a personalized style guide, and build a concept library. Run on first use or whenever the user wants to backfill account history.
Open skill

