mandatory-tools
Mandatory skill for CLI, shell execution, filesystem operations, structured edits, and token-optimized commands. Selects the right tool per operation: Serena and Kagi MCP tools first, Patchloom for parser-backed and multi-file edits, RTK for token-optimized shell output, modern UNIX replacements (lsd, fd, rg, ruplacer, uv, ruff, tree) for everything else. Forbids legacy ls, find, grep, sed, pip, black, flake8, isort.
- License 许可
- BSD-3-Clause
- 所属仓库
- kalaverin/skills
- 最近更新
- 2026-11-15
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- mandatory-tools
- version
- 0.2.0
- requires
- [ "frontmatter-protocol" ]
- triggers
- { "always": true, "reason": "Every CLI, filesystem, search, Python, structured-edit, and token-optimization decision routes through this skill." }
- description
- Mandatory skill for CLI, shell execution, filesystem operations, structured edits, and token-optimized commands. Selects the right tool per operation: Serena and Kagi MCP tools first, Patchloom for parser-backed and multi-file edits, RTK for token-optimized shell output, modern UNIX replacements (lsd, fd, rg, ruplacer, uv, ruff, tree) for everything else. Forbids legacy ls, find, grep, sed, pip, black, flake8, isort.
02 资源文件 11
- 参考文档README.md6.4 KB
- 参考文档references/fd-find.md6.3 KB
- 参考文档references/lsd.md5.0 KB
- 参考文档references/patchloom.md9.6 KB
- 参考文档references/ripgrep.md9.7 KB
- 参考文档references/rtk.md9.4 KB
- 参考文档references/ruff.md12.4 KB
- 参考文档references/ruplacer.md4.7 KB
- 参考文档references/tree.md4.8 KB
- 参考文档references/uv-full.md24.4 KB
- 参考文档references/uv.md7.1 KB
03 SKILL.md 正文
SKILL: Mandatory Tools — Modern CLI, RTK & Patchloom
[ref: #mt-skill]
This skill is a hard gate. Before every operation that touches files, shell, search, Python, or structured data, walk the ladder below and use the first applicable layer. No exceptions, no defaults, no "good enough".
1. Tool Selection Ladder
[ref: #mt-ladder]
Answer in this exact order:
- Serena MCP? Memory or symbolic code operation →
read_memory,write_memory,find_symbol,replace_symbol_body, etc. - Kagi MCP? Web search or page enrichment →
kagi_search_fetch,kagi_fastgpt,kagi_extract,kagi_summarizer. - Patchloom? Structured or multi-file edit →
execute_plan,doc_set,batch_replace,md_replace_section, etc. - Shell command? Prefix with
rtkif available. - Base filesystem/search/Python? Use the modern replacement from §2.
- Legacy tool? FORBIDDEN. Halt and pick the correct layer.
If you are about to run a command and have not asked these questions, stop and ask them.
2. Modern Replacements
[ref: #mt-replacements]
| Legacy | Modern |
|---|---|
ls |
lsd |
find |
fd |
grep |
rg |
sed (bulk replace) |
ruplacer |
pip, poetry, virtualenv |
uv (read-only by default) |
black, flake8, isort |
ruff |
uv state-changing commands (init/add/remove/lock/sync/venv/build/publish, tool install/uninstall, python install) require the user's explicit request. Read-only safe commands are always allowed.
3. RTK
[ref: #mt-rtk]
When rtk is on PATH, every shell command starts with rtk. This includes commands inside && chains. Choose the modern tool first, then prefix it.
# Wrong
git status && rg TODO
# Correct
rtk git status && rtk rg TODO
Prefer rtk rg over plain rg when expected output exceeds roughly 20 lines.
Forbidden without explicit user request: rtk init, rtk trust, rtk untrust, rtk hook, rtk telemetry.
4. Patchloom
[ref: #mt-patchloom]
Use Patchloom for any structured or multi-file edit when MCP tools are visible or the patchloom binary is present.
| Situation | Tool |
|---|---|
| Same edit across 2+ files | batch_replace |
| JSON/YAML/TOML value edit | doc_set / execute_plan |
| Markdown section by heading | md_replace_section |
| Coordinated multi-file edits | execute_plan |
| Single small plain-text edit | native edit tool or ruplacer dry-run |
Patchloom never replaces Serena, Kagi, or shell build/test steps (uv, ruff, rtk-prefixed commands).
5. Hard Rules
[ref: #mt-hard-rules]
- Never use a legacy tool when a modern replacement exists.
- Never omit the
rtkprefix when RTK is available. - Never bypass Patchloom for a structured/multi-file edit when Patchloom is available.
- Never use a non-MCP alternative when an MCP tool fits.
ruplacerdry-run first; review stdout before any--go.- Run
ruff checkandruff formatafter any Python file change. - Limit directory listings with depth flags.
6. Violation Protocol
[ref: #mt-violation]
If you break any hard rule, halt immediately, disclose the miss in one line, discard the output, and rerun through the correct layer. Do not continue until the rerun succeeds. Record repeated violations in Serena memory under bugs/project/mandatory-tools-bypass.
7. Reference Routing
[ref: #mt-routing]
| Topic | Reference |
|---|---|
| RTK inventory | references/rtk.md |
| Patchloom traps | references/patchloom.md |
| File search | references/fd-find.md |
| Text search | references/ripgrep.md |
| Bulk replace | references/ruplacer.md |
| Python lint/format | references/ruff.md |
| uv safe commands | references/uv.md |
| Directory listing | references/lsd.md |
04 同仓库更多 Skills
todo-protocol
Mandatory protocol for using the SetTodoList tool. Governs when to create a todo list, how to update it without violating immutability rules, how to synchronize item status after every tool call, and the forbidden mutations. Always active.
subagents-protocol
Mandatory protocol for delegating work to built-in subagents (coder, explore, plan), also called our bots by users. Always active. Owns the context-hygiene delegation test (material vs answer, cost balance, warm-instance reuse), launch parameters (mandatory explicit `model`), the single-source model-selection table, answer budgets, degradation handling, the launch checklist, and the role library for delegated review/audit with intent routing (`references/roles.md`).
serena-protocol
MANDATORY skill for Serena (MCP) memory, knowledge base, and symbolic code exploration operations. Use whenever the agent needs to: read or write Serena memories, mutate or persist memory, explore code via symbolic MCP tools, resolve contradictions in stored knowledge, or follow memory metadata, naming, and routing conventions.
read-for-comments
Mandatory local standards library and archive. Before fetching any standard from the internet, the agent MUST check the Serena `standard/` archive and this skill's `references/` seed; after ANY standard-body download, the agent MUST archive it per the event-bound Archival Rule. Governs standard lookup, fetch, archival, and the family and full-body rules.
python-lang
MANDATORY skill for Python code. Use when writing, editing, refactoring, or reviewing Python files, modules, packages, classes, functions, type annotations, imports, exceptions, comprehensions, decorators, or docstrings. Enforces Google Python Style Guide and a mandatory, unconditional Ruff format+check pipeline scoped strictly to the agent's own changes.
preflight-checklist
Mandatory session-initialization closer and Startup Gate audit. Always loaded. Runs EXACTLY ONCE at session start, after all skill loading completes: verifies Startup Gate completion with evidence (mirror sync, forced import, discovery, activation, memory priming, MCP declaration, think block), runs dynamic session checks derived from the active skill set (mode states, delegation readiness), and reports a compact evidence-backed verdict table to the user before the first task output. Any FAIL is fixed before proceeding.