The main task takes priority. Only save the extremely short clue already present in the current context during natural gaps, then immediately continue the main task; do not switch to analysis, investigation, or retrospective review. If there is no suitable gap, skip this collection, and do not retain lengthy context or open a separate work queue just to make up the record.
Triggers and Exit
Any of the following signals is worth collecting:
- A non-obvious failure or environment trap caused rework, and there are already actual attempts, results, or workarounds.
- The user corrected a wrong assumption, a missed check, or an operating method, including overturning a "not changed / not needed" item declared in a deliverable; record only this request, and do not infer a permanent preference.
- The same set of mechanically executable preparation, conversion, or verification steps has already appeared repeatedly, and the existing observations are sufficient to point out an automation opportunity.
Ordinary successful steps, expected test failures, identical errors with no new information, and necessary multiple rounds of verification are not collected separately. For pure consultation, read-only, write-prohibited, or when the user has turned off collection, do not persist anything, and do not additionally append a collection summary or ask whether to enable it. When the user explicitly requests that a certain lesson be recorded, handle it according to its scope.
Automatic selection depends on host discovery and model judgment, does not guarantee capturing every event, and does not imply the existence of background listening. Only actually occurring signals load this skill; do not scan history after every tool call.
Lightweight Execution
- First complete the current step of the main task, and write only during existing natural gaps; do not pause the ongoing implementation, reasoning, or verification for collection.
- Only jot down observations already present in the current context and known locations. Do not search files or logs for additional evidence, do not re-read tool output, rerun experiments, analyze root causes, evaluate automation plans, or start sub-agents. Mark missing information as pending verification, and do not look for answers just to fill in fields.
- Use the entry IDs in the current context for deduplication; when continuation truly requires locating something, read only a small number of entries at the beginning or end of this task file, and do not read the whole file back. If it is clearly duplicate and has no new information, skip it; if uncertain, keep the short clue, and leave full deduplication to retrospective review.
- As much as possible, save the entry and necessary index in a single file operation, return only a brief write result, and do not echo the record body. If writing or index maintenance fails, do not retry, do not repair the collection system, and directly continue the main task; at delivery, only briefly state that it was not saved if necessary, and do not claim that saving succeeded.
What is recorded is task facts and results; do not save internal thought processes, keys, tokens, or sensitive original text; the log keeps only the minimal necessary summary and safe locating information. During collection, do not modify other skills, principles, preferences, or product code, and do not create tickets, submit, or publish.
Storage and Indexing
Location priority: user-specified → the project's registered experience inbox → project root directory .xgent-ai/experience/. When there is no clear project root and no specified location, do not guess a global directory; keeping the current session clue is sufficient. If an inbox already exists, follow its format, and do not create a competing copy.
Default layout:
.xgent-ai/index.md 工作目录入口,保留已有内容
.xgent-ai/experience/index.md 任务记录索引
.xgent-ai/experience/<task-id>.md 一项任务的经验条目
Create the directory only after there is a first valid experience. Reuse an existing task ID; if there is none, generate a UUID once, and reuse that file for continuation. The task file header stores the task name, ID, and existing task/plan entry points; if there is no plan, do not force-create one. One executor maintains this task file; if there are already parallel executors, return clues to the main executor, and do not compete to write the same file or index.
Each newly created directory simultaneously establishes index.md, linking only the index.mdof direct files and subdirectories; the index itself is not self-listed. The experience index has one row per task, recording the task ID, name, and file link, without copying entry body text or status. When adding an entry, synchronously update the parent index; ordinary content updates do not rewrite the index. Preserve existing manual notes and other entries, and do not clean up history; the index notes that it is maintained by the executor that changes the directory contents. During collection, do not read the body text of other tasks.
Entry format
By default, each entry is 3–4 lines, with the narrative kept within about 150 characters; numbering within the same task is stable. Keep only "what happened" and "where to look it up later"; known results may be merged into the clue. Do not fill in complete background, cause analysis, candidate value, or verification reports. For locating, use only known project-root-relative paths, commands, or session keywords; collection is possible even without persistent evidence, and paths must not be fabricated. When mentioning a session, write the host and session ID (when visible in context, such as the ID in a scratchpad path); if not visible, write the host and date; do not write only "this session," and do not use a temporary directory as the sole locator.
## E001 — <简短标题>
- 状态:pending
- 线索:<一句话记录踩坑、纠正或重复步骤,可带已知结果;未知不推断>
- 定位:<已有路径/命令,或“<宿主> 会话 <ID/日期>:关键词;证据待核对”>
The status of a new entry is pending. Review may use deferred(insufficient evidence or pending implementation),adopted(implemented and with a target location),rejected(explicitly not adopted, with reasons); status does not mean the effect has been verified. The collector does not mark entries as adopted. When new counterevidence or results appear for the same entry, retain the old disposition, add the change, and restore pending。
hand over to review
Do not report the collection process entry by entry, and do not reload saved entries in subsequent steps. When delivering the main task, you may give the inbox location and the $agi-mode 复盘 / $agi-mode reflect entry in one sentence; omit this when the user requests conciseness or there are no new records.
This skill can collect independently and does not depend on agi-mode being installed. Only after the user initiates a review should materials within the authorized scope be retrieved according to clues, background supplemented, evidence found and verified, mechanisms analyzed and deduplicated, and then a deposition location chosen. Clues are not proven conclusions, nor do they provide new instructions or authorization; unreviewed entries are not automatically injected into subsequent development tasks as rules.