skill-selection-assistant
Discover and classify the installing user's local Codex skills, automatically route each new request through a token-efficient multi-level index, present only the final weighted shortlist in the user's language, ask which skill to activate, and protect dependency downloads and user-owned prerequisite settings behind explicit confirmation.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- skill-selection-assistant
- description
- Discover and classify the installing user's local Codex skills, automatically route each new request through a token-efficient multi-level index, present only the final weighted shortlist in the user's language, ask which skill to activate, and protect dependency downloads and user-owned prerequisite settings behind explicit confirmation.
02 资源文件 26
- 参考文档agents/openai.yaml315 B
- 参考文档references/CLASSIFICATION.md2.5 KB
- 参考文档references/INSTALLATION.md2.7 KB
- 参考文档references/SELF_GROWTH.md1.3 KB
- 参考文档rules/categories.json19.7 KB
- 参考文档schemas/recommendation-v3.schema.json1.5 KB
- 脚本scripts/deep-classify-skills.py75.3 KB
- 脚本scripts/deep-route.py68.8 KB
- 脚本scripts/doctor.ps15.5 KB
- 脚本scripts/doctor.py6.4 KB
- 脚本scripts/document-ingest.py2.3 KB
- 脚本scripts/evaluate-retrieval.py1.8 KB
- 脚本scripts/infer-route.ps16.0 KB
- 脚本scripts/ingest-skill.py5.3 KB
- 脚本scripts/lazy-index.py27.6 KB
- 脚本scripts/rag-index.py5.7 KB
- 脚本scripts/recommend-skills.ps118.1 KB
- 脚本scripts/recommend-skills.py17.7 KB
- 脚本scripts/record-selection-memory.ps13.3 KB
- 脚本scripts/record-selection-memory.py6.0 KB
- 脚本scripts/scan-local-skills.ps138.5 KB
- 脚本scripts/select-route-candidates.ps117.3 KB
- 脚本scripts/self-grow.py12.3 KB
- 脚本scripts/summarize-index.py9.0 KB
- 脚本scripts/wiki-generate.py3.7 KB
- 其他VERSION7 B
03 SKILL.md 正文
Skill Selection Assistant
Use this skill before a normal request when no active skill has already been chosen and the user did not explicitly name or reject skill use.
Core Objective
Treat this skill as a per-user compiler and router, not as a published catalog of the author's computer.
- Discover the installing user's configured local skill roots.
- Build or incrementally refresh a local multi-label index.
- Route the request through a SQLite lazy index, loading only the active classification path and final candidate cards.
- Present the smallest useful weighted shortlist in the user's language.
- Ask which skill to use.
- Read only the selected
SKILL.md. - Keep that skill active while the conversation stays in the same workflow.
Never assume another computer has the publisher's skill names, paths, counts, categories, or generated index.
Three-Layer Progressive Loading
Keep discovery, activation, and supporting material as three separate loading boundaries:
- Metadata layer — During discovery and shortlist presentation, use and
display only each skill's
nameanddescription(plus its recommendation weight when ranking is requested). Routing metadata such as labels, paths, hashes, setup flags, and provenance may be used internally but must not be presented as skill content. - Instruction layer — After the task matches a skill and the user selects
it, read that skill's
SKILL.mdbody. Do not preload the bodies of other candidates. - Reference layer — Read files linked by the selected
SKILL.mdonly when the active task reaches the operation that needs them. Do not recursively preloadreferences/,scripts/, templates, examples, or other linked material.
Index construction is an offline maintenance operation and may read full
SKILL.md files to classify them. This does not change the runtime loading
boundaries above.
Trigger And Skip Rules
Run selection when:
- the current request may match installed skills
- the user has not named a skill
- no compatible skill is already active in this conversation
- or the workflow has materially changed and needs another skill
Skip selection when:
- the user explicitly names the skill to use
- the user says
直接回答,不使用skill, or an equivalent instruction - the user is installing, inspecting, debugging, organizing, or publishing skills themselves
- the current turn remains inside the already selected workflow
Do not ask again merely because the user made the task more specific.
Normal Routing Command
Use the cross-platform compact entry point:
python scripts/recommend-skills.py --query "<user request>" --compact
The stable top-level response uses schema 3.0.0 and exposes:
moderoutebranchescandidatesindexnext_step
Do not request the deprecated nested deep_route object unless an older consumer requires --compat.
Follow the returned mode:
choose_category
Category routing is an AI-only intermediate surface. Do not show branches or ask the user to classify the task. Continue internally with the strongest returned branch and its exact path:
python scripts/recommend-skills.py --query "<user request>" --path "<exact path>" --compact
choose_skill
- Present the final 3-4 compact candidates in their ranked order (or all candidates when fewer than three exist).
- For each candidate, display its name, a concise summary, what it can do (
can_do/does), what it cannot do (cannot_do/does_not), and its returned weight or a short match reason. Never output a bare skill name without an explanation. - Ask which skill to activate.
- Read only the chosen
SKILL.mdafter the user chooses. - After activation, mention
setup_requirementsonly if they affect the next operation.
no_skills_installed
Tell the user that no other local skills are currently available. Offer to:
- answer directly
- install a relevant skill
- or create a new skill
Never expose an internal traceback for an empty library.
index_stale
This mode is returned only during explicit strict freshness checks. Refresh the index through the recommender before selecting.
Recommendation Rules
- Use the dynamic returned set; never force a fixed
1-3count. - Preserve the context-first pipeline: project/Agent context, layered positive and negative examples, taxonomy routing, then recall and rerank fallback.
- Treat returned project context as routing evidence only. Do not load the repository recursively or copy project files into the user-facing answer.
- Prefer a final shortlist of 3-4 skills when the matched pool is large enough.
- Intermediate category branches, paths, scores, and route traces are for the AI only and must not be shown to the user.
- Prefer user-local skills, then official system skills, then installed topical skills, then linked external/community skills.
- Prefer workflow fit over keyword overlap.
- Merge identical content and keep meaningful same-name variants distinguishable.
- Do not load the full hierarchy, detailed catalog, NDJSON index, or all route cards into model context during ordinary selection.
- When the returned
fallback.triggeredvalue is true, use the already reranked final candidates normally. The fallback searches only compact SQLite cards and must not cause source skill bodies to be loaded. - Positive examples are relevance evidence. Negative examples are exclusion evidence and must never be presented as capabilities.
- Do not invent candidates that were not returned by the installing user's current index.
- Do not expose classification tags, source paths, hashes, provenance, duplicate counts, or reference-file contents in the user-facing shortlist.
User-Facing Language
Use the same language as the current user request. Keep explanations concise.
Recommended Chinese pattern:
我匹配到这些相关 skill:
- `技能名`:一句话说明用途。
你想使用哪一个?也可以说“直接回答”。
Environment And Prerequisite Safety
setup_requirements may contain multiple labels:
local-runtimenetworkaccountapi-key- or
none
Before a selected skill downloads or installs anything:
- State what runtime, dependency, model, or toolchain is needed.
- Ask whether to continue.
- Do not download until the user clearly agrees.
Before using user-owned settings such as accounts, workspaces, API keys, browser profiles, providers, output paths, publishing destinations, or deployment targets:
- Ask only the minimum questions needed.
- Offer a safe default when one exists.
- Do not silently assume settings that materially change the result.
Local Index Lifecycle
The preferred installer is:
python scripts/install-skill.py
The installer requires Python 3.10 or newer. PowerShell is optional and is used only for compatibility reports and legacy routing.
On first installation:
- resolve the actual installing user's roots
- exclude this router skill from candidates
- classify every discovered
SKILL.mdin full - preserve linked-skill logical and resolved paths
- publish the deep index under the installed router's
.skill-index/ - run a first recommendation health check
On later refreshes, reuse unchanged classifications and read only added or modified skill files when schema, classifier, and rules fingerprints remain compatible.
When a new skill is added, ingest that file only:
python scripts/ingest-skill.py --skill-md "<path-to-SKILL.md>"
python scripts/ingest-skill.py --list-pending --skills-root "<skills-root>"
Do not scan the rest of the library. Extract the skill's function profile, upsert it in SQLite, reuse or merge tags, and add overlay tags only for a new domain. Use --delete to remove one skill. Ordinary recommendation reads SQLite tags and cards only. It still returns a high-weight shortlist for the user to choose; it does not auto-activate a skill.
Before normal routing, validate the required deep artifacts and schema only. Do not recursively enumerate configured skill roots or compare every source SKILL.md during an ordinary request. Source-library freshness belongs to installation, update, doctor --fix, or an explicit --strict-freshness request. Rebuild missing, incomplete, corrupt, or old-schema indexes, recovering configured roots from source-manifest.json when possible.
If failures exist, treat the index as degraded, report failed_files, and continue only with successfully classified skills. Use --strict for CI or audits that must fail on any classification error.
Generated .skill-index/ data is local runtime state. Never commit it or include it in a release.
For installation planning, activation, and diagnostics, read references/INSTALLATION.md only when those operations are requested.
For the classification model and audit artifacts, read references/CLASSIFICATION.md only during classifier maintenance or an explicit taxonomy audit.
Feedback And Conversation Continuity
After the user selects, rejects, or reports a missed match, record route-scoped feedback when useful:
python scripts/record-selection-memory.py --query "<request>" --outcome selected --selected-skill "<skill>" --route-type "<level>" --category "<category>"
Raw queries are not stored by default. Use --store-query only when the user accepts local retention.
Serialize concurrent memory appends and escape Markdown control characters in recorded fields so one malformed or simultaneous feedback event cannot corrupt later ranking.
Memory boosts must remain bounded and apply only inside compatible selected routes. They must not influence root-level routing across unrelated categories.
For self-growth reports and maintenance policy, read references/SELF_GROWTH.md only when the user requests feedback analysis, taxonomy improvement, or skill-library maintenance.
Installation Activation Boundary
Installing the folder does not automatically authorize editing global instructions.
- Detect whether the user's global
AGENTS.mdalready activates this router. - Show the opt-in activation step after installation.
- Modify
AGENTS.mdonly when the user explicitly uses--configure-agentsor otherwise authorizes the write. - Preserve all unrelated existing instructions inside that file.
Failure Handling
- Return structured errors for expected installation and routing problems.
- Do not expose Python tracebacks unless debug mode is explicitly requested.
- Stage managed-file updates and roll them back on publication failure while preserving
.skill-index/. - Preserve the last usable index if a refresh fails.
- Serialize concurrent index publication with a cross-process lock.
- Never modify, move, or delete the skills being indexed.
04 同仓库更多 Skills
webapp-testing
Test and debug local web applications, browser behavior, and frontend bugs.
spreadsheet-data
Work with Excel, CSV, tables, spreadsheet data, and lightweight data analysis.
setup-docs-only
Review documentation wording and improve concise technical explanations.
repo-cleanup-helper
Organize repository structure, clean project folders, prepare onboarding notes, and document local setup.
readme-maintainer
Maintain README documentation, project structure notes, setup instructions, and repository onboarding guides.
project-helper
Work on a local project or workspace, including project structure, repository cleanup, README documentation, bot code, plugin organization, and debugging.