The distillation instruction entry point of the ybrain main skill: distill materials into structured key points and write them into the knowledge pack at the idea layer of the two-layer structure.
Prerequisite: main skill
This instruction is an entry point of the ybrain main skill. It does not carry its own scripts or API documentation and depends on the main skill installed in the same directory:
- Main skill directory =
<本技能目录>/../ybrain(the two are always installed in the same directory); you can also invoke the main skill directly by the skill nameybrainto invoke the main skill - All transmission goes through
node "<主技能目录>/scripts/ima_api.cjs" <apiPath> <json-body>(credentials are automatically read from ~/.config/ima) ⛔ It is forbidden to bypass it and directly use curl to construct IMA requests - Before calling the API, read the corresponding references/ documentation according to the main skill's SKILL.md "Positioning and Hard Boundaries"
- Before the first execution in each session, complete ID resolution and Bootstrap according to the main skill's SKILL.md (after one confirmation of missing structure, automatically create it all)
- If there is any discrepancy between this instruction and the main skill description, the main skill's SKILL.md prevails
Process
- Retrieve the original text (three branches by material type):
- Knowledge base entry →
get_media_infobranch (references/core-rules.md; ⛔export_media_for_ima_sandboxthe current credentials have no permission 220030, use is forbidden) - Note →
export_note(target_content_format=1, download content_url to get Markdown) - External webpage → WebFetch
- Knowledge base entry →
- Distill into structured key points; you may ask the user one question, "Is there any resonance or thought you want to record?" (optional, not mandatory — knowledge base entries cannot have annotations, and resonance can only be recorded in notes during distillation).
- Locate the knowledge pack:
search_notetitle【项目】Xor【领域】X. If it exists → after confirming with the user,append_docappend a new section (to revise an old section useexport_note_blocks+update_note); if it does not exist → after confirming the title and prefix with the user,import_doccreate a new one. - Short-focus annotation: at the end of the new section, annotate "Can be used for: Project X / None for now" to help long-focus projects gather materials.
Hard rules
- Continuously append the same project/topic to the same knowledge pack, distill and add value; do not create a new one each time.
- Creating a new knowledge pack is an out-of-scope write; the title and prefix must first be confirmed with the user.
- For long text written into notes, do not use command-line inline parameter passing (PowerShell will silently lose special punctuation, and quote escaping in Unix-like shells will corrupt JSON). Write to disk according to the safe writing method in the main skill's references, and read back to verify after writing.
Common errors
| Error | Correction |
|---|---|
| A new knowledge pack is created for each distillation | Continuously append the same project/topic to the same one |
Attempting to use export_media_for_ima_sandbox to retrieve the original text |
220030 has no permission; use get_media_info(entry) or export_note(note) |
| Command-line inline JSON body passing causes characters such as —— → to be lost | For writing, use the file body method, and after writing export_note download and read back to verify |
| Bypass ima_api.cjs and directly curl the IMA interface | All transfers go through the main skill's built-in script, with credentials and errors reused in layers. |