用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ktg-one/mcp --skill agent-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | agent-patterns |
| description | When to spawn agents vs work directly - parallel execution, specialization |
| allowed-tools | Read, Bash, Task |
| model | sonnet |
Spawn smart, not often.
"Search for auth bugs"
→ Spawn 5 agents, one per module
→ 5x faster, same tokens
"Review this PR"
→ security-agent
→ performance-agent
→ style-agent
Each has focused expertise
❌ Agent 1 creates file
❌ Agent 2 needs that file
= Race condition, wasted tokens
✓ Do sequentially in main conversation
❌ "Spawn agent to add one line"
= Overhead > benefit
✓ Just do it directly
Task tool with subagent_type=Explore
- Fast file/code search
- Codebase questions
- Pattern finding
Task tool with subagent_type=general-purpose
- Multi-step implementation
- Complex changes
- Autonomous work
code-reviewer: Style, bugs, patterns
debugger: Error investigation
security-reviewer: Vulnerability scan
performance-reviewer: Bottleneck analysis
Single message, multiple Task calls:
Task 1: "Search auth module for bugs"
Task 2: "Search payment module for bugs"
Task 3: "Search user module for bugs"
Task 4: "Search api module for bugs"
Task 5: "Search data module for bugs"
All run simultaneously.
run_in_background: true
Start long-running work →
Continue other tasks →
Check results later with TaskOutput
Main conversation: Full codebase context
Agent: Only sees what it needs
"Search auth/"
Agent loads only auth/, not entire codebase.
Agent does extensive search →
Returns: "Found issue in auth.swift:142"
You get 1-line summary, not full exploration.
Tokens saved: 90%+
1. Explore agent finds the problem
2. Main conversation receives summary
3. You fix directly with focused context
No need to spawn another agent.
❌ "Spawn agent for each file"
= 50 agents for 50 files = chaos
✓ "Spawn agent per module" (5-10 agents)
❌ "Spawn agent to read config.json"
= 10 seconds + overhead
✓ Read tool directly = instant
❌ Spawn → Wait → Spawn → Wait
✓ Spawn all → Work on other things → Collect results
| Task | Agents | Why |
|---|---|---|
| Bug search | 5-10 | One per major module |
| PR review | 3-4 | Security, perf, style, tests |
| Refactor | 2-3 | Analyzer, transformer, validator |
| Feature build | 4 | UI, logic, tests, docs |
| Codebase exploration | 1 | Single thorough search |
Task tool with resume: "agent-id"
Agent continues with full prior context.
No need to re-explain.
Resume: Same task, more work needed
New: Different task, fresh context
# In skill frontmatter or Task call
model: haiku # Simple searches, formatting
model: sonnet # Code review, implementation
model: opus # Architecture, complex reasoning
Default to cheapest model that works.
Use when: Parallel work, specialized tasks, large codebase operations
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when the user asks to run Codex CLI (codex exec, codex resume) or references OpenAI Codex for code analysis, refactoring, or automated editing
CONTEXT: Cognitive Order Normalized in Transformer EXtract Truncated. Cross-model context handoff via Progressive Density Layering, MLDoE expert compression, Japanese semantic density, and Negentropic Coherence Lattice validation. Creates portable carry-packets that transfer cognitive state between AI sessions. Use when context reaches 80%, switching models, ending sessions, user says save, quicksave, handoff, transfer, continue later, /qs, /context, or needs session continuity.