Communitygithub.com

High-cla/multi-skilled-repository

AI Agent Skills 合集 — CMD+PowerShell 避坑指南 · CLI 优先决策矩阵 · 更多技能持续添加

multi-skilled-repository 是什么?

multi-skilled-repository is a Claude Code agent skill that aI Agent Skills 合集 — CMD+PowerShell 避坑指南 · CLI 优先决策矩阵 · 更多技能持续添加.

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add High-cla/multi-skilled-repository

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

CLI-First Decision

Core Rule

Before any task starts, decide by priority: trigger first → think → select tool → execute

  1. Forced Trigger: Upon receiving ANY request, before starting to think, before calling any tool, before dispatching any sub-agent, you MUST first trigger this skill to make a decision
  2. Think First: First understand the essence of the problem—clarify requirements, break down steps, determine scope. Don't rush to grab tools.
  3. Built-in Tools Next: Simple read/write/search one step away → directly use Read/Edit/Grep/Glob etc. (zero extra cost)
  4. CLI Tools Next: Batch/mechanical operations → use corresponding CLI tools (<1s, refer to matrix below)
  5. Skill Assistance: Operations requiring domain expertise → first load the corresponding skill for guidance (refer to available skills list)
  6. MCP Tools: Knowledge graph queries, sequential reasoning, web scraping, etc. → use tools provided by MCP server
  7. Sub-Agent: Multi-step reasoning, semantic understanding, cross-module analysis → dispatch a sub-agent
  8. Self-Reasoning as Fallback: Architecture decisions, design trade-offs, review and validation → reason yourself or consult Oracle

Decision Tree

Receive request (trigger)
  └─ Identify type: fix/implement/research/evaluate/open-ended?
       └─ Reason: first clarify requirements, break down steps, determine scope
       ├─ Simple read/write/modify a file with known content? ───→ Built-in tools (Read/Edit/Write)
       ├─ Mechanical batch operation?
       │   ├─ Batch text replacement? ───────────→ git-sed / sd
       │   ├─ File search? ──────────────────────→ fd-find / glob
       │   ├─ Content search? ───────────────────→ rg-search / grep
       │   ├─ AST structured operation? ─────────→ ast-grep
       │   ├─ JSON/YAML/XML query? ─────────────→ jq-query / yq
       │   └─ Other mechanical operations? ───────→ Check matrix below
       ├─ Corresponding domain skill available? ─→ Load skill for guidance
       ├─ MCP tool available?
       │   ├─ Knowledge graph/code relationship query? ──→ codebase-memory-mcp
       │   ├─ Sequential reasoning/complex analysis? ───→ sequential-thinking
       │   └─ Web content retrieval? ───────────────────→ fetch
       ├─ Need semantic understanding/multi-step reasoning/cross-module? ──→ Sub-agent (task/sub-agent)
       └─ Architecture decision/design trade-off/review? ─────→ Self-reasoning or consult Oracle

Tool Decision Matrix

LevelScenarioPreferred ToolCost
TriggerReceive request, identify type, clarify intentIntent Gate ClassificationInstant
ReasoningTask analysis, requirement breakdown, step planningThink first, then select toolInstant
Built-inSimple file read/write/editRead / Edit / WriteInstant
Built-inBasic content searchgrep<1s
Built-inFile pattern matchingglob<1s
CLIBatch text replacement (regex)git-sed<1s
CLIFile search (by name/type/time)fd-find<1s
CLIContent search + statisticsrg-search (ripgrep)<1s
CLIAST code search/replace (25 languages)ast-grep<1s
CLIJSON query/transformjq-query<1s
CLIHTTP API testinggit-curl<1s
CLIFuzzy filtering / narrow down listfzf-filter<1s
CLIPacking/extractinggit-tar<1s
CLILine ending conversion (CRLF/LF)git-dos2unix<1s
CLIText find-and-replace (simpler syntax)sd<1s
CLICode statistics (language distribution)tokei<1s
CLIXML/YAML/JSON queryyq / xq<1s
SkillDomain-specific operations (quant/frontend/cloud, etc.)Load corresponding skill for guidanceSee skill docs
MCPKnowledge graph/code relationship querycodebase-memory-mcp<5s
MCPSequential reasoning/multi-step analysissequential-thinkingDepends on steps
MCPWeb content retrievalfetch<10s
Sub-agentMulti-step reasoning, semantic understanding, cross-module analysistask() dispatch sub-agentTens of seconds+
Self-reasoningArchitecture decisions, design trade-offs, review and validationHandle yourself or OracleDepends on complexity

