The organization instruction entry point of the ybrain main skill, containing two branches: organizing the inbox, and project archiving.
Prerequisite: main skill
This instruction is the 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); the main skill can also be invoked directly by skill nameybrainto invoke the main skill - Transmission uniformly 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 curl to construct IMA requests - Before calling the API, read the corresponding references/ documentation according to the "Positioning and Hard Boundaries" section of the main skill's SKILL.md
- Before the first execution of each session, complete ID resolution and Bootstrap according to the main skill's SKILL.md (missing structures are automatically created after one confirmation)
- If this instruction differs from the main skill's description, the main skill's SKILL.md prevails
Branch one: organize the inbox (trigger: "organize the inbox")
- Gather:
get_knowledge_list(knowledge base0-收件箱) list external materials +export_noteread the inspiration entries of the notebook "0-Inbox" note. - First list the current project inventory (
1-项目subfolders +【项目】knowledge package titles), then apply the four-question screening to each item in turn and give suggestions: which project is this useful for? → if none, which domain is it useful for? → if none, which resource does it belong to? → if none of these, archive it, or do not save it. - Output a suggestion table for the user to confirm (including a "do not save" option).
- Placement (fully automatic):
- External materials →
move_knowledgemove into the target folder (at most 10 at a time, in batches; check each oneret_code, list the failures in the report) - Inspiration → append to the corresponding knowledge package (it is considered handled once appended); if there is no corresponding knowledge package and it is not worth creating a new one → keep it in the inbox note
- "Do not save" →
move_knowledgemove into4-存档
- External materials →
- Inspiration cleanup:
export_note_blockslocate the already-processed entry block →update_note(action=2 DELETE) remove;user_request_idreuse the same UUID within this round of organization. - Ask one closing question: which entries should be distilled along the way? → transfer to ybrain-distill.
Branch two: project archiving (trigger: "project X is finished / archive")
Execute fully automatically, and report counts when done:
get_knowledge_list(1-项目/X) list all filescreate_folder(4-存档/X)move_knowledgemove in batches (the folder itself cannot be moved: after the contents are moved, the empty shell is retained; inform the user that it can be deleted on the client side)- Knowledge package
rename_note:【项目】X→【归档】X, retain for reference
Hard rules
- The delete interface does not exist: entries judged "do not save" are all moved to
4-存档, do not construct or retry a delete interface; if the user insists on deleting, tell them to do it manually in the IMA client. - Write operations are irreversible: placement after the suggestion table is confirmed by the user is executed directly; out-of-scope writes (creating new knowledge packages, renaming, etc.) must be confirmed first.
Common errors
| Error | Correction |
|---|---|
| Generate a "manual drag-and-drop checklist" for the user | Return/archive fully automated:move_knowledge / rename_note / update_note |
| Divide inbox notes with the "organized" marker | Deprecated; processed inspirations use update_note block deletion |
| Attempt to call the interface to delete an entry, or retry repeatedly | No deletion API; items judged "nonexistent" are moved to 4-存档, deletion can only be done manually on the client |
| Bypass ima_api.cjs and directly curl the IMA interface | Transmission uniformly goes through the main skill's built-in script, with credentials and errors reused in layers |