agentleFS
naranornaranor/code-intelligence-skill/SKILL.md

code-intelligence

Skill1 starsChanged 7 months agoMITView on GitHub

Universal, safe, and professional code modification and refactoring environment for 50+ languages. Use when editing source files to prevent syntax breakage, perform project-wide type-aware renames (LSP), or distill large command output to save context window tokens.

  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. WingedGuardian/GENesis-AGI★ 100same name
    2. dachent/skills★ 27same name
    3. darinh/copilot-tools★ 1same name
    4. TIKAZI/TIKAZ-Codex-Engineering★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Validating changes against the AST: before saving.

    line 33
  2. Distinctive:

    Aborting the save: if the syntax is broken.

    line 34
  3. Distinctive:

    Before starting intensive work, verify your environment to see which languages and tools are supported.

    line 39
  4. Very specific:

    Use safe_edit.py for ALL code modifications.

    line 45
  5. Very specific:

    Always wrap voluminous commands with distiller.py to keep your context lean.

    line 72
  6. Very specific:

    NO SED: Never use sed or grep -v for code editing.

    line 77
  7. Very specific:

    CHECK ENV FIRST: Run check-env at the start of a session to understand your capabilities.

    line 78
  8. Very specific:

    LSP FIRST: If working on a Java or Go project, always run lsp-start first to ensure fast and reliable refactoring.

    line 79
  9. Very specific:

    INSTALL IF MISSING: If check-env shows missing dependencies (e.g., rope or tree-sitter), you are PERMITTED to run pip install to enable …

    line 81

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Code Intelligence Skill (Universal Edition)

This skill provides a unified, safe, and professional environment for code modification and refactoring across 50+ languages using AST verification and LSP (Language Server Protocol).

Runtime Requirements

RequirementGemini CLIClaude CodeNotes
Python 3.10+✅✅Must be on PATH as python3
tree-sitterOptionalOptionalEnables AST checks for Go/Java/Rust/C++
ropeOptionalOptionalEnables Python project-wide rename
goplsOptionalOptionalEnables Go rename via LSP
jdtls / rust-analyzer / clangdOptionalOptionalLanguage-specific LSP rename

To verify your environment, run: python3 safe_edit.py check-env

Skill scripts (safe_edit.py, distiller.py) must be accessible from the working directory or be on PATH. Install dependencies with: pip install -r requirements.txt

🛡️ Why use safe_edit? (Core Mandate)

Standard file edits often lead to syntax breakage, causing you (the agent) to enter a "fix-it" loop that wastes tokens and can lead to permanent code loss or oversimplification if you decide to overwrite the entire file.

safe_edit.py prevents this by:

  1. Validating changes against the AST before saving.
  2. Aborting the save if the syntax is broken.
  3. Preserving your context by preventing unnecessary debugging steps.

1. Environment Diagnostics

Before starting intensive work, verify your environment to see which languages and tools are supported.

  • Command: python3 safe_edit.py check-env
  • What it checks: Presence of tree-sitter, rope, and active Language Servers (gopls, jdtls, etc.).

2. Safe Multi-Language Editing

Use safe_edit.py for ALL code modifications. It prevents syntax breakage by verifying code structure before saving.

A. Pre-heating (LSP Warming)

For heavy languages (Java, Rust, C++), start the language server early to build the index in background.

  • Command: python3 safe_edit.py lsp-start <lang> [--root <project_root>]
  • Example: python3 safe_edit.py lsp-start java
  • When to use: At the beginning of the implementation phase if you plan to do refactoring.

B. Smart Replace (Atomic & Verified)

Replaces unique text blocks with mandatory syntax verification.

  • Command: python3 safe_edit.py replace <file> "<old>" "<new>"
  • Engines:
    • Python: Uses builtin ast (No dependencies required).
    • Go/Java/Others: Uses tree-sitter grammars if available.
  • Rule: <old> text MUST be unique in the file to avoid ambiguity.

C. Industrial Refactoring (Rename)

Renames symbols across the entire project with full type-awareness.

  • Command: python3 safe_edit.py rename <file> <symbol> <new_name> [--root <project_root>]
  • Engines:
    • Python: Uses Rope library.
    • Go: Uses native gopls CLI for maximum speed and reliability.
    • Java/Rust/CPP: Uses generic LSP JSON-RPC client.
  • Behavior: Updates the definition and ALL call-sites/references in the project.

3. Token Saving (Output Distillation)

Always wrap voluminous commands with distiller.py to keep your context lean.

  • Example: python3 distiller.py <tool_name> <command...>

Mandates for Agents

  1. NO SED: Never use sed or grep -v for code editing. Use safe_edit.py replace.
  2. CHECK ENV FIRST: Run check-env at the start of a session to understand your capabilities.
  3. LSP FIRST: If working on a Java or Go project, always run lsp-start first to ensure fast and reliable refactoring.
  4. VERIFY ALWAYS: safe_edit.py replace automatically verifies syntax. If it fails, do NOT attempt to force the write via other tools.
  5. INSTALL IF MISSING: If check-env shows missing dependencies (e.g., rope or tree-sitter), you are PERMITTED to run pip install to enable them.

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.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

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.