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

codeprobe-patterns代码探测模式

Agent Skill

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

总安装

643

周安装

26

GitHub Stars

4

下载量

202
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/nishilbhave/codeprobe --skill codeprobe-patterns

简介

用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位结果。
  • 通过 npx 命令安装,具体用法需结合原始 README 进一步确认。
  • 使用前应确认权限范围、维护状态及是否触发联网或命令执行。
  • codeprobe-patterns 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Standalone Mode

If invoked directly (not via the orchestrator), you must first:

  1. Read ../codeprobe/shared-preamble.md for the output contract, execution modes, and constraints.
  2. Load applicable reference files from ../codeprobe/references/ based on the project's tech stack.
  3. Default to full mode unless the user specifies otherwise.

Design Patterns Advisor

Domain Scope

Never recommend a pattern for the sake of it. Only flag a pattern opportunity when a concrete problem exists in the code that the pattern would solve. If the code works, is readable, and is maintainable without a pattern, do not suggest one.

This sub-skill detects two categories of design pattern issues:

  1. Pattern Opportunities — Places where a specific GoF or architectural pattern would solve an observable problem in the code (complexity, duplication, rigidity, hidden dependencies).
  2. Anti-Patterns — Misapplied patterns that add complexity, indirection, or abstraction layers without delivering measurable benefit.

What It Does NOT Flag

  • Switch statements on type/status are already flagged by codeprobe-solid (OCP-xxx). This sub-skill flags them *only* when it can recommend a *specific named pattern* (e.g., Strategy, State) with concrete benefits over the current implementation. If the finding would be a generic "consider a pattern here" without naming one, defer to the SOLID auditor. To avoid duplicate findings, check whether the same switch/if-else block would already be covered by an OCP violation. If codeprobe-solid would flag it and your recommendation is simply "use polymorphism," do not emit a finding. Decision rule: if you can name the pattern, show the interface, and list the concrete implementations, emit a PATTERN- finding. If you can only say "this violates OCP," let codeprobe-solid handle it.
  • God classes are already flagged by codeprobe-architecture (ARCH-xxx). This sub-skill only flags them when a *specific pattern* (e.g., Facade, Mediator) would be the recommended decomposition approach. If the recommendation is simply "split this class," defer to the architecture auditor. Only emit a finding when you can name the exact pattern and explain why it fits better than a generic decomposition. Decision rule: if your fix prompt says "extract into a Facade with these methods," emit a PATTERN- finding. If it says "break this into smaller classes," let codeprobe-architecture handle it.
  • Cross-cutting concerns flagged by codeprobe-code-smells (SMELL-xxx). Duplicated logging, caching, or authorization code may already be flagged as code duplication. Only emit a PATTERN- finding when you recommend a specific pattern (Decorator, Middleware) as the solution. If the duplication is the primary issue, defer to the code smells auditor.
  • Simple scripts or small applications where patterns would be over-engineering. A 50-line CLI script does not need a Strategy pattern. A single-file utility does not need a Factory. Apply proportional design judgment — patterns are tools for managing complexity, not goals in themselves.
  • Code that already implements a pattern correctly — do not suggest replacing one correct pattern with another. If a Factory is working well, do not suggest switching to a Builder unless there is a concrete problem. If a class uses Observer correctly, do not suggest switching to a Mediator.
  • Test files — test utilities and helpers have different design constraints. Test setup classes, fixture builders, and mock factories are not subject to the same pattern expectations as production code. Do not flag test doubles, test data builders, or test orchestration helpers.
  • Low-confidence pattern matches (e.g., Prototype pattern) unless there is strong evidence of cloning behavior. Emit as Suggestion severity at most. When in doubt, do not emit the finding.

Detection Instructions

Pattern Opportunities

