Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计通过

patterns模式

Agent Skill

patterns 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

768

周安装

32

GitHub Stars

1,795

下载量

256
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:patterns(模式)
来源仓库:https://github.com/pchalasani/claude-code-tools
仓库路径:skills/patterns
安装命令:
npx skills add https://github.com/pchalasani/claude-code-tools --skill patterns
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/pchalasani/claude-code-tools --skill patterns

简介

patterns 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词快速定位候选结果时使用。

  • 适用于研究检索类任务,可结合来源仓库和原始 README 核验具体用法。
  • 通过 npx skills add 命令从 GitHub 安装,需确认权限范围和是否触发联网或文件操作。
  • 建议在安装前检查维护状态和实际功能,避免依赖未经验证的自动化行为。
  • patterns 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Langroid Patterns

Instructions

Below is an INDEX of design patterns organized by category. Each item describes WHAT you might want to implement, followed by a REFERENCE to a document with a complete code example.

Scan this index to find patterns matching your needs, then consult the corresponding document.


Agent & Task Basics

  1. Task Returns Tool Directly Create a Langroid Agent equipped with a single Tool (a ToolMessage), and wrap it in a Task so that running the task returns that ToolMessage directly. Use this pattern when you want a simple LLM agent that returns a structured response.

- Reference: ./task-return-tool.md


Tool Handlers

  1. Stateful Handler on Agent Define a STATEFUL tool handler as a METHOD on the agent (not inside the ToolMessage). Use this pattern when: (a) the tool handler needs to execute external operations (API calls, database queries, file I/O), (b) you need to track state across retries (e.g., failure counter), (c) the handler needs access to agent-level resources (connections, configs), or (d) you want Langroid to automatically loop errors back to the LLM for self-correction. The method name must match the request field of the ToolMessage. Return a string for errors (LLM sees it and can retry), or DoneTool(content=result) to terminate successfully.

- Reference: ./agent-tool-handler-with-state.md

  1. Handler with Validation Validate tool output against agent state before accepting it. Use this pattern when: (a) the LLM's tool output must preserve certain content from the input (e.g., placeholders, required fields), (b) you want automatic retry if validation fails, (c) you need to compare tool output against context the LLM received. Define a handler method on a custom agent class that stores the input context as state, validates the tool output, and returns an error string for retry or AgentDoneTool for success (note: use AgentDoneTool, NOT DoneTool). Use done_sequences=["T[ToolName], A"] so the handler runs before task termination.

- Reference: ./agent-handler-validation-with-state.md


Task Control

  1. Terminate on Specific Tool Terminate a Task only when a SPECIFIC tool is called. Use TaskConfig(done_sequences=["T[ToolName]"]) to exit immediately when that tool is emitted, or TaskConfig(done_sequences=["T[ToolName], A"]) to exit after the tool is emitted AND handled by the agent. Use this when an agent has multiple tools but you only want one specific tool to trigger task termination.

- Reference: ./done-sequences-specific-tool.md

  1. Batch Processing Run the SAME task on MULTIPLE inputs concurrently using run_batch_tasks(). Use this pattern when: (a) you need to process many items with the same agent/task logic, (b) you want parallelism without manual asyncio/threading, (c) you need state isolation between items (each gets a cloned agent with fresh message history), (d) you want to avoid connection exhaustion from creating too many agents manually. Each item gets a cloned task+agent, runs independently, results collected in order. Supports batch_size for concurrency limiting.

- Reference: ./run-batch-tasks.md


Integration & Output

  1. MCP Tools Integration Enable a Langroid agent to use MCP (Model Context Protocol) tools from an external MCP server like Claude Code. Use this pattern when: (a) you want your agent to use file editing tools (Read, Edit, Write) from Claude Code, (b) you need to connect to any MCP server via stdio transport, (c) you want to enable ALL tools from an MCP server or just SPECIFIC tools selectively, (d) you want to customize/post-process MCP tool results before returning to the LLM. Uses @mcp_tool decorator for specific tools or get_tools_async() for all tools.

- Reference: ./mcp-tool-integration.md

  1. Quiet Mode Suppress verbose Langroid agent output (streaming, tool JSON, intermediate messages) while showing your own custom progress messages. Use this pattern when: (a) you want clean CLI output showing only milestone events, (b) you're running a multi-step workflow and want to show progress without agent noise, (c) you need thread-safe output control. Use quiet_mode() context manager to wrap agent task.run() calls, then print your own messages outside the context.

- Reference: ./quiet-mode.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.08%
按下载量换算90

Claude

30.88%
按下载量换算79

Cursor

18.49%
按下载量换算47

Gemini CLI

8.78%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills