You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _sources/en/task/agent-skill.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,11 @@ Adopts **three-stage on-demand loading** to optimize context: Initially loads on
14
14
15
15
**Workflow:** User Query → AI Identifies Relevant Skill → Calls `load_skill_through_path` Tool to Load Content and Activate Bound Tools → On-Demand Resource Access → Task Completion
16
16
17
+
**Unified Loading Tool**: `load_skill_through_path(skillId, resourcePath)` provides a single entry point for loading skill resources
18
+
-`skillId` uses an enum field, ensuring selection only from registered Skills, guaranteeing accuracy
19
+
-`resourcePath` is the resource path relative to the Skill root directory (e.g., `references/api-doc.md`)
20
+
- Returns a list of all available resource paths when the path is incorrect, helping the LLM correct errors
21
+
17
22
### Adaptive Design
18
23
19
24
We have further abstracted skills so that their discovery and content loading are no longer dependent on the file system. Instead, the LLM discovers and loads skill content and resources through tools. At the same time, to maintain compatibility with the existing skill ecosystem and resources, skills are still organized according to file system structure for their content and resources.
Bind Tools to Skills for on-demand activation. Avoids context pollution from pre-registering all Tools, only passing relevant Tools to LLM when the Skill is actively used.
167
172
173
+
**Lifecycle of Progressively Disclosed Tools**: Tool lifecycle remains consistent with Skill lifecycle. Once a Skill is activated, Tools remain available throughout the entire session, avoiding the call failures caused by Tool deactivation after each conversation round in the old mechanism.
Provides an isolated code execution folder for Skills, supporting Shell commands, file read/write operations, etc. Uses Builder pattern for flexible configuration of required tools.
@@ -433,6 +433,12 @@ <h2>Core Features<a class="headerlink" href="#core-features" title="Link to this
433
433
<h3>Progressive Disclosure Mechanism<aclass="headerlink" href="#progressive-disclosure-mechanism" title="Link to this heading">¶</a></h3>
434
434
<p>Adopts <strong>three-stage on-demand loading</strong> to optimize context: Initially loads only metadata (~100 tokens/Skill) → AI loads complete instructions when needed (<5k tokens) → On-demand access to resource files. Tools are also progressively disclosed, activated only when the Skill is in use.</p>
435
435
<p><strong>Workflow:</strong> User Query → AI Identifies Relevant Skill → Calls <codeclass="docutils literal notranslate"><spanclass="pre">load_skill_through_path</span></code> Tool to Load Content and Activate Bound Tools → On-Demand Resource Access → Task Completion</p>
436
+
<p><strong>Unified Loading Tool</strong>: <codeclass="docutils literal notranslate"><spanclass="pre">load_skill_through_path(skillId,</span><spanclass="pre">resourcePath)</span></code> provides a single entry point for loading skill resources</p>
437
+
<ulclass="simple">
438
+
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">skillId</span></code> uses an enum field, ensuring selection only from registered Skills, guaranteeing accuracy</p></li>
439
+
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">resourcePath</span></code> is the resource path relative to the Skill root directory (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">references/api-doc.md</span></code>)</p></li>
440
+
<li><p>Returns a list of all available resource paths when the path is incorrect, helping the LLM correct errors</p></li>
441
+
</ul>
436
442
</section>
437
443
<sectionid="adaptive-design">
438
444
<h3>Adaptive Design<aclass="headerlink" href="#adaptive-design" title="Link to this heading">¶</a></h3>
<h3>Feature 1: Progressive Disclosure of Tools<aclass="headerlink" href="#feature-1-progressive-disclosure-of-tools" title="Link to this heading">¶</a></h3>
588
594
<p>Bind Tools to Skills for on-demand activation. Avoids context pollution from pre-registering all Tools, only passing relevant Tools to LLM when the Skill is actively used.</p>
595
+
<p><strong>Lifecycle of Progressively Disclosed Tools</strong>: Tool lifecycle remains consistent with Skill lifecycle. Once a Skill is activated, Tools remain available throughout the entire session, avoiding the call failures caused by Tool deactivation after each conversation round in the old mechanism.</p>
<h3>Feature 2: Code Execution Capabilities<aclass="headerlink" href="#feature-2-code-execution-capabilities" title="Link to this heading">¶</a></h3>
624
+
<p>Provides an isolated code execution folder for Skills, supporting Shell commands, file read/write operations, etc. Uses Builder pattern for flexible configuration of required tools.</p>
<divclass="highlight-java notranslate"><divclass="highlight"><pre><span></span><spanclass="c1">// Customize working directory and Shell command whitelist</span>
<spanclass="w"></span><spanclass="kc">null</span><spanclass="p">,</span><spanclass="w"></span><spanclass="c1">// baseDir will be automatically set to workDir</span>
<spanclass="w"></span><spanclass="p">.</span><spanclass="na">workDir</span><spanclass="p">(</span><spanclass="s">"/path/to/workdir"</span><spanclass="p">)</span><spanclass="w"></span><spanclass="c1">// Specify working directory</span>
646
+
<spanclass="w"></span><spanclass="p">.</span><spanclass="na">withShell</span><spanclass="p">(</span><spanclass="n">customShell</span><spanclass="p">)</span><spanclass="w"></span><spanclass="c1">// Use custom Shell tool</span>
<li><p><strong>Unified Working Directory</strong>: All tools share the same <codeclass="docutils literal notranslate"><spanclass="pre">workDir</span></code>, ensuring file isolation</p></li>
661
+
<li><p><strong>Selective Enabling</strong>: Flexibly combine Shell, read file, and write file tools as needed</p></li>
662
+
<li><p><strong>Flexible Configuration</strong>: Supports custom ShellCommandTool to meet customization requirements</p></li>
663
+
<li><p><strong>Automatic Management</strong>: Automatically creates temporary directory when <codeclass="docutils literal notranslate"><spanclass="pre">workDir</span></code> is not specified, with automatic cleanup on program exit</p></li>
664
+
</ul>
665
+
</section>
666
+
<sectionid="feature-3-skill-persistence-storage">
667
+
<h3>Feature 3: Skill Persistence Storage<aclass="headerlink" href="#feature-3-skill-persistence-storage" title="Link to this heading">¶</a></h3>
617
668
<p><strong>Why is this feature needed?</strong></p>
618
669
<p>Skills need to remain available after application restart, or be shared across different environments. Persistence storage supports:</p>
0 commit comments