agentleFS
dmzoneilldmzoneill/skills/find-similar-code/SKILL.md

find-similar-code

Skill2 starsChanged 19 days agoApache-2.0View on GitHub

Find code similar to a given snippet or description using semantic vector search. Use to discover existing implementations, patterns, reference code, or potential duplication.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If "index not found": learn_tool_fix("code_search", "index not found", "Vector index not created", "Run skill_run('bootstrap_knowledge')")

    line 43
  2. Very specific:

    If "empty index": suggest skill_run('knowledge_refresh', '{"full_rescan": true}')

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Find Similar Code

Uses semantic vector search for intelligent matching across the codebase.

Inputs

InputTypeDefaultPurpose
querystringrequiredDescription or code snippet to match
projectstringautoProject from config
limitint10Max results
show_contextbooltrueShow surrounding code context

Workflow

1. Check Known Issues

  • check_known_issues(tool_name="code_search", error_text="")

2. Detect Project

  • Infer from cwd; default automation-analytics-backend

3. Semantic Search

  • code_search(query=query, project=project, limit=limit)
  • Parse results: file, line, snippet

4. Get Related Patterns

  • knowledge_query(project=project, section="patterns.coding")
  • Include top 3–5 in output

5. Build Summary

Output markdown with:

  • Query and project
  • Found N Results: each with file:line, snippet
  • Related Coding Patterns: from knowledge
  • Tip: Use code_search() for more control

6. Error Handling

  • If "index not found": learn_tool_fix("code_search", "index not found", "Vector index not created", "Run skill_run('bootstrap_knowledge')")
  • If "empty index": suggest skill_run('knowledge_refresh', '{"full_rescan": true}')

7. Log

  • memory_session_log("Code search in {project}", "Query: {query[:50]}, Results: {count}")

Key MCP Tools

  • code_search — semantic vector search
  • knowledge_query — related patterns
  • check_known_issues, learn_tool_fix — error handling
  • memory_session_log — session logging

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.