بنقرة واحدة
find-pattern
Find the right Claude Code design pattern for a specific agent engineering problem
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Find the right Claude Code design pattern for a specific agent engineering problem
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Design an agent system by referencing Claude Code's battle-tested architecture patterns
Design a multi-agent workflow using Claude Code's coordinator/swarm patterns — outputs a complete orchestration spec
Design a new tool using Claude Code's buildTool pattern — produces a complete, implementation-ready tool spec
| name | find-pattern |
| description | Find the right Claude Code design pattern for a specific agent engineering problem |
Usage: /find-pattern <problem description>
Quickly match the user's problem to the right Claude Code design pattern. Be fast and precise. They just need: WHAT pattern to use + WHERE to find the implementation.
Read /Users/mjm/Claude Code/_reference/en/09-PATTERNS.md
## Pattern Match: Pattern #N — [Pattern Name]
**The problem it solves**
[one clear sentence]
**How Claude Code implements it**
[two sentences, concrete — name the actual source files]
**The non-obvious insight**
[the key thing that makes this pattern work, that isn't obvious at first]
**Read this next**
`/Users/mjm/Claude Code/_reference/[relevant toolkit or reference file]`
**First thing to implement**
[the single most important concrete step]
If multiple patterns apply, lead with the PRIMARY one, then add a brief "Also consider: Pattern #N" section.
| Pattern | Core idea | Toolkit | Reference |
|---|---|---|---|
| #1 Tool Interface + Defaults | buildTool() fills safe defaults | toolkit/tool-template.md | en/01-TOOL-SYSTEM.md |
| #2 Context Forking | byte-exact prompt cache inheritance | toolkit/agent-spawning-template.md | en/02-MULTI-AGENT.md |
| #3 Fan-Out → Synthesize → Impl → Verify | 4-phase coordinator, fresh verifier | toolkit/coordinator-workflow-template.md | en/02-MULTI-AGENT.md |
| #4 Two-Stage Validation | validateInput (logic) + checkPermissions (auth) | toolkit/permission-system-template.md | tutorial/05-permission-security.md |
| #5 AsyncLocalStorage Isolation | per-agent state without manual threading | toolkit/task-system-template.md | en/03-TASK-SYSTEM.md |
| #6 Progressive Result Delivery | typed ToolCallProgress<P> callbacks | toolkit/tool-template.md | en/01-TOOL-SYSTEM.md |
| #7 Deferred Tool Loading | shouldDefer + ToolSearch discovery | toolkit/tool-template.md | en/01-TOOL-SYSTEM.md |
| #8 XML Async Notifications | <task-notification> XML in message stream | toolkit/agent-spawning-template.md | en/02-MULTI-AGENT.md |
| #9 Shared Work Queue | agents self-claim from TaskList | toolkit/swarm-team-template.md | en/02-MULTI-AGENT.md |
| #10 Multi-Source Command Registry | aggregated built-in + skills + plugins | en/05-COMMAND-SYSTEM.md | tutorial/07-command-plugin-system.md |
| #11 GC-Free Packed Buffers | Int32Array cells, interning pools | en/06-INK-UI.md | tutorial/06-terminal-ui.md |
| #12 Coordinator + Scratchpad | shared filesystem for cross-agent findings | toolkit/coordinator-workflow-template.md | en/02-MULTI-AGENT.md |
All files are under: /Users/mjm/Claude Code/_reference/
| Problem keywords | Most likely pattern |
|---|---|
| "share context", "inherit", "child agent knows parent's work" | #2 Context Forking |
| "parallel research", "multiple agents searching" | #3 Fan-Out + Coordinator |
| "share findings", "cross-agent knowledge", "scratchpad" | #12 Coordinator + Scratchpad |
| "same process", "multiple agents", "isolation" | #5 AsyncLocalStorage |
| "background", "async", "notification when done" | #8 XML Notifications |
| "work queue", "distribute tasks", "parallel workers" | #9 Shared Work Queue |
| "too many tools", "prompt too long", "token budget" | #7 Deferred Loading |
| "long running", "streaming output", "progress" | #6 Progressive Delivery |
| "dangerous command", "safe default", "permission" | #4 Two-Stage Validation |
| "new tool", "buildTool", "tool interface" | #1 Tool Interface |
| "extensible commands", "slash commands", "plugins" | #10 Command Registry |
| "terminal UI", "rendering performance", "GC" | #11 GC-Free Buffers |