Observed ProblemCandidate PatternHow to DetectConfidenceSeverity
Complex object construction with 4+ optional paramsBuilderConstructor or factory method with 4+ optional/nullable parameters. Methods that build objects step-by-step using setters then build() would be clearer.HighMinor
Duplicated new X() with conditionals scattered across codebaseFactorySearch for new ClassName() instantiation of the same family of classes in 3+ locations with surrounding if/switch logic to decide which class to create.HighMajor
Switch on type to select behavior (when a specific pattern applies)StrategySwitch/if-else chain where each branch executes a different *algorithm* or *behavior* — not just returning a value. Must have 3+ branches and the variants are likely to grow. Only flag if NOT already covered by an OCP finding.HighMajor
Object behavior changes based on internal state fieldStateA class with methods containing if/switch on $this->status or this.state where the same field controls behavior in 3+ methods. State transitions are scattered across the class.MediumMinor
Multiple listeners need to react to a changeObserver / Event DispatcherA method that directly calls 3+ other services/handlers after a state change (e.g., after order creation: send email, update inventory, notify warehouse, log audit). Should be events.HighMinor
Cross-cutting logic interleaved with business logicDecorator / MiddlewareLogging, caching, authorization, or timing code mixed into business logic methods. Same cross-cutting concern copy-pasted across 3+ methods.HighMajor
God class wrapping a complex subsystemFacadeA large class (300+ LOC) that coordinates multiple subsystems. Clients only need a simplified interface. Only flag when probe-architecture hasn't already flagged as a god object.MediumMinor
Undo/redo or command queue requirementsCommandCode that needs to queue, log, or reverse operations but currently executes them inline.MediumSuggestion
Data flows through conditional transformation stepsPipeline / Chain of ResponsibilityData processed through 3+ sequential if/else transformation steps where each step is conditionally applied. Could be a pipeline of composable stages.MediumMinor
Multiple similar objects differing by a few fieldsPrototypeFactory-like code that creates copies of objects with minor variations.LowSuggestion

Anti-Patterns (Misapplied Patterns)

Anti-PatternWhat to DetectHow to DetectSeverity
Singleton for dependency hidingClass uses getInstance(), static::$instance, or module-level singleton to access dependencies that should be injected via constructor. The singleton pattern hides dependencies and makes testing difficult.Search for getInstance(), static::$instance, self::$instance, module-level singleton access patterns in business logic classes. Check whether these dependencies could be injected via constructor instead.Major
Pass-through RepositoryRepository class wrapping ORM (Eloquent, Doctrine, Prisma) where every method is a 1-line delegation with zero added abstraction, caching, or query logic. The repository adds a layer without value.Find repository classes and check each public method body: if every method is a single-line call to the underlying ORM model with no additional logic, the repository is a pass-through.Minor
Service class that's a renamed controller actionService class with a single public method that exactly mirrors a controller action — same params, same logic, just moved to a different file. Adds indirection without reuse.Find service classes with only one public method. Check if the method signature and logic closely match a corresponding controller action. Look for zero reuse across the codebase (only one caller).Minor
Abstract Factory with one familyAbstract factory interface with only one concrete factory implementation and no foreseeable second implementation. Over-abstraction.Find abstract factory interfaces/classes. Count the number of concrete implementations. If there is exactly one and no indicators of planned expansion (no TODO comments, no documentation mentioning future variants), flag it.Suggestion

ID Prefix & Fix Prompt Examples

All findings use the PATTERN- prefix, numbered sequentially: PATTERN-001, PATTERN-002, etc.

Fix Prompt Examples

  • "Replace the switch on $type in NotificationSender (lines 30-65) with a Strategy pattern: create a NotificationChannel interface with send(Message $message) method. Create EmailChannel, SmsChannel, and PushChannel implementations. Use a NotificationChannelFactory to resolve the correct channel by type."
  • "Refactor ReportBuilder constructor (line 15) which takes 7 optional params ($title, $subtitle, $dateRange, $format, $includeCharts, $paperSize, $orientation) into a Builder pattern: create ReportBuilderConfig with fluent setter methods and a build() method."
  • "The AuditLogger at app/Services/AuditLogger.php uses AuditLogger::getInstance() (line 5) as a singleton. Replace with constructor injection: register AuditLogger in the DI container as a singleton binding, and inject it via constructor in the 4 classes that currently call ::getInstance()."
  • "Remove the UserRepositoryInterface and UserRepository wrapper at app/Repositories/ — every method (find, create, update, delete) is a single-line delegation to Eloquent with zero added logic. Use the Eloquent model directly until you have a concrete reason for the abstraction."

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.49%
按下载量换算74

Claude

30.65%
按下载量换算62

Cursor

20.84%
按下载量换算42

Gemini CLI

9.17%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

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

来源信息

继续浏览同类 Skills