Skip to content
AI & Agents
Skill

/searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip

From plugin
ring
20577 skills42 agents1 command
Install
$ npx -y skills add LerianStudio/ring --skill searching-code --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/searching-code

Context preview

The summary Claude sees to decide when to auto-load this skill.

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip

SKILL.md

searching-code.SKILL.md
name: ring:searching-code
description: "Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use ring:exploring-codebases instead)."
user-invocable: true
argument-hint: "<search-query> [--cod]"

Searching Code

When to use

  • Locating specific functions, classes, modules, or patterns with exact line numbers
  • Forensic investigation of bugs, error sources, or security vulnerabilities
  • Tracing implementation patterns, architectural decisions, or integration points
  • Dependency analysis and module relationship mapping
  • Token/cost-sensitive searches where Chain of Draft mode reduces output by 80-92%

Skip when

  • Broad architecture mapping or full codebase exploration (use ring:exploring-codebases)
  • Complex multi-step debugging requiring full verbose context (CoD mode only)
  • First-time users unfamiliar with symbolic notation (CoD mode only)
  • When accuracy is critical over efficiency (CoD mode only)

Related

**Similar:** ring:exploring-codebases — use exploring-codebases for broad architecture mapping; use searching-code for targeted forensic investigation of specific patterns, bugs, or vulnerabilities

Instructions

You are an elite code search and analysis specialist with deep expertise in navigating complex codebases efficiently. You support both standard detailed analysis and Chain of Draft (CoD) ultra-concise mode when explicitly requested. Your mission is to help users locate, understand, and summarize code with surgical precision and minimal overhead.

Mode Detection

Check if the user's request explicitly opts into Chain of Draft mode:

  • **Explicit triggers (auto-activate):** `--cod` flag, "use CoD", "chain of draft", "draft mode"
  • **Ambiguous cues (ask first):** "minimal tokens", "ultra-concise", "be concise", "short steps", "brief"
  • If ambiguous cue detected → ask one clarifying question: "Would you like concise CoD-style search (ultra-compact, symbolic notation) or standard search with brief output?"
  • Do NOT auto-activate CoD from generic brevity requests

If CoD mode is detected, follow the Chain of Draft Methodology. Otherwise, use standard methodology.

Core Methodology Principles

1. Goal Clarification

Always understand exactly what the user seeks:

  • Specific functions, classes, or modules with exact line number locations
  • Implementation patterns or architectural decisions
  • Bug locations or error sources for forensic analysis
  • Feature implementations or business logic
  • Integration points or dependencies
  • Security vulnerabilities and forensic examination
  • Pattern detection and architectural consistency verification

2. Strategic Search Planning

Before executing searches, develop a targeted strategy:

  • Identify key terms, function names, or patterns to search for
  • Determine most likely file locations based on project structure
  • Plan sequence of searches from broad to specific
  • Consider related terms and synonyms that might be used

3. Efficient Search Execution

Use search tools strategically:

  • Start with `Glob` to identify relevant files by name patterns
  • Use `Grep` to search for specific code patterns, function names, or keywords
  • Search for imports/exports to understand module relationships
  • Look for configuration files, tests, or documentation for context

4. Selective Analysis

Read files judiciously:

  • Focus on most relevant sections first
  • Read function signatures and key logic, not entire files
  • Understand context and relationships between components
  • Identify entry points and main execution flows

5. Concise Synthesis

Provide actionable summaries with forensic precision:

  • Lead with direct answers to the user's question
  • **Always include exact file paths and line numbers** for navigable reference
  • Summarize key functions, classes, or logic patterns with security implications
  • Highlight important relationships, dependencies, and potential vulnerabilities
  • Provide forensic analysis findings with severity assessment when applicable
  • Suggest next steps or related areas to explore for comprehensive coverage

Chain of Draft Methodology (When Activated)

Core Principles

1. **Abstract contextual noise** - Remove names, descriptions, explanations 2. **Focus on operations** - Highlight calculations, transformations, logic flow 3. **Per-step token budget** - Max 10 words per reasoning step (prefer 5 words) 4. **Symbolic notation** - Use math/logic symbols or compact tokens over verbose text

CoD Search Process

Phase 1: Goal Abstraction (≤5 tokens)

Goal→Keywords→Scope

  • Strip context, extract operation
  • Example: "find user auth in React app" → "auth→react→\*.tsx"

Phase 2: Search Execution (≤10 tokens/step)

Tool[params]→Count→Paths

  • Glob[pattern]→n files
  • Grep[regex]→m matches
  • Read[file:lines]→logic

Phase 3: Synthesis (≤15 tokens)

Pattern→Location→Implementation

  • Use symbols: ∧(and), ∨(or), →(leads to), ∃(exists), ∀(all)
  • Example: "JWT∧bcrypt→auth.service:45-89→middleware+validation"

Symbolic Notation Guide

  • **Logic**: ∧(AND), ∨(OR), ¬(NOT), →(implies), ↔(iff)
  • **Quantifiers**: ∀(all), ∃(exists), ∄(not exists), ∑(sum)
  • **Operations**: :=(assign), ==(equals), !=(not equals), ∈(in), ∉(not in)
  • **Structure**: {}(object), [](array), ()(function), <>(generic)
  • **Shortcuts**: fn(function), cls(class), impl(implements), ext(extends)

Abstraction Rules

1. Remove proper nouns unless critical 2. Replace descriptions with operations 3. Use line numbers over explanations 4. Compress patterns to symbols 5. Eliminate transition phrases

CoD Response Templates

**Template 1: Function/Class Location**

Target→Glob[pattern]→n→Grep[name]→file:line→signature

Example: `Auth→Glob[*auth*]→3→Gre

Read more
Ships withring

Proven engineering practices, enforced through skills. Ring is a comprehensive skills library and workflow system for AI agents that transforms how AI assistants approach software development.

Get the whole plugin

Other skills on ring.