Quick Tool Reference

ToolTypical CommandUse Case
git-sedgit-sed expression:"s/old/new/g" files:["src/**/*.ts"] inPlace:""Batch regex replace, cross-file editing
fd-findfd-find pattern:"*.xml" extension:"xml" path:"./Characters"Find files by name/type/size/time
rg-searchrg-search pattern:"somePattern" glob:"*.xml" context:2File content search, PCRE2 regex, context lines
ast-grepast_grep_search pattern:"if($$$) { $$$ }" lang:"ts" / ast_grep_replace pattern:"console.log($MSG)" rewrite:"logger.info($MSG)" lang:"ts"AST structure search/replace, understands code syntax tree
jq-queryjq-query filter:".name" file:"data.json"JSON data query, filter, transform
git-curlgit-curl url:"https://api.example.com" method:"POST" data:'{"key":"val"}'HTTP API request, supports various methods and custom headers
fzf-filterfzf-filter pattern:"keyword" input:$linesFuzzy filter text lines, narrow down list
git-targit-tar action:"create" archive:"out.tar.gz" files:["src/"] compression:"gzip"Create/extract tar/zip archives
git-dos2unixgit-dos2unix file:"script.sh" mode:"dos2unix"Convert CRLF ↔ LF line endings
grepgrep pattern:"somePattern" include:"*.xml" output_mode:"files_with_matches"Basic content search (built-in)
globglob pattern:"**/*.xml"File pattern matching (built-in)
sdsd find:"old" replace:"new" files:["file.txt"]Simpler find-replace, default in-place edit, supports regex and literal patterns
tokeitokei path:"./"Count code lines, comments, blanks per language. Results in seconds.
yqyq expression:".Missions.NestMission[]" file:"Missions.xml" xml:trueYAML/XML/JSON structured data query. XML mode can directly query XML files (e.g., list all mission IDs)

When to Use Sub-Agents (Sub-Agent Trigger Guide)

Sub-agents excel where CLI tools and built-in tools fall short:

ScenarioDescriptionRecommended Method
Semantic UnderstandingDetermine if code logic is correct, if functionality is completetask() dispatch sub-agent
Cross-Module IntegrationCoordinated changes across multiple modules, interface alignmenttask() dispatch sub-agent
Multi-Step OperationsChain operations requiring search → analysis → modifytask() dispatch sub-agent
Code Generation/RefactoringNeed to understand existing code structure then generate new codeSub-agent or self-reasoning
Architecture DecisionsDesign choices, trade-off analysisSelf-reasoning or Oracle
Verification & ReviewUnderstand code intent, make quality judgmentsSelf-reasoning or review-work

Note: Even if you ultimately decide to use a sub-agent, you can reference CLI tools inside the task() prompt—the sub-agent can also call these tools internally to complete the task.

Common Mistakes

  1. Skipping CLI check and directly calling task(): Habitually dispatch a sub-agent for batch replacements, wasting tens of thousands of tokens. A 30-second agent job could be completed by a <1s CLI command.

  2. Manually modifying files after finding them with ripgrep: First use rg to locate, then use CLI batch edit in two steps. Use git-sed one command to complete search+replace.

  3. Calling a sub-agent on a single file: To modify known content in a single file, just edit directly—no need to start a full sub-agent session.

  4. Using CLI tools to brute-force when a sub-agent is appropriate: CLI tools don't understand semantics. For scenarios involving cross-module analysis, multi-step reasoning, or understanding code intent, a combination of CLI tools is less efficient than a sub-agent. Example: "Find all files calling function X, analyze their parameter patterns, then uniformly refactor"—this is the domain of a sub-agent, not something sed can handle.

  5. sd edits in-place by default—always --preview before executing: sd and sed behave differently—sd modifies files directly by default. In practice, sd '<?xml' '<?XML' filelist.xml rewrote all <?xml tags (63 occurrences), only recoverable via git checkout. Safe procedure: First use sd --preview 'find' 'replace' file to see the scope of changes, then execute only after confirming (without --preview).

  6. yq XML mode: yq v3 uses --xml, v4 changed to -p xml: yq v4 removed the --xml short parameter, now uses -p xml. Default output format warnings can be suppressed with -o yaml.

相关技能