crystallize

A command that turns repeated, structured rules or workflows stored in the agent’s memory into permanent skills. It reviews possible candidates with the user, then prepares the approved skills and checks them.

In plain words
What is it for?
Finding recurring project practices, proposing which ones should become skills, getting user approval, and creating the approved skills in a batch.
Why use it?
Important conventions can be pushed out of a limited memory list or treated as one-off facts. Making them skills keeps them available whenever their trigger matches.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/lee-w/maigo/crystallize
Clone the repo
git clone --depth 1 https://github.com/Lee-W/maigo
Per session 72 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,531 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00072 $0.03531
Opus 5 $0.00036 $0.01766
Sonnet 5 $0.00014 $0.00706
Haiku 4.5 $0.00007 $0.00353

Measured 2d ago against content hash 1a7ae26e8b6d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

crystallize scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

讀 cross-project index 全文,再 `cat ~/.claude/projects/<current-project>/memory/MEMORY.md`
commands/crystallize.md · 202 lines

How it starts

The opening of the file, as written. The whole thing — 202 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/maigo:crystallize

🌙 Doloris:「請讓散落的記憶在今夜結晶;往後的路,不必再由偶然照亮。」

記憶層是扁平、relevance-ranked、capped 10 筆的事實儲存(見 skills/memory-loading)。 但有些條目其實不是「一次性事實」,而是反覆出現的慣例 / workflow / 規則—— 塞在 memory 裡每次只被當事實載入,相關條目一多還會被擠出前 10 筆。

crystallize 把這類條目「畢業」成常駐 skill:trigger 命中就一定在 context、 結構化、可被 command / agent 直接引用。這是 maigo 知識成熟度階梯往上爬一階的動作:

memory(單一事實,relevance-ranked、capped 10)
   ↓ 反覆出現、夠結構化、有明確 consumer  ← crystallize 走這一步
skill(共用 convention / workflow,trigger 命中就常駐)
   ↓ 失敗該整個 turn 擋下
hook(機器強制)

分工:互動的「挑候選 → 逐筆 propose → 使用者拍板」由 orchestrator + 旁白主持 (這段需要對話 context,不下放);確認的畢業攢成一批,寫 skill + 驗證那段委派 🎀 愛音,照 /maigo:quick 的輕量模式(愛音實作 + 輕量 🟡 爽世 4 項 review + 顯式驗證)。

為什麼這樣切:挑候選 / 確認天生是 orchestrator 的活;但「寫 SKILL.md + shim + mkdocs + catalog 再跑 validator」是一個該被 review、被 verify 的 code change,不該 orchestrator 自己 偷雞。批次委派(不 per-entry spawn)是為了攤平冷啟動成本——一次 run 畢業幾條都只 spawn 愛音一次。

使用

/maigo:crystallize

(無參數——掃整個記憶層找畢業候選)

流程

1. 載入記憶層(全讀,不做 relevance 排序)

cat ~/.config/maigo/memory/MEMORY.md

讀 cross-project index 全文,再 cat ~/.claude/projects/<current-project>/memory/MEMORY.md (若存在)讀 per-project index。

skills/memory-loading 的差別:那個 skill 為「當前 task」按相關性取前 10 筆;crystallize 要掃全部, 因為畢業候選跟當前 task 無關。Read 每個 index 行指向的 entry 全文。

Fallback:記憶目錄 / index 不存在或為空 → 印「記憶層是空的,沒有可畢業的條目」,結束。

2. 挑畢業候選(criteria)

對每筆 entry 套一組準則,全中才是候選:形狀是 convention / workflow / 規則(非一次性事實)、 有明確 consumer、有反覆性 signal;額外強訊號與排除規則見 skills/maigo-self-check/references/skill-graduation.md「Step 2 — 挑畢業候選:criteria 細節」。

掃完印一段 ## 畢業候選,列出 N 個候選 + 每個的一句畢業理由。候選為 0 → 跳到步驟 7 的空結算。

3. 世界觀隔離 gate

每個候選 propose 前,先判斷它屬於哪個 plugin 的世界觀。

  • maigo 記憶只能畢業進 maigo skill。 若候選描述的是 mujica(寫作 / 部落格審稿 / daily-plan 等)世界觀的慣例 → 不在此命令處理,標記「跳過(mujica 世界觀, 請在 mujica 端處理)」,不 propose。
  • 共用底層(記憶層路徑、frontmatter schema)不算特定世界觀,可畢業進 maigo skill。

Read the full file on GitHub · 202 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 202 lines · 72 tokens per session scan B 1a7ae26e8b6d

Subscribe to this mod's changes

crystallize is a command published in the GitHub repository Lee-W/maigo (14 stars, last pushed 8d ago), licensed MIT. It adds 72 tokens to every session and 3,531 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.