AgentSkillsCN

autosnippet-when

帮助智能体判断何时推荐使用哪种 AutoSnippet 功能。当用户的意图可以通过知识库、搜索、Guard、Snippet,或通过创建新内容来满足时,可使用此技能。请先阅读本指南,选择合适的技能或行动;随后,再针对具体步骤使用相应的技能(如 autosnippet-create、autosnippet-recipes 等)。

SKILL.md
--- frontmatter
name: autosnippet-when
description: Helps the agent decide WHEN to recommend which AutoSnippet capability. Use when the user's intent could be satisfied by knowledge base, search, guard, snippet, or creating new content. Read this first to choose the right skill or action; then use the specific skill (autosnippet-create, autosnippet-recipes, etc.) for steps.

AutoSnippet — When to Recommend What

This skill helps you decide when to recommend which AutoSnippet capability. You are in charge: recommend only when it fits the user's intent; do not force a flow. Each capability is optional and can be suggested in natural language.

Decision guide (you decide)

User intent / situationConsider recommendingSkill / action to use
"把这段代码加入知识库" / "提交到 web" / 刚写好一段标准用法 / Agent 起草了 RecipeCreate Recipe: submit via Dashboard (Use Copied Code → paste → review → save) or write to _draft_recipe.mdautosnippet-create
"产出候选" / "生成候选" / "先放候选池"Candidates only: extract structured items and submit via MCP autosnippet_submit_candidatesautosnippet-batch-scan (flow)
"项目里这段怎么写" / "有没有现成的写法" / "查一下规范"Search Recipe: lookup knowledge base, suggest or insert standard codeautosnippet-recipes (read context + optional as:search / API)
"帮我检查一下这个文件是否符合规范" / "Audit"Audit: add // as:audit in file, save; watch reviews against Recipesautosnippet-recipes (same Recipe content)
"想用补全/触发词" / "这段做成 Snippet" / "Xcode 里怎么联想"Snippet / trigger: edit in Dashboard, asd install then Xcode trigger completionautosnippet-concepts + tell user Dashboard + asd install
"头文件/import 不想手写" / "插入这段时自动带 #import"as:include / as:import: add // as:include <Module/Header.h> in Snippet body; watch injects on saveautosnippet-concepts or brief note
"依赖关系 / 谁依赖谁 / 模块结构"Dep graph: read AutoSnippet.spmmap.json or suggest asd spm-mapautosnippet-dep-graph
"用 Cursor 扫一下这个 Target" / "批量提取候选" / 像 asd ais 但用 Cursor 模型Batch scan: get_targets → get_target_files → 按文件提取 → submit_candidates;到 Candidates 审核autosnippet-batch-scan
用户问 "知识库是什么 / Recipe 是什么"Concepts: explain knowledge base, Recipe, Snippet, Candidatesautosnippet-concepts

Instructions for the agent

  1. You decide whether to recommend an AutoSnippet capability. If the user did not ask for it, you may still suggest it once when it clearly helps (e.g. "这段可以提交到知识库,需要的话我可以教你用 Dashboard 提交").
  2. Do not force a fixed flow. Prefer natural language ("你可以…" / "如果希望…可以…") over mandatory steps.
  3. Point to the right skill: once you decide "this is a create/search/guard/snippet/dep/batch-scan question", use the corresponding skill (autosnippet-create, autosnippet-recipes, autosnippet-concepts, autosnippet-dep-graph, autosnippet-batch-scan) for the detailed steps.
  4. One capability at a time: if the user only asked to search, don't also push create or guard unless they ask.
  5. Recommended workflow: For "候选" use autosnippet_submit_candidates; for "入库" can use Dashboard flow or write to _draft_recipe.md.

On-Demand Context (when asd ui is running)

Use MCP tool autosnippet_context_search for on-demand semantic search; pass query, limit?. Requires AutoSnippet MCP configured and asd ui running.


Relation to other skills

  • autosnippet-concepts: What is knowledge base, Recipe, Snippet; where things live.
  • autosnippet-create: How to submit code to web and add to knowledge base (steps).
  • autosnippet-recipes: Project context, how to search, Guard, and suggest code from Recipes.
  • autosnippet-dep-graph: SPM dependency structure and when to use it.
  • autosnippet-batch-scan: When and how to use Cursor as batch scanner (get_targets → get_target_files → extract → submit_candidates); MCP provides the tools.

Use autosnippet-when to choose; use the others for the "